Real time PWM generation using Texas Instruments Piccolo Launchpad F28027

Sivakumar Selvam on 25 Aug 2019
Latest activity Reply by Sivakumar Selvam on 26 Aug 2019

Hello everyone,

      Recently i started using MATLAB Real Time Code Generation Tool to generate code for 3 phase Induction motor speed control using V/F. I used the piccolo launchpad F28027 to implement this V/F technique. I used a pot to get the frequency input and computed the corresponding Voltage using V/F ratio. When i tried implement it on the board, output PWM frequency was not exactly the same which i simulated. It was 2 - 3 times higher than the actual. So i tried reducing the inputs by the same 2-3 times. It worked. 
       Question is, what the problem with the code and processor?  why difference in PWM frequency between simulation and Realtime?
Sabin
Sabin on 25 Aug 2019

I assume you generate the PWM in simulation and in real-time you use a built-in library block ePWM. This might be related to a different sampling mode (count mode). If you configure the ePWM to count UP-DOWN using clock cycles, it will require double clock cycles compared to UP or DOWN counting. That might justify the difference that you see. Hope this helps.

Sivakumar Selvam
Sivakumar Selvam on 26 Aug 2019

Oh yes you are correct. I did the same. Let me try as per your suggestion and revert back to you... Thank you Sabin Carpiuc