T4 Interrupt Counter and extra pulses | LabJack
 

T4 Interrupt Counter and extra pulses

12 posts / 0 new
Last post
n5oe
n5oe's picture
T4 Interrupt Counter and extra pulses

I have a T4 setup to count pulses from a RG3 tomahawk water meter on a well. That info linked here, basic as it is: https://rg3meter.com/wp-content/uploads/2015/11/Tomahawk-07.23.15.pdf

I am currently wired into FIO4, and it is set up as an incremental counter as seen here in the screenshot:

As of this writing, you can see it has already counted 1 pulse, and the well is off, and I cleared the counter just a few minutes ago. Of note here, I also have a 4.7k pullup resistor from VS to FIO4 which helped a lot, but still getting 20-30 extra pulses a day that do NOT register on the actual RG3 tomahawk register. My voltage on the FIO4/signal wire from the tomahawk is 3.89vdc, and drops to 0vdc according to my DMM, when the well is running and the tomahawk pulses. The green signal wire from the tomahawk is on FIO4, the black common connects to GND, which as I read is common for all GND's. The cable running out to the tomahawk is sheilded 16g twisted pair with a drain wire that is connected to ground of my NEMA 4 box bus. ALL my signal wires are hooked up in this fashion for ground, and these are only terminated on one end, and that is inside the NEMA 4 monitoring cabinet.

I have tried hooking this same sensor wire from the tomahawk into a Sensaphone Web600 set to read pulse as well, and I never get any extra pulses during off-time like I do on the T4? I need to move everything to the T4 and take out the Sensaphone as all 6 of my I/O ports there are full.

I have tried setting some debounce settings as is in the manual, but understand that this well at peak performance is only about 5 gallons per minute, thus the maximum pulse rate I ever get is one about every 10-12 seconds. When the well is on, and I zero the T4 before activating the well, it counts perfectly with the tomahawk for hours and when the well stops, the T4 matches in gallons/pulses BUT over the next few hours the T4 gains pulses and the tomahawk never registers. We do not use the well that often, it my only run a few hours a day, and the rest of the time it sets idle, but across a week or two, the T4 at present setup will register hundreds more pulses during this off time collectivly.

My next move is to try and build a filter, one with a 1uf capacitor as seen in the docs here:

Question is, is this a eloctolytic capacitor or ceramic? I ordered a kit of ceramics before posting here.

The atached picture is what I have for now, lacks a little profesionalism, but not bad for a volunteer remote monitoring system for a very small water corp:) EIO4 and EIO5 are sensing our booster pumps through a current switch from automation direct, these work flawlessly and that GND is common for everything needing GND and bused together seperate from the wiring earth ground in green on the DIN rail which too is bused together as mentioned earlier for my drain wire terminations.  Might I remove that cable and put it on the GND closest to FIO4?? Their the same right?

Any and all help is appreciated.

 

 

 

LabJack Support
labjack support's picture
Indeed the doc you linked

Indeed the doc you linked tells us pretty much nothing about the electrical details of the signal.

If time permits I would suggest the following test to try and see if the false signal is coming on the signal wire, through the air, or somewhere else.  Remove your signal wire and instead to the following variations and see if you still get counts while idle:

1.  Nothing connected.
2.  Shorted to VS.
3.  Shorted to GND.
4.  4.7k to VS.
5.  4.7k to GND.

 

Any type of cap is generally fine for a filter, but ceramics are the best.  Since your pulse rate is so slow you might be able to use a huge cap, but we need to know a little more about your signal.  You said your signal is normally high and has a low pulse at a max pulse rate of about 0.1 Hz.  What is the width of that low pulse?  We need an idea of your minimum pulse width.

 

n5oe
n5oe's picture
Thank you for the comment and

Thank you for the comment and quick response.

I have already tried a few of the several suggested trials above, (1) The 4.7k hooked onto the VS and FIO4, with no signal wire attached from the tomahawk. That proved to NOT register any pulses over nearly a 24 hour period. (2) Nothing connected, same result, zero pulses recorded or seen over a day. And (3) I thought maybe it was a supply voltage issue, maybe drooping when a pump came on or another well, so I hooked up a 4.7k resistor from VS to AIN0 and logged that with Node-Red. The second a false pulse came in, it tagged the AIN0 voltage along with it and no luck, voltages on the T4 remained steady at 5.043-5.046vdc right close to each false pulse.

I cannot see or figure out what the differance is from the T4 and the Web600. Literally the signal cable was disconnected from the Labjack, swung over about 12 inches within the same enclosure and hooked into the Web600 and it worked without extra pulses for a day. Drain wire remained on the same bus, the black and green of the tomahawk sensor wire attached into the Web600 + and - ?? Same environment, same enclusure.

I have an email into Sensaphone for schematic info on their internals (not hopeful there) and an email back to RG3 asking more about the internals of the meter and if indeed it is a NPN open collector etc etc. Will post back with those findings as well.

Once the capacitors come in, I will try that for a day, and if no success, will swap over to something like FIO6 or FIO7 to try something else.

Attached is a full shot of the enclosure box with both the T4 and Web600.

 

File Attachment: 
LabJack Support
labjack support's picture
So it sounds like the false

So it sounds like the false edges are actually coming in on your signal wire.  Whether they are sent by the meter, or somehow induced into the wire between the meter and the T4, we are not sure.  I would say rather than worrying about that too much you just try the filter and see if that does the trick.  Your link was missing in your original post ... what filter are you planning to try?

The likely difference between the T4 and the Web600 is speed or filtering.  The T4 counters are very fast and will detect very fast pulses (including noise and transients in some applications, whereas the Web600 might be much slower and not detect brief transients.

n5oe
n5oe's picture
Thanks for the replies. I

Thanks for the replies. I will head down there this weekend and spend some more time testing. I found in the T-series datasheet about measuring pulse width, and will try to get that info back to this topic as well. The filter was one I also found in the T-series datasheet and it is the attached picture on the first post , titled Passive_Hardware_Filter.png. The forum form took inline copy/paste of pics but guess they did not actually process, so I went back and edited the original post and added a couple more pictures.

Makes good sense on the differance with speed and/or filtering differances with the T4 vs Web600. Since last posting, I too was looking into building an outboard ciruit of some sense with opto-isolaters. Sounds like a good thing to do anyway once I get this dialed in a little more. Thinking about these for this counter as well??

 

File Attachment: 
LabJack Support
labjack support's picture
Measuring the low-time would

Measuring the low-time would be ideal, but you can always just try different filters and see if any caps are so big that you no longer register counts at all.

An opto might help, but on the other hand if it is also fast like the T4 it might transfer the transient across the optical barrier.

 

n5oe
n5oe's picture
I was able to run down to the

I was able to run down to the remote site Satruday and do some investigating. As mentioned in the post just above this one, turns out that the 1uf cap very well may be to big big. I missed 2475 gallons/pulses completly as the register on the T4 only saw one of those:) Unfortunatly I did not have with me the capacitor kit to change values there, but did have my resistor kit. I changed the 1k heading out to the sensor to a 500k with the mindset this would help drop the seen voltage on the input by creating more current (10ma?) thus drooping the voltage? I did not have time do any testing to determine the width of the low pulse as suggested, but will keep that on the schedule of to-do's. As for false pulses, so far this setup has eliminated those, but it eliminated the true ones too :) For now, if I miss the next run of the well, my next move will be too replace the 1uf cap with a 470nf, the next closest half value in my cap kit ??

LabJack Support
labjack support's picture
Dropping the resistor from 1k

Dropping the resistor from 1k to 500 ohms will cut your cutoff frequency in half, but if you are now getting no counts I would do bigger drops.  Stick with the 1k resistor, but try caps of 1 uF, 100 nF, 10 nF, 1 nF and 0.1 nF.  Try 0.1 nF next to see if you get your normal counts.  If you do try the others to see where you stop getting counts and then can use a cap well less than that.

 

n5oe
n5oe's picture
Some progress but still

Some progress but still getting a few dribble false pulses. I did hear back from RG3, and they said the tomahawk needs a minimum pulse width of 10ms. The smallest capacitor I have at the moment (that has been tried) is 100nF, and that has not allowed true pulses through either. The fastest pulse rate this particular setup will ever see is 1 pulse every 10 seconds (0.1Hz?)  I do have in my kit box, a 33pF cap if that could be factored in.

So far, the best luck I have had is building a filter (exactly as it showed above with 22k, 1uF, and 1K) for each of the other two current sensing solid state relays to EIO4 and EIO5 from our booster pumps, AND adding a wide band ferrite onto the signal wire coming from the tomahawk pulse meter. 

Will be ordering a smaller capacitor kit, a set hopefully from 100nF down to continue the testing, but would like to have better values dialed in to test with. Thanks again,

 

LabJack Support
labjack support's picture
they said the tomahawk needs

they said the tomahawk needs a minimum pulse width of 10ms

When they say "needs" it sounds like they are telling you the minimum required on their counting inputs.  What we really want to know the minimum pulse width of the signal, according to whatever produces the signal.

Reading back through these posts, I am not totally clear what is producing the pulses, and then what besides the T4 is counting the pulses.

What is powering the device that creates pulses, or does it not need power?

Do you connect the T4 and other counters at the same time so you can compared the counts?

You have mentioned adding a pull-up resistor.  Is this recommended by the whoever is producing the pulses?  Can you get electrical details on the pulse signal?  Is it open-collector NPN or perhaps driven (push-pull)?

 

What we can do is calculate a filter such that the  minimum pulse width for the T4 counter input is also 10 ms just like the tomahawk, so lets target a cutoff frequency around 100 Hz.  The cutoff frequency is 1/2piRC, so with R=1000 and C=1uF you are at 159 Hz which is pretty close to the target.

The filter drawing you posted is geared for a mechanical switch.  Also, we don't want to add a pull-up if your device output is a driven signal.  Try a normal filter of 1k in series with FIO4, with 1uF from FIO4 to GND, with nothing else.

 

n5oe
n5oe's picture
Yes, that was my assumption

Yes, that was my assumption from "needs" 10ms too. Getting exact info from the maker of the meter has been really tough, and I understand they want you to use "their" controllers-counters-software and that the market for this is small but cempetitive.

I was told by the manufacturer/engineer, that pull-up resistors could be used, suggested were 4.7k and 10k as needed. I also was told this is a NPN open collector, and 5vdc was fine to use. The meter itself has a built in battery and LCD screen which registers total gallons, GPM, direction of flow, and causes the pulse every 1 gallon of throughput, etc. However, my access remotely through these signal wires etc is ONLY a pulse. Therefor getting all the "true' pulses and nothing else is critical for me to be able to re-produce the GPM, total register count etc remotely.

The T4 is the only thing tied to the meter receiving pulses. I am accessing the T4 through Node-Red, polling the T4 via modbus-tcp for the counter numbers and the state of several other I/O's as either high or low. Node-Red takes this data, converts to GPM, tallies register numbers and indicates when other devices are either are on or off. I use Kipling for accessing the dashboard or register matrix to view/check for these stray pulses on the meter.

Yes, the filter I originally posted was for a mechanical switch, and thought a RC filter was what I was trying to duplicate. Close but not the same, the Capacitor needs to be grounded. One of the attached pictures is what I have come up with this weekend as for a working RC filter for the meter. "Working" in the sense, I do get pulses on the T4 when the well is on, as before any combination of .1uf, .01uf, and various resistors in series would stop the stray pulses, but also NOT register any true pulses. This RC-filter is using a 4.7k pullup and a 33pf ceramic cap. No series resistor to the meter input. While at the well and my laptop logged into the T4, it was counting fine, and over the course of nearly two hours now, NO stray pulses :) Holding my breath for another 24 hours though.

You said "What we can do is calculate a filter such that the  minimum pulse width for the T4 counter input is also 10 ms just like the tomahawk, so lets target a cutoff frequency around 100 Hz.  The cutoff frequency is 1/2piRC, so with R=1000 and C=1uF you are at 159 Hz which is pretty close to the target." Unfortunatly that is one of several combinations that I tried earlier, and again no stray pulses were seen, but no true ones came though either. 

I also built a small homemade RC-filter module that plugs into the T4 to help filter the inputs coming back from our current sensing switches on our booster pumps. This was discussed earlier, and I think it has helped. Prior too, 20-50 stray pulses a day, and now down to only 5-10 pulses a day on the counter. That picture is attached as well.

Thanks for the response and continuing to help.

 

LabJack Support
labjack support's picture
Your screenshot-1 has a 33pF

Your screenshot-1 has a 33pF cap from DI to GND and a 4.7k pull-up from DI to VS.  The cap forms a very very high speed filter with the resistance of your signal wire.

The fact is that a 1k 1uF cap should pass a pulse of 10 ms or longer.  I think you need an oscilloscope to figure out what is happening there and look at the actual signal.  You could try running a jumper from the DI to an analog input and then run LJStreamM to acquire data (at up to 50 ksamples/second) and see what the signal looks like.

One comment is that 4.7k is a very strong pull-up.  With such a strong pull-up it should take a very very strong transient to cause a false pulse.  Makes me suspicious that we are missing a fundamental detail in your signal or setup but I don't know what it might be from my remote perspective.