Home Forums PID Control / Tuning Autotuning

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • Petterson
    Participant
    Post count: 2

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

    Brett
    Keymaster
    Post count: 101

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

    dchris01
    Participant
    Post count: 17

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

    Brett
    Keymaster
    Post count: 101

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

    Maddox
    Participant
    Post count: 13

    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
    Participant
    Post count: 13

    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/

    deejay1272
    Participant
    Post count: 20

    .

    JohnP
    Participant
    Post count: 4

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

    Brett
    Keymaster
    Post count: 101

    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.

    deejay1272
    Participant
    Post count: 20

    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):

    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)

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

    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.

    Brett
    Keymaster
    Post count: 101

    @deejay. the last point on that blog post is probably the most important. autotune is about getting to a starting point. with the relay method specifically, you’re going to need to do some after-the-fact tweaking. there are better autotune methods, but none of them are perfect. as mentioned in other places, the reason this is the method that was used is because I was able to copy another open-source project. due to an agreement with my employer, I’m barred from writing any original pid tuning code.

    so i just said that the desired performance that comes out of the relay method has some overshoot (10% overshoot, 25% decay ratio I believe,) but be forewarned! there are certain types of processes for which there will ALWAYS be overshoot. known as “Integrating” or “non self-regulating” processes, these can be maddening to tune if you aren’t aware of what’s happening. heating a tank of water may very well fall into this category. in this situation you may need a little more than just PID. perhaps using a setpoint profile. you could set the setpoint below the target value, and let the overshoot carry you to the correct value. then use a ramp or step to get the setpoint up to where you really want it. just a thought.

    deejay1272
    Participant
    Post count: 20

    Thanks for the reply, Brett. I just want to respond and close the loop on your comment concerning the nature of heating a tank of water. You do raise some interesting questions concerning the non-linearity of the process (hence exhibiting varying degrees of good or bad control based the temperature of the system when the autotune process was executed).

    If I can read between the lines here a bit – it seems that the osPID can certainly accommodate a control strategy that does account for system non-linearities (losing heat to the walls of a tank), but you haven’t included this capability in the code because of intellectual property issues or simply a lack of memory. Is that a fair estimate?

    Is it possible, using the standard equipment on board, to program the osPID such that it can control the temp of water in a tank going from cold (room temp) to boiling? I just want to know what the osPID is capable of doing so I can switch gears and start digging into code modifications rather than trying to find the magic PID parameters via trial and error testing.

    reserve
    Participant
    Post count: 7

    Hi guys,

    after some trouble with the german customs i finally got my ospid controller today! It´s working so far (with big overshoot at default values), but i really don´t know how to use the AutoTune command.
    I toggled to automatic control. After setting the setpoint, the oven started to heat. Then i activated the autotuner, but the oven is heating and heating and heating… I manually turned it off at >200 degrees.
    Also I tried to wait for the oven-temperature is at 100 degrees and then turned on the autotune, but then i have the same problem. It will heat up to 200 degrees and greater.

    What am i doing wrong? I really don´t understand that… can someone help me please?

    Edit: I got it! Thanks anyway 🙂

    bmandl
    Participant
    Post count: 1

    Hello,
    I have the same problem as @reserve.
    @reserve wrote:

    Edit: I got it! Thanks anyway

    @reserve, can you please tell me how did you solve your problem?
    Thank you

    Glyphi
    Participant
    Post count: 1

    Hello, built my own kit and am having the same problem as @bmandl and @reserve. Could either of you tell me how you fixed it? I assume I’m going about it wrong. Phang Moh is helping me out too.

    Glyn

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.