PLUS+1 Software > Sub System Applications

Flow Meter Integration

(1/4) > >>

Fitzsimmons Hydraulics:
I am trying to interpret a flow meter signal with a micro controller. The pulse rate/gallon is known.

I have written some code for this application, but its not picking up the signal. I have wired one side of the flowmeter to the micro input. The other wire is grounded.

Can anyone share their experiences with incorporating flow meters into the Plus+1 environment?

I have included a snapshot of what I am doing with the frequency signals. pinconfig0=0, pinconfig1=0 for both inputs. The service tool can't seem to pick up the frequency. Any suggestions?

BRIan:
I assume you are not getting a Freq when you check with the service tool. This may be due to NPN output rather than PNP. Just change the PinConfig on the input and recheck.

Jakob:
Good point BRIan.

If you do see the frequency on the input pin, but nothing comes out to you CAN-data.
I suspect the value is lost due to being multiplied with 0,00112485, and then multiplied with 60 rather than just dividing the input with around 14.

Fitzsimmons Hydraulics:
BRIan, I will have to try it out today. Just wanted to make sure my wiring logic was correct. There doesn't seem to be a specific polarity to either pin.

Jakob, I have run into this before with a SDT sensor and temperature output. Assuming I can get the input fixed and the signal reaches the mathematical logic, and my code creates trouble, would it be better to just use a scale function?

oiltronic:
Left side of the oil flowmeter code shows 1 divided by 216.  Plus+1 is all integer math, so the result is zero, which will result in zero gallons coming out of the next multiplication.

Left side of the glycol flowmeter code shows 889005 divided by 1000, which is just 889, no decimal point due to integer math.  If you want high accuracy you'll need to make it u32 and work with milli-gallons (i.e. gallonsx1000, fixed-point integer math), then save that division for later, like before it's shown on a screen (when you create two separate numbers for the values for before & after the decimal).

For math like a gpm flow rate you might want to switch all the math to u32, multiply by 60 and by your conversion rate first, and divide by 1000 or whatever scaling factor last, before changing back to desired data size.  Otherwise your gpm will always be some multiple of 60 (0, 60, 120, etc).

What is your expected frequency?  I see you're using the IO bus, meaning the signal is coming from a remote I/O unit, correct?  Which one?  Check the hardware spec for the frequency and period limitations for that particular pin.  I had a particularly slow pulse where I ended up using the period input instead, and really slow ones used my own direct period measurement.

To test just the signal I have forced some speed sensors and paddle wheels to the on-state and looked for the signal with the service tool.  At least one has required a goofy external pull-up resistor (internal microcontroller one was too weak).

Navigation

[0] Message Index

[#] Next page

Go to full version