Author Topic: Cruise control, PID and integral wind-up  (Read 2596 times)

0 Members and 1 Guest are viewing this topic.

Online CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: au
Cruise control, PID and integral wind-up
« on: April 30, 2019, 01:16:09 am »
Just thinking, if a normal analog PID setup was used in a car cruise control then if a hill came along and the car slowed somewhat then recovered, it would overshoot the original speed and then settle down to the set speed again. This overshoot "problem" as I see it is not a deficiency in the circuit but simply the car catching up to the position it would have been at if it had not slowed down.

The question is - how can you make an analog system that doesn't overshoot greatly, that once it reaches the set speed again it dumps the integral wind-up? In other words, is happy once it regains the set speed rather than the lost position.
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1079
  • Country: au
Re: Cruise control, PID and integral wind-up
« Reply #1 on: April 30, 2019, 02:38:32 am »
A leaky integral term is a simple way. For every unit time, subtract some small value from the absolute value of the integral error. Essentially the integral term will always decay to zero. 

You could also not use the integral term at all. In some systems the I term can actually increase error (although I have no idea about cruise control)
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12263
  • Country: us
Re: Cruise control, PID and integral wind-up
« Reply #2 on: April 30, 2019, 02:54:47 am »
Just thinking, if a normal analog PID setup was used in a car cruise control then if a hill came along and the car slowed somewhat then recovered, it would overshoot the original speed and then settle down to the set speed again.

This is not necessarily the case.

Quote
This overshoot "problem" as I see it is not a deficiency in the circuit but simply the car catching up to the position it would have been at if it had not slowed down.

I don't think this is how control loops work. The control loop doesn't know the vehicle's position--it is not using GPS, for example. It only knows the instantaneous speed of the car.

Quote
The question is - how can you make an analog system that doesn't overshoot greatly, that once it reaches the set speed again it dumps the integral wind-up? In other words, is happy once it regains the set speed rather than the lost position.

This is easy, it is all a matter of tuning. If you tune for an over-damped control response then there will be no overshoot.
« Last Edit: April 30, 2019, 02:56:34 am by IanB »
 

Online Phoenix

  • Frequent Contributor
  • **
  • Posts: 435
  • Country: au
Re: Cruise control, PID and integral wind-up
« Reply #3 on: April 30, 2019, 03:00:10 am »
Cruise control these days is digital. Anti windup is as simple as limiting a variable or stopping the integral summation if the output is >100%.

Similar can be done with an opamp pid using a zener diode across the integrator capacitor.

Sent from my G8441 using Tapatalk

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17030
  • Country: us
  • DavidH
Re: Cruise control, PID and integral wind-up
« Reply #4 on: April 30, 2019, 03:22:23 am »
Cruise controls or at least the analog ones do suffer from windup and will overshoot when recovering but the effect is usually well controlled.

Integrator windup is ameliorated either by including anti-windup circuits or using a topology which does not suffer as much from it like a transconductance error amplifier.  Some operational amplifiers include "clamping" inputs which can be used to limit windup.  The old LM301A operational amplifier is a favorite of mine because one of its compensation pins provides access to the transconductance node and can be used for clamping.
 

Online CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: au
Re: Cruise control, PID and integral wind-up
« Reply #5 on: April 30, 2019, 03:34:21 am »
^^ Overshoot when recovering. After thinking about it further, that sounds right. The integrating cap gets charged one polarity as the car falls behind when initially slowing on a hill, so later, when the hill levels off to flat road again, the car overspeeds to get back to its “rightful” position on the road, causing the cap to discharge. Any sag in speed must be balanced by a later bump in speed. Equal area under the curve.

Edit -> add "when the hill levels off to flat road again"
« Last Edit: April 30, 2019, 05:13:57 am by Circlotron »
 

Offline coppercone2

  • Super Contributor
  • ***
  • Posts: 10327
  • Country: us
  • $
Re: Cruise control, PID and integral wind-up
« Reply #6 on: April 30, 2019, 03:38:20 am »
Yes, what you are asking for sounds like it would be refereed to as a PID-Heuristic. That is, non-linear PID behavior which transfer function (or I guess control loop plot?) is easier described with words then a equation.

To implement an analog solution you would need to figure out how to turn that words into a equation that is valid over some response.

The art of electronics calls this non-simple behavior heuristics. The different solutions people proposed here to modify the PID have different complexities (kind of like different approximations to a simple resistor with inductance, capacitance, etc.. you can get deeper and deeper into it to get a more ideal response).

Maybe along the lines of if this and that term of the PID are in this and that region connect them to dummy loads and monitor them but swap in another circuit (or add another circuit to their response to weigh after their buffered/isolated in the signal chain).

You can also add a digital supervisor to a analog loop, I believe typically you would do digital-bulk and analog-mini to get more precision, or analog-bulk and digital-trim to get better response but I am not sure. They will obviously fight each other but you can get a favorable response.

If it needs memory then its more complicated. What I mean is like if integral output is between 7-10V, then add in a dampening circuit, otherwise isolate that circuit to change response. If you want something like a response to a term-high 5 seconds ago being weighed into the response etc.. i can imagine its going to get very hairy, i think sample and holds etc (then you are looking at digital filter math for more complicated stuff to be practical)

i.e. i between 5-7V means P gets gain loss.


when the PID frequency response differs greatly from your desired heuristic time, then digital starts to make more sense.

**
The question is - how can you make an analog system that doesn't overshoot greatly, that once it reaches the set speed again it dumps the integral wind-up? In other words, is happy once it regains the set speed rather than the lost position.

something like connect a drain resistor to discharge the I some how rapidly when absolute ~ 0 if I is > then some number and P and D are within some range? soft comparator connected to a voltage dependant drain resistor?
« Last Edit: April 30, 2019, 03:48:25 am by coppercone2 »
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12263
  • Country: us
Re: Cruise control, PID and integral wind-up
« Reply #7 on: April 30, 2019, 03:57:41 am »
There seems to be a misunderstanding in this thread about what integral windup is. Integral windup is not "excess" integral action that has to be "dumped" once you reach the set point (the desired speed).

Integral windup is rather a continuing accumulation of integral action after the manipulated variable (the gas pedal) has hit the limit and can move no further. For example if you perhaps were going up a very steep hill and the pedal hit the floor and therefore no more control action were possible.

In normal freeway driving with reasonable inclines and a reasonable excess capacity in the engine to recover the dropping speed then integral windup will not occur and no special action will be required to compensate for it.

As I mentioned above a normal PID control loop can be tuned more aggressively or less aggressively. With aggressive tuning you can get overshoot. With less aggressive tuning you can have a damped response with no overshoot. It's a choice you can make. It does not require any kind of special non-linear control algorithms or special logic to achieve in the normal control domain.
 
The following users thanked this post: T3sl4co1l

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12263
  • Country: us
Re: Cruise control, PID and integral wind-up
« Reply #8 on: April 30, 2019, 03:59:03 am »
The question is - how can you make an analog system that doesn't overshoot greatly, that once it reaches the set speed again it dumps the integral wind-up? In other words, is happy once it regains the set speed rather than the lost position.

There is no such difficulty. You simply tune the controller for the response you want.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3859
  • Country: us
Re: Cruise control, PID and integral wind-up
« Reply #9 on: April 30, 2019, 04:00:44 am »
I don't think this is how control loops work. The control loop doesn't know the vehicle's position--it is not using GPS, for example. It only knows the instantaneous speed of the car.

This is actually what happens in an ideal PID controller.  In the steady state of a PID controller, the P and D terms are zero and the I term provides 100% of the output.  i.e., If you need 10% throttle to maintain speed, the I term will be 10%.  After a temporary external disturbance (such as going up a hill), the system will regain equilibrium at the same level of 10%.  That means that the velocity error integrated across the disturbance sums to zero.  It will have as much area "too fast" as "too slow", and you end up in the same position as you would have without the disturbance.

The simplest "solution" to this is actually to just increase the gain.  That reduces the undershoot and therefore the overshoot.  Beyond that you need something non-linear.  That could be just picking a sensible saturation level for the integrator, or a more sophisticated anti-windup circuit.  What you need depends on your system and tolerance for exceeding the setpoint. 
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22229
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Cruise control, PID and integral wind-up
« Reply #10 on: April 30, 2019, 04:10:01 am »
The circumstance you describe is not usually a case of integrator windup, just the normal (LTI) dynamic, how much overshoot it exhibits. :)

Integrator windup is a nonlinear process, where the integrator has positive and negative saturation limits beyond the input range of the plant being controlled.  Typically this arises due to internal nodes (e.g., a multistage amplifier where the internal node has a range of state outside your control), or due to explicit nonlinear elements added to the control loop to provide additional functionality (e.g., the wired-OR diodes in an analog bench supply).

A complementary process is slew rate limiting, where the integrator cannot move fast enough to match the input -- this is typically a saturation process earlier in the chain (i.e., in a diffamp's input or volt-amp stage).

Incidentally, note that traditional dominant-pole-compensated voltage mode op-amps are "leaky" integrators, in and of themselves -- they have a dominant -20dB/dec frequency response, starting from a quite low frequency pole, with reasonably high DC gain (say 0.01Hz-1kHz and 60-140 dB).

With definitions cleared up -- where else might we expect windup?

To use the same example, we might actually expect it for a sufficiently steep upwards hill (where the cruise control would be flooring the throttle), assuming the control is designed for full control authority of course (which it might not be? I wonder).

Note that, for a given RPM, the engine is only capable of so much torque at full throttle, and it reaches nearly this torque (say within 90%) at some fraction of full throttle.  This happens because the engine isn't drawing its maximum intake flow rate, so the partially-opened throttle has little pressure drop, and the manifold air pressure is nearly atmospheric.

This won't be so noticeable in an automatic car -- the transmission will downshift when high throttle is demanded, increasing engine RPM and extending the useful throttle control range.  It is noticeable in a manual car, especially in an especially high gear (low engine RPM) for a given cruising speed, where torque maxes out quickly with respect to throttle range.

We might also expect it for a downwards hill, where the throttle backs off completely (the hill is steeper than the vehicle's "glide slope" and it accelerates), then comes out of saturation as speed returns to nominal.

Incidentally, between automatic and manual cars, the cruise response is quite stark -- the automatic must take account of the slow throttle, torque converter and transmission response.  The whole thing is a squishy mess, and this decouples throttle input from wheel torque and therefore speed change.  In control terms, there are additional poles in the system.  Typical cruise controls have a dominant pole around 1Hz.

Manual cruise controls can act much faster, and indeed could even be designed to use engine RPM instead of ground speed, or even a phase lock to a DDS (which corresponds to a position lock with respect to other traffic going the exact same speed*).  Throttle response of a traditional engine is pretty straightforward (having a dominant pole in the maybe 5-10Hz range) so the cruise can be much more stable.

*Although, unfortunately you'd never see this in practice due to variations in tire size and inflation, for example.

Modern auto transmissions with locking gears should be able to do this as well, but I don't know if they are made to.

And the less said about CVTs, the better? :-DD  The one of those I test drove, the whole traction system (since it's fly-by-wire and not meaningfully an engine and transmission, but a whole system unto itself) had a dominant pole of fractional Hz, very unpleasant to drive.  (I suspect a lot of that is intentional -- psychology.  Mass produced things have a ridiculous amount of psychology driving their design, no matter how stupid.  CVTs with simulated gears, for example...)  Unclear if the cruise would be integrated into that system (and therefore the CVT can be set to anticipate the "intent" of the cruise control), or external and therefore even slower still (with a plant of fractional-Hz, the control would have to roll off at 100s mHz!).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12263
  • Country: us
Re: Cruise control, PID and integral wind-up
« Reply #11 on: April 30, 2019, 04:13:07 am »
This is actually what happens in an ideal PID controller.  In the steady state of a PID controller, the P and D terms are zero and the I term provides 100% of the output.  i.e., If you need 10% throttle to maintain speed, the I term will be 10%.  After a temporary external disturbance (such as going up a hill), the system will regain equilibrium at the same level of 10%.  That means that the velocity error integrated across the disturbance sums to zero.  It will have as much area "too fast" as "too slow", and you end up in the same position as you would have without the disturbance.

This analysis assumes that you started and ended on a level road and there was a temporary incline somewhere in between. But in this case there is no overshoot due to integral windup, there is just the natural action of the controller when the incline ends. The car starts going slightly too fast as the gradient levels out and the speed control compensates.
 

Online CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: au
Re: Cruise control, PID and integral wind-up
« Reply #12 on: April 30, 2019, 05:36:51 am »
And part of the problem, if you'll pardon the pun, is that I misunderstood the *term* "wind-up".  I thought that was the proper description of the value accumulated in the integrator at any given moment, not a problem with a saturated control loop caused by a maxed out integrator.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf