have a CTU of rising edges with a preset of 5, and it's counter.DN bit resets itself (after the falling edge e.g. [XIC counter.DN XIO photo_eye RES counter]).
at 100part/minute or more it will take less than 3s to count to 5.
at 75part/minute or more it will take less than 4s to count to 5.
less than 75part/minute it will take 4s or more to count to 5.
Have two TONs: ton075 with a .Preset of 4s and and ton100 with a .Preset of 3s, both running when [XIO counter.DN] (you might need something else to ensure the timer restarts on the rising edge of the counter.DN, and does not have to wait until it goes back to 0 e.g. [BST XIO counter.DN NXB counter.CU BND TON ...]?).
Every time it counts to 5 i.e. every time counter.DN is 1
- XIC counter.DN
- BST XIO ton100.DN OTE full_choke
- NXB XIO full_choke XIO ton075.DN OTE half_choke
- BND
Obviously you can play with the count and times, and put in some hysteresis (Start/Stop ladder logic pattern), so if does toggle full choke because of noise near 100ppm.
this could also be done with a single timer with a very long .Preset, and then you check the .Accumulator value when counter.DN is 1; implementing hysteresis around the break points might be easier this way; or .Accumulator value could be linear with %choke.