coding for burner

derickloo

Member
Join Date
Mar 2015
Location
Malaysia
Posts
36
I has a requirement, in 87-90 minutes need increase the burner to 280 degree celcius and every minute only can increase 3 degree celcius. The starting temperature will be around 25-26 degree celcius. How I can coding this? I'm totally no idea how to start. I'm using Structure text plc.
 
Derickloo: I think a little bit more information is required, for example what type of control is it PID or on/off for example.
One suggestion is use a timer (self resetting) based on 1 minute, on the start of process, copy the current actual value into a variable, add 3 degrees, update the required set-point, do this on the timer up bit so every 1 minute it adds 3 degrees to the set-point, once you get to set-point then just disable the timer and copy your original set-point to the required set-point
So you have a variable that holds the set-point (or a fixed value if it never changes)
A variable that you control i.e. the user set-point.
So on start copy current actual temperature to the user set-point.
After 1 minute add 3 to the user setpoint.
continue to do this until the final set point is reached.
As I said this will depend on what type of control you have.
 
Here is a quick ST program, may need some tidying up but works. this is based on using the Var_Setpoint, not the setpoint for the final temperature so rather than for example using the normal setpoint variable for the control, use the Var set point, which starts at the ambient temperature plus 3 degrees, then increments by 3 degrees every minute, instead of just adding the 3 to the last var set point you could take the current measured variable & add 3 to that.

so instead of "VAR_Set_Point := VAR_Set_Point + 3; "
It would be "VAR_Set_Point := Actual_Temperature + 3; "
The timer used is just an IEC TON function.

Incremental Temperature.png
 
I'm using Beckhoff EL3318 thermocouple to get the oven temperature. the rest on the control still using manual way to on/off the oven.
Do mind provide a simple sample how to code it? I'm still can't get it how to code. I'm new in PLC.
 
I have never used Beckhoff, however, ST is basically the same in most PLC's.
The code I have shown is just the way you would code the incremental steps for increasing the required temperature, I assume from your last post you will be using a on/off valve that is controlled by the PLC, is that correct ?.
Or will you use the PID code and an analogue output to drive a variable position valve. Without that it would be difficult to show you code applicable to your process, however I will try to give you some ideas, Why are you using ST rather than FBD or ladder ?.
Are you putting an HMI on it for the operator ?
How are you going to enter the set point temperature i.e. 280 Deg C.
Do you know how to scale the temperature probe in the PLC ?
What model of Beckhof are you using ?
What type of analogue card is it ?
 
I'm using Beckhoff EL3318 thermocouple to get the oven temperature. the rest on the control still using manual way to on/off the oven.


Does this oven have a burner (or burners), and the burner(s) can only be on or off? So the only way to control the oven temperature is to control how long the burner is on and off over some time period?


That is called on-off, or "bang-bang" control.
 
derickloo,

lots of questions.
is this an oven, test chamber?
gas electric heat?
exhaust method for fumes, if any
how large is the enclosure you are trying to heat?
what is in the unit?
is it open on both sides?
you are making a big assumption, rise 3 degrees in 1 minute, this is determined by the size of the chamber, insulation of chamber, and what's in the chamber. also what is the temperature of the product when it is placed into the chamber and the materials support structure.
any product placed into a heated chamber will cause the temperature to decrease as the product will absorb the heat as it heats up. a customer learned this the hard way. we built a solder chamber for them to their spec and they forgot the solder paste material. it required another 33kw of heat.

once you get to the desired temperature, is there a cool down, shut down sequence?
james
 
Does this oven have a burner (or burners), and the burner(s) can only be on or off? So the only way to control the oven temperature is to control how long the burner is on and off over some time period?


That is called on-off, or "bang-bang" control.

Sorry forgot to mention, the oven got burner(gas fire) which only able to on and off. I use Beckhoff EL2004 to control the burner on/off.
 
Last edited:
I have never used Beckhoff, however, ST is basically the same in most PLC's.
The code I have shown is just the way you would code the incremental steps for increasing the required temperature, I assume from your last post you will be using a on/off valve that is controlled by the PLC, is that correct ?.
Or will you use the PID code and an analogue output to drive a variable position valve. Without that it would be difficult to show you code applicable to your process, however I will try to give you some ideas, Why are you using ST rather than FBD or ladder ?.
Are you putting an HMI on it for the operator ?
How are you going to enter the set point temperature i.e. 280 Deg C.
Do you know how to scale the temperature probe in the PLC ?
What model of Beckhof are you using ?
What type of analogue card is it ?


The oven come with burner which using gas fire. It only able to on/off the burner to control the temperature. It's not able to set the temperature to the oven. So, to hit 280 degree, just control the on/off of the burner. I'm using Beckhoff EL2004 to control the burner and EL3318 thermocouple to detect the oven temperature.
How should the program control if within 1 minute the temperature increase over 3 degree and stop the burner?
 
derickloo,

lots of questions.
is this an oven, test chamber?
gas electric heat?
exhaust method for fumes, if any
how large is the enclosure you are trying to heat?
what is in the unit?
is it open on both sides?
you are making a big assumption, rise 3 degrees in 1 minute, this is determined by the size of the chamber, insulation of chamber, and what's in the chamber. also what is the temperature of the product when it is placed into the chamber and the materials support structure.
any product placed into a heated chamber will cause the temperature to decrease as the product will absorb the heat as it heats up. a customer learned this the hard way. we built a solder chamber for them to their spec and they forgot the solder paste material. it required another 33kw of heat.

once you get to the desired temperature, is there a cool down, shut down sequence?
james

Hi James, it is gas fired burner which only able to on/off the burner. It has 2 door at the front. It's use to burn the glass. The max temperature for the oven is 290 and the max temperature for the glass is around 250 degree celcius. I'm using Beckhoff EL2004 to control on/off of the burner and EL3318 thermocouple to check the temperature.
 
Note: others should review this program to ensure it is safe for the process intended. For example, it may be possible that the EL3318 module could go bad, or a wire could become disconnected, and provide a bad input value for the oven temperature, perhaps a negative number. in which case the burner would be turned on indefinitely.

I would do this with 3 inputs and 1 output:

  1. Start - a momentary discrete input; 1 to start the oven
  2. Stop - a momentary discrete input; 1 to stop the oven
  3. Oven_temperature - an integer (or real) analog measurement of the current oven temperature, by EL3318, in degC
  4. Burner - a discrete output: turns the burner on or off when Burner is 1 or 0, respectively.
and 3 sections in a program:

  1. The first section will be the Start/Stop circuit, cf. here, but will do the equivalent in ST. It will assing 1 or 0 to a bit (not an output) called Run (or whatever you like). None of the other sections will run unless Run is 1.
  2. The second section will advance the setpoint, which is an integer called Oven_setpoint (mentioned in section 1 above). It's first statement will set up a TON timer {ton}, similar to @parky's code in post #3 of this thread, but the IN will be a more complex expression that ensures the timer will not run unless the process is running (Run is 1) and the setpoint has not reached 280deg.; the ton.PRESET will be 20s. The rest of this section will increment the burner setpoint by 1 degree every 20s (which will be the same as 3 degrees every minute), and will execute when ton.Q is 1. Once the setpoint reaches 280deg, the timer cannot run so ton.Q will cannot be 1, and the setpoint will not increment any further.
  3. The third section is bang-bang control. It will turn the burner on whenever the Run bit is 1 AND the current temperature is below the setpoint; otherwise it will turn the burner off.
Note that sections 1 and 2 do not "care" what the state of the burner is, sections 1 and 3 do not "care" how the setpoint is incremented, and sections 2 and 3 do not "care" how the Run bit is assigned on a Stop or Start.


Code:
(* Section 1:  Start/Stop; initialize setpoint *)
(* to a value no more than 280deg *)

IF Start THEN
  IF NOT Run THEN
    Oven_setpoint := MIN(280,Oven_temperature);
  END_IF;
  Run := 1;
END_IF;

IF Stop THEN
  Run := 0;
END_IF;

(* Section 2:  increment setpoint every 20s *)
(* until it reaches 280deg *)

ton(IN:=Run AND Oven_setpoint<280 AND NOT ton.Q, PT=T#20s);

IF ton.Q THEN
  Oven_setpoint := Oven_setpoint + 1;
END_IF;

(* Section 3:  bang-bang control of burner *)

Burner := Run AND Oven_temperature < Oven_setpoint;
 
Last edited:
Note: others should review this program to ensure it is safe for the process intended. For example, it may be possible that the EL3318 module could go bad, or a wire could become disconnected, and provide a bad input value for the oven temperature, perhaps a negative number. in which case the burner would be turned on indefinitely.

I would do this with 3 inputs and 1 output:

  1. Start - a momentary discrete input; 1 to start the oven
  2. Stop - a momentary discrete input; 1 to stop the oven
  3. Oven_temperature - an integer (or real) analog measurement of the current oven temperature, by EL3318, in degC
  4. Burner - a discrete output: turns the burner on or off when Burner is 1 or 0, respectively.
and 3 sections in a program:

  1. The first section will be the Start/Stop circuit, cf. here, but will do the equivalent in ST. It will set a bit (not an output) called Run (or whatever you like). None of the other sections will run unless Run is 1.
  2. The second section will advance the setpoint, which is an integer called Oven_setpoint (mentioned in section 1 above). It's first statement will set up a TON timer {ton}, similar to @parky's code in post #3 of this thread, but the IN will be a more complex expression that ensures the timer will not run unless the process is running (Run is 1) and the setpoint has not reached 280deg.; the ton.PRESET will be 20s. The rest of this section will increment the burner setpoint by 1 degree every 20s (which will be the same as 3 degrees every minute), and will execute when ton.Q is 1. Once the setpoint reaches 280deg, the timer cannot run so ton.Q will cannot be 1, and the setpoint will not increment any further.
  3. The third section is bang-bang control. It will turn the burner on whenever the Run bit is 1 AND the current temperature is below the setpoint; otherwise it will turn the burner off. The clause protects against invalid values in the Oven_temperature measurement.
Note that sections 1 and 2 do not "care" what the state of the burner is, sections 1 and 3 do not "care" how the setpoint is set or incremented, and sections 2 and 3 do not "care" how the Run bit is assigned on a Stop or Start.


Code:
(* Section 1:  Start/Stop; initialize setpoint *)
(* to a value no more than 280deg *)

IF Start THEN
  IF NOT Run THEN
    IF Oven_temperature > 280 THEN
       Oven_setpoint := 280;
    ELSE
      Oven_setpoint := Oven_temperature;
    END_IF;
  END_IF;
  Run := 1;
END_IF;

IF Stop THEN
  Run := 0;
END_IF;

(* Section 2:  increment setpoint every 20s *)
(* until it reaches 280deg *)

ton(IN:=Run AND Oven_setpoint<280 AND NOT ton.Q, PT=T#20s);

IF ton.Q THEN
  Oven_setpoint := Oven_setpoint + 1;
END_IF;

(* Section 3:  bang-bang control of burner *)

Burner := Run AND Oven_temperature < Oven_setpoint;

Hi @drbitboy, may I know the ST program how to make it keep repeating the 20 second timer until reach 280 degree? When the timer reach 20 second, it will stop.
 
Hi @drbitboy, may I know the ST program how to make it keep repeating the 20 second timer until reach 280 degree? When the timer reach 20 second, it will stop.

Sorry, I know where wrong. Now it can repeat the timer. But the increase 1 degree not hit. ton.Q not change to true when reach 20 second. And may I know if the actual oven temperature not able increase 3 degree in 1 minute but the SET_POINT keep increase 1, then will it be SET_POINT reach 280 degree but the actual temperature still not reach
 
Last edited:
DR: You beat me to it, here is my one I did yesterday but did not have time to post it, however, I have concern about the rate of change it actually does in real life but that is easily adjusted, and assumed bang bang control with a window of +- 1 Degree, my other concern is if this oven is gas, the purge sequence, is this incorporated in the burner control, is it modulated etc.
Also, I have put in the comment that it is possible to use the actual and add the + 3.0 degrees rather than just increment the Var Setpoint, this way if it does not reach the original set point before the timer up bit then it only adds +3 so in effect it will only ensure it is trying to reach 3 degrees above actual rather than keep incrementing the set point.
Another point, perhaps you should generate an alarm if the actual does not reach the set point within a given time as a notification to the operator.

Incremental Temperature.png
 
Last edited:
Sorry, I know where wrong. Now it can repeat the timer. But the increase 1 degree not hit. ton.Q not change to true when reach 20 second.





ton.Q does change to 1 when the timer expires at 20s, but you are unlikely to see it because ton.Q will only be 1 for a single scan, which is by design to ensure the setpoint increase by only 1, not by 1 on each of several scanse. A single scan typically lasts a few milliseconds or less, so any monitoring program is unlikely to show the change. Even so, one way you know that ton.Q became 1 is that the timer restarts: the current ton timer Elapsed Time (ton.ET) will return to a value near zero and start increasing again. Another way you know is that the setpoint will increase by 1; that can only happen if and when ton.Q becomes 1.

And may I know if the actual oven temperature not able increase 3 degree in 1 minute but the SET_POINT keep increase 1, then will it be SET_POINT reach 280 degree but the actual temperature still not reach



If the burner is not able to increase the current oven temperature by 1deg every 20s (= 3deg/min), then that does not affect the setpoint algorithm, and the code's behavior is still consistent with the specification provided in Post #1:

...
increase the burner to 280 degree celcius and every minute only can increase 3 degree Celsius ...
Changing the setpoint cannot change the thermal capacity of the physical burner, it will only prevent the burner from raising the temperature more than 3deg/min*.


If the burner does not have the capacity to drive the furnace at 3deg/min, then the setpoint algorithm is not needed, or perhaps it is needed only at lower oven temperatures, i.e. when heat losses are less.


* This is not strictly true: for example, say the oven temperature fell behind the setpoint because the feed gas pressure dropped temporarily or was lost entirely. When the feed gas pressure recovers, the the setpoint will have advanced several degrees, and the burner will heat the oven as quickly as possible, which could be at a rate of more than 3deg/min at the higher feed gas pressure. In the case where the feed gas was lost entirely, the setpoint algorithm would merrily advance to 280deg. Then, when the gas recovers, and the burner would again proceed to heat the oven at an uncontrolled rate. So I ask you to tell me: look at @parky's program and at my prorgram; how can we stop the setpoint from increasing if the actual temperature fell too far behind the setpoint progression?


P.S. @parky's algorithm uses the variable SET_point instead of hard-coding 280. That is a good idea, as the limit of the setpoint algorithm is actually independent of the algorithm, so it would be a good idea to make that limit a user-specified value. Perhaps someday the temperature sensor will develop an offset error, so it reads 280deg when the actual temperature is 275deg, or a new type of glass requires a different temperature. Having the target as a variable that the operator can set without changing the program will be more convenient than editing the hard-coded setpoint lime.


P.P.S. Note that @parky's algorithm has the same three sections. Each may be implemented differently, but the basic steps are the same. For example @parky's resets the VAR_Set_Point when, after it is increased, it exceeds the SET_Point value (280deg). It is useful to look at such differences and think about how they will affect the process; you understand your process the best, so you should look at all options or even come up with some of your own. For example, I see @parky codes his AND expression with more parentheses; that is probably based on experience and I will seek to follow that example in future: it is easier to use parentheses to make logic explicit than to learn the precedence rules for a programming language.
 
Last edited:

Similar Topics

Hello, I was wondering if anyone has a ControlLogix block or routine for encoding and decoding base64. I figured I would ask before diving into...
Replies
1
Views
246
Hello All, I hope we are all doing great and have a healthy and happy 2023!! I was wondering if anyone could help me decode this Motor Name...
Replies
15
Views
5,251
I have a Mitsubishi FX2N-64MR-UA1 processor. The 1st analog output card is an FX2N-4DA. It requires 24VDC power. That card is obsolete. The card...
Replies
1
Views
1,539
Hi All, I am trying to use FactoryTalk studio for SCADA design. How is the scripting done? I have previously worked with Ignition SCADA, and...
Replies
5
Views
1,979
Want to create a button for open excel sheet in factory talk View se client. Create a VBA code below mentioned Private sub Button3_Released()...
Replies
0
Views
1,051
Back
Top Bottom