DSPRelated.com
Forums

Bound control system

Started by Vladimir Vassilevsky August 30, 2008
The classic closed loop system tries to minimize the error wrt some 
criteria.  But what if the requirement is to limit the error to the 
bounds (-E,+E) ? So as long as the error is within the bounds, the 
control signal should be zero.

Consider the PID controller and just the upper bound of error E. 
Initially, the error is below the bound, so the control signal is set to 
0 and the controller state is set to zero also. Then the error drifts 
up, and when it crosses the bound E, the controller is enabled and it 
tries to keep the error at E. So far so good.

Eventually the error goes down below E. At this moment, the controller 
output is disabled, the integrator state is frozen, the differentiator 
memory is updated normally. When the error goes above E again, the 
controller is enabled again.

The problem is what to do with the integrator. Since the error is always 
non negative, the integrator will grow up indefinitely. If the 
integrator is set to zero every time when the error goes below E, then 
the control is not going to be optimal. A solution could be multiplying 
the integrator by a factor of A (less then unity) when crossing E on the 
way down. Then what should be the rational way for determining A.

I am sure that the problem is not unusual, so there should be a good 
solution for it. Can you suggest an idea or a book with the treatment of 
that sort of problem?


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
>The classic closed loop system tries to minimize the error wrt some >criteria. But what if the requirement is to limit the error to the >bounds (-E,+E) ? So as long as the error is within the bounds, the >control signal should be zero. > >Consider the PID controller and just the upper bound of error E. >Initially, the error is below the bound, so the control signal is set to
>0 and the controller state is set to zero also. Then the error drifts >up, and when it crosses the bound E, the controller is enabled and it >tries to keep the error at E. So far so good. > >Eventually the error goes down below E. At this moment, the controller >output is disabled, the integrator state is frozen, the differentiator >memory is updated normally. When the error goes above E again, the >controller is enabled again. > >The problem is what to do with the integrator. Since the error is always
>non negative, the integrator will grow up indefinitely. If the >integrator is set to zero every time when the error goes below E, then >the control is not going to be optimal. A solution could be multiplying >the integrator by a factor of A (less then unity) when crossing E on the
>way down. Then what should be the rational way for determining A. > >I am sure that the problem is not unusual, so there should be a good >solution for it. Can you suggest an idea or a book with the treatment of
>that sort of problem?
Vladimir, Your problem appears to be a minimax problem, except that you ignore error magnitudes below E, whereas the former tries to minimize E as well. It should not hurt your criteria to consider the controller given by minimize_{PID parameters} max(absolute error) (1) There seems to be some interest on this problem. You can see for yourself by googling "minimax pid controller". In particular, the following seems relevant. http://www.iaeng.org/IJAM/issues_v37/issue_1/IJAM_37_1_06.pdf Also, (1) appears to be a convex optimization problem, which you can solve once for your parameters once, given a (stationary, I suppose,) noise model. Having said that, I am not a control person, so forgive me if this response bears no useful information to you. Emre
Vladimir Vassilevsky wrote:
> The classic closed loop system tries to minimize the error wrt some > criteria. But what if the requirement is to limit the error to the > bounds (-E,+E) ? So as long as the error is within the bounds, the > control signal should be zero. > > Consider the PID controller and just the upper bound of error E. > Initially, the error is below the bound, so the control signal is set > to 0 and the controller state is set to zero also. Then the error > drifts up, and when it crosses the bound E, the controller is enabled > and it tries to keep the error at E. So far so good. > > Eventually the error goes down below E. At this moment, the controller > output is disabled, the integrator state is frozen, the differentiator > memory is updated normally. When the error goes above E again, the > controller is enabled again. > > The problem is what to do with the integrator. Since the error is > always non negative, the integrator will grow up indefinitely. If the > integrator is set to zero every time when the error goes below E, then > the control is not going to be optimal. A solution could be > multiplying the integrator by a factor of A (less then unity) when > crossing E on the way down. Then what should be the rational way for > determining A. > I am sure that the problem is not unusual, so there should be a good > solution for it. Can you suggest an idea or a book with the treatment > of that sort of problem? > > > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultant > http://www.abvolt.com
Vladimir, This looks like a classical "bang/bang" controller with a dead zone. So, instead of bang/bang you might say bang/off/bang or +1/0/-1. Then, you might modify the +1 and -1 to have proportional responses instead of +1 or -1 only. It might be like this: | | +------------ | | | | | | | | | | | | +----------|----------+ | | | | | | | | | | | | ------------+ | OR -------------- / | / | / | / | / | / | / | / | / +----------|----------+ / | / | / | / | / | / | / | / | ---------- ----------- / OR | / / / | / | / | / | / | / | / | | | | +---------------|----------+ | | | | / | / | / | / | / | / | / ------- You pick the parameters... The Describing Function method of Krylov and Bogolyubov is treated in "Control System Theory", Olle I. Elgerd, McGraw-Hill. Because the nonlinearity is sometimes part of the system under control and not necessarily the controller then a PID in the mix might be fine. I guess I would start with a block diagram with the PID involved and with the nonlinearity involved and then use the Describing Function analysis to decide what the PID (and other) parameters might be. I'd not get too invested in the PID by itself - for starters. I once used this method to change a control system from bang/bang (100% duty cycle) to bang/off/bang with a huge saving in energy, noise, etc. with under 10% duty cycle. There were just little correcting "blips" in the control signal. Of course, all this is "classical" control theory as compared to "modern" but I've USED the former compared to the latter. For simple systems you may find it appealing. Fred
Vladimir Vassilevsky wrote:
> > The classic closed loop system tries to minimize the error wrt some > criteria. But what if the requirement is to limit the error to the > bounds (-E,+E) ? So as long as the error is within the bounds, the > control signal should be zero.
For the general plant you run into problems right there, because in general a plant may well require a control signal to remain in place (this is usually the job of the integrator if you're doing control with a PID).
> Consider the PID controller and just the upper bound of error E. > Initially, the error is below the bound, so the control signal is set to > 0 and the controller state is set to zero also. Then the error drifts > up, and when it crosses the bound E, the controller is enabled and it > tries to keep the error at E. So far so good. > > Eventually the error goes down below E. At this moment, the controller > output is disabled, the integrator state is frozen, the differentiator > memory is updated normally. When the error goes above E again, the > controller is enabled again. > > The problem is what to do with the integrator. Since the error is always > non negative, the integrator will grow up indefinitely. If the > integrator is set to zero every time when the error goes below E, then > the control is not going to be optimal. A solution could be multiplying > the integrator by a factor of A (less then unity) when crossing E on the > way down. Then what should be the rational way for determining A. > > I am sure that the problem is not unusual, so there should be a good > solution for it. Can you suggest an idea or a book with the treatment of > that sort of problem?
If you have some valid reason for completely powering down the drive when you're within your error bounds (because you can count on friction, say), then the easiest thing to do would be to zero out your integrator state. As described you have a controller that's only going to be quite unsatisfactory for a sizable subset of plants, and is going to make a downright unstable (at least conditionally unstable) system for a sizable subset of plants that are perfectly controllable by other means. What's your goal, really? Are you trying to build a controller for a system where it just doesn't matter what the error is once it gets within the error bounds? Are you trying to build a controller for a system where it's expensive to keep the drivers turned on (making your desire to turn the drivers _off_ quite valid)? Synthesizing an appropriate controller from specifications and mathematical first principals can be a monumental, if not impossible task. Sometimes the best method to solve one of these corner cases is just apply a combination of common sense, intuition, and mathematical analysis of candidate controllers. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
On Aug 31, 3:28 am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> The classic closed loop system tries to minimize the error wrt some > criteria. But what if the requirement is to limit the error to the > bounds (-E,+E) ? So as long as the error is within the bounds, the > control signal should be zero. > > Consider the PID controller and just the upper bound of error E. > Initially, the error is below the bound, so the control signal is set to > 0 and the controller state is set to zero also. Then the error drifts > up, and when it crosses the bound E, the controller is enabled and it > tries to keep the error at E. So far so good. > > Eventually the error goes down below E. At this moment, the controller > output is disabled, the integrator state is frozen, the differentiator > memory is updated normally. When the error goes above E again, the > controller is enabled again. > > The problem is what to do with the integrator. Since the error is always > non negative, the integrator will grow up indefinitely. If the > integrator is set to zero every time when the error goes below E, then > the control is not going to be optimal. A solution could be multiplying > the integrator by a factor of A (less then unity) when crossing E on the > way down. Then what should be the rational way for determining A. > > I am sure that the problem is not unusual, so there should be a good > solution for it. Can you suggest an idea or a book with the treatment of > that sort of problem? > > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultanthttp://www.abvolt.com
If you want to minimize the maximum value of the error then you will need H infinity control theory.

Tim Wescott wrote:
> Vladimir Vassilevsky wrote: > >> >> The classic closed loop system tries to minimize the error wrt some >> criteria. But what if the requirement is to limit the error to the >> bounds (-E,+E) ? So as long as the error is within the bounds, the >> control signal should be zero.
> What's your goal, really? Are you trying to build a controller for a > system where it just doesn't matter what the error is once it gets > within the error bounds? Are you trying to build a controller for a > system where it's expensive to keep the drivers turned on (making your > desire to turn the drivers _off_ quite valid)?
The plant is a heavy push-pull thing which normally balances itself. Sometimes the external disturbance is too high, so the plant needs a little help from the servo to keep within the allowed limits. The plant is naturally slightly off zero because of the tolerances. So if I set the servo to keep the plant at exactly zero, then the servo will be fighting with the self balancing property of the plant. What is even worse in this case is that the servo has to compensate the full strength of the external disturbance rather then only helping to the plant when needed.
> Synthesizing an appropriate controller from specifications and > mathematical first principals can be a monumental, if not impossible > task. Sometimes the best method to solve one of these corner cases is > just apply a combination of common sense, intuition, and mathematical > analysis of candidate controllers.
I got the system to work by the shamanistic methods. I was wondering if there is a good systematic approach to the problem. The compensation of the nonlinearities in the loop is a well developed area, however what I need seems to be the opposite. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

Fred Marshall wrote:
> Vladimir Vassilevsky wrote: > >>The classic closed loop system tries to minimize the error wrt some >>criteria. But what if the requirement is to limit the error to the >>bounds (-E,+E) ? So as long as the error is within the bounds, the >>control signal should be zero.
> This looks like a classical "bang/bang" controller with a dead zone. So, > instead of bang/bang you might say bang/off/bang or +1/0/-1. > Then, you might modify the +1 and -1 to have proportional responses instead > of +1 or -1 only.
The proportional controller has a steady state error. Besides, there is some deadband in the actuators. So I would like to include the I term.
> The Describing Function method of Krylov and Bogolyubov is treated in > "Control System Theory", Olle I. Elgerd, McGraw-Hill.
Thank you, I will take a look.
> I once used this method to change a control system from bang/bang (100% duty > cycle) to bang/off/bang with a huge saving in energy, noise, etc. with under > 10% duty cycle. There were just little correcting "blips" in the control > signal.
Using the common sense, I got the system working. Looks almost like the error is hard limited at +/- E. However the algorithm is rather ad hoc and not very elegant at all.
> Of course, all this is "classical" control theory as compared to "modern" > but I've USED the former compared to the latter.
:-) Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky wrote:
> > The classic closed loop system tries to minimize the error wrt some > criteria. But what if the requirement is to limit the error to the > bounds (-E,+E) ? So as long as the error is within the bounds, the > control signal should be zero. > > Consider the PID controller and just the upper bound of error E. > Initially, the error is below the bound, so the control signal is set to > 0 and the controller state is set to zero also. Then the error drifts > up, and when it crosses the bound E, the controller is enabled and it > tries to keep the error at E. So far so good. > > Eventually the error goes down below E. At this moment, the controller > output is disabled, the integrator state is frozen, the differentiator > memory is updated normally. When the error goes above E again, the > controller is enabled again. > > The problem is what to do with the integrator. Since the error is always > non negative, the integrator will grow up indefinitely. If the > integrator is set to zero every time when the error goes below E, then > the control is not going to be optimal. A solution could be multiplying > the integrator by a factor of A (less then unity) when crossing E on the > way down. Then what should be the rational way for determining A.
No. You wrote above that the integrator state is frozen. That's all you need to do.
> I am sure that the problem is not unusual, so there should be a good > solution for it. Can you suggest an idea or a book with the treatment of > that sort of problem?
Phelan? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Tim Wescott wrote:
> Vladimir Vassilevsky wrote: >> >> The classic closed loop system tries to minimize the error wrt some >> criteria. But what if the requirement is to limit the error to the >> bounds (-E,+E) ? So as long as the error is within the bounds, the >> control signal should be zero. > > For the general plant you run into problems right there, because in > general a plant may well require a control signal to remain in place > (this is usually the job of the integrator if you're doing control with > a PID).
Right, and freezing the integrator says "Steady as she goes." ... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:
> Tim Wescott wrote: >> Vladimir Vassilevsky wrote: >>> >>> The classic closed loop system tries to minimize the error wrt some >>> criteria. But what if the requirement is to limit the error to the >>> bounds (-E,+E) ? So as long as the error is within the bounds, the >>> control signal should be zero. >> >> For the general plant you run into problems right there, because in >> general a plant may well require a control signal to remain in place >> (this is usually the job of the integrator if you're doing control >> with a PID). > > Right, and freezing the integrator says "Steady as she goes." > > ... > > Jerry
"the controller output is disabled, the integrator state is frozen" Freezing the integrator says "steady as she goes", but "disabling the controller output" says "anything goes". Vladimir explained quite well why he wanted it to do what it does -- it's a set of requirements that are off the beaten track, hence the solution needs to be as well. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html