pid output limiting

M

Thread Starter

Mario de Sousa

Hi all,

I have just commited support for output limiting to the pid block of the dsp module. This is achieved by adjusting the integral part of the pid equation to whatever value is required to guarantee that the output value will never stray outside a configured band.

This means that the integral of the pid will not 'wind up' while in auto mode.

pid configuration syntax is now:
fblock pid <in_pt> <out_pt> [<P> [<I> [<D>]]] max_out <upper_lim>
min_out <lower_lim>


BTW, I changed the oven demos configuration files to include this. They still need to be optimized though, because the nonlinear (limiting)
block is now no longer required to limit the pid output. Juan, do you think you could do that?

I will still need to add support for automatic/manual modes, to guarantee that the pid output will follow the manual setpoint in manual
mode. Any preferences on how to do this?

I was thinking of something along the lines of:
fblock pid <in_pt> ... man_sp <plc_pt> mode_crtl <plc_pt>

Any other sugestions?


Cheers,

Mario.



--
----------------------------------------------------------------------------
Mario J. R. de Sousa
[email protected]
----------------------------------------------------------------------------

The box said it requires Windows 95 or better, so I installed Linux

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
M

Mario de Sousa

Mario de Sousa wrote:

> pid configuration syntax is now:
> fblock pid &lt;in_pt> &lt;out_pt> [&lt;P> [&lt;I> [&lt;D>]]] max_out &lt;upper_lim>
> min_out &lt;lower_lim>


Sorry, the above should have read:

fblock pid &lt;in_pt> &lt;out_pt> [&lt;P> [&lt;I> [&lt;D>]]] [max_out &lt;upper_lim>]
[min_out &lt;lower_lim>]



Mario.

--
----------------------------------------------------------------------------
Mario J. R. de Sousa
[email protected]
----------------------------------------------------------------------------

The box said it requires Windows 95 or better, so I installed Linux

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
Mario:
> I have just commited support for output limiting to the pid block of the
> dsp module.

I was about to ask you if you could add it to the manual, but I see that you already did! Thank you.

> This is achieved by adjusting the integral part of the pid equation
...
> This means that the integral of the pid will not 'wind up' while in auto
> mode.

Perhaps this could be mentioned in the manual - as it is, it's not clear whether it's an anti-windup limit or a clipping limit (or something else).

> I will still need to add support for automatic/manual modes, to guarantee
> that the pid output will follow the manual setpoint in manual mode. Any
> preferences on how to do this?

> I was thinking of something along the lines of:
> fblock pid &lt;in_pt> ... man_sp &lt;plc_pt> mode_crtl &lt;plc_pt>

> Any other sugestions?

Perhaps instead of mode_ctrl you could have two alternatives, to allow both "on for manual" and "on for automatic" logic.

fblock pid &lt;in_pt> ... [man_sp &lt;plc_pt>] [man_mode|auto_mode &lt;plc_pt>]

Default for man_sp should probably be a constant 0.0 (you could generally allow a constant instead of a plc_pt).

I'm not sure what the default for man_mode should be - probably best make it so that one has to be specified if there is a man_sp. You could try
guessing based on man_sp (non-zero, or within limits, or not Inf/-Inf/NaN), but the first two would probably cause more trouble than they're worth and the last is too weird to be useful.

Jiri
--
Jiri Baum <[email protected]>
http://www.csse.monash.edu.au/~jiribvisit the MAT LinuxPLC project at http://mat.sf.net

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
J

Johan Bengtsson

While someone is at it I have a further suggestion: Make it possible to block integrating upward and downward (as separate inputs or an input accepting four different
values) Also make suitable outputs telling if this PID currently are blocked in either direction (either by setting the inputs or by itself because output limits are reached)

When two or more PID:s are cascaded this could make the master PID stop integrating when the slave PID is blocked. This would make cascaded controllers act better when the physical
output is saturated.


It could also be used if you want to put in a feedforward function after the PID (but in that case you probably don't want the built in limits.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------
 
M

Mario de Sousa

[email protected] wrote:
>
> While someone is at it I have a further suggestion:
> Make it possible to block integrating upward and downward
> (as separate inputs or an input accepting four different
> values)
> Also make suitable outputs telling if this PID currently
> are blocked in either direction (either by setting the inputs
> or by itself because output limits are reached)
>
> When two or more PID:s are cascaded this could make the master
> PID stop integrating when the slave PID is blocked.
> This would make cascaded controllers act better when the physical
> output is saturated.
>
> It could also be used if you want to put in a feedforward
> function after the PID (but in that case you probalby don't
> wan't the built in limits.
>
> /Johan Bengtsson
>


Hi Johan,

Thanks for your ideas!

It probably wouldn't take too long to implement it, but I was hoping we could keep the pid block as simple as possible. Maybe we should just fork it and have two, a simple pid and a new fully bloated pid?

Cheers,
Mario.

--
----------------------------------------------------------------------------
Mario J. R. de Sousa
[email protected]
----------------------------------------------------------------------------

The box said it requires Windows 95 or better, so I installed Linux

_______________________________________________
LinuxPLC mailing list
[email protected]org
http://linuxplc.org/mailman/listinfo/linuxplc
 
Top