Autotuning

Autotuning

Postby Petterson » Tue Apr 24, 2012 10:57 am

Wondering if I set a temp of 100 for Autotuning how long does the Autotuning take to complete the process
Petterson
 
Posts: 2
Joined: Tue Apr 24, 2012 10:41 am

Re: Autotuning

Postby Brett » Tue Apr 24, 2012 3:04 pm

Petterson wrote:Wondering if I set a temp of 100 for Autotuning how long does the Autotuning take to complete the process


there isn't a set time. the autotuner will induce oscillations in the process. depending on the type of process you're connected to this oscillations may be slow or fast. the autotuner will generate between 3 and 10 peaks. it's "i'm done" criterion is if the last 3 peaks were within 5% of eachother. you can find more information on the autotune here.
User avatar
Brett
Site Admin
 
Posts: 99
Joined: Fri Mar 09, 2012 10:05 pm
Location: Boston

Re: Autotuning

Postby dchris01 » Tue Apr 24, 2012 4:14 pm

So is Autotuning better activated before any profiles are implied on the ospid
dchris01
 
Posts: 17
Joined: Sun Mar 11, 2012 10:18 pm
Location: Ireland

Re: Autotuning

Postby Brett » Tue Apr 24, 2012 4:52 pm

dchris01 wrote:So is Autotuning better activated before any profiles are implied on the ospid


correct. if I did the internal logic correctly you shouldn't even be able to run both at the same time.

what I would recommend is, separate from the profile, get your system to the most critical area. for a reflow oven, this would be up in the reflow region (~235 if I'm not mistaken.) if the existing tunings are somewhat good, you may be able to do this by just adjusting the pid setpoint and letting the pid get you there. if the existing tunings are god-awful, you can put the pid in manual mode and adjust the output directly.

once you're in your target region, execute the autotuner. running the tuner in your critical region will ensure that the values you get are optimized for that section.
User avatar
Brett
Site Admin
 
Posts: 99
Joined: Fri Mar 09, 2012 10:05 pm
Location: Boston

Re: Autotuning

Postby Maddox » Tue May 01, 2012 12:51 am

I decided to try autotune and I can't figure out what is going on.

It looks like the output goes to 20% for a period of time, then disappears below the x-axis. The run screen shows a -20, but the relay is on 100% and the oven is heating up fast. What have I overlooked?

http://www.flickr.com/photos/77705680@N06/6984013306/
Maddox
 
Posts: 13
Joined: Fri Mar 30, 2012 11:57 am

Re: Autotuning

Postby Maddox » Tue May 01, 2012 1:30 am

OK - I read the post about getting the temperature at your desired point and then running autotune. What a difference - autotune is great, at least for a rookie!

http://www.flickr.com/photos/77705680@N06/6984110858/
Maddox
 
Posts: 13
Joined: Fri Mar 30, 2012 11:57 am

Re: Autotuning

Postby deejay1272 » Tue Jan 08, 2013 2:52 am

.
Last edited by deejay1272 on Sat Feb 09, 2013 10:20 pm, edited 1 time in total.
deejay1272
 
Posts: 20
Joined: Sat Nov 03, 2012 4:44 am
Location: Portland, OR USA

Slowly getting there - but stuck on the cool down side of th

Postby JohnP » Fri Jan 18, 2013 6:40 pm

I'm trying to tune a toaster-based reflow oven I'm building (http://www.spcoast.com/wiki/index.php/ReflowOven)

Running on manual, I can get the oven to heat at the desired ramp rates (or faster, the 4 elements have enough oomph to easily keep up with the leaded and unleaded curves), and by modulating the door opening by hand, I can track the cool down ramps as well.

I've tweeked the settings to KP=0.78, KI to 0.09 and KD=0 so that when I run osPID automatically on a reflow curve, the temperature ramp up curve rises as fast as the reflow curve, but it overshoots the top of the curve a bit, and the cool down is way too slow (probably due to the insulation and heat-mass of the oven).

I can live with the 5 degree overshoot, but the thermal mass of the oven is making it hard to track the soak and cool curves. This seems to call out for a "cooling element" to balance the heating one. I suspect I could add a fan or automatic door opener or ... under control of the PID algorithm to help cool the oven on the ramp down side of the reflow curve. In other words, use the heating coils to raise the temp when {input < setpoint} and <something else> to cool it down when {input > setpoint}.

Unfortunately (at least for my brainstorming :-) with these tuning settings, the PID output is zero for the whole cool side of the curve. Would it be "proper" to apply an offset to the output such that (say) anything above 20 is heating, anything below 20 is cooling, and 20 is taken to be steady state - or is there another way to address the problem?

Thank in advance for any clue dispensed :-)
-John
Attachments
osPID-reflow-.78-.09-0.jpg
reflow curve showing slow cooldown
osPID-reflow-.78-.09-0.jpg (100.9 KiB) Viewed 2659 times
JohnP
 
Posts: 4
Joined: Tue Jan 01, 2013 4:05 am

Re: Autotuning

Postby Brett » Sun Jan 20, 2013 12:19 pm

John I replied to your other thread. Basically, the osPID doesn't currently support "split range control," but it could. I've added an issue to the github. if there's interest I'll see what I can do about adding it. keep in mind that my time is a bit short lately.
User avatar
Brett
Site Admin
 
Posts: 99
Joined: Fri Mar 09, 2012 10:05 pm
Location: Boston

Re: Autotuning

Postby deejay1272 » Sat Feb 09, 2013 11:29 pm

Perhaps I'm missing something about the autotune process.

I've put my system (an espresso machine) near the setpoint temp and executed autotune as described in this thread. The result of that process yields: Kp=2.55, Ki=0.01, Kd=0.0. However, when I actually use these tuning parameters to run my system, bringing water up from ambient to setpoint brew temp, the following results are achieved (that initial blip in the output is just me taking the output from manual to automatic before starting the run):

Image

So if the autotune parameters are used, then there is still a material degree of overshoot. Why is this?

Not knowing the answer to this question, I thought that the system should include a Kd parameter to help anticipate the overshoot before it occurs. Rather than taking the manual guess 'n check approach, I looked at the Autotune description page (http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/) to read up and try to calculate the Kd parameter that I think I need. Using the Autotune inputs that I used to get the above parameters, I calculated a set of PID parameters that *should* make sense, or at least be reasonable - they are Kp=3.82, Ki=0.04, Kd=105.04 (see below for a snapshot of my calcs)

Image

Ok, great! Let's take this for a spin:

Image

Whoa - that's a lot of overshoot - and a lot of noise around that output line!

Now I've lost a lot of faith in the ability of Autotune to point me at all in the right direction. What's going on here? Why would Autotune give me only PI parameters and not PID parameters? Are my tuning problems associated with the fact that the delta between cold startup temp and brew temp is so large (approx 80C)? Is there a way to force Autotune to perform a test over a much larger temperature span (producing oscillations from, say, 20C to 100C)?

I've done over 65 test runs to manually tune the PID (each at over 5 min test time) and I'm losing my patience with the manual approach as well. Any input to the above questions is appreciated.
deejay1272
 
Posts: 20
Joined: Sat Nov 03, 2012 4:44 am
Location: Portland, OR USA

Next

Return to PID Control / Tuning

Who is online

Users browsing this forum: No registered users and 0 guests

cron