WC8 counter input goes berserk

LarrylLix

Senior Member
Last night in throughout the night I received four notifications of high winds from my ISY994i HA system. This is fed by he WC8 board stuffing variable data  into the ISY via it's REST  interface and using the WEBSET commands built into the WC8.
 
The counter input is fed from a dry contact anemometer  that puts out pulses at a rate of 2.5 mph = 1 pulse / second. This has been integrated over 15 second measurements and smoothed out with a time-weighted averaging algorithm.
 
Damn grid just failed and I am on battery power right now!
 
Anyway, this system has worked very well for over a year now and only notified my of high winds over 100 kph gusts a few times before. They all seemed warranted each time with severe aluminum siding rattling etc.. This is typical on this mountain.
 
This morning I investigated and reports showed wind gusts of 155 kph peak! This would have woken me up  so I investigated further.
 
WC8 status page was showing winds of 150 to 200 kph constantly. It was windy outside but  maybe about 60-70 kph would have been reasonable. I power cycled the WC8 board with a 30 second pause and the gusts speeds accumulated and reported again. I used a stopwatch and counted a few sample counter increments, hand calculating the same speeds that the PLC code was calculating. I could see the counter was moving much faster than I had ever seen before.
 
I thought maybe I had an overflow problem in some register. I went through  my math factors again but barely even 16 bits of value so that wasn't the problem.
 
I had a few factors in the UROM1-4 registers and I tried setting them to different values, saving, and them setting them back to no avail.
 
In the end I went into the PLC code page and just saved it back into the WC8 The problem went away. The counter behaved again and looked to be a reasonable rate that I have seen before, the wind speeds returned to normal being reported to ISY.
 
It would seem the input counter is based on some software that can run away or act strangely. This was most disturbing as even power cycling would not fix this problem but writing the same code just uploaded from the WC8 back to itself somehow jogged the counter input to perform as it should.
 
 
Larry,  the pulse counter on WC8 is based on a hardware counter, which counts on the pulse edge change.  I suspect the problem is somewhere extra pulse edge change gets into the IP1.  If you tested with another board or with an oscilloscope, it might disclose if the problem was inside the board or not.  Sometimes, the dry contact could have spikes, because WC8 counter input can counts up to 4MHz frequency pulses, those spike could also be counted.
 
It is really puzzling when you saved PLC code again, since that does nothing other than stop PLC execution internally and restart PLC execution.  It does not even related to the counter logic.
 
That is very puzzling.  Could that be coincident thing?  Because internal counter is a hardware counter, with the rate 2.5m/pulse rate, 60kph rate, means the hardware counter is big enough to hold pulses more than a hour before interrupt other logic to do anything.  PLC merely reads that counter value, it does not make any change to it. The hardware counter is triggered at rising edge after a falling edge.  If high wind caused some static jitter could cause the counter mis-trigger.   Don't know how your input logic circuit looks like, if that is high impedance input, it could help to add a resistor in parallel to lower its impedance, or even add a little capacitor, so that trigger pulse must wide enough to pass the filter.
 
I will have to scope the input to investigate. This has worked flawlessly for about a year now, until two nights ago. It seemed like it did the same thing last night also.
 
Checking it today it looks about correct again with appropriate counts. Winds are down to a few kph now though so perhaps with  a higher frequency the input floats and causes the voltage to be in the deadband too long and gets multiple counted. This could be some capacitance on the lines, not enough pulldown/up to make the voltage snap, and/or lack of hysteresis on the input sensing.
 
The scope will tell more once I get some energy :)
 
Back
Top