Angle generator
Table of Contents
The angle generator block contains a counter that continuously outputs the current value of the angle, wrapped between the chosen lower and upper limits, with a given frequency. Therefore, the angle block can be used to generate clean sinusoidal signals in both simulation and code generation modes that do not exhibit phase jumps or inaccuracies as the model execution time increases. Further details on the implementation of the angle generator can be found on the page: TN168 – Grid Forming Inverter (GFMI).
A typical use case is to generate sine wave signals that are not based on the simulation time, as shown below
Similarly, the angle block can also serve as a frequency reference signal, which is then used to produce a three-phase voltage signal and the corresponding duty cycles for PWM modulators.
Simulink block
Signal specification
- No input signal is needed.
- The output signal
θ
is the angle value, in radians.
Parameters
Frequency [Hz]
set the output signal frequency.Sample time
set the interrupt frequency of the block. It is set by default as CTRLPERIOD to ensure the execution at the interrupt frequency and with the proper phase.Upper limit
set the output upper limit.Lower limit
set the output lower limit.
PLECS block
The angle generator block is not available in PLECS. The PLECS block TriangularWave Generator can be used instead.