Page 1 of 15

Re: Hydreon double tips

Posted: Wed Jun 20, 2012 3:10 pm
by steve
Manual gauge 6.7mm
RG-11 7.4mm

FO tipping bucket 6.0mm
RG-11 (Cumulus) 11.2mm
I wonder why there's such a large discrepancy between the two RG11s? It's possible that Cumulus is getting false tip indications, or it could simply be a bug - but the code is very simple. If your turn on the debug log, it will log a message each time DSR changes, and it should be adding the configured amount each time DSR goes 'on'. You may be able to tell from the timestamps of the log messages whether it looks reasonable or not.

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 3:28 pm
by apenwith
Hi Steve
I've put the debug log on but now it has stopped raining - the odd thing is when I had the RG (which is now by the manual gauge) up on the flat roof it also read very high which I put down to the wind but today has very light winds. Is it possible Cumulus is seeing the RS232 status change not just an 'ON'.
Regards
Alan

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 3:32 pm
by steve
apenwith wrote:Is it possible Cumulus is seeing the RS232 status change not just an 'ON'.
It gets informed whenever DSR changes, with an indication of whether it's gone on or off - in theory. You should see this in the debug log when you next get some rain. It adds a tip only for the 'on' notifications.

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 3:46 pm
by apenwith
Hi Steve

Rain again so here is the debug

Regards
Alan

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:09 pm
by steve
It looks like each 'tip' is toggling DSR twice:

2517.7407 : 16:28:38 RG11 port DSR change: On
2517.7501 : 16:28:38 RG11 port DSR change: Off
2517.7501 : 16:28:38 RG11 port DSR change: On
2517.7501 : 16:28:38 RG11 port DSR change: Off

2527.0353 : 16:30:11 RG11 port DSR change: On
2527.0462 : 16:30:11 RG11 port DSR change: Off
2527.0462 : 16:30:11 RG11 port DSR change: On
2527.0462 : 16:30:11 RG11 port DSR change: Off

2541.1081 : 16:32:31 RG11 port DSR change: On
2541.1175 : 16:32:31 RG11 port DSR change: Off
2541.1175 : 16:32:31 RG11 port DSR change: On
2541.1175 : 16:32:31 RG11 port DSR change: Off

Is this the expected behaviour?

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:15 pm
by apenwith
Hi Steve

I would not expect that - it would only happen if the tips happened twice in one second but by observation that was not the case.

Regards
Alan

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:18 pm
by steve
Do you have the mystery capacitor fitted that was the subject of some discussion the other day? I wonder if you are getting contact bounce?

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:23 pm
by apenwith
Hi Steve

I forgot to mention but I am pretty sure the relay closes for 50ms - I don't know how often Cumulus checks the DSR but that might explain it.
No - I didn't put the capacitor in.
When I had the data logger in use it was checking the status 4 times per second so I think it would have picked up a bounce.

Regards
Alan

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:28 pm
by steve
apenwith wrote:I forgot to mention but I am pretty sure the relay closes for 50ms - I don't know how often Cumulus checks the DSR but that might explain it.
It doesn't check at all, it gets an event message when it changes state. So it appears that it's going on-off-on-off each time.

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:44 pm
by apenwith
Hi Steve
I have checked more of the debug log and the 4 entries always happen - I wonder if it is the way the USB ports are handled - presumanbly they are polled in some way (out of my depth here - just guessing) . I think it looks as though it would be safe just to ignore duplicates.
Regards
Alan

Re: Hydreon RG-11 Results

Posted: Wed Jun 20, 2012 5:52 pm
by apenwith
Hi Steve
I was hoping this thread would be for comparing results only so would it be possible to move all the over-reading discussion to the 'connecting' thread.
Regards
Alan

Re: Hydreon double tips

Posted: Wed Jun 20, 2012 6:25 pm
by steve
It's not easy to detect duplicates, I'd have to start comparing timestamps and applying a threshold etc. Assuming it's consistent, the easiest work around is to halve your rain tip setting.

Re: Hydreon double tips

Posted: Thu Jun 21, 2012 8:38 am
by apenwith
Hi Steve
I think my guess might be right - it seems that Windows polls the USB posts at 125Hz - once every 8ms so during the 50ms relay closed windows could be seeing the relay position up to 6 times. So this might only be a function of the USB/Serial adapter - direct RS232 might be different. I think it is also possible that the relay time might vary from unit to unit so a shorter time than 50ms could explain the 4 changes rather than 6. It will be interesting to see what others find with both adapters and serial ports.

If all this is correct the work around of changing the bucket size could be the only way to fit everybody.

The latest build is now installed - many thanks from me also.

Regards
Alan

Re: Hydreon double tips

Posted: Thu Jun 21, 2012 8:50 am
by steve
apenwith wrote:I think my guess might be right - it seems that Windows polls the USB posts at 125Hz - once every 8ms so during the 50ms relay closed windows could be seeing the relay position up to 6 times. So this might only be a function of the USB/Serial adapter - direct RS232 might be different. I think it is also possible that the relay time might vary from unit to unit so a shorter time than 50ms could explain the 4 changes rather than 6.
But the 4 events that Cumulus gets are on-off-on-off. It gets called when the state changes. If it was simply a function of how often the port was being polled, how does that account for the 'off' event in the middle? The only explanation that makes sense to me is that the relay is actually closing twice in quick succession, e.g. because of contact bounce.

Re: Hydreon double tips

Posted: Thu Jun 21, 2012 9:21 am
by apenwith
Hi Steve
I see your point unless Windows in its infinite cleverness assumes the opposite must be the case. Would it be possible to ignore messages for 75ms after a first message in the software.
Incidentally the use of a capacitor is normally to stop any relay arcing - a debounce circuit is a bit more complicated.
Regards
Alan