defcon.klaxon
Lifetime Supporting Member
Hey guys, I have a client that has a v-notch chlorinator that doesn't run off a 4-20mA loop, it instead has two discrete inputs that drive the actuator up (closing the v-notch) or down (opening the v-notch). The PLC is a SLC 5/05.
The programmer used a pretty clever pulse width modulating technique to drive the discrete outputs. Every ten seconds, the program looks at current flowrate (in lb/day), subtracts it from the setpoint, and determines if the error is positive or negative. If positive, then it's dosing too much and sends a pulse to close the valve. If negative, then it's not dosing enough and sends a pulse to open. The duration of the pulse is determined by the magnitude of the error.
I've got this all sorted, minus the equation that determines the error. The equation expression is:
and the comment for this equation is:
The MODULATOR_Period is set to 10, and this makes sense because the outputs are energized for the pulse duration every 10 seconds. The GAS FLOW ERROR is simply the PV-SP, so that makes sense. The one thing that doesn't make sense is the MODULATOR MAX. It's set to 30, but I can't wrap my head around where this number comes from. How can the MODULATOR_Period be 10 seconds, but the MODULATOR MAX be three times that?
I have no idea where this equation came from, so I don't know how the MODULATOR MAX is determined. Was wondering if anyone here might know more about this method and could take a stab at what MODULATOR MAX is. Thanks for any help!
The programmer used a pretty clever pulse width modulating technique to drive the discrete outputs. Every ten seconds, the program looks at current flowrate (in lb/day), subtracts it from the setpoint, and determines if the error is positive or negative. If positive, then it's dosing too much and sends a pulse to close the valve. If negative, then it's not dosing enough and sends a pulse to open. The duration of the pulse is determined by the magnitude of the error.
I've got this all sorted, minus the equation that determines the error. The equation expression is:
Code:
( N25:15 * ( ABS F8:8 ) ) | N25:14
RAW PULSE DURATION = MODULATOR_Period * ( ABSOLUTE VALUE OF GAS FLOW ERROR)/MODULATOR MAX).
The MODULATOR_Period is set to 10, and this makes sense because the outputs are energized for the pulse duration every 10 seconds. The GAS FLOW ERROR is simply the PV-SP, so that makes sense. The one thing that doesn't make sense is the MODULATOR MAX. It's set to 30, but I can't wrap my head around where this number comes from. How can the MODULATOR_Period be 10 seconds, but the MODULATOR MAX be three times that?
I have no idea where this equation came from, so I don't know how the MODULATOR MAX is determined. Was wondering if anyone here might know more about this method and could take a stab at what MODULATOR MAX is. Thanks for any help!