|
Hello, I am curious as to what, if anything, I can change with my code in order to produce better results. We are reading an analog input from a 1-5v pressure transmitter into our Atom, and converting it to a digital value for a display. We are using a 2000psi pressure transmitter and one of our customers is only dealing with pressures within the 0-20psi range. Our values are off from actual value by around ~3-8 psi. When dealing with such a small range of low pressure, being off by that much isn't what you would want.
Our analog input is a 1-5v pressure transmitter where 1v = 0psi, 5v = 2000 psi
ADin 28,3,AD_RON,RESULT
SLOPE = ((float sizelimit) FDIV (1023.0 FSUB 203.74068)) //sizelimit is constant 2000
OFFSET = (0.0 FSUB (SLOPE FMUL 203.74068))
READING = ((SLOPE fmul float RESULT) fadd OFFSET)
We’re having trouble getting the reading to be accurate. Our values seem to be off by 4-5psi and when well site are dealing with flow pressures between 0-20 psi; that is simply too big a deviation. I assume this may have something to do with the resolution of the ADC on the chip?
Any suggestions are appreciated.
Thanks,
|