Go to Post Fun and adrenaline make you waaaaaaaay better at robotics. Proven fact. - Matt Krass [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-04-2012, 02:55 PM
1757 1757 is offline
Registered User
FRC #1757
 
Join Date: Oct 2012
Location: Westwood
Posts: 27
1757 is an unknown quantity at this point
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!

Last edited by artdutra04 : 12-04-2012 at 03:03 PM. Reason: link wasn't properly formatted, I fixed it. :)
Reply With Quote
  #2   Spotlight this post!  
Unread 12-04-2012, 03:27 PM
1757 1757 is offline
Registered User
FRC #1757
 
Join Date: Oct 2012
Location: Westwood
Posts: 27
1757 is an unknown quantity at this point
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-04-2012, 06:00 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,697
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Pressure Sensor

Quote:
Originally Posted by 1757 View Post
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 12-04-2012, 03:28 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,697
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 12-04-2012 at 05:59 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-04-2012, 04:15 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,547
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Pressure Sensor

You would use the getVoltage method of the AnalogChannel class.

Last edited by Joe Ross : 12-04-2012 at 06:32 PM. Reason: fix typo
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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