Help tuning the PID algorithm for my oven.

Chat about pick and place machines, reflow ovens, assembly techniques and other SMT tips & trix

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
jdraughn
 
Posts: 2
Joined: Sat Feb 04, 2012 8:41 am

Help tuning the PID algorithm for my oven.

Post by jdraughn »

Hello, this is my first post here. I have been very impressed with the knowledge and experience that the posters have on this forum, so hopefully someone will be able to help me out.

I have built a reflow oven and I am having trouble tuning my PID algorithm. In all of the documents I have found on the subject, they all say to increase the proportional until you get slight oscillation, then increase the derivative. However, my oven has no way of cooling so if you totally cut the power to the heating elements, the temperature will continue to climb about another 20º, then it will stay there for a long time so I have no oscillation. I have overshoot, but no corresponding droop.

For a few hours I was trying to tune by running an actual reflow profile, I was actually able to get some oscillation that way because of the incline of the temperature rise, since the target temperature was always climbing, once I overshot, the target temperature would overtake the actual temperature resulting in a droop, and that would repeat a couple of times. I had huge overshoot once my profile went from phase 1 where I needed around .9º of temperature rise a second, to phase 2 where it switched to about .5º a second.

I realized that instead of trying to tune using an actual reflow profile, I should setup a "tuning" profile, where for the first 10 seconds, the targetTemp = currentTemp, and then the targetTemp would suddenly increase to 110º. That way I could get a better idea of what was happening when I changed my PID gains.

Here are my results at various amounts of pGain using my "tuning" profile.
pGain = 2 = no overshoot
pGain = 3 = 5º of overshoot
pGain = 6 = 11º of overshoot
pGain = 20 = 16º of overshoot
pGain = 120 = 20º of overshoot

I am still experimenting with different pGain values but I can't judge the correct value by oscillation, only by overshoot.

I am thinking that if I had about 2º of overshoot, that when I switched to phase 2, I would get very little or no overshoot. But once I start tuning the derative, it would act to dampen the effect of proportional, so ideally I should maybe shoot for around 4º of overshoot using only the proportional? These are the assumptions I am going on right now, but maybe someone can offer some insight into the best way of tuning this thing. But once I start running an actual reflow profile, my overshoot is going to change quite a bit, so I am really pretty confused about how I should be tuning this.

I am running my PID calculations 4x a second. If needed I can post images of my current tuning results that are in a graph. I am sending the data to my laptop where I am graphing it using c# and saving the results of each.

Ideally once I get this tuned, connecting my laptop will just be an extra option, otherwise I will be able to just press a button to start the oven.

Thanks
James.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help tuning the PID algorithm for my oven.

Post by adafruit_support_bill »

the temperature will continue to climb about another 20º, then it will stay there for a long time so I have no oscillation.
That is just the beginning of an oscillation with a very long period.

jdraughn
 
Posts: 2
Joined: Sat Feb 04, 2012 8:41 am

Re: Help tuning the PID algorithm for my oven.

Post by jdraughn »

adafruit_support wrote:
the temperature will continue to climb about another 20º, then it will stay there for a long time so I have no oscillation.
That is just the beginning of an oscillation with a very long period.
In my previous post I stated that instead of trying to tune using my actual reflow profile, I created a false one that would suddently rise to 110º and stay there. This was working at first, I had it all tuned pretty well, but once I switched to a real reflow profile, it was suddenly obvious that the tunings from the "fake" profile would not work in a real situation. I didn't have enough pGain so I was always about 10º under, the actual temp could not ever reach the desiredTemp.

I went back to using an actual reflow profile and I got it tuned about as good as I can, however my pGain is set at around 200, and my dGain is over 10k, which makes my precision drop to basically 2 bits. Watching my LED flash on and off, it's corrosponding duty cycle is either 0, 50%, or 100% because my gains are saturating my duty cycle.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help tuning the PID algorithm for my oven.

Post by adafruit_support_bill »

I didn't have enough pGain so I was always about 10º under
The integral term is typically used to eliminate the offset. (or at least bring it within tolerance)

philipm
 
Posts: 29
Joined: Tue Dec 27, 2011 10:50 am

Re: Help tuning the PID algorithm for my oven.

Post by philipm »

Try the tuning section of this widely used article:
http://www.eetimes.com/design/embedded/ ... hout-a-PhD

As adafruit says, the integral term may well be your key to success here.

Locked
Please be positive and constructive with your questions and comments.

Return to “SMT (Surface Mount Tech)”