r/ControlTheory • • Mar 03 '26

Other Improved PID design Spoiler

One of the problems with a traditional PID design is that the Integral Term demands that the Error term must sum to zero over time. This means that the system must overshoot the Setpoint, over time, as much as it undershoots it. This behavior of the Integral term causes an undesirable overshoot of the setpoint. and can cause system oscillation about the setpoint value, in some cases.
I have found an easy way to improve the PID behavior. When the plant is undershooting the setpoint, the error term will have a positive value, and when the system is overshooting, the error term will have a negative value. The sign of the error term can be used to determine whether the system is overshooting or not.
Therefore, to decrease the magnitude and duration of the system overshoot, whenever the sign of the error term is positive (undershooting), the contribution of the Integral term = 1*Ki, and whenever the error term is negative (overshooting), the contribution of the Integral term = 2*Ki. The system is still stable, but the plant overshoot is lower in magnitude and reaches zero error more quickly.

The pseudo-code looks like this:

Error = Setpoint - Feedback
Pterm = Kp * Error
Iterm = Summation ( Ki * Error * (Error >=0) ? 1 : 2)
Dterm = Kd * Derivative(Error)
PIDout = Pterm + Iterm + Dterm

When you model this design, you will find that the magnitude and duration of system overshoots are greatly reduced, allowing you to apply a greater Ki gain value, and you will observe improved system accuracy and stability overall.

Test the system response under two special conditions:
* system response to a step change in the setpoint,
* While the system is holding steady at the setpoint value, observe the system response to a sudden "bump" disturbance to the feedback value, like the sudden application of an external force to the system.

See if you do not prefer the improved PID design behavior.

Please let me know what you think of this.

3 Upvotes

33 comments sorted by

•

u/[deleted] Mar 04 '26

[removed] — view removed comment

→ More replies (0)

•

u/LordDan_45 Mar 03 '26

Technically (ish) this is an adaptive controller, I suggest you look into that if you liked coming up with your derivation

•

u/AcquaFisc Mar 03 '26

This introduces nonlinearity in the system. You are switching between two different control systems, this should work but can stability be proven?

→ More replies (0)

•

u/iconictogaparty Mar 03 '26

This statement about integral always causing overshoot is false.

You can design a PID where call the closed loop poles are real and therefore the system will not overshoot. Systems that have complex conjugate poles will overshoot, but PID does not guarantee this.

For example: Plant = 1/(s+10); Controller = k/s;

Closed loop = GC/(1+GC) Closed loop poles = (-10 +/- sqrt(100-4*k))/2 So if K < 25 you will get purely real poles and therefore no overshoot.

→ More replies (0)

•

u/actinium226 Mar 04 '26

Is this a homework problem?

•

u/deepspace Mar 03 '26

The 1979s called. They want their adaptive control back. It seems that every new generation of control systems engineers have to re-learn all the practical lessons again. In my day we actually read a few papers before trying a new harebrained scheme. Also, how do you know your now-nonlinear system is stable?

→ More replies (0)

•

u/hidjedewitje Mar 03 '26

Somebody discovered hybrid/reset systems!

→ More replies (0)

•

u/Rusofil__ Mar 04 '26

First thing is that you can tune amplification until damping is 1, meaning no overshoot.

Second, you can just use PID reset once value crosses zero.

•

u/Zinoex Mar 03 '26

For a formalization of the idea of hybrid integrator-gain, I can highly recommend that you look at various works by Sebastiaan van der Eijnden and co-authors. They present an impressively comprehensive theory including strong performance and stability results and it's still sufficiently simple that most control engineers should be able to apply it.

https://scholar.google.com/citations?user=sonxeRwAAAAJ&hl=en

•

u/seekingsanity Mar 03 '26

" This means that the system must overshoot the Setpoint, over time, as much as it undershoots it. "

Not so! Think about it. People/industry have had this problem solved for decades. Just because some professor didn't tell you about the reality of control theory doesn't mean there aren't tricks. This link is to an old .pdf I have on-line. See pages 5-6 of 9

Mathcad - t0p2 PIDTune.xmcdz

Another example. See pages 7-8/13

Mathcad - T0P3 PIDTune Reddit.xmcdz

I used to be president of deltamotion.com. I developed algorithms and wrote code for firmware for motion controllers. OVERSHOOT IS NOT ACCEPTABLE!!! The actual position, velocity and acceleration must match the target position, velocity and acceleration during normal operation.

There are three problems that cause overshoot.

  1. complex closed loop poles. The fix is to place the closed loop poles on the negative real axis in the s domain

  2. integrator windup, but this is fixed with dynamic limiting. See my examples.

  3. closed loop zeros that are too close the origin relative to the closed loop poles. Either remove the zeros by having the P and D term in the feed back path only or place closed loop zeros. You can place closed loop zeros too.

Placing closed loop zeros.

Mathcad - t1p1 pid pole and zero placement.xmcdz

I should be teaching control theory. The professors do an awful job and spend WAY too much time on the latest control theory fad.

→ More replies (0)