I have written control logic for several situations recently where I have used a compute statement instead of a PID loop. My statement looks like:
output = output + (setpoint - actual).
So a situation with a setpoint above actual (temp or pressure or...) will add to the output, a situation with the setpoint below the actual will add a negative, effectively subtracting.
So if I have a large deviation from my actual temperature, or pressure, or level... I change the output significantly. A small deviation changes the output minimally. I do usually add a multiplier to affect how much I change the output. Looks like this:
output = output + ((setpoint - actual)*multiplier).
The multiplier might be a fractional number (0.25) or it might be larger (16). It depends on how my output and input are set up. An input that varies from 0 to 100, with an output that varies from 0 to 100 might have a fractional multiplier, while an input from 0 to 100 with an output from 0 to 32000 might have a larger multiplier.
I use a timer to trigger the statement to execute every second or so.
Below the statement I will have rung to limit the output to a minimum and maximum valve (if output < 0, output = 0, if output >100, output = 100).
It works great and is easy to tune with just a multiplier change. I also can make two compute statements with different multipliers, one for if the actual is above the setpoint, another for if the actual is below the setpoint. (Use a couple of compares LES and GRT to trigger the compute statements. )
I feel that this give me control that I am able to manipulate better than a PID. It works particularly well where the input sensor reacts slowly to the output change.
It has its place. Sometimes PID works better. Sometimes, I prefer computes.
Thoughts?
output = output + (setpoint - actual).
So a situation with a setpoint above actual (temp or pressure or...) will add to the output, a situation with the setpoint below the actual will add a negative, effectively subtracting.
So if I have a large deviation from my actual temperature, or pressure, or level... I change the output significantly. A small deviation changes the output minimally. I do usually add a multiplier to affect how much I change the output. Looks like this:
output = output + ((setpoint - actual)*multiplier).
The multiplier might be a fractional number (0.25) or it might be larger (16). It depends on how my output and input are set up. An input that varies from 0 to 100, with an output that varies from 0 to 100 might have a fractional multiplier, while an input from 0 to 100 with an output from 0 to 32000 might have a larger multiplier.
I use a timer to trigger the statement to execute every second or so.
Below the statement I will have rung to limit the output to a minimum and maximum valve (if output < 0, output = 0, if output >100, output = 100).
It works great and is easy to tune with just a multiplier change. I also can make two compute statements with different multipliers, one for if the actual is above the setpoint, another for if the actual is below the setpoint. (Use a couple of compares LES and GRT to trigger the compute statements. )
I feel that this give me control that I am able to manipulate better than a PID. It works particularly well where the input sensor reacts slowly to the output change.
It has its place. Sometimes PID works better. Sometimes, I prefer computes.
Thoughts?