Hi,
I am trying to use TI C2000 PWM (Variable) block. I started with the PWM block with a fixed switching frequency, and I can simulate my circuit. However, when I change it to the TI C2000 PWM (Variable) block, even with the fixed switching frequency, the block shows an error. It would be great if I could get some help on this.
Regards,
Shrivatsal
single_phase_itcm_pfc_c2000.plecs (402.7 KB)
Hello Shrivatsal,
The frequency input to the PWM (Variable) block is normalized to the Carrier Frequency (Hz) parameter of the block mask. Since you entered the variable fs
or 100 kHz into the component mask, the appropriate value for the f'
input into the block is 1.0. The error is because you’re trying to generate a switching frequency of fs*fs
or 10 GHz which the simulation model cannot achieve due to how we model the PWM clock of the C2000 peripheral.
I’ll also note that your model currently has the execution time equal to the PWM period or 100 kHz. You likely will not be able to actually run your code this fast on the MCU. You would want to set to something more reasonable like 50 kHz and below (i.e. Ts_controller=1/(2*fs)
) and change the ADC Trigger Divider in the PWM (Variable) blocks to 2
to match the period divider.
Hi Bryan,
Thank you for your reply. It was quite helpful.
Best regards,
Shrivatsal
1 Like