Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch.embedded > #29693
| From | DJ Delorie <dj@delorie.com> |
|---|---|
| Newsgroups | comp.arch.embedded |
| Subject | Re: PID controller: dummy questions |
| References | <rd2odq$oiv$1@dont-email.me> |
| Date | 2020-06-25 15:29 -0400 |
| Message-ID | <xnlfkbc5ah.fsf@delorie.com> (permalink) |
I'm not an expert, but I've gone through this puzzle in the past, so... pozz <pozzugno@gmail.com> writes: > For the proportional term, we have an output from PID controller that is > > P = Kp*err Yup! > FIRST STEP > T = 20°C. Error = 60°C. P = 6V. > Should I set the power supply output voltage to 6V? I think so. Yup! > SECOND STEP > T = 30°C. Error = 50°C. P = 5V. > Should I set Vout=5V or increase Vout by 5V so setting it to 11V? 5V. > The mathematics say the output of PID controller *is* Kp*err, As a first step, yes. You're not done though. Even with a pure P controller, you can just set Kp high enough that the error is small. I.e. if your Kp was 10V/V, you'd get a 10V swing from 79C to 81C, which may be enough. If you set Kp REALLY high, you effectively get an on-off control like a mechanical thermostat. Ideally, you'd set Kp as high as you can get away with, but not so high that you get runaway oscillations in the output. > but I'm not sure. With the increase of temperature, the errore > decreases to a minimum, so the Vout. At the steady state the error > should be zero, but the voltage from the power supply can't be zero. P = Kp * err (note = not += ) Vout = P So far you've done the "P" part of PID. Next you need to do the "I" part of PID. The P portion quickly (hopefully) gets you close to the goal, with some steady-state error. The next step is to integrate the remaining error over time, which undoes any "offset" in the system. I += Ki * err (note += not = ) Vout = P + I So now, if the Kp isn't enough to get you to goal, the system will slowly boost the output to remove the offset. This is a PI controller. Note that the accumulated I value is often limited in magnitude to prevent runaway. Now for the "D" term. The D term is designed to prevent overshoot by "putting on the brakes" if you're approaching the goal too quickly. D = Kd * (err[t] - err[t-1]) (i.e. how fast is the error changing) Vout = P + I + D; Now you have a PID controller :-) There's one more term that's often used to optimize the system - a "feed forward" term. F = Kf * Tgoal I.e. if your system is of the type where (approximately) input voltage = output temperature, you can estimate this with an F term, and use the PID control just for precision.
Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PID controller: dummy questions pozz <pozzugno@gmail.com> - 2020-06-25 19:55 +0200
Re: PID controller: dummy questions Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2020-06-25 21:14 +0200
Re: PID controller: dummy questions DJ Delorie <dj@delorie.com> - 2020-06-25 15:29 -0400
Re: PID controller: dummy questions David Brown <david.brown@hesbynett.no> - 2020-06-26 08:43 +0200
Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-25 22:21 -0400
Re: PID controller: dummy questions pozz <pozzugno@gmail.com> - 2020-06-26 10:59 +0200
Re: PID controller: dummy questions David Brown <david.brown@hesbynett.no> - 2020-06-26 11:07 +0200
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-26 09:10 -0700
Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-26 12:29 -0400
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-26 12:00 -0700
Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-26 22:24 -0400
Re: PID controller: dummy questions Paul Rubin <no.email@nospam.invalid> - 2020-06-26 21:41 -0700
Re: PID controller: dummy questions DJ Delorie <dj@delorie.com> - 2020-06-27 01:15 -0400
Re: PID controller: dummy questions Paul Rubin <no.email@nospam.invalid> - 2020-06-26 23:12 -0700
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 00:07 -0700
Re: PID controller: dummy questions pozz <pozzugno@gmail.com> - 2020-06-27 16:53 +0200
Re: PID controller: dummy questions David Brown <david.brown@hesbynett.no> - 2020-06-27 17:31 +0200
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 10:09 -0700
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 15:44 -0700
Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-27 12:34 -0400
Re: PID controller: dummy questions DJ Delorie <dj@delorie.com> - 2020-06-27 11:51 -0400
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-26 23:06 -0700
Re: PID controller: dummy questions Paul Rubin <no.email@nospam.invalid> - 2020-06-26 23:18 -0700
Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 00:23 -0700
Re: PID controller: dummy questions Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2020-06-27 10:28 +0300
Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-27 18:13 -0400
Re: PID controller: dummy questions Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2020-06-26 22:30 +0200
Re: PID controller: dummy questions Phil Martel <pomartel@comcast.net> - 2020-06-28 13:10 -0400
csiph-web