# Siemens implementation of PI control.

#### DaraghC

Hi everyone,

I'm commissioning a dissolved oxygen system at a wastewater treatment works, and the PI controller is implemented by a Siemens S7 PLC. So I checked out S7 online and found a Siemens manual at the link below.

The problem I'm having is with the PI description on page 32 to 33. It shows two graphs.

Then an equation which I believe is for the output y.

I'm assumming that 't = time interval since the step of the control deviation' means the time since the disturbance. Even if it doesn't, as time passes t will increase. This means that the integral term will decrease not increase as time passes and it will just be a proportional controller. Or, am I missing something fundamental.

The controller on site doesn't behave like the above equation. If the error doesn't decrease, the output starts to ramp up, as I would expect an integral to do.

Thanks for any help.

#### pnachtwey

That equation looks wrong. Assuming Ti is the integrator time constant and t is the update interval, the units are not right because there are two times in the denominator. Also, I don't see where the output is being integrated.

#### Fil

Hi DaraghC,
Assuming Xw is the amplitude of the deviation step change (starting from zero deviation), the time t elapsed since that step change should be located in the numerator instead of the denominator in the equation : the integral term will actually generate a ramp on the controller output with a constant slope as long as the deviation remains constant. Proportional and integral terms are in series as in a standard PID structure, since the gain is a multiplication factor for both of them.

#### pnachtwey

Don't ignore what I said above about there being two times in the denominator. How does a ( 1 + 1/(TI*t) ) make sense?
The first 1 is unit less. The second 1/(TI*t) has units of 1/seconds^2. How can these be added together?
What cancels out the 1/seconds^2 units?
There must be a misprint or you copied it wrong. It should be (1+t/TI). Now the times cancel out and the whole term is unitless.
This is very important! Do not pass Go do not collect \$200 until you figure this out.
Doesn't the Siemens documentation define the variables?
There should be a SP ( set point ) and PV ( process value ). The difference is the error. I don't see and error term. If there is one it must be the Xw.

#### DaraghC

Hi DaraghC,
Assuming Xw is the amplitude of the deviation step change (starting from zero deviation), the time t elapsed since that step change should be located in the numerator instead of the denominator in the equation : the integral term will actually generate a ramp on the controller output with a constant slope as long as the deviation remains constant. Proportional and integral terms are in series as in a standard PID structure, since the gain is a multiplication factor for both of them.
So I'm not missing something. The equation is wrong. Thing is, this is from a Siemens document on PID implementation on a S7 PLC.
I think I'll write to Siemens. Feel a bit more confident now that both you and Pnachtwey agree it's wrong.

#### DaraghC

Don't ignore what I said above about there being two times in the denominator. How does a ( 1 + 1/(TI*t) ) make sense?
The first 1 is unit less. The second 1/(TI*t) has units of 1/seconds^2. How can these be added together?
What cancels out the 1/seconds^2 units?
There must be a misprint or you copied it wrong. It should be (1+t/TI). Now the times cancel out and the whole term is unitless.
This is very important! Do not pass Go do not collect \$200 until you figure this out.
Doesn't the Siemens documentation define the variables?
There should be a SP ( set point ) and PV ( process value ). The difference is the error. I don't see and error term. If there is one it must be the Xw.
First of all my apologies the link I posted is from my PC. Correct link below.

https://support.industry.siemens.co...ic-s7-1200-s7-1500-pid-control?dti=0&lc=en-AR

And the graphs are on page 33 equation's on page 34.

It's not a misprint I copied that equation from a Siemens document using Snipping tool.
So, as both you and Fil agree it's wrong I'll contact Siemens and see what they say.