Thread Content
The container heater is equipped with three temperature transmitters, which are used to perform PID control of the heater based on the measured temperatures. The readings from these transmitters are considered valid only when they fall within 10% to 90% of the range. The average of the valid values from the three transmitters is then used as the PV input for the controller. What methods can be used to calculate this average? The HONEYWELL PKS system is being used.
This is actually a bit complicated; three scenarios need to be considered: when there are no invalid values, after making the determination, the three values are added together and averaged; There is an invalid value; once it is identified, the binary values are added together to calculate the average ; There are two invalid values; once they are identified, it’s unnecessary to take an average. They are all invalid values; it is necessary to check whether there is a problem with the instrument.
I tried writing it as a script, using two intermediate variables for each transmitter. When the transmitter’s measurement value is valid, it is assigned to intermediate variable 1 (Measurement Value); otherwise, 0 is assigned ; The other intermediate variable, 2 (whether the measurement is valid), takes a value of 1 when the measurement is valid and 0 otherwise. Then, the measurement values 1 from the three transmitters are added together and divided by the number of valid values. The denominator cannot be zero, so the number of effective values must be greater than or equal to 1. I’m not sure if there’s a better way to do it.