I’m using a TI C200 to create a frequency converter closed loop. The waveforms simulated in PLECS are correct, but after programming to a 28069MHz processor, the waveform measured with an oscilloscope is fixed and doesn’t change frequency according to voltage variations. What could be the problem?
For the offline simulation and with the model as is, the variable frequency module changes from 200kHz to 100kHz in the first 32ms and the frequency remains saturated
it appears that you are testing your model with a closed loop controller that does not actually drive anything on the plant itself? Is that your intent?
measuring signals on the HW - I put in a little manual switching and a constant to be able to ensure that the variable PWM module actually changes frequency and was able to confirm this by changing the parameter via external mode. I have attached the model here for you.
NOTE: since your system saturates in the offline model within 32ms it would be difficult to capture this in real-time unless you use the appropriate triggering. It would “appear” that the real time waveform is only switching at 100kHz where in fact it had started at 200kHz but very quickly saturated to 100kHz.
I modified some parts to make the circuit more complete, but I encountered the same problem: the frequency changes with the voltage during analog operation, but after programming the RT box and DSP, the frequency becomes fixed.
I had a quick look at your model and have the following feedback:
In your plant model instead of using the the full-bridge with sub-cycle averaging and discrete components for the LLC tank I would advise you to utilize the the “Full-Bridge LLC Converter” nanostep module. You can find this in the library components under “Electrical>Nanostep”.
if you double click the component you can set the output rectifier to be either half-bridge or full-bridge.
Your Analog Out and ADC measurements in your offline model are measuring at 400V in the offline model. However, on the RTBox the output voltage of the ADC pin is limited to 3.3V and the Analog Out of the RTBox is limited to 10V. I would recommend the following:
Set the RTBox Analog out scaling to 3.3/450 → this will set the ADC pin voltage to 3.3V when the output voltage is 450V.
Set the RTBox Analog out Min and Max output voltage to 0 and 3.3 respectively.
On the Controller side, I ADC is measuring the pin voltage between 0 and 3.3 and you can rescale it back to 0 to 450 level by scaling the ADC channel by 450/3.3 factor.
Additionally, prior to running your model in closed loop I would highly recommend first running your model in open loop and ensuring that your offline model is matching what you see on the RT Box. This will help you narrow down any discrepancies before the complexity of the control loop comes into the picture.