Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Analog Sensors Returning Incorrect Voltages (http://www.chiefdelphi.com/forums/showthread.php?t=126397)

AIS Falcons 13-02-2014 14:16

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

Joe Ross 13-02-2014 14:19

Re: Analog Sensors Returning Incorrect Voltages
 
Are you sure you didn't plug them in backwards?

vgdude999 13-02-2014 14:21

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.

AIS Falcons 14-02-2014 11:06

Re: Analog Sensors Returning Incorrect Voltages
 
Thanks!

Our Analog Breakout seemed to be labeled wrong :confused: 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

dvanvoorst 14-02-2014 11:51

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);


AIS Falcons 14-02-2014 12:03

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

feverittm 14-02-2014 13:40

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!

AIS Falcons 15-02-2014 06:31

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!


All times are GMT -5. The time now is 11:34.

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