Hold and Ramp Down function in Simulink

16 views (last 30 days)
Phil_I
Phil_I on 11 May 2015
Commented: KL on 12 May 2015
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

Answers (1)

KL
KL on 11 May 2015
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 Comments
Phil_I
Phil_I on 11 May 2015
Thanks. How about the hold for a set amount of time before ramping down?
KL
KL on 12 May 2015
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.

Sign in to comment.

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!