For the PID challenged.

Join Date
Apr 2002
Location
No income tax, no capital gains tax. Freedom!
Posts
8,351
Over a year ago Tom Jenkins mentioned that he used sliding mode control for temperature control. I have seen sliding mode control (SMC) mentioned in my control books but they just glossed over what it is. The last out of curiousity I searched the web and bought a book ( a waste ). What I learned is that sliding mode control is indeed a VERY SIMPLE and VERY ROBUST means of control. SMC is not for every closed loop application, but it does work extremely well for temperature control. In most temperature control applications a heater or banks of heaters are simpley turned on and off. These are the applications where SMC will excel.

I used Ron Beaufort's soldering iron system data as example data for the link below. What would be nice is if Ron Beaufort implemented the third and forth equations of the link on his test system and report on the results. Notice that the link below is much simpler than the lambda tuning calculations done in a earlier posts. I think Ron Beaufort should scrutinize the link below as it too could help his customers that want zero overshoot but at the same time providing quick response. See the link.

To be honest, I could not hold back what I know now. Too many people use PID for applications where SMC is a much simpler and robust control method. The recent questions about PID and problems with PID have prompted me to to make this post. My Mathcad has also been upgraded which makes it much easier for me to post these simulations.

Temperature Control using Slidling Mode Control.

I am hoping that my explantion is simple enough for a couple of people to understand. I am also hoping that others consider this alternative to PID control because it is easy. One of the main problems I see is that there is no SMC block in a PLC. PLCs only offer PID blocks which is a shame.

I bet Tom has been shaking his head with each temperature PID post.
Tom, I am a believer now. Actually I have been for about year now. At least for applications that only require on/off control.
 
I am still shaking my head

Nothing personal but for at least 2 years or more, I have been listening to or watching Engineers spout formulas concerning PID.

By this time dealing with temperature (or motion) cant be that difficult. Over time most situations are resolved/developed.

The problem I have with all this PID stuff is the way y'all talk about it. Math is great (I understand math) but the NEED for the math at this time eludes me.

If a person/company has a printing press that runs approximately 1000 feet per minute with 4 colors...u cant tell me that over the last 60 years noone has determined what temp to use and how to maintain it?

Motion I can kinda understand, because there are servo/stepper motors now that werent around yrs ago. Same point tho, how many years do you have to tell something to start, stop, pause?
 
Well, Peter, I am gratified with the attribution, but I must confess that you are probably giving me more credit than I am due. I know I didn't use the term Sliding Mode Control. (I usually refer to it as Floating Control with Bandwidth.) And I certainly never developed the rigorous and elegant mathematical formulation you presented. I am very impressed with this formulation - my approach is a lot more rough and ready.

I do believe that PID control is over applied, and the method you describe is simpler to program, tune, and control in a process with widely varying load and response characteristics. Perhaps the elegant mathematical treatment you provided will overcome many engineers' prejudice in favor of the PID they study in school!

And you are certainly right in saying I am frequently shaking my head and asking "Why are these guys making life so tough for themselves?"
 
I'll be quick

plc.doctor, I will write and post some code do that.

I think it is neat that Ron Beaufort has a heater system that he uses to train on heater control. I am hoping that he will try the sample code that I write on his training system and report the results.
So Ron, which PLC do you use? Obviously it is a AB... I don't have a PLC5 but I do have a MicroLogix, ControlLogix and and SLCs.

Tom, you are right. You did only mention floating control but my searching for floating control lead to SMC which is a floating control with out the error rate taken into account. In any case it was you comments that got me researching SMC just like Ron Beauforts questions about lambda tuning got me to research that.
 
Greetings, Peter,

First things first: Although I’m addressing this post specifically to you, naturally others will also be reading it. The extra detail that I’m including is for their benefit. Sorry if it seems that I’m providing way more information than you need.

Yes, I’d be happy to run some experiments for you on my heater system. Normally I use a PLC-5 but it wouldn’t be any trouble at all for me to switch over to an SLC-5/04. Let’s talk about the heater system to get things lined up.

Basically it’s a 25 watt soldering iron. I’ve removed the original soldering tip and inserted a screw about one inch long in its place. And incidentally, this whole experimental system has been nicknamed the “Hotrod” ... in reference to the “rod” (actually the screw) that gets “hot”.

Continuing on ... there are two J-type thermocouples. The first thermocouple is mounted right up next to the barrel (the “barrel” is what I call the part that actually does the heating) of the heating element ... I call this one the BASE thermocouple ... this one gives a pretty quick response. The other thermocouple is mounted out at the end of the screw. I call this one the TIP thermocouple ... and this one gives a somewhat slower response. I can use either one of these that you prefer, but I’d suggest that we use the tip thermocouple to begin with. It’s more challenging because it introduces more “deadtime” into the system ... which of course is the amount of time it takes for the heat from the barrel to travel down the length of the screw and actually affect the tip thermocouple reading.

I’ve got a hunch that the term “deadtime” is something you’d prefer not to use ... so I’m open to suggestions. How about “total system lag” or something along those lines? In the figure below, the “deadtime” (as I call it) shows up as the time between the point at which the CV (control variable) is suddenly increased ... and the point at which the temperature really “gets up to speed” and increases at its maximum rate. As noted below, the base thermocouple has a “lag/deadtime” of 0.15 minutes ... the tip thermocouple has a “lag/deadtime” of 0.82 minutes.

You’ll also notice that the tip thermocouple doesn’t get quite as hot as the one mounted right at the base ... even when both configurations are fed with the same CV (10% at the start of each graph and 80% at the end). This is obviously due to the radiation from the screw as the heat travels from the barrel of the heater out to the thermocouple.

[attachment]

Next you’ll notice that I’ve included the measurement T1 on the graphs ... this is the amount of time that the system takes to reach 63.2% of its total rise. I think that you engineering-type people call this the “first order time constant” or something along those lines.

The system gain (at least the way that I’ve always calculated it is G=(PV2-PV1)/(CV2-CV1).

More about the CV: The 4-20mA output from the PLC is fed to a module which pulses the heater’s 120 volt power supply off and on ... to provide a time-proportional signal.

You’ll also need to know that the Hotrod system includes a fan which blows across the barrel of the heater and serves as a heat load. I can vary the amount of the air flow by positioning a damper in the air stream. In the figures above, the air flow was held at a constant 20% of its maximum value. Later (assuming that we get this idea off the ground) we’ll probably want to vary the air flow to provide a varying “load” to the system and test its response to those types of upsets. Normally I force the air flow from 20% to 80% during these tests.

Summing up, let’s say that I will be delighted to run whatever tests that you can come up with for the Hotrod. You said that an SLC controller would do ok ... so let’s say that I’ll be using an SLC-5/04 processor. The analog input module will be a 1746-NI4 which will read the 4-20mA signal (PV = address I:7.0) from the thermocouple transmitter. The temperature scale is 0 to 500 degrees Fahrenheit. The analog output module will be a 1746-NO4I which will send a 4-20mA signal (CV = address O:8.0) to the “time proportioning” pulse controller. The addresses listed here are the ones that I usually use ... feel free to change them to make them more compatible with the systems that you have available.

And the inevitable disclaimer: The Hotrod is not a simulator ... it is an actual process. True, it is a SMALL process ... but the fact that it is a system made up of real-world mechanisms does occasionally lead to some rather interesting “learning opportunities”. What I’m getting at is that the “process gain” might have had a value of 4.014 the last time I hooked the darned thing up ... but the next time the gain might be slightly changed. The biggest variable is usually the room air temperature ... it obviously affects the heat load by way of the air stream’s temperature. Normally the incoming air temperature is kept around 75 degrees ... but if it happens to shift appreciably, then some of our carefully calculated settings might end up out in left field. I’ll do my best to keep the system consistent from one test session to the next ... but sometimes our “mileage may vary”. I suggest that we proceed anyway and see what happens. Nice things about the Hotrod: Nobody’s going to get hurt ... and no raw material is going to be wasted.

Well, that should be enough of a “Hotrod” introduction to at least get us started ... now for the tricky part.

Unfortunately, I’m going to have a rather hard time trying to program the “Sliding Mode Control” that you’ve posted. As I’ve mentioned before, I personally don’t have the engineering-type math background to readily understand all of those formulas that you posted. So converting those formulas into ladder logic is likely going to require more time than I currently have available. But ... now that we’ve got the system sort of specified, could you go ahead and make the conversion yourself? If you could post the code in the ASCII format (example: SOR 0 ADD N11:49 1 N11:49 EOR SOR ADD F8:8 N11:[N11:49] F8:8 EOR) or a screen dump or something else along those lines, then I could probably get this thing hooked up and running sometime tomorrow. And incidentally, this week looks kind of OK (at least right now) but next week is going to be really busy for me.

Let me know if this sounds reasonable ... so far it looks like a fun project.

charact.jpg
 
Fun Project

Ron, I will write the SMC ladder. I too have a SLC5/04 or SLC5/05 that I can use and RSLOGIX 500. I will post this because the PLC.DOCTOR ( and I bet others ) wants to see what it would take to implement SMC. It shouldn't take more than a handfull of rungs. You may need to adjust the inputs and outputs to suit your 4-20 ma inputs and outputs. Note that SMC is usually full on or full off like many temperature controls that normally use PWM to convert analog values to on/off heaters.
 
Let me be the first to thank you for taking the time to do this Peter. I looked the subject up yesterday and the math is WAY over my head. I am very interested in seeing what the ladder logic to do this looks like.
 
Peter, I have never used this SMC scheme and am very interrested to play with it. I have Mitsu and Omron PLC in the shop that can only wait to see your code for the AB.

I'll give it a shot and compare the PID to PWM and this SMC control.

I'will certainly learn "again" some nice stuff.

Don't let go this thread into to PM. Many of us want to know.
 
... ready to go ...

Greetings, Peter,

Just wanted to touch base with you and let you know that the Hotrod is wired and ready. I just ran a couple of tests in the manual mode to make sure that everything is working properly. In the one shown below, I kept the air flow (system load) over the heater at a constant 20%. I set the CV to 10% and let the system stabilize. The temperature leveled out at 115 degrees F. Then I stepped the CV to 80% and let the system stabilize again. This time the temperature leveled out at 375 degrees. The total graph duration is 22 minutes. According to my “hand-measured” calculations, the Deadtime (or “total lag” if you prefer) is 0.66 minutes. The T1 Time Constant (time to reach 63.2% of total rise) is 3.38 minutes. I calculate the process gain as 3.714.

[attachment]

On to the next post ...

heat_a.jpg
 
... load test ...

Throughout the entire test shown below, I kept the CV at a constant arbitrary value of 30%. I started out with the air flow (system load) set at 20% and let the system stabilize. The temperature leveled out at 199 degrees F. Next I stepped the air flow up to 80% to increase the load on the system. The temperature dropped and finally leveled out at 165 degrees F.

[attachment]

I’m looking forward to experimenting with the code you’re working on. I know that you’re a busy man - so just post it whenever you get around to it. There’s no hurry at my end but I wanted to let you know that I’m ready whenever you are.

heat_b.jpg
 
Progress report. I just got back my SLC5/04.

I worked on the SMC last night for an hour or two. I am spending more time figuring out how I want to do it. Most of the decisions concern brevity, clarity, transportability and PLC limitations.

The SMC program is now two subrountines that get called from the main routine. A SMC_INIT with about 6 blocks and a SMC_UPDATE with 8 blocks. The SMC_INIT routine gets called on a first scan or a change in a parameter. The SMC_UPDATE routine gets called every second when a 1 second timer expires.

I will have it SMC part done tonight, but I want to test it out using a simulator ( I need to write that too ) here and make sure there are no errors because it will be difficult to debug from across the country.

Ron, I am confident the SMC will control well even when your your load changes.
 
... another squiggly line from the Hotrod ...

Here I programmed a simple “on-off” control with a setpoint (green trace) of 200 degrees F. The CV (blue trace) goes from 1% to 99% ... ok, I fudged just a little to keep the CV trace visible on the graph.

[attachment]

Notice that even after the CV goes “off” above 200 degrees, the temperature (red trace) continues to rise and eventually reaches a maximum reading of 228 degrees. Then, even after the CV turns “on” again below 200 degrees, the temperature continues to fall until it reaches a minimum reading of 187 degrees. The air flow (system load) was kept at a constant setting of 20% of full flow.

My calculations indicate that this system has a period of 3.54 minutes per cycle.

heat_c.jpg
 
The sensor lag is a problem!

This is why I didn't think much of the simple on off techniques.

However, the code that I am working on will update much faster than your example. Try updating every second. Second, the code I am working on will taking into account the sensor time constant and the error rate. Calculating the error rate must be done with attention detail. I am filtering the error rate just to eliminate the 'noise'. I will try to estimate the sensor time constant from your plot above. The etimate only needs to be within a factor of five for the SMC to work, but if you get the sensor exactly correct then there will be no overshoot of the actual temperature. I probably won't get a chance to finish the code till the weekend.

On the www.control.com forum there is another PID challenged person. He is having a problem with his heater control system because of the sensor time constant. For some reason my posts on that forum never show up so I haven't be able to steer him over here.
 
www.control.com sux

They dont offer real time responses to queries/questons. When you do respond your message MAY or MAY NOT be posted.

Its history, Scientists/Intellectuals that think they believe in freedom but when in charge do NOT and will NOT listen to most or allow anything not of their thinking to be portrayed in print or expression.
 

Similar Topics

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
10
Views
275
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
851
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
386
I'm setting up a PID for a 50hp RO pump in a water treatment plant. When I go to manual mode on hmi I set the swm bit, I also ons the pid output%...
Replies
5
Views
525
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
897
Back
Top Bottom