Hi Everyone,
Thought I had it figured out but I came to the conclusion it would not work. Here is what I'm working with...
I'm going to chase pulses. As the meter is counting pulses and gets to its desired goal it will shut the valve and do a batch correction because it will overshoot "X" gallons on first run. I wanted the PLC to correct this for every new batch being made.
At first I calculated the pulses, for example, 100 gallons was needed thus be 10000 pulses. (Math in background does this for V/V% of the calculated amounts per ingredient).
My calculation was (TargetPulses - TargetOS) = TargetConfirmed (target the valve should close ahead of time to meet the target required).
When stored pulse count reached target it will close the valve. The valve takes about 3 seconds to close. So I set a timer for 5 seconds.
PulseCount - TargetPulses for the overshoot. Then i moved that result to TargetOS. In my mind if it equalled ZERO as every batch it corrected itself. Example: 1000 pulses counted and it was 1000 pulses targeted. (1000 pulses - 1000 target = 0 overshoot). Overshoot moves to 0 thus restarting the whole cycle over and it will be off by a good amount after "x" amount of batches that passed.
Code:
Is there something I'm missing? I tried to look for batch controller code or examples but everyone uses a PID loop with control valve.
Thought I had it figured out but I came to the conclusion it would not work. Here is what I'm working with...
- 1769-L30ER
- Flow Meter with pulse output (100:1)
- Batching process (Great info on this site that helped me build this!!!)(Though for a small program I did was fine I'm going to work on SFC or SQI SQO)
I'm going to chase pulses. As the meter is counting pulses and gets to its desired goal it will shut the valve and do a batch correction because it will overshoot "X" gallons on first run. I wanted the PLC to correct this for every new batch being made.
At first I calculated the pulses, for example, 100 gallons was needed thus be 10000 pulses. (Math in background does this for V/V% of the calculated amounts per ingredient).
My calculation was (TargetPulses - TargetOS) = TargetConfirmed (target the valve should close ahead of time to meet the target required).
When stored pulse count reached target it will close the valve. The valve takes about 3 seconds to close. So I set a timer for 5 seconds.
PulseCount - TargetPulses for the overshoot. Then i moved that result to TargetOS. In my mind if it equalled ZERO as every batch it corrected itself. Example: 1000 pulses counted and it was 1000 pulses targeted. (1000 pulses - 1000 target = 0 overshoot). Overshoot moves to 0 thus restarting the whole cycle over and it will be off by a good amount after "x" amount of batches that passed.
Code:
Is there something I'm missing? I tried to look for batch controller code or examples but everyone uses a PID loop with control valve.