Home > Forum > IEC 61131 Programming (LogicLab) > Hysteresis management on heater control
- This topic has 5 replies, 2 participants and was last updated 8 years, 2 months ago da Sergio Bertana.
-
AuthorPost
-
November 18, 2015 at 2: 19 pm #35879AuthorlessIdle
I created a simple ladder program that manages the command of a heater on temperature acquisition from Pt100. To avoid oscillations on the heater control, I managed a hysteresis on the temperature value.
Not being very practical in ST language, following what is reported in this topic I made it all in ladder, here it is screenshot of the program. I was wondering if it was possible to have an example in ST, so it can also be useful for me to get closer to the use of language.
November 18, 2015 at 2: 30 pm #39195Sergio BertanaAdministrator ForumGiven that the management of the hysteresis you have done is correct, the scheme you have created has nothing of the ladder and is more suitable for the FBD language (Screenshot). So much so that in the new version of LogicLab 4 the ladder editor has been revised for "costringere”The developer to follow the rules dictated by the IEC 61131 standard. But do not worry it is always possible to continue to use the backwards compatibility with the current editor. Now let's see how to write the program in ST.
AnInp.Address:=0; (* Module address *)
AnInp.Channel:=0; (* Module channel *)
AnInp.Mode:=AD_VOLT_0_10_COMMON; (* Acquisition mode *)
AnInp(); (* Execute the analog acquisistion *)IF (AnInp.Value < Minimum) THEN Heating:=TRUE; END_IF; (* If the value drops below minimum set the command *)
IF (AnInp.Value >= Maximum) THEN Heating:=FALSE; END_IF; (* If the value reach the maximum reset the command *)
IF (AnInp.Fault) THEN Heating:=FALSE; END_IF; (* On FB fault reset the command *)Even for those who have no experience of programming in ST language, I believe the program is readable, in the first part the acquisition is managed. Then the acquired value is compared with the IF statement with the minimum and maximum values and if the condition is true, the operations written after the THEN are performed.
November 18, 2015 at 3: 40 pm #39196Sergio BertanaAdministrator ForumOf course it is convenient to create a function to manage the hysteresis. In this program (Print) I have created two functions for the management of the hysteresis, one written in ST and the other in FBD (Download program).
November 20, 2015 at 2: 00 pm #39198AuthorlessIdleI should do a check that:
Temperature <of SetPoint -> open valve A (heat)
Temperature> of SetPoint -> open valve B (cool)
-2 ° from SetPoint> Temperature <+ 2 ° from SetPoint -> close both valve A and BIn this way, if the flow of heat or cold (for oversized pumps or valves) is too much, stopping them before the set point does not tend to exceed it.
November 20, 2015 at 2: 15 pm #39199Sergio BertanaAdministrator ForumIn the meantime, let's say that with an On / Off regulation it is difficult to avoid overshoots, the system always tends to go beyond the set point values a little, only a PID regulation allows to avoid this problem. But to realize a PID control you should have pumps and / or valves that can be managed analogically (variable speed / flow).
However, it is a good solution to create a dead band around the SetPoint value (You have fixed ± 2 degrees) but you can have a variable value to be set experimentally based on the real tests on the system. By increasing the dead band you can stop the action before reaching the SetPoint, leaving the thermal inertia the task of bringing the temperature to the SetPoint value without having overshoot.
There he is screenshot Simulation of a simple double-effect heater with dead band on SimuLab (Download program).
February 3, 2016 at 8: 15 am #39330Sergio BertanaAdministrator Forum -
AuthorPost
- You must be logged in to reply to this topic.