|
MotorWare f2806x Module API Documentation
|
In this implementation the frequency of the ramp output is controlled by a precision frequency generation algorithm which relies on the modulo nature (i.e. wrap-around) of finite length variables in 28xx. One such variable, called
(a data memory location in 28xx) in this implementation, is used as a variable to determine the minimum
of the ramp signal. Adding a fixed step value to the Angle variable causes the value in Angle to cycle at a constant rate.
At the end limit the value in
simply wraps around and continues at the next modulo value given by the step size. For a given step size, the frequency of the ramp output (in Hz) is given by:
where
is the sampling loop frequency in Hz
is the number of bits in the auto wrapper variable
From the above equation it is clear that a
value of 1 gives:
when
and
.
For IQmath implementation, the maximum step size in per-unit,
, for a given base frequency,
and a defined
number is therefore computed as follows:
Equivalently, by using _IQ() function for converting from a floating-point number to a _iq number, the
can also be computed as:
where
is the sampling period in seconds.
The following figure shows the Simulink Model of this block.
The following figure shows the error in the calculation by the microcontroller, and compares it agains simulation output from Simulink.
Error is the microcontroller output minus Simulink output for function RAMPGEN_run().
Outputs shows both microcontroller and Simulink outputs for RAMPGEN_run().
Please see the TRAJ_init() and TRAJ_run() functions defined in traj.h for more details.
There is only one module in this package, the APIs can be referenced at TRAJ. The API headers can be located at traj.h. The test procedures are described at test_traj.h.
1.8.9.1