Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Pressure Sensor (http://www.chiefdelphi.com/forums/showthread.php?t=109839)

1757 12-04-2012 02:55 PM

Pressure Sensor
 
Hi my team recently ordered one of these:

http://www.digikey.com/scripts/DkSea...rds=734-1003-N

I'm wondering where to start coding this. If someone could provide a java example of how to get it to display the current psi in the system that would be great. Any help is greatly appreciated! Thank you!

1757 12-04-2012 03:27 PM

Re: Pressure Sensor
 
Edit: I found out it's an analog module. Problem is it's saying it's protected and shows an error when I write
pressure = new AnalogModule(1);
in the robotInit().
Any more help would be appreciated.

Mark McLeod 12-04-2012 03:28 PM

Re: Pressure Sensor
 
I won't be much help, since I don't know the Java libraries well.
I do own several of these sensors though and have used them in competition.

This sensor connects to an Analog input and is read using the Java equivalent of Get Voltage.

The voltage (0-5v) will need to be converted to psi if you want a human readable value. To derive the equation you can start with a series of psi readings from a pressure gauge while noting the corresponding voltage reading (just dump the raw voltage to the screen or a print). Then to calculate a best curve fit you can use the LINEST function in Excel. For LINEST highlight two cells and SHIFT/CTRL+ENTER to get both the slope and the y-intercept.

psi = analog_reading *slope + y-intercept
The sensors have slight reading differences between them, but we used the following for our robot this past season:
psi = voltage *29.5433-10.4115 (this was for a different model, so the numbers will be different)

Joe Ross 12-04-2012 04:15 PM

Re: Pressure Sensor
 
You would use the getVoltage method of the AnalogChannel class.

Mark McLeod 12-04-2012 06:00 PM

Re: Pressure Sensor
 
Quote:

Originally Posted by 1757 (Post 1198651)
Edit: I found out it's an analog module. Problem is it's saying it's protected and shows an error when I write
pressure = new AnalogModule(1);
in the robotInit().

It isn't an AnalogModule.
An analog module is a box that plugs into the cRIO chassis in the first slot. An Analog breakout circuit board plugs into that, then the pressure transducer, an analog sensor, plugs into one set of the available analog breakout pins.


All times are GMT -5. The time now is 09:02 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi