Hold and Ramp Down function in Simulink

8 ビュー (過去 30 日間)
Phil_I
Phil_I 2015 年 5 月 11 日
コメント済み: KL 2015 年 5 月 12 日
I have a PID controller in Simulink which is operating within an enabled subsystem. When the subsystem is disabled, outside of the subsystem I would like to hold the last value calculated whilst the subsystem was active for a parameterisable amount of time, then ramp down to 0 over a parameterisable amount of time.
It's easy to hold the last value from the subsystem using output port settings, but i'm struggling with the hold and subsequent ramp. Any suggestions? Cheers, Phil

回答 (1 件)

KL
KL 2015 年 5 月 11 日
Take a negative constant (your slope) and then connect it to a discrete integrator with an external reset. This will produce a negative ramp, add this signal to your held signal, so it will ramp down. When it reaches zero reset your integrator. Activate this part only when your signal is held.
  2 件のコメント
Phil_I
Phil_I 2015 年 5 月 11 日
Thanks. How about the hold for a set amount of time before ramping down?
KL
KL 2015 年 5 月 12 日
Lets say, you successfully manage to hold your signal. Now multiply it with a step input whose initial value is 1. Set the end time as the step time here and make the step go to zero. so the result will be zero after this time. At the end of the path use some switching logic to route the proper signal after our multiplied signal reaches zero.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by