Totalizer block (was On delay Timer routine)

johan.bengtsson:
> That is right (apart from some misstyping :) )

Yeah, sorry about that... see corrected version below.

> The Igain and Dgain should still be calculated as Igain=gain/Itime and
> Dgain=gain*Dtime

I'm not sure what you mean by gain here? Isn't gain just what I called masterGain? (I multiplied it into the formulae at a different place, but
the effect is the same...)

What is Itime and Dtime ? (Is that just a different way of saying that Igain should be in hertz and Dgain should be in seconds?)

> Do you want me to try to implement a more full-blown PID controller
> (including bumpless transfer and so on)

Probably best to put it into the one that's already in the CVS, if that's OK with you Mario.

The formulae again, hopefully without typos now...

error = (desired - actual) * masterGain
P = error * Pgain;
I += error * Igain * time
D = (error - last_error) * Dgain / time
output = P+I+D

Tuning:
masterGain (no units)
Pgain (no units)
Igain (in Hz)
Dgain (in s)

Other values:
time is the period of the PID in seconds


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

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

Johan Bengtsson

yes it is, normally you have three parameters in to a PID that is changed during tuning
gain
Itime
Dtime (if D is to be used, otherwise this is 0)

this would mean for your formulas:
masterGain=gain
Pgain=1
Igain=1/Itime
Dgain=Dtime

Having error multiplied by gain is somewhat missleading however since the control error have some use of it's own and the definition of that number is changed in these formulas.

/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/
----------------------------------------

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

Mario de Sousa

Jiri Baum wrote:
>
> johan.bengtsson:
> > That is right (apart from some misstyping :) )
>
> Yeah, sorry about that... see corrected version below.
>
(...)
>
> > Do you want me to try to implement a more full-blown PID controller
> > (including bumpless transfer and so on)
>
> Probably best to put it into the one that's already in the CVS, if that's
> OK with you Mario.

Sure, go ahead.

I was working on the dsp, but got a little sidetracked. I installed Red Hat 7.1 at home, and am now trying to experience a what a new user would have to go through when making a fresh build.

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
 
johan.bengtsson:
> Having error multiplied by gain is somewhat missleading however since the
> control error have some use of it's own and the definition of that number
> is changed in these formulas.

Good point - if it's done this way, the control error would probably have to be made available both ways (unscaled error, scaled error) or just be made available before it's multiplied by the gain.


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

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