I have had the opportunity to work on a similar project, which involved an inner current control loop and an outer speed control loop. The project included:
- An offset added to all measurements
- Two abc to dq0 transformations (for current and voltage)
- Four PI controllers (two within the current loop and two within the voltage loop)
- Various summing and product blocks
- Two trigonometric functions
Therefore, I think that I will be able to provide some usefull discussions regarding this. Let's address your questions one by one:
1) Is building the control loop in Simulink slower than using CCS or PSIM?
I have utilized Code Composer Studio for coding and configured one of the PWM channels to trigger the start of conversion for ADC channels. By measuring the number of clock cycles required to complete one control loop using the "clock" feature in Code Composer Studio, I found it took approximately 25,000 clock cycles. The clock frequency of microcontroller (TMS28335) was 150 MHz , which corresponds to roughly 0.1666 ms or a 6kHz frequency. Therefore, there is no significant difference between using Code Composer Studio or the C2000 blockset of Simulink for generating microcontroller code. In fact, Simulink optimizes the code for reduced execution time, making it a computationally efficient choice. Thus, the MATLAB C2000 blockset is indeed a preferable option!
2) Do I really need to run the inverter control loop for every switching cycle?
It is feasible to operate the switches at switching frequencies of 30 kHz while running the control loop at 15 kHz or lower frequencies. However, this may reduce the permissible maximum bandwidth of your control loop. In brief, the dynamic response of your inverter will be slower if you run the control loop at 15 kHz compared to 30 kHz. While designing the controller, consider the sampling time period of the plant = 3) Should I look for a different chip, if so, any suggestions?
The key parameters to consider when selecting a microcontroller for your project include:
- Cost
- Number of peripherals needed (ADCs, PWMs, SPIs, CANs, I2C, etc.)
- Clock frequency (it should be high enough to compute the control loop within the desired time frame)
- Debugging interface requirements (e.g., JTAG port)
Please note that additional features in a microcontroller will typically increase its cost.
4) Should the F280049C be fast enough for closed-loop inverter control?
If you can complete one control loop at 15 kHz, the F280049C should be sufficient. In my project, the control loop frequency was 5 kHz, and it performed satisfactorily.
5) Should I expect the control loop to take this long to execute, or are there some inefficiencies in my design?
From my perspective, completing one control loop at 15 kHz is commendable. There appears to be no inefficiency in your design, as control loops generally take this amount of time to execute.
Additional Suggestions:
- The design of the LCL filter is significantly influenced by the switching frequency of your converter. Choose the frequency wisely, as a higher switching frequency allows for smaller filter components.
I hope you find this information helpful