Subject: PID Control in SWMM 5 for a Weir
The blog http://swmm5.blogspot.com/2010/12/pid-control-in-swmm-5-for-type-3-pump.html describes theFunction getPIDSetting which returns the PID setting at each time step. The PID parameter set contains three values -- a proportional gain coefficient, an integral time (in minutes), and a derivative time (in minutes) which are kp, ki and kd, respectively. More about the theory of PID controllers can be found at http://en.wikipedia.org/wiki/PID_controller.
Here is an example PID Rule that will keep the node depth at 3 feet in a SWMM 5 model by changing the Weir Setting. The example file is attached in this blog. In this particular example, you can reduce the oscillations about the 3 foot rule level by lowering the integral time and derivative time coefficients in the PID control rule.
RULE PID_Weir
; the PID controller adjusts the weir height to have a
; depth of 3 feet in Node 82309e
IF NODE 82309c DEPTH <> 3
THEN WEIR WEIR1@82309c-15009c SETTING = PID 10 -.01 -.01
; kp ki kd
PRIORITY 1
Comments
All three of these rules, work. any value of Kp is valid as long as you do not have all negative coefficients
RULE PID_Orifice1
; the PID controller adjusts the orifice opening to have a
; depth of 3 feet in Node 82309b
IF NODE 82309b DEPTH <> 5
THEN ORIFICE OR1@82309b-15009b SETTING = PID -10 0.01 0.01
; kp ki kd
PRIORITY 1
RULE PID_Orifice2
; the PID controller adjusts the orifice opening to have a
; depth of 3 feet in Node 82309b
IF NODE 82309b DEPTH <> 5
THEN ORIFICE OR1@82309b-15009b SETTING = PID 10 -0.01 -0.01
; kp ki kd
PRIORITY 2
RULE PID_Orifice3
; the PID controller adjusts the orifice opening to have a
; depth of 3 feet in Node 82309b
IF NODE 82309b DEPTH <> 5
THEN ORIFICE OR1@82309b-15009b SETTING = PID 10 -0.1 -0.1
; kp ki kd
PRIORITY 3
Hi Bob, Is it possible to have a negative Kp value in PID controller...... what are the possible range of values of Kp, Ki, Kd in a PID controller?