FORUM ON BEER, HOMEBREWING, AND RELATED ISSUES Digest Janitor: pbabcock at hbd.org *************************************************************** TODAY'S HOME BREW DIGEST BROUGHT TO YOU BY: Logic, Inc. - Makers of Straight A Cleanser www.ecologiccleansers.com Support those who support you! Visit our sponsor's site! ********** Also visit http://hbd.org/hbdsponsors.html ********* DONATE to the Home Brew Digest. Home Brew Digest, Inc. is a 501(c)3 not-for-profit organization under IRS rules (see the FAQ at http://hbd.org for details of this status). Donations can be made by check to Home Brew Digest mailed to: HBD Server Fund PO Box 871309 Canton Township, MI 48187-6309 or by paypal to address serverfund@hbd.org. DONATIONS of $250 or more will be provided with receipts. SPONSORSHIPS of any amount are considered paid advertisement, and may be deductible under IRS rules as a business expense. Please consult with your tax professional, then see http://hbd.org for available sponsorship opportunities. *************************************************************** Contents: PID Algorithm ("A. J. deLange")
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Beer is our obsession and we're late for therapy! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * NOTE: With the economy as it is, the HBD is struggling to meet its meager operating expenses of approximately $3500 per year. If less than half of those currently directly subscribed to the HBD sent in a mere $5.00, the HBD would be able to easily meet its annual expenses, with room to spare for next year. Please consider it. Financial Projection As of 03 March 2012 *** Condition: Guarded *** 501(c)3 revoked in process of retroactive reinstatement. See Site News on http://hbd.org for details and progress. Projected 2012 Budget $3191.79 Expended against projection $ 721.78 Unplanned expenditures $ 79.98 Projected Excess/(Shortfall) ($ 725.01) As always, donors and donations are publicly acknowledged and accounted for on the HBD web page. Thank you Send articles for __publication_only__ to post@hbd.org If your e-mail account is being deleted, please unsubscribe first!! To SUBSCRIBE or UNSUBSCRIBE send an e-mail message with the word "subscribe" or "unsubscribe" to request@hbd.org FROM THE E-MAIL ACCOUNT YOU WISH TO HAVE SUBSCRIBED OR UNSUBSCRIBED!!!** IF YOU HAVE SPAM-PROOFED your e-mail address, you cannot subscribe to the digest as we cannot reach you. We will not correct your address for the automation - that's your job. HAVING TROUBLE posting, subscribing or unsusubscribing? See the HBD FAQ at http://hbd.org. LOOKING TO BUY OR SELL USED EQUIPMENT? Please do not post about it here. Go instead to http://homebrewfleamarket.com and post a free ad there. The HBD is a copyrighted document. The compilation is copyright HBD.ORG. Individual postings are copyright by their authors. ASK before reproducing and you'll rarely have trouble. Digest content cannot be reproduced by any means for sale or profit. More information is available by sending the word "info" to req@hbd.org or read the HBD FAQ at http://hbd.org. JANITORs on duty: Pat Babcock (pbabcock at hbd dot org), Jason Henning, Spencer Thomas, and Bill Pierce
---------------------------------------------------------------------- Date: Mon, 12 Mar 2012 04:13:20 -0400 From: "A. J. deLange" <ajdel at cox.net> Subject: PID Algorithm "Error is not the proportional term." Jeff is apparently still confused on how PID controllers work. They start by computing an error, the difference between the process variable and the set point. For a heating load E = SP - PV and the set point is the upper edge of the proportional band. The lower edge is at SP - Band where 'Band' is the band width in PV units (i.e. degrees). The proportional term from the controller is G*(SP - PV)/Band where G limits the output to 0 - 1 (0 to 100%). Thus if PV = SP - Band the output of the proportional term is 0. If PV< SP - Band G sets the output to 0. If PV> SP the output is 0 (unless the controller is set up to simultaneously control heating and cooling loads). If PV = SP-Band then the proportional output is 1 (100%). If PV< SP - Band then the output is still 100%. Thus, clearly the error scaled by gain = 1/Band is indeed the proportional term. " With only proportional gain the error will oscillate around the setpoint, but never eliminate/minimize the error." If a controller is run with only the proportional term it cannot (unless the load is 0) ever bring the PV to SP so the second part is true. There will be some finite error necessary to establish the output required to supply the load (heat losses). But a P-only controller does not oscillate at all unless the proportional gain is set absurdly high (band to a fraction of a degree) in which case oscillation does occur but not around the set point. In the usual case the PV simply assymptotically approaches some value less than the SP. "It's take the integral term which integrates its gain value as a function of time to reduce the error beyond the ability of proportional gain." It is not the gain which is integrated but rather the error. The integrated error is then scaled by a gain and that plus the proportional error is the output. The constant error from P integrates up calling for more output until such time as the total error goes to 0. The integrator holds its value for ever - it computes the integral from startup to the current time. E is also differentiated. The differential is also scaled by a gain and added to the output. Output = G*[E/Band + g2*Integral_-infinity_to_t(E) + g3*dE/dt] The differential term responds to sudden changes in PV (SP) such as throwing a block of ice into the mash tun and also helps damp overshoot after an SP step. Proper tuning (correct choice of Band, g2 and g3 are required for optimum performance of a PID controller. These differ as thermal mass and rate of heat loss from the thing being heated vary. "Lacking a method to infinitely vary the output in response to error makes the ability of the integral term to extinguish the error not managed by proportional gain a pretty tough putt in a closed loop system." Not so. This can easily be verified by writing a simple simulation in which you coarsely quantize the output. But more to the point, as I explained in the last post controllers that use Output, as computed above, to control relative on and off times, be it within a cycle of the 60 Hz line or within a 30 second or longer cycle time do provide infinite control (subject to the quantization of Output i.e. whether the controller resolves to 1% or 0.1%). "My best guess is with an on/off output, any integral gain value applied will wind-up in value and put the system back in oscillation." The arguments I gave above, the simulation I ran and most important, the fact that I have three channels of PID control in my brewery that use on/off output with a PID algorithm make it clear that this guess is not a good one at all. We might also ask ourselves why, if this guess had any validity, manufacturers would offer this output mode in a PID controller. "Most pid controllers also have a filter on the PV signal before it is passed to the pid algorithm. If this value is increased to the point that the pv signal is effectively dampened out of it's normal responsive range the loop can also appear to be in a steady state." Again simple simulation shows what happens if the input is excessively low pass filtered. The loop will come to equilibrium at the set point eventually but the overshoot/undershoot after a SP step can get kind of wild. Increasing the differential gain will take a lot of that out and speed up convergence but obviously if the input is low pass filtered it is going to take longer to respond to a step in SP or load. Details of how PID works must be in dozens of textbooks. Suggest Jeff look at one of those. Playing around with simulations is also most instructive. Most convincing of all, I suppose, would be to set up a PID controller with on/off output and watch it play. A.J. Return to table of contents
HTML-ized on 03/13/12, by HBD2HTML v1.2 by KFL webmaster@hbd.org, KFL, 10/9/96 |