Author Topic: Need expert advice on PID controllers  (Read 1869 times)

0 Members and 1 Guest are viewing this topic.

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2245
  • Country: us
Need expert advice on PID controllers
« on: January 21, 2019, 05:45:16 pm »
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.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Need expert advice on PID controllers
« Reply #1 on: January 21, 2019, 05:56:06 pm »
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.
 

Offline EmmanuelFaure

  • Regular Contributor
  • *
  • Posts: 154
  • Country: 00
Re: Need expert advice on PID controllers
« Reply #2 on: January 21, 2019, 05:57:28 pm »
"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 predictor https://en.wikipedia.org/wiki/Smith_predictor. Overkill.
« Last Edit: January 21, 2019, 08:50:12 pm by EmmanuelFaure »
 

Offline snarkysparky

  • Frequent Contributor
  • **
  • Posts: 419
  • Country: us
Re: Need expert advice on PID controllers
« Reply #3 on: January 21, 2019, 06:35:39 pm »
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.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4705
  • Country: au
  • Question Everything... Except This Statement
Re: Need expert advice on PID controllers
« Reply #4 on: January 22, 2019, 02:54:55 am »
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.
 

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2245
  • Country: us
Re: Need expert advice on PID controllers
« Reply #5 on: January 22, 2019, 02:56:37 pm »
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.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12536
  • Country: us
Re: Need expert advice on PID controllers
« Reply #6 on: January 22, 2019, 03:36:32 pm »
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?

It 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.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: Need expert advice on PID controllers
« Reply #7 on: January 23, 2019, 03:30:28 am »
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.
 
The following users thanked this post: FrankE

Offline joran paets

  • Newbie
  • Posts: 1
Re: Need expert advice on PID controllers
« Reply #8 on: January 23, 2019, 08:27:04 pm »
Perhaps is this helpfull
See download.
Control Engineering - Basic principles and tips for practitioners

http://cloud.tapatalk.com/s/5c48cd26daaf8/FAS525en_Control%20Engineering.pdf

Verstuurd vanaf mijn SM-G930F met Tapatalk

 
The following users thanked this post: ratio

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 2096
  • Country: us
    • KE5FX.COM
Re: Need expert advice on PID controllers
« Reply #9 on: January 23, 2019, 08:47:07 pm »
I've been meaning to try a velocity PID implementation 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?
 

Offline FrankE

  • Regular Contributor
  • *
  • Posts: 188
  • Country: gb
Re: Need expert advice on PID controllers
« Reply #10 on: January 24, 2019, 02:18:29 am »

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.

Can one cascade PID Controllers that drive SSRs?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf