Go to Post I openly admitted to using IE at robotics last year and recieved a major lashing for such blasphemy. Then I downloaded Chrome. - jwallace15 [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 13-02-2014, 14:16
AIS Falcons's Avatar
AIS Falcons AIS Falcons is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: Israel
Posts: 14
AIS Falcons is an unknown quantity at this point
Analog Sensors Returning Incorrect Voltages

Hey all,

Today we were adding our sensors to the robot and started testing out code and we discovered the they were returning near zero voltages from the getAverageVoltage() method.
Code:
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.23009997599999998
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.24552717599999999
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.240384776
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.214672776
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.101539976
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.142679176
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.122109576
[cRIO] Ultrasonic: -0.0014189800000000002
[cRIO] Potentiometer: 0.106682376
Does anyone have an idea as to why this is happening? We wired them right as far as we know and the Analog Breakout has power. We were also adjusting the sensors correctly.

Thanks for any help
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2014, 14:19
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,590
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: Analog Sensors Returning Incorrect Voltages

Are you sure you didn't plug them in backwards?
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2014, 14:21
vgdude999 vgdude999 is offline
Programmer/Driver
FRC #1751 (Comsewogue Warriors)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Port Jefferson Station, NY
Posts: 25
vgdude999 is an unknown quantity at this point
Re: Analog Sensors Returning Incorrect Voltages

I had a similar problem with an ultrasonic, but that was a few weeks ago and I forget exactly how I fixed it. I think I had some code in the wrong place... It might help if you posted your code so we could take a look at it.
__________________
2013: Rookie year, programmer-in-training; SBPLI Regional Finalists
2014: Co-Captain, Programmer, Driver; Seeded 15th
2015: Co-Captain, Programmer, Driver
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2014, 11:06
AIS Falcons's Avatar
AIS Falcons AIS Falcons is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: Israel
Posts: 14
AIS Falcons is an unknown quantity at this point
Re: Analog Sensors Returning Incorrect Voltages

Thanks!

Our Analog Breakout seemed to be labeled wrong and the Potentiometer now works fine. However; the ultrasonic returns either a constant voltage of 3 with one orientation or a voltage ranging from 0-1. We are using the basic MaxSonar analog ultrasonic sensor.

Any information would be incredibly beneficial.

Thanks,

Team 4338
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2014, 11:51
dvanvoorst dvanvoorst is offline
Registered User
FRC #2771 (Code Red)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Grand Rapids, MI
Posts: 66
dvanvoorst is an unknown quantity at this point
Re: Analog Sensors Returning Incorrect Voltages

I'm not sure about an analog ultrasonic sensor, but the digital ones require you to tell it when to ping. With the Ultrasonic object, you can turn on an "automatic mode" that will continuously ping.

Code:
us = new Ultrasonic(2,3);
us.setAutomaticMode(true);
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2014, 12:03
AIS Falcons's Avatar
AIS Falcons AIS Falcons is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: Israel
Posts: 14
AIS Falcons is an unknown quantity at this point
Re: Analog Sensors Returning Incorrect Voltages

If I remember correctly ping isn't a factor in an analog object (correct me if I'm wrong). The analog channel class has no method for setting ping. We tested with a multimeter and the sensor was receiving 5 volts when ground and +5 were tested. The AN return a near 0 voltage as before. We are getting correct readings from the pot so I can only assume something is wrong with either the sensor itself or the signal wiring.

Thanks

Last edited by AIS Falcons : 14-02-2014 at 12:24.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2014, 13:40
feverittm's Avatar
feverittm feverittm is offline
Registered User
FRC #0997 (Spartans)
Team Role: Mentor
 
Join Date: Apr 2010
Rookie Year: 2010
Location: Corvallis, OR
Posts: 122
feverittm will become famous soon enoughfeverittm will become famous soon enough
Re: Analog Sensors Returning Incorrect Voltages

Remember that the analog voltage is just proportional to the distance. Does it change with distance to the sensor?

I am assuming you are using the LV series sensor and have read the datasheet and the application notes for the sensor (I know because we screwed up at first too).

http://www.maxbotix.com/documents/MB1000_Datasheet.pdf

Enjoy!
__________________
Floyd Moore
Mentor Electrical and Pneumatics
Team 997 - Spartan Robotics
Corvallis High School, Corvallis Oregon
Reply With Quote
  #8   Spotlight this post!  
Unread 15-02-2014, 06:31
AIS Falcons's Avatar
AIS Falcons AIS Falcons is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: Israel
Posts: 14
AIS Falcons is an unknown quantity at this point
Re: Analog Sensors Returning Incorrect Voltages

Thanks, we figured it out! The sensor is now working perfectly fine with further testing it should be great!
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 13:23.

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