pid controller design in simulink video -凯发k8网页登录
design a pid controller for a dc motor modeled in simulink®. create a closed-loop system by using the pid controller block, then tune the gains of pid controller block using the pid tuner.
in this demonstration you will see how to quickly tune the pid controller for a planned model in simulink.
in this particular case, we model the dc motor. in this block dialog are the parameters that define the behavior of the motor: damping, inertia, back emf, resistance, and inductance.
working on their block mask we see simscape and simutronics blocks. we use the model as a motor. we will not design the digital control systems that will control the rotation speed of the motor shaft. the controller will calculate the error signal between the desired speed and the measured speed, and it uses our signal to calculate the voltage request to command to the motor.
notice that we are modeling sensor noise in the measurement channel, and because our control system is digital, they are also modeling an a to d converter is a sampling time off 0.02 seconds, using a zero order over the whole block.
you now need to add the compensator. to do that, we go to simulink library browser and just create sub library. take discrete pid controller block and add it to our model. let's now connect this block to the rest of our model and open the block dialog.
here we can specify the type of controller we want to use: pid, pi, pd, proportional, or simply integral. we will stay this at pid. we can specify the sampling time. in this case we'll use the same one as we used in our a to d converter. and if you know the gains of the pid controller, we can type them in here. in this case, we don't know what the gain should be yet, so let's apply the sampling time changes and try running the simulation as default gain values. let's also add voltage to our scope.
running the simulation, we see that our control system was not doing all that well. blue lines show the desired speed, and a red line shows actual measured speed. as we see, our control system is not tracking very well. let's try to improve that performance. to do that we'll go back to the block dialogue and press the tune button.
this launch has paired the tuner, which linearizes a plan, calculates pid gains, and opens a graphical user interface. in the graphical user interface we see two lines. the dashed line shows a closed loop step response of our system for the current gain values. and solid lines show the same response for calculated gain values.
so let's simply accept the gains to calculate it for us. when we do that, we see that our block parameters, pid gains, get updated. let's press ok, go back to our simulation, and rerun it. as we see, we indeed improve the performance of our control system. it is now tracking very well with zero steady state error. it's relatively fast and has relatively little overshoot.
if you want to improve the performance of our control system, we can come back to the pid tuner graphical user interface and, for example, try to make the overshoot a little lower, if you want that. or if you want faster response, we could try to use a slider here to move it to the right to make the system response faster.
for example, let's try this design. we now go back to our model and we run the simulation with this design. we see that we indeed get much faster response, but at the expanse of much noisier and much higher voltage request signal, so we are probably sacrificing actuator life to achieve this faster response.
now, this is a trade-off you can decide on as an engineer, but you now have this tool at your disposal that lets it quickly design and tune pid controllers for plans modeled in simulink. this concludes the demo.
download code and files
related products
learn more
featured product
simulink control design
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 mathworks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- (español)
- (english)
- (english)
欧洲
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
亚太
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)