Designing an integer PI controller
6 次查看(过去 30 天)
显示 更早的评论
I'm designing a PI controller for a Buck Converter. The controller will run on a 16-bit microcontroller with integer data types to achieve the desired compute speed as floats computing time is prohibitive.
I got the continuos transfer function of my system and converted it to a discrete transfer function with c2d() using a sample frequency of 150kHz. I designed the system on Simulink and tried to tuned the PI. The problem is that the P and I constants for the PI controller are floating point numbers:
P = 0.001330 I = 1.762928
So if I set the P and I types to be integers in the PID controller the P constant will be 0 and the I constant will be 1. How do I tell MATLAB to calculate the P and I constants as integer or I'm misinterpreting something?
Attached is the Simulink file, the transfer function should give a voltage between 0 and 30V with and input between 0 and 1 representing the duty cycle. There are two Gain blocks called "Volts to ADC" and "Ref to ADC" that converts voltage to the 14-bit ADC value. The "PID Output Scaling" scales the PID output that should output values between 0 and 3136 ideally to values between 0 and 1 that represents the duty cycle.
Finally the "Sum" block generates the difference between the reference signal and the current output. It has an output type of "double", if I change it to "int16" the PID becomes unstable too.
Any guidance on the subject will be greatly appreciated! Thank you so much!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 PID Controller Tuning 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!