Hi All.
Please help me out here I am loosing all my faith in my maths ability
I have a SW that I easily can create Graphical user interfaces very similar to LABVIEW,(Graphical programming ) this SW has a PID component (controller block).
my problem is when I use a positive KI coeficient then the controller output is positive and when I use a negative KI then the controller output is negative.This to me is incorrect looking that the method of calculating the controller output,
a negative KI should help to reduce the intergal value and even when the complete term is negative the output should not change to negative as it is first term + Second term for example 2 + -1 = 1 not as in this case from the controller -1
The help file of the component shows this
Sanity Check on PID Controllers
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Sanity Check on PID Controllers
- Attachments
-
- 2.JPG (39.96 KiB) Viewed 3591 times
-
- 1.JPG (22 KiB) Viewed 3592 times
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Sanity Check on PID Controllers
Hi Peter,
This is my simple PID formula I worked out at Uni and have implemented in a few places (including the Flowcode DSP Control component), seems to work well and be correct.
The equations they gave to us were horrible but boiling it down to the basics it's not actually that bad.
This is my simple PID formula I worked out at Uni and have implemented in a few places (including the Flowcode DSP Control component), seems to work well and be correct.
The equations they gave to us were horrible but boiling it down to the basics it's not actually that bad.
Hopefully this should help.Error = (Setpoint - Feedback)
PrevError = Error from last cycle
PrevPrevError = Error from two cycles ago
Control Signal = P * (Error - Prev_Error + (Error / I) + D * (Error - (2 * Prev_Error) + Prev_Prev_Error))
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: Sanity Check on PID Controllers
Ben
Thank you very much this is very helpful
Thank you very much this is very helpful

https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR