Intergral Windup method in PID control

Go To Last Post
53 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


1. Trying to write PID control for temperature maintain in oven. We are doing it Pb,Ti & Td.

 

2. Now I see sometimes I am able to maintain temperature to setpoints.

 

3. Problem happens when intergral grows to large values. I am reading on internet there are many ways available. I tried clamping method to try clamp to some values, but it dont work, for some cases it work and some it dont, i.e for every setpoint clamp value is different to maintain temperature. Higher the setpoint higher the clamp value required.

Currently I am doing by hit and trial, but its not final solutions

 

4.Any one have experiecne which methods work best for this type of applicaiton?

 

5. I have seen two most common are:

a) Back calculations: but found most of matlab implementations, trying to find c implemenation

b) second is this: but dont know how to calculate AR band

 

 

c) Any other better method?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

If you know the limit of your control you can simply stop additional integration.

 

For example, say a total PID value of 200 corresponds to where a motor will start to reach its max possible speed.  Beyond this, the system is saturated and forms an open loop (non-control)

When you get to more than, say 90%, of that (180), simply stop accumulating any more integral term.

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oven temps don't change very fast (usually) so you may only need PI control, start by setting the I gain to zero, P gain to 1.

Measure your oven temp vs SP (error diff) and see how it performs.  Increase I gain until the error diff oscillates slowly about the SP.

If oscillations are excessive, reduce I gain as needed.  

 

Cool off the oven and repeat your test now with the new PI settings. 

Rinse and repeat until satisfied.

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Maybe go back to the fundamentals.

 

https://www.youtube.com/watch?v=...

 

Comes with code in C.

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:

Maybe go back to the fundamentals.

 

https://www.youtube.com/watch?v=...

 

Comes with code in C.

 

I've been following this series. It's fairly accessible ... until the maths gets hard, then I just copy the code ;) I've been using it successfully for motor speed control using BEMF and PWM. Motors are more amenable to trial and error than ovens though. Much more responsive.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Much more responsive.

I will say normally not!

A oven don't generate power when you slow down ;) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks,

will read and implement and see what work

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have problems with a oven, my guess there is a problem with your model. Is the temp. sensor placed correct ? (if there is no forced flow it could be that the measurement is wrong, and need to be a part of the model of the system ).

 

On a motor at least the speed is easy and fast to measure. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For an oven, I might not even bother with PID, the math can get very unhappy with all of the delay lags & be hard to tame. 

Stair Step:

   From the desired setpoint a rough starting heating level can be set (like 0%, 25%, 50%, 75%, 100%)

 

   Now, measure the temperature every 30 sec, or whatever is appropriate

   If the temperature is way off, increase/decrease by 2 or 3 setting steps (say you have 255 heating levels to choose from).

   If the temperature is fairly close, increase/decrease by one step.

   If the temperature is very close, make no change.

   repeat & enjoy fine control.

   

       ...while this is very simple in software, it would be a very difficult circuit to build using opamps & RC values (analog approach).  You have much more flexibility using code.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Wed. Jun 17, 2020 - 11:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I am using PID method to control the temperature, but issue is once setpoint is reached, integral already gets to such large value, that it takes time to fall back and in the meantime, temperature keeps on increasing. large here doesnt mean that it goes beyond output sautration limit, but large here means, large enough that it takes some time to fall back and meantime temperature goes beyonf acceptable range.

 

Red is integral

Setpoint is 70C

blue line is process variable

All values are to be divided by 100.

 

 

 

In code to prevent integral windup what I have done, is if some of p,i & d terms exceed 100%, then dont add intgegral term, otherwise add up integral term.

Looks like this is not enough.

 

I am using Pb, Ti & Td instread of Kp, Ti & td. 

 

 

const float32_t c_output_max = 100.0f;
const float32_t c_output_min = 0.0f;

float32_t input_temperature;
float32_t setpoint_temperature = 70.0f;
float32_t output_duty_cycle;
float32_t unclamped_output;

float32_t previous_temperature = 0.0f;
uint32_t first_time = 1U;
float32_t dt = 1.0f;  //sec

const float32_t pb = 37.3f;   
const float32_t ti = 302.0f;  
const float32_t td = ti / 4.0f; 

float32_t error = 0.0f;
float32_t p_term;
float32_t i_term = 0.0f;
float32_t d_term;



void compute_pid_duty_cycle(void)
{      
   float32_t i_term_temp;
   
/* get error */    
   error = setpoint_temperature - input_temperature;
   
   if(first_time)
   {
       first_time = 0U;
       previous_temperature = input_temperature;
   }    

/* calculate duty cycle */
   if(error > pb)
   {
       output_duty_cycle = 100.0f;
       unclamped_output = output_duty_cycle;
   }    
   else if(error < -pb)
   {
       output_duty_cycle = 0.0f;  
       unclamped_output = output_duty_cycle;        
   }    
   else
   {
   /* calcukate p term */
       p_term = (100.0f * error) / pb;

   /* differential error */  
       d_term = (input_temperature - previous_temperature)/dt;     //dt = 1seconds
       d_term = d_term * td * 100.0f / pb;
       
       
   /* calculate i term */
       i_term_temp = i_term + (100.0f / (pb * ti))*error*dt;
       
   //clamp integral term
       if((p_term + i_term_temp - d_term) > 100.0f)
       {
           //saturated, dont add the i_term
       }    
       else
       {
           i_term = i_term_temp;   //otherwise add since no saturation
       }
       

   /* Compute PID Output */
       output_duty_cycle = p_term + i_term - d_term;
       unclamped_output = output_duty_cycle;
       if(output_duty_cycle > c_output_max)
       {
           output_duty_cycle = c_output_max;
       }    
       else if(output_duty_cycle < c_output_min)
       {
           output_duty_cycle = c_output_min;
       }    
       else
       {
       }  
   }


/* Remember some variables for next time */
   previous_temperature = input_temperature;
   
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I try again :

If your temperature go up after you turn the heater off, the sensor are placed wrong, or your model of the oven is wrong (to simple).

 

I think that you will need a set of values for open loop at start. (does the heat capacity of things in the oven change a lot from start to start? )

 

And then close the loop when temperature are close to your set point. (does your set point change a lot in the process ?)

 

 

PS

It's the same for a motor, the start is often different than keep RPM.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Temperature will keep on rising for some time, even if heater turned off suddenly, just like its normal inertia. It will settle down after sometimes, after which it start falling. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes and therefor you need to have that as a part of the model. 

 

What you measure is not the temperature.

 

Try to make a model of the temperature (or energi ) that is correct based on the temperature you read.

 

And have in mind that the time constant for temperature go up (your heater), and down (losses) are probably very different.   

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As mentioned in #2 when you get close to the max allowable gas pedal position (say 80%), STOP accumulating the integral amount.  Form PID from the values you have (including the I value you already have).

Stop allowing the I value to build up and up and up, quit at around 80% rather than 100%.

 

Stop building up iterm_temp ...stop ALL integral accumulation during this time

 

if  (P+I+D)<= 80% of max allowable command

     Accumulate/update integral term calculation

else

     skip integral calculation update

 

form P+I+D command

 

 

 

Add a stop accumulate condition  (rather than relying on iterm to be held)

 /* calculate i term */
       i_term_temp = i_term + (100.0f / (pb * ti))*error*dt;

 

Also, you can turn down your I gain (accumulation rate)...a little goes a long way, since it  for long-term setpoint reaching.

    

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Jun 21, 2020 - 06:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@avrcandies , I will try that will limit to 80%.

You said " Add a stop accumulate condition  (rather than relying on iterm to be held) " ?

Whats wrong on what I have limited if value grater than 80% than dont add.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Also for PID control I have a word with Delta Electonics Engineer, they have this reply. They have interesting implementation on integral method. Anyone know this?

 

1.     Pb : also called the P band , when the PV is between SV and SV-Pb (in the range of P control), the output% is (deviation/PB)*100% for deviation >=0 and 0% for deviation<0.

Pb will be generated after the process of AT

2.     Ti and iof(100CH) : The I control activates when the process value begins falling , the iof is the initial value of I control which can help to decrease the amplitude of PV

Ti and iof will be generated after the process of AT.

And here is the formula for your reference :

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So during heating from cold.

  1. The proportional term could become very high so you should clamp at 100%
  2. The integral term rises high so it's clamped at 100%

 

Perhaps try to back off the integral term clamp value if the proportional term is also high so that together they reach 100%.

 

Example:

Proportional Term (clamped at 100) Integral Term Clamp Value
100 0
80 20
0 (at setpoint) 100

 

 

<edit>

I didn't see your #16 whilst I wrote my post. It seems the above goes a fair way to implementing most of the Delta Electronics tweaks.

 

Last Edited: Mon. Jun 22, 2020 - 11:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you perform an open-loop experiment: allow temp come to steady state with 20% duty cycle; then change to 40% duty cycle and allow to come to steady state.   Plot the result and fit to a first order model: T(k+1) = a*T(k) + b*dc + T0  where dc is duty cycle, and k is the number of samples after the change in duty cycle.  Then you could simulate and play with parameters.  (There could be a delay so that at change in duty cycle k = -N.)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what is in the oven, and what is the heat capacity of it ?

if you make a test like in #18, you need have it 1/2 full or something like that.

 

 

Once I made a heater system, where I was not able to measure the temperature, but the heater itself had a relative high mass, so I placed a PT100 sensor in the heater block, and let the PID controller keep that temperature stable. The user could then change the set point. And the heater was 100% on until a specific temp. was reached.(kind like #16 but just not in %, but because the set point at start was fixed the result was the same.)     

Last Edited: Mon. Jun 22, 2020 - 01:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ N.Winterbottom  , i think this will not work, as PV approaches SV, P_term keep on decreasing since error is decreasig, the method u suggest will let grow integral more and more as PV is near SV, since P_term is very small.

 

You said: "I didn't see your #16 whilst I wrote my post. It seems the above goes a fair way to implementing most of the Delta Electronics tweaks. "

Are u telling to use your method here or use Delta method ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't forget that when the process variable is exactly at the setpoint the proportional term must become zero because the error becomes zero, however we do need some small controller output to maintain the oven temperature. This controller output can only come from the integral term.

 

If you understand the Delta Electronics Tweak then go with that, they've out a lot more effort into testing their tweak than I did with my tweak.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Delta Electonics Engineer

Why do you bring up Delta Electronics? You should be able to get a PID controller running.   How much is your PID accumulating to & why do you not stop accumulating earlier?    That is not the same as clamping!  Clamping says the accumulated value is 463 but we will limit the amount used in PID total to 125.   So that will continue on for a very long time.  Just don't accumulate in the first place.  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@avrcandies

I used i_term_temp, if its greater than 80, only then its saved to i_term. Isnt it right?

i_term_temp = i_term + (100.0f / (pb * ti))*error*dt;

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used i_term_temp, if its greater than 80, only then its saved to i_term

Get rid of i_term_temp.  If the total PID >80% of max command, then just skip accumulation of the integral (so the I term does not get changed)....then the logic is very straightforward.

 

calc new P

calc new D

maybe calc new I (if P+I+D<80%)

 

now you have 3 values P,I,D

form P+I+D & limit total to to 100%

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Mon. Jun 22, 2020 - 03:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


This is what have been observed for when integral is maintained . Blue is tempeature and red is integral. There is swing large in temperature 

Going to give a shor to method in #16.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is what have been observed for when integral is maintained 

Where are your P, D, & PID values? , The graph is somewhat useless without them to tell what is happening.

 

You also need a separate graph with a longer timescale---does the temperature stabilize out?   Is the axis in seconds?

 

What is causing the integral to do nothing for a long time at the beginning? Maybe P & D are gobbling up all of the allowable range before then?  Maybe your D term gain is a little high.

More lines on the graph will show what is going on.

 

Also, you may not even need PID, better ways exist. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ avrcandies , you said " Also, you may not even need PID, better ways exist.  "

I saw many paper on researchnet for this. But didnt  practical implementation in hardware for it for industry. I searched for many reputed brand tempearture controller, all used PID controller only

 

Apart from integal controller, I want to apply derivative filter also :  https://en.wikipedia.org/wiki/PID_controller#Noise_in_derivative

Although I am using PV-Pv(n-1) method for avoaiding derivative kick, instand of derivative on filter., as explained here.

 

I am thinking of taking rolling average of last 20 values for it.

 

Current is:

d_term = (PV - PVlast)/dt;     //dt = 1seconds
d_term = d_term * td * 100.0f / pb;

 

Now I planning to make PVlast as rolling average of last 20 values. Is it right method to do so?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now I planning to make PVlast as rolling average of last 20 values. Is it right method to do so?

I'd say no, it's more complex with little benefit.  Use an exponential avg, which is more like a natural RC filter anyhow (no sudden truncation)

 

filtered=  (4*reading+12*filtered)/16  , the 4 & 12 can be adjusted, such as 3 & 13,  5 & 11, or 1 & 15 to give desired RC constant.  This works great with integer values & only requires a shift for the divide

 

This requires no buffering of old samples (other than the last value, which is the filter result itself).

 

. I searched for many reputed brand tempearture controller, all used PID controller only

Be the leader not the follower, do you care about their unit? 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Wed. Jun 24, 2020 - 04:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I was looking for what error I made, could this be error, although I have taken care of that?

 

 

1.Output range is 0 to 100% which is actually dimensionless quantity. This is made by three terms: P_term, I_term & D_term
So these should be dimensionless also.

 

2. p_term = (100.0f * error) / pb;
a) pb is in celsius
b) error = SV-PV  which is also in celsisu
c) So dimension of this term is = Celsius/Celisus  i.e no dimension

3. Similarly  i_term = (100.0f / (pb * ti))*error*dt;
a) pb : celsius
b) ti = sec
c) error = celsius
d) dt = sec
e) All when combined turn i_term into dimensionless no?

 

4. Similarly d_term = [(PVnew - PVold)/dt]* td * 100.0f / pb;
a) PVnew - PVold : celsius
b) td = sec
c) pb= celsius
d) dt = sec
e) All when combined turn i_term into dimensionless no?

 

 

5. So all the terms are dimensionless? No?

 

Could this be error? Although according to me both sides are dimensionless.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another issue may be:

 

1. Now I have some doubt, that I call the function compute_duty_cycle() every 1 seconds. While SSR pulse width is 5seconds, as recommended by manufacturer.
So what I do is I call compute_duty_cycle() 5 times, take the average of 5 duty_cylces and then send it to SSR.
I am not sure if its right way to do it?

Can you suggest what could be right thing to do that in this?

 

 

Next will share the graph values for 70C and 100C, have got the values.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It totally depend of the reaction time of your system. 

By delaying the control signal you will make a phase error for the regulator. 

 

Will wait for the graph.

Remember also to include a graph for 100 to 70 deg!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could this be error? Although according to me both sides are dimensionless.

The coefficients convert the units to volts output (the driver command)

 

Proportional is volts of error, mult by a coefficient with no dimensions----> volts (V1)

Integral is area, (volts of error)*time, divide by coefficient of time---->volts (V2)

Derivative is slope, (volts of error)/time, mult by coefficient of time---->volts (V3)

Driver command is V1+V2+V3 (up to some max allowable limit)

 

if you divide instead of multiply, or multiply instead of divide, the coefficient's units implicitly become inverted, which is just a bookkeeping task (you tend to dial in adjustments, without saying units: increase Ki to 11.624, for example).

 

Due to your sensors, volts is also proportional (or related) to Celsius.  The ADC works in volts.

You just leave Celsius outside of the PID block (ex: I want to set 50 degrees, which is 1.4685 volts), or you could carry Celsius along into the units (not needed).

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. Jun 26, 2020 - 01:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Tried implenting method as in #16.

1. 70C : https://drive.google.com/file/d/...

2. 100C: https://drive.google.com/file/d/...

 

Here is sequcne:

Time, Temperature/100, P_term/100, D_term/100, I_Term/100, Unclampded_output/100

 

 

A) Here is at 70C:

 

 

B) 100C:Error in this is that temperature never reaches 100C though

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Also this d-term is creating havoc actually

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Also when I asked that when I call compute_duty_cycle every 1 seconds, while SSR period should be 5 seconds.

Here is reply from anoither person by @pwlps :

 

Any idea how to manage both it?

One method is suggsted by him, but here I have to keep both p_term, i_term and d_term separate and compute duty cycle after 5 seconds only. Any other alternative?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Time, Temperature/100, P_term/100, D_term/100, I_Term/100, Unclampded_output/100

Why not post the graphs?...you should mention this is the data--it looked like you forgot to post some

Why does your data table have unlabeled columns???!

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sat. Jun 27, 2020 - 04:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you system is not converging on multiple set-points then your modified integral control is not working.

The solution to #34 is to low-pass (well above the CL bandwidth)  the control signal coming out of your PID.

Trial and error design of controllers is not easy.

 

[Edit: or, for #34, remove/reduce the derivative control]

Last Edited: Sat. Jun 27, 2020 - 01:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

At the startup, your table makes no sense...P, I, D, are all zero, yet the temperature is  going up quite a bit (36 to 54)...why?

 

 

7:57:38 PM 54.73 0 0 0

 

The slope calc may have some issues....see the derivative (slope) numbers jump all around, though the numbers indicate fairly steady temperature change (this may be due to numeric truncation of your table temperatures), since the delta from the setpoint may be a small number, so truncation can become a big factor in derivative calc, where small difference are mult by large scaling.

 

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sat. Jun 27, 2020 - 05:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Sorry that was using algo which i trued to emulate some algo.

Here is my code also and updated 70C graph.

 

I have taken 5 seconds temperature reading, average them out and kept dt=5seconds in code.

Set point is 70C.

Note that first spike is very high while maintain temperature. How to control that?  After first spike this is relatively stable.

 

 

 

PFA CSV file also.

 

float32_t previous_temperature = 0.0f;
uint32_t first_time = 1U;
float32_t dt = 5.0f;  //sec

const float32_t pb = 37.3f;   
const float32_t ti = 302.0f;  
const float32_t td = ti / 4.0f; 

float32_t error = 0.0f;
float32_t p_term;
float32_t i_term = 0.0f;
float32_t d_term;


void compute_pid_duty_cycle(void)
{          
/* get error */    
    error = setpoint_temperature - input_temperature;
    
    if(first_time)
    {
        first_time = 0U;
        previous_temperature = input_temperature;
    }    
    
/* calculate duty cycle */
    if(error > pb)
    {
        output_duty_cycle = 100.0f;
        unclamped_output = output_duty_cycle;
    }    
    else if(error < -pb)
    {
        output_duty_cycle = 0.0f;  
        unclamped_output = output_duty_cycle;        
    }     
    else
    {        
    /* calcukate p term */
        p_term = (100.0f * error) / pb;

    /* differential error */  
        d_term = (input_temperature - previous_temperature)/dt;     //dt = 1seconds
        d_term = d_term * td * 100.0f / pb;
        
        
    /* calculate i term */
        if( ((p_term + i_term - d_term) < 80.0f)  && ((p_term + i_term - d_term) >= 0.0f))
        {
            i_term = i_term + (100.0f / (pb * ti))*error*dt;
        }    
        

    /* Compute PID Output */
        output_duty_cycle = p_term + i_term - d_term;
        unclamped_output = output_duty_cycle;
        if(output_duty_cycle > c_output_max)
        {
            output_duty_cycle = c_output_max;
        }    
        else if(output_duty_cycle < c_output_min)
        {
            output_duty_cycle = c_output_min;
        }    
        else
        {
        }  
    }  

/* Remember some variables for next time */
    previous_temperature = input_temperature;
    
}
    

 

 

 

1. Value of Ti & Td are in seconds and calculated from  astrom hagglund method. These values are calculated independent and they match values from Delta Electronics PID also which also used astrom hagglund method for auto-tuning.

 

2. Pb values we dont how to calculate, but noticed that Delta Electronics took Pb=3.69*(max-Min) from astrom hagglund method. Its values is in degree Celsius. 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How to control that? 

is this from the regulator or the 100% on level ? (try to lower it).

 

Your I say you are behind so it will make the overshoot (hack could be set point 59C until temp go down (passed the overshoot))

 

add:

But only if temp in the last 2 min has been below 45 deg.

 

 

 

I still guess think that you temperature measuring is wrong (delayed).

 

Please make the same curve with this:

 

Start cold (best 38C again).

turn on to 100%

when temperature reach 60C turn the heater off.

 

If that make about the same curve overshoot curve, you need to make a model for measured temperature and real temperature (the head capacity of the heater), this is probably close to 0 when you hold the temperature, but perhaps not at startup.   

 

 

 

 

 

 

 

 

Last Edited: Sun. Jun 28, 2020 - 01:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

To get less overshoot, I'm guessing you can reduce integral control (Ki), but your response will be slower.

Below I used a model of heater system w/ time constant of 100 sec, and use PI control.   I"m plotting step change from 70 deg to 100 deg.

The two pairs of plots show open loop response on top, closed loop response on bottom.

I get 80 deg of phase margin and infinite gain margin with either design.  In the bottom pair, Ki is 40% of what it is for the top pair.

 

Last Edited: Sun. Jun 28, 2020 - 02:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

This is another test done at 100C setpoint.

 

 

Tommroow willsome test again:

1. Keep Pb same

2. Multiply Ti by 2, this will decrease Ki.  Factor of 2 is ok, or any other ?

3. Td to keep same or different?

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it would be a big help if you also plotted the power to the heater with the same timeline 

 

Add:

Sorry I see that the power numbers is in the excel file.

Last Edited: Sun. Jun 28, 2020 - 03:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is another test done at 100C setpoint.

Ok, what about it?  Yes, lower the gains and you won't have such a high overshoot...have you tried that by now?

As already mentioned your graph needs to also include P, I & D so you can see what is going on with the 4 values

What criteria are you trying to reach?

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, maybe check out this thread with overshoot issue on PID motor control.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Here is test:

1. Keep Pb is kept same

2.Ti is multiplied by 2

3. td is kept same

 

 

Set point is 100C.

 

 

Series in above graph has this seq:  Temperatre, P_term, I_term, D_term, Output.

 

Trying to test on other temperature also.

 

@ MattRW will implement this also and see results.

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That looks great!  Is that what you wanted?

 

You can see when the setpoint is reached, the output is mostly the I value.

The error is "zero", so the P term is "zero", everything is steady, so the D term is also "zero", leaving only the I term to form the output.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Mon. Jun 29, 2020 - 08:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


This is another test we have done at 200C.

Here we simulated two other conditions:

1. Sometimes in field, Main power get cut off & system gets shifted to Inverter or Emergency generators.

2. When at peak 200C, user may open the door of heater for placement/remove of material to be heated, as that time suddenly temperature drops.

 

 

Series in above graph has this seq:  Temperate, P_term, I_term, D_term, Unclampled Output.

*unclamped output can go out of range of 0 to 100%, but in the end we have put limits to output to limit between 0 to 100%.

 

 

 

Case 1: When shifted on inverter/generator not much diff, some temperature falls, but PID again start maintaining the temperature.

 

Case 2: When from door of heater is opened, temperature suddenly drops to 170C from 200C, and it generates huge D_term which pass 300 values in negative direction. However system again maintains the temperature after some time. 

Anyone what is right way to do that? Although in our PID keep hold of it, but we didn't do many test. What is right way to handle this kind of situation?

 

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any comments/suggestions? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any comments/suggestions? 

When you open the door, you expect a big temperature drop.  You could probably clamp the derivative so it doesn't get so wildly excessive during such times (and/or take the derivative over a slight longer time scale, so it its slightly less time sensitive) Ovens are sloooow.  You want a derivative for fast reaction, but it doesn't need to be a race car, or turn the wheel beyond an extreme amount.

 

Also, when your D goes very negative it looks like your PID total goes up!!!! That might just mean your D calc sign is reversed, so the total is still happy...take a look.

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vindhyachal Takniki wrote:
user may open the door of heater for placement/remove of material to be heated, as that time suddenly temperature drops.

Indeed - I have noticed that also. You receive a face-full of hot air and on closing the door you notice the temperature has dropped very significantly. However due to the amount of heat energy stored in the walls, inside face of the door, and shelving; the temperature recovers extremely quickly to within a few degrees of set-point inside a couple of minutes.

 

The Panasonic ovens we have in the Engineering Test Lab of my employer actually shut down the fan & heater whilst the door is open and restart when the door is closed. Note; they have a built-in PID controller which I believe has been factory tuned to absolutely avoid over-shoot  because the target market includes bio-medical labs where over-temperature could kill biological samples.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As mentioned in #37, to limit that D action designers will band-limit the PID.

 

If you want to try here is an approach:

 

Add global "float filtered_output_term = 0.0;"

and "float a = 0.0;"

 

After "output_duty_cycle = p_term + i_term + d_term;" add

filtered_output_duty_cycle = a*filtered_output_duty_cycle + (1.0 - a)*output_duty_cycle;

Then proceed with the clamped output computation based on filtered_ouptut_duty_cycle instead of output_duty_cycle.  

With "a = 0.0" nothing different should happen.  As you increase a (but keep below 1.0) you will low-pass the controller.  

You want to keep this above the bandwidth so that you keep the nominal behavior but smooth out the spikes.

Last Edited: Wed. Jul 1, 2020 - 02:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Panasonic ovens we have in the Engineering Test Lab of my employerNote; they have a built-in PID controller

Some of these are horrific to use...they have so many settings & options & they try to do everything with literally 3 buttons and 3 digits (like setting a scan sequence, menus of limits, units, etc)...they like to use the 7-seg to show odd "chars" to tell what you are adjusting.

 

Our tech loaded up a chamber with a bunch of expensive handheld units for a 48 hour QA burn in.  Upon returning Monday, he opened the door to be greeted by a pile of semi-molten & slumped over units.  Ummm...200 F & 200 C are two different things!!  We had a tense laugh & he had a few melted conversation pieces for his desk.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!