S7 - PID loop quick question

PLCKeef

Member
Join Date
Nov 2005
Location
Australia
Posts
68
Hi all
I've just been fiddling around with the PID loop in an S7 313C , using the Function block CONT_C FB41.
My question is should I be calling this block from a timed interupt block.

My only experience is with S5 and I used to call OB251(PID loop) from OB13 , OB13 being a timed interupt block.

Anyone used CONT_C ?

thanks
I will work it out myself , but tips / help is always handy :)
 
John Gaunt said:
One second is probably rather slow for many applications. I generally have a lot of very slow temperature control loops that need extreamly precise control.
Why do very slow temperature control loops need fast update times? If the update time is 10 times faster than the minimum of the plant or closed loop time constant then you should be OK.

BTW, the only place where the controlguru and I disagree is on this very subject. Most process people say the same time must be 10 times faster than the plant time constant. I say it must be 10 times faster than the minimum of the plant and closed loop time constant. The reason for this is that one can crank up the gains on those systems that don't have a lot of dead time so that the closed loop time constant is shorter than the plant time constant.
 
?????????

John Gaunt said:
In fact fast action will usually make the control less precise.
This just means you usually work with inferior PIDs and poor feedback.

Why? How?

A motion controller can control temperature applications using 0.0005 seocnd updates with no problem explain that? It is just a waste of processing power.

I have left you some wiggle room. What are the exceptions?
 
I use CONT_C regularly - my current project has 37 PID loops all being CONT_C.

I create an FC with the call to the CONT_C block. Then I call the FC from a cyclic OB - depending on the CPU but 20mS ideally.

Also - set the CYCLE input on the CONT_C block to 25mS.

Hope this helps.
 
PID myth busting, the explanation

John Gaunt In fact fast action will usually make the control less precise.[/QUOTE said:
The ideal is to design the control system so it has an infinite update rate and infinite feedback resolution like an analog system. The integrator gain term for a temperature PID looks like this:

Code:
Kc*T/Ti

One can see that as Ti becomes large the integrator gain gain can be very small. In fact it may round down to 0 or the gains may only change in increments like 1,2 or 3 when a 2.33333... is required. This is poor gain resolution. This is a problem with any controller that uses only 16 bit integer gains and keeps track of only 16 bits of output. To keep from losing resolution the gain may require 32 bits where the extra 16 bits provide extra resolution, not range. If your PID doesn't use 32 bit integer or floating point math it will suffer from quantizing or loss of resolution problem. The resulting integrator gain will not be accurate and could make the system impossible to tune. One should use 32 bit math or floating point controllers to avoid this problem. Resolution and dynamic range is the key.

Poor feed back resolution is also a problem. As the sample intervals get smaller the calculated rates of change for the derivative get bigger. The derivative gain is calculated by
Code:
Kc*Td/T
where T is the sample time. As T becomes small the resulting gain can become quite large. If the feedback is coarse, noisy or suffers from sample jitter then the resulting rate in change of error or PV will cause the derivative term to be useless. If the feedback is course then the output will change more for each change in the output. Noise is also amplified by the higher gains that occur when sampling faster. The effects of sample jitter become worse as the jitter becomes larger with respect to the sample time.
Slower sample times effectively 'time average' the derivative gain but this also introduces phase delay.

When sampling at a very fast sample time one should use fine resolution feedback that is sampled at even intervals and the calculations should be done using 32 bit math or floating point.
 
Peter Nachtwey said:
This just means you usually work with inferior PIDs and poor feedback.

Why? How?

In fact I use Siemens Modular PID Control that is purchased separately but I find it gives far superior control to that provided in Step7 or their other purchased product Standard PID Control. Most of my controls are temperature control where the temperatures are around 1200 deg C and I work with a resolution of 0.01 deg C and expect to achieve control to within 0.05 deg C.
Because the temperature changes very slowly I find control action every second to be quite satisfactory. I have controlled up to 68 PID control loops in an S7-400 PLC.

Sometimes I control air pressures and in particular Furnace internal pressure and in such cases need faster control and faster valve actuators. I usually use electric actuators everywhere with slidewire feedback of "valve" position.
 
Thansk guys , I have a 313C and am having trouble finding which OBs owrk in my model.
I tried to transfer an OB32 to the PLC and got an error saying it was out of range for the hardware.
Searching for the hardware manual now , any ideas ?

thanks
 
PLCKeef said:
Thansk guys , I have a 313C and am having trouble finding which OBs owrk in my model.
I tried to transfer an OB32 to the PLC and got an error saying it was out of range for the hardware.
Searching for the hardware manual now , any ideas ?

thanks

Take a look in the HW-config and CPU properties, the OB's that aren't available for your CPU will be greyd out.
I think OB35 is the only interrupt OB for 313C CPU.
 
John Gaunt said:
Most of my controls are temperature control where the temperatures are around 1200 deg C and I work with a resolution of 0.01 deg C and expect to achieve control to within 0.05 deg C.
Because the temperature changes very slowly I find control action every second to be quite satisfactory. I have controlled up to 68 PID control loops in an S7-400 PLC.

Not wishing to hijack the thread but I'm intrigued as to what process requires temperatures of 1200 deg C controlled to an accuracy of 0.05 degrees and what sort of temperature sensor can provide that sort of accuracy.
 

Similar Topics

Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,184
We have a PID loop at the plant that measures our drum outlet temp. It adjusts a damper to control the temp within the set point. We have a...
Replies
8
Views
1,418
Hello All, Has anyone on here used Soft PLC brand PLCs? I've just now started doing PLC programming and I am totally stuck on trying to make a PID...
Replies
4
Views
1,553
Hello and thanks for reading my question/problem. I am working on an a application where I have a servo controlled gate that allows product (dry)...
Replies
14
Views
2,767
Hello All, I am trying to figure out the best way to control a system I am working on. I have 2 bags of peanuts being lifted up by hoist. I am...
Replies
23
Views
4,736
Back
Top Bottom