MATLAB: Linearization of a simulink model and pid controller tuning

pid tuningSimulink Control Design

Hello Sir,
I am doing simulation of dc dc converter with a PWM generator and PID controller. Initially, I got error for linearization,and I know it is because of PWM generator and non linear discontinuity. Later I installed Matlab new version to remove the linearization error. I tried with auto pid tuning but I am getting strange result. Also showing errors with the system I/O ports while tuning pid.
I attached the simulation model for reference. Can any one please help me in linearization and pid tuning of my simulation model?
please help!
thank you

Best Answer

This is very similar to the sitaution shown in this example . If you have 14a and all needed tools (Simulink Control Design and System Identification Toolbox) you can follow the workflow shown in the example. I tried it and everything works just fine.
A couple of points:
  1. When you specify a step signal to inject to the plant, you need to do it in a smart way, which means you can't just keep default options. If you run the simulation with your existing gains, you will see that controller request (output of PID Controller block stays at around 0.007. Therefore, when you specify a step signal to inject, specify an offset to be 0.007 and step magnitude to be 0.001 as shown below.
Now run the simulation, apply the results, then fit the default first order model. You can see it is not perfect, you can play with higher order models, but I was able to get a decent controller even with first order plant model.
  • Tune how fast you want your controller to be using the sliders, here is my design (solid line) vs your existing gains (dashed line). Your existing design seems pretty good already.
  • apply the tuned gains, run the simulation. Error signal looks pretty good.