Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Simulink: PID output when transitioning between Manual and Automatic control?

Subject: Simulink: PID output when transitioning between Manual and Automatic control?

From: Aryn

Date: 4 Nov, 2010 20:41:03

Message: 1 of 3

I am unable to uncover a method to allow a smooth transition between a PID output value, and a static output value. That is, there is a need to control an output that is run via a PID to a stable value, and then allow the PID to pick up from that position and control again on the fly.

The setup is as follows:
I have an output that is a valve position. This is driven by a manual switch which selects between a constant block and a PID block.
The manual switch is controlled programatically.
The constant block output is also controlled programatically.

I'm attempting to align the initial PID output to the constant block when toggling from the constant to the PID block. This operation needs to be able to occur multiple times, meaning a method for altering the current PID integrator value on the switch toggle is required, otherwise the output would be discontinuous.

Attempted resolution:
Setup the PID block to accept external reset, which I can trigger programatically.
When transitioning from the static output to the PID. Alter the Initial conditions for the integrator and filter terms to produce the same initial output as the constant block.
Toggle the reset.

This causes an error because I am unable to alter those initial conditions without halting the simulation. I also will need to alter the "P" "I" and "D" parameters on the fly, for gain scheduling, but I haven't gotten that far to see if this would also cause an issue.

I've tried pausing the simulation but this generates the same error, and stopping the simulation isn't an option.

Any ideas?

Thanks.

Subject: Simulink: PID output when transitioning between Manual and Automatic control?

From: Arkadiy Turevskiy

Date: 5 Nov, 2010 14:46:04

Message: 2 of 3

Hi Aryn,
Bumpless transfer is supported by PID Controller block in Simulink Continuous and Discrete libraries.
What you need to do is enable "tracking mode" in PID Controller block dialogue.

There is a shipping Simulink demo that shows how to do bumpless transfer with PID Controller block, take a look:
>>sldemo_bumpless

Detailed description of what is happening in this model is available as well: open Help, select Simulink -> Demos -> Industrial Automation Applications -> Bumpless Control Transfer Between Manual and PID Control.

The demo is available starting with R2010a.

This is also described in online block help:
http://www.mathworks.com/help/toolbox/simulink/slref/pidcontroller.html
(search for bumpless transfer).

As for your gain scheduling question, PID Controller block does not currently support it out of the box. However, you can take the shipping PID Controller block and disable and break the link to the library. The you can modify how the block is implemented (right click on it, and look under mask). Specifically, make P,I,D gains inport signals - these way they will be external inputs to the block.

HTH.
Arkadiy


"Aryn " <aryn.shapiro@carrier.utc.com> wrote in message <iav5ov$cqs$1@fred.mathworks.com>...
> I am unable to uncover a method to allow a smooth transition between a PID output value, and a static output value. That is, there is a need to control an output that is run via a PID to a stable value, and then allow the PID to pick up from that position and control again on the fly.
>
> The setup is as follows:
> I have an output that is a valve position. This is driven by a manual switch which selects between a constant block and a PID block.
> The manual switch is controlled programatically.
> The constant block output is also controlled programatically.
>
> I'm attempting to align the initial PID output to the constant block when toggling from the constant to the PID block. This operation needs to be able to occur multiple times, meaning a method for altering the current PID integrator value on the switch toggle is required, otherwise the output would be discontinuous.
>
> Attempted resolution:
> Setup the PID block to accept external reset, which I can trigger programatically.
> When transitioning from the static output to the PID. Alter the Initial conditions for the integrator and filter terms to produce the same initial output as the constant block.
> Toggle the reset.
>
> This causes an error because I am unable to alter those initial conditions without halting the simulation. I also will need to alter the "P" "I" and "D" parameters on the fly, for gain scheduling, but I haven't gotten that far to see if this would also cause an issue.
>
> I've tried pausing the simulation but this generates the same error, and stopping the simulation isn't an option.
>
> Any ideas?
>
> Thanks.

Subject: Simulink: PID output when transitioning between Manual and Automatic control?

From: Hartman29CANDACE

Date: 22 Nov, 2010 10:59:11

Message: 3 of 3

Have no enough money to buy a house? Don't worry, just because this is real to receive the <a href="http://bestfinance-blog.com/topics/business-loans">business loans</a> to resolve such kind of problems. So take a financial loan to buy everything you want.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us