Internet Explorer는 TI.com에서 지원되지 않는 브라우저입니다. 최상의 환경을 위해 다른 브라우저를 사용하십시오.
Video Player is loading.
Current Time 0:00
Duration 7:14
Loaded: 2.30%
Stream Type LIVE
Remaining Time 7:14
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected

Welcome to the fifth video in our series about the C2000 digital control library. In this video, we will take a brief look at a reference generator module. The reference generator is a new feature in version 3.4 of the DCL. It is capable of producing up to three control references, each comprising a dynamic wave form superimposed on a static offset. The generator offers similar functionality to the older S gen module in C2000 [INAUDIBLE] but for floating-point devices.

The reference generator is made up of five submodules. The static offset generator produces a DC level, which can be adjusted using a linear ramp with configurable transition time. The waveform generator produces various types of common dynamic waveforms, such as sine waves, pulses, square waves, and so on. The submodule has three outputs.

The frequency and amplitude of the waveform generator are each adjustable using a separate modulator submodule, which allows smooth transitions between frequencies and amplitude. For example, the user may specify a target frequency and a transition time, thus producing a frequency sweep. Similarly, the user may implement a ramp change between two amplitudes by specifying the target amplitude and a transition ramp time.

All three dynamic waveforms are superimposed on the same static offset and then clamped to ensure they always lie within a defined range. Typically, the user will configure the reference generator such that all its output slide in the range minus 1 to plus 1. Configuring the static offset generator is achieved using the DCL_setRefgenRamp function.

The user applies a pointer to the reference generator structure, a target offset, and a transition time. The function computes the required increment to be applied each time the reference generator module is run. The change takes effect immediately this function is written.

The computed increment depends on both the transition time and the offset change. For very long transition times or very large changes of offset, the increment may become too small to be effective. This is because in floating-point format the addition of a small number to a much larger number results in resolution loss. And in extreme cases, the small increment might disappear. If this happens, the DCL error function is called. For this reason, it is strongly recommended to normalize the static offset range between minus 1 and plus 1.

The dynamic waveform generator can operate in any of the seven modes shown here. The four modes on the left are single channel modes, while those on the right produce one, two, or three channel sine waves. The two-channel sine mode generates waves in quadrature phase, effectively a sine and cosine pair. The three-channel sine mode generates waves with a fixed 120 degree phase relationship. The operating mode is set using the DCL_setRefgenMode function.

This table summarizes the three outputs in each operating mode. The mode name comes from an enumerated list in the reference generator header file and would be the last argument to the DCL_setRefgenMode function seen below. The three outputs are called phase A, phase B, and phase C in this table. In off mode, all outputs are forced to zero. This is the default mode.

In static mode, only the output of the static offset generator appears on all three outputs. Modes 2 to 6 are the single channel modes, respectively producing a sine wave, square wave, saw tooth wave, triangle wave, and pulse sequence with adjustable duty cycle. The outputs on phases B and C are the static offset. Mod 7 and 8 are the two and three-channel sine wave outputs seen in the previous slide.

The user interface to the reference generator module is through these 11 C functions. The reset function forces all dynamic variables in the reference generator structure to their default values. Typically, this would be called at initialization and any time the user wanted to restart waveform generation from a known datum. The set ramp function controls the static offset generator as described earlier. The next two functions control the amplitude and frequency modulators, allowing smooth changes of each to be implemented over a specified time interval.

The next function loads the duty cycle value and is used by the waveform generator in pulse mode only. The upper and lower clamp limits are configured in the next function and then the operating mode in the next. The reference generator itself is executed by the runRefgen function, which would normally reside in an interrupt service routine to ensure timings are correct. The last three functions simply return the three reference outputs.

Let's wrap up with a simple code example to see how the reference generator might be used. On the left, we see code, which might be found in the main C source file. Notice the reference generator header file is included at the top and instances of the reference generator structure and its associated common support structure below. The CSS stores the update rate parameter and is needed for error handling. Unlike the DCL controller functions, we always need the CSS when we work with the reference generator.

Note that there is no shadow parameter set involved in the reference generator. Further down, we see two lines to initialize the CSS pointer and to load the update rate. The remaining lines set up the parameters of the reference generator as described in the last slide.

On the right, we see part of the ISR code. The first line executes the reference generator run function, which computes new outputs. And the last three lines simply read these new values, all pretty simple. This concludes our video on the reference generator module. Thanks for watching.

이 비디오는 시리즈의 일부입니다.