How can i pause an engaged PID controller while i am running a simulation? How can i start and reset a subsystem at a given time?
조회 수: 16 (최근 30일)
이전 댓글 표시
Hi there.
I am currently trying to a model a fluid level closed loop control.
In the real world application the PID controller is forced to stop its interference with the system and stay in tracking mode for 20 seconds when done with its work (control factor equals zero) to prevent excessive movement of the valve of the system.
I got the part of the tracking mode solved by looking into the sldemo_bumpless, but i am currently struggling to get the pause to work correctly.
I hope that someone can push me in the right direction,
best regards, Joachim
Ps: Please excuse my poor english skills, it's been a while ;)
Edit:
The more i look at my problem, the more i think i have the answer, altough i do not know how to get it to work. Since my PID controller can only pause when the difference between the target level and the actual value is smaller then my dead band and i will have to make a subsystem, which is able to give out a value=0 for twenty seconds.
But how can i do this without huge trouble?
Thanks in advance
댓글 수: 0
답변 (2개)
ES
2013년 9월 5일
You want to pause the simulation using code?
If yes, you can use
set_param(bdroot,'SimulationCommand','pause')
then you can restart or stpo by passing appropriate commands.
Arkadiy Turevskiy
2013년 9월 30일
Should be pretty straightforward to do. You basically want the PID controller in one control path and the constant zero in the parallel path. Downstream of them you want the switch that you will program with your logic.
PID Block in Simulink has tracking mode, so you should use that while PID is not active so that there is bumpless transfer.
The best tool to implement logic like yours for the switch would probably be Stateflow.
참고 항목
카테고리
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!