For the PID challenged.

I think 'switching curve' control is just a non-linear variation of SMC.

Mars Reentry Vehicle Control Using Swithing Curve Control (SMC)

What is called sliding mode and Nasa is calling Switch Curve are probably the same thing.

In some documents I have heard of a switch hyper plane. This is because the switching formula has many parameters. In the temperature example the formula is s = tau * e' + e. This is obviously a switching LINE as it has the form of y = m * x + b and the there is a linear relation between e and e'. The Nasa example is non linear so it is a switching curve. A motion example looks like this s = e" + c1*e' + c0*e. This is a switching plane where e", e' and e are the different axis.

BTW
e is the error
e' is the error rate
e" is the error accerelatation.

I can be absolute sure that what you book is calling 'switch curve' conrol is the same so I will leave it to you to compare your book with the Nasa article.

I updated the first sliding mode control like to the .html file. I added some examples of what would happen it the estimate for the sensor time constant is off. In one example the estimate is too long by a factor of 1.5 and the other the estimate is too short by a factor of .3

Sliding Mode Control Updated with poor estimates of the sensor time constant.

What the .html file shows is that it is best to error on the high side when estimating the sensor time constant. I also corrected the simulation so that the temperature will decay ( cool ) to ambient temperature instead of to 0.
 
I finally got the Sliding Mode Control working with my "Hotrod" setup, although mine is a hot melt glue gun instead of a soldering iron. It performs quite well with the exception of the rise time. I may not be calculating TAU or T quite right. Once at setpoint, it will hold +/- 0.5 degrees with a input signal precision of 0.10 degrees. Quite excellent i think.

Many thanks Peter for the help with the AD software. If I can figure out what I am doing wrong with my time constant I will repost the full version with the calculation setup routine.

test 09-11-03.jpg
 
Last edited:
That looks pretty good.

As good as the Lambda tuning ( no overshoot ) and you didn't need to pay $30!

I agree that the response time is too slow. Your estimate of the sensor time constant is too long. Try shortening it up. This will reduce the response time. Ron Beauforts, estimate looks too short. See the link above about poor estimates of the sensor time constant.

While trying different sensor time constants use a spread sheet to calculate the coefficients. I use Mathcad which is an engineers free form spread sheet, but Excel will do nicely.
 
I hate to resurrect an old thread but can the SLC5/04 files for Peter's version with the simulator and Ron's version for the HotRod be uploaded as attachments? I see Ron's version in post #29 but it seems changes were made later in the thread without a new upload. Peter's uploads were links to his website which has been redesigned. I would like to try this control method as an alternative to PID in a heat control process for an acrylic mold.
Our current obstacles are bang-bang relays controlling the heater elements, a time constant of ~25 sec on the thermocoupler and a tight temperature range hold spec. The simulator would certainly help test and sell the idea to management.
 
There is a hotrod.zip in the download/Misc directory. It has the files I made for simulating Ron Beaufort's hotrod trainers. I haven't looked at those files for years and haven't had RS500 installed for about 8-9 years.

I have a Scillab SOPDT simulation. Scilab is free. It takes 3 files. You can change the parameters to what you want and see how it changes the response.
http://www.deltamotion.com/peter/Scilab/SOPDT/ISA-PID.sci
http://www.deltamotion.com/peter/Scilab/SOPDT/PlotTemp.sci
http://www.deltamotion.com/peter/Scilab/SOPDT/SOPDT.sce

The last file is the main file that includes the other two. The Scilab time constants will match the Rockwell time constants. The gains will not because Rockwell makes one go through a 3 step process. Scilab expects the plant gain to be degree/% control output. It expects the controller gain to be % control output/degree. Rockwell's PID gain is unitless and basically counts out/counts in. This is because the RS500 PID appears to be an integer only PID. So one must consider that the RS500 PID is only part of the gain that must be multiplied by the counts/degree input scale factor and % control output / count in the output scale factor.
 
MicahFerguson - Welcome to the forum! Thanks for bringing up this old post as it prompted me to try something new.

The key to making the SMC work in a optimal way is to know or calcuate the sensor time constant. The sensor time constant must be used to calculate the coefficients. In the Automation Direct program I did not include a routine to calcuate these coefficient but I did document how to calculate them.

There have been over 200 people that have download the original .htm file. Still there are few questions.

I am surprised that no one has asked about 'how does one find the sensor time constant'?

Peter - I realize it's been a while, but "how does one find the sensor time constant"??? At first I thought you meant the "system" time constant meaning the amount of time the PV reaches 63.2% of steady state due to a CV step change. I tried that value (~45 seconds) with my water heater application and ended up with a very shaky error calculation and constant overshoot in my PV. Could it be that the sensor time constant is the lag time in the sensor response as the step change is applied?

For a little background: I tried the SMC in a PLC5/80 utilizing the SLC program that Ron Beaufort provided in an earlier post. I am testing this on a heat exchanger with a steam shutoff valve for on/off heat control. The HX is used to heat a silo of water & maintain temperature. I haven't had much time to dig into the logic as much of my day is spent herding cats. I hope to look into it a bit more this weekend in my spare time. Thanks in advance.
 
Evaluation period has expired

I'm apologize for offtopic. Peter, I can view content of *.sci files of your links from few posts above, but if I try to access to this link http://deltamotion.com/peter/Maxima/Seg1234567.html it requires the authorization (same with access to 'Maxima' or 'Scilab' directory).
deltamotion.png


There are a lot of unique, rare and useful information on it. Can you, please, share access again?
 
SMC is intriguing- does anyone have a link to more info as far as what it is and how to implement it in the PLC world? My searches have all taken me to graduate school type papers and similar things that are over my head.
 
You can look at my SMC worksheets here
http://deltamotion.com/peter/Mathcad/SMC/
The SMC code itself is very simple.

Basically SMC is just code to turn on/off a switch. An extremely simple version would be to turn on the switch ( heater ) when the temperature is below the set point and turn it off when the temperature is greater or equal to the set point. This will work buy you know that the PV will over shoot the SP. You could simply turn off the heater 3 degrees or some number of degrees before reaching the set point but that is crude and the temperature can drop below the set point before the heater is turned on. This is the dead band approach that is simple.

SMC doesn't use the dead band approach to avoid over shooting. Instead is uses a rate predictor sort of like the way people describe the derivative gain in a PID. The rate predictor does use the derivative of error just like the PID does. The plant or system time constant should be used as the gain. The error from the position term and the error from the rate predictor are added together to get a combined value of what you could think of as the proportional error and the rate of error ( derivative error ) it looks like this
Code:
ERROR=SP-PV
ERROR_RATE=(ERROR-LAST_ERROR)/UPDATE_INTERVAL
s = tau*ERROR_RATE+ERROR
IF s >=0 Then
   heater on
ELSE
   heater off
END_IF 
LAST_ERROR=ERROR;
So if the update interval is 1 second and the plant time constant is 1 minute or 60 seconds then the decision to turn the heater on or off occurs every second. The update interval should be much faster than the plant time constant.

The teachers make a big deal out of something so simple. The make a big deal out of making sure the heater will actually raise the temperature to the SP under all conditions. They make a big deal about convergence. Here is a what they are trying to say. You know the PV will converge or is converging if the ERROR*ERROR_RATE<0. Think about it.

Now SMC can be more complicated. SMC doesn't work will when there is a dead time between when the heater goes on and the temperature starts to increase. The code for computing s gets to be a little more complicated if the plant has two time constants like one for the thermal mass and one for the response time of the temperature detector. In this case the formula for s is now
Code:
s=tau1*tau2*ERROR''+(tau1+tau2)*ERROR'+ERROR
I am using ERROR' to mean the error rate and the ERROR'' to mean the second derivative of the error.
Code:
ERROR''=(ERROR(n)-2*ERROR(n-1)+ERROR(n-2))/UPDATE_INTERVAL^2
The SMC code is still simple but computing the second derivative of the error is not.

Here is a video I made years ago for LinkedIn.
http://deltamotion.com/peter/Videos/SOPDT Sliding Mode Control with Smith Predictor.mp4
There was a discussion about how long dead time can be and still be controllable. I added random errors just to show how the SMC with Smith Predictor would respond.

The Smith Predictor is necessary for most temperature control applications because of the dead time.
 
Wow, thanks for the awesome "plain english" explanation- I really appreciate it! I'll have to experiment with it. I've been using PID control of heaters by using the CV to drive a PWM signal to the heater. That works well but obviously requires tuning for each application which can add hours to startup time depending on the application. This promises to minimize the tuning, or so it would seem.
 
We have 20 process tanks that are heated using simple on/off valves. The old control that was originally programmed was lacking in accuracy. I implemented the SMC and all of our tanks are now within 1-2degrees of setpoint.

The old control was just turning on the valve based on a high and low sp value. They had an actual setpoint, and then a high and low setpoint. Which were used for alarming, but they also used it to control the pv.
So the PV would bounce from the High setpoint to the Low setpoint, which was usually about a 40 degree swing. (20degrees +/-)

I appreciate and thank all who contributed to sharing this information. It really helped out our process.
 

Similar Topics

Hi, I would like to assemble a simulator/practice booster pump system that uses PID to maintain steady water pressure under various outlet demands...
Replies
0
Views
86
Hello, I have a motor that we are sending a RPM Speed Output from 0-100% to the VFD. However, the Motor HP needs to be limited to 6000 HP and the...
Replies
3
Views
92
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
620
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
966
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
423
Back
Top Bottom