Sign in to follow this  
Followers 0
andrea

Tempture controller

11 posts in this topic

Hi Guys I am setting up a water boiler with a analog sensor input. I am wondreing if there is a better way of controling the offset and timedelay than what I have in the program I have posted. I have added the time delay so the output will not cycle to fast. Are there any better ideas? Andrea boiler_temp.RSS Edited by andrea

Share this post


Link to post
Share on other sites
Assuming you are talking about controlling the boilers temperature, Here is what I used for heating up some aluminum platens. I could not allow the heaters to be on 100% all the time while trying to reach set point to prevent burning up, and to keep it from overriding set point. So I had a span of temperature from room temp to 75 % of set point, where the heaters cycle was 30 seconds on and 5 seconds off. Once the temp got above the 75% of set point the heaters cycle went to 10 on and 5 off. I was also using a thermocouple for temp input. Not sure if this helps, but I thought I would throw it out there. Rob Heater_RampControl.RSS

Share this post


Link to post
Share on other sites
Here are some thoughts: The timer set at 10 seconds doesn't seem like it would do anything except allow the temperature to drop a bit, which could be accomplished by a lower set point. One thing it does do however is help isolate the system from temperature sensor noise. That is a downward spike in temperature (not real temperature... just noise), would not turn on the output. I would guess that .5 to 1 second would be plenty for this. You seem not to be set up to catch the same for turning the output off. This would take another timer. Obviously I don't know the application environment. These are just thoughts. Edited by finfin

Share this post


Link to post
Share on other sites
I am controlling a hotwater boiler . all I want to do is have a high set point and a 5 c offset the timer is to prevent it from cycling to fast.

Share this post


Link to post
Share on other sites
What is "to fast"? Could it really change 5 degrees C in less than 10 seconds? Right now the timer seems to limit the "off" time to not less than 10 seconds, and doesn't limit the "on" time at all.

Share this post


Link to post
Share on other sites
Right now when the temperature will reach high or low, for a second or 2 it will go on and off because of the way the analog sensor sense the temperature since I have added the timer it has to time out before it can come back on.

Share this post


Link to post
Share on other sites
so it's not really cycling through the temperature thresholds... it's just noise from the sensor input. I understand now. Seems like latching it on and not unlatching until it goes below the low threshold would have fixed that. Reported temperature uncertainty of a few hundredths of a degree I can understand, but 5 degrees of noise is wild. Did you add the latch/unlatch at the same time as the timer?

Share this post


Link to post
Share on other sites
yes it is .5deg noise that will turn it on and off so the timer prevents that. I had to change the rungs . The program is edited now. the program works ,but was wondering if this is the right way of doing it or is there a better way?

Share this post


Link to post
Share on other sites
HI Is it possible to convert your code to PDF format, not everybody got the current revision . Thanks

Share this post


Link to post
Share on other sites
Here you go. HEATER_RAMPCONTROL.pdf

Share this post


Link to post
Share on other sites
Now I can see what you are doing. How do you know that 10 seconds is the right amount of time to be on or off. That can be too long depending on the time constant of your system. Do you know the time constant of your system? Does your system have a dead time? What you are doing is somewhat of a kludge. There is an alternative approach to PID control that works well when the output is on or off. It is called Sliding Mode Control or SMC. The basic idea is similar to what you already have. If the Error= SP-PV > 0 then the heater is on otherwise it is off. You already know the problem with this technique is that the temperature WILL over shoot the SP because the heater is on until the PV > SP. This is not good so we need a way of turning off the heater even though the PV is below the SP. This is done by taking the error rate into account. It should be obvious that the faster the PV is approaching the SP the sooner you want to turn off the heater to keep from over shooting the SP. Now the condition for turning on the heater changes to: Error(n)=SP(n)-PV(n) ErrorRate(n)=(Error(n)-Error(n-1))/TimePeriod Now if tau*ErrorRate(n)+Error(n) > 0 then turn on the heater. Tau is a time constant. If must be equal to or longer than the time constant of the system. I like to keep the TimePeriod short relative to tau ( time constant ) or the plant time constant. I would do these calculations every second in a interrupt. Here is an example ftp://ftp.deltacompsys.com/public/SMC/smc%20rs500.zip Don't be intimidated. Most of the code is for the simulator. Yes there is a simulator and trends!!!! Talk about a gift. The advantage of SMC is that it is very robust and easy to setup. Load changes do not affect SMC control as much as load changes affect PID control. SMC will tend to turn on and off the heater more often than in your example because it is doing its check every second instead of every 10 but this isn't a problem if you are using solid state relays. The ML1500 LRP must have mechanical relays because I could here it click on and off as the simulation progressed. If the control overshoots then just make tau ( the time constant ) longer. SleepyWombat made a SMC simulator in Excel so you can see what it does and how it does it. http://www.plcs.net/downloads/index.php?PH...3ad43284fd22a74 See the Sliding Mode Control.xls

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0