Need expert advice on PID controllers - Page 1
Forum section: electronics / projects

author: Peabody
author_rank: Super Contributor
timestamp: January 21, 2019, 05:45:16 pm
content: I've been through Dave's stuff and other material on PID controllers, and generally understand how they work. But the part that's still a mystery to me is whether, and how, they deal with situations of extremely laggy reponse.The attached picture shows a hotplate reflow session for leaded paste. It shows the power duty cycle (over each 2-second period) in red, and the actual temperature in black. The duty cycle seqence was arrived at manually through trial and error. You can see that it takes a long time for the hotplate to respond to changes in average power.I don't understand how a PID controller could be set so that, for example, it would start cutting back on power when the actual temperature is still less than 1/3 of the target soak level - so as to avoid overshoot. Can PID controllers do that? If so, how would you go about choosing the weights for the three equations?Having done the grunt work, at this point I'm planning to build in the fixed sequence so that anyone using the same setup I used could in theory reproduce the temperature profile I produced, without needing any thermocouple feedback at all. But if a workable PID solution could produce the same curve, I would like to consider it. The controller would need to be software for the Arduino if that's possible. I've seen libraries, but don't know anything about them.If PID controllers successfully deal with this kind of situation, it would be helpful if someone could point me to an example of that.Thanks for any wisdom on this subject.

author: james_s
author_rank: Super Contributor
timestamp: January 21, 2019, 05:56:06 pm
content: This is what the derivative portion does, the 'D' in 'PID'. It comes from the rate of change of the process value. So if you're heating something up and the temperature is rising very rapidly, the derivative will be high and will act to throttle back the heat in order to avoid overshoot. The system has to be properly tuned in order to know how much to back off on the heat in to avoid overshooting. It does the same thing you would do manually if you were controlling a flame under something and watching the temperature with a thermometer.A properly tuned PID controller will bring the process value in line with the set value as quickly as possible with minimal overshoot. They work remarkably well in most cases.

author: EmmanuelFaure
author_rank: Regular Contributor
timestamp: January 21, 2019, 05:57:28 pm
content: "D" term does not offer anything great in such thermal control applications.By order of preference, three solutions :1) Integrator tweaking. Basically shutting down the integrator after rise and fall of setpoint. See :https://en.wikipedia.org/wiki/Integral_windup.2) A cascaded controller. Controller n°1 controls for example the power supplied to the heating resistor, or the surface temperature of that resistor using a close coupled temperature sensor. Controller n°2 controls the air temperature. Controller 1 is in the loop of the controller 2. Controller n°1 is fast, controller n°2 is slow. The system is always faster that way than with a single controller controlling everything. But requires hardware modifications, cost and complexity increase.3) Smith predictorhttps://en.wikipedia.org/wiki/Smith_predictor. Overkill.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: January 21, 2019, 06:35:39 pm
content: Look up "lead compensator" This can be implemented with proper derivative and gain terms in the PID like James says.Also investigate tuning rules for PID that bring down overshoot.Basically as the process approaches the setpoint the proportional gain will start lowering the plant output. The derivative term of the error will be lowering the plant drive also as it is negative, but near the transition the derivative of error works with the gain to smooth the response.This is how i see it anyway.Also cut back on integral action until you like the transient response.

author: Rerouter
author_rank: Super Contributor
timestamp: January 22, 2019, 02:54:55 am
content: The other simple thing for cases like this is an integral based set point. Have your set point wind up at about the same rate the process is able to. This will keep things in a controlled state rather than 100% output for x minutes.

author: Peabody
author_rank: Super Contributor
timestamp: January 22, 2019, 02:56:37 pm
content: I appreciate the responses, and will look into your suggestions. I suspect that most of it is beyond me, but it's good to know that at least in theory a PID controller can produce the same result. However, it seems that applying the PID method to any other system (a different hotplate, or a toaster oven) with different lag characteristics would require retuning the PID, which might actually be more complicated than trial-and-error changes to the manual sequence.One thing I remember from one of the toaster oven controller kits is that it requires you to do a "learn" trial first, during which I think it turns on max power to 100C, then shuts down and watches what happens after that to see where and when the temperature maxes out. Apparently it then adjusts the PID factors accordingly. That's pretty fancy if it works. Automatic tuning.But there's one big advantage to the manual sequence method, and that is that the operator doesn't have to be responsible for placing the thermocouple properly every time he reflows a board, which I suspect is a major cause of fried boards. In working with the manual sequence, I've found that thermocouple placements is a bit trickier than I thought it would be. But once a manual sequence has been determined and tested, after that there is no feedback, and no need for the thermocouple, and every time you run it, it produces the same temperature profile.

author: IanB
author_rank: Super Contributor
timestamp: January 22, 2019, 03:36:32 pm
content: Quote from: Peabody on January 21, 2019, 05:45:16 pmIt depends on the exact response of the system. If the system has a pure "lag" (i.e. first order response) then theory shows that a PI controller can control it perfectly with no overshoot, no matter how slow the system.You can characterize the system by manually changing the power setting and measuring the temperature response.For the PID controller to cut back on power when it gets close to the setpoint is a natural outcome of the proportional gain. Since the proportional action is proportional to the error, the action will naturally decrease as the error reduces.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 23, 2019, 03:30:28 am
content: Temperature controll is basically a first order system, just like a DC motor. (bit simplified).When learning to adjust PID controllers it is quite annoying if you have to wait 2 minutes before you see the result of your settings.A DC motor with an inertia disk is a much better platform to learn how to tame PID regulators.With a DC motor the reaction time will be a second or less and it will be much easier to match the theory you are learning with something practical.

author: joran paets
author_rank: Newbie
timestamp: January 23, 2019, 08:27:04 pm
content: Perhaps is this helpfullSee download.Control Engineering - Basic principles and tips for practitionershttp://cloud.tapatalk.com/s/5c48cd26daaf8/FAS525en_Control%20Engineering.pdfVerstuurd vanaf mijn SM-G930F met Tapatalk

author: KE5FX
author_rank: Super Contributor
timestamp: January 23, 2019, 08:47:07 pm
content: I've been meaning to try avelocity PIDimplementation for thermal control. Seems like that might be a good way to avoid the usual windup problems without the usual assortment of empirical hacks. Anyone had any experience with those?

author: FrankE
author_rank: Regular Contributor
timestamp: January 24, 2019, 02:18:29 am
content: Quote from: EmmanuelFaure on January 21, 2019, 05:57:28 pmCan one cascade PID Controllers that drive SSRs?