Go to Post Show me the mentor who has never built a bad robot and I'll show you either a new mentor, a liar, or Andy Baker. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
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-03-2014, 13:19
Fej Fej is offline
Registered User
FRC #1672
 
Join Date: Jan 2014
Location: Mahwah, NJ
Posts: 8
Fej is an unknown quantity at this point
VEX Ultrasonic Sensor not functioning

Hey guys.

For a while, we have been trying to get the VEX Ultrasonic Rangefinders to work. We're pretty sure they were plugged in correctly - one digital input and one digital output on the digital sidecar - but we swapped them anyway just to be sure. No dice. We flipped the connectors themselves as well, still nothing. The output changed from zero to infinity, though.

The code is in Java, and it's very simple. We just create an instance of Ultrasonic with the digital input/output pins as arguments, and then put getRangeInches() in the command loop.

Is there anything you guys can think of that we may have done wrong?

Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 12-03-2014, 13:45
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: VEX Ultrasonic Sensor not functioning

The code and wiring should be pretty straightforward. Can you show us the relevant part of the program, and a picture of how the sensor is connected?
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2014, 16:26
Fej Fej is offline
Registered User
FRC #1672
 
Join Date: Jan 2014
Location: Mahwah, NJ
Posts: 8
Fej is an unknown quantity at this point
Re: VEX Ultrasonic Sensor not functioning

The connector labeled INPUT is plugged into digital I/O pin 2. OUTPUT is plugged into pin 1. Wires are black to black.

Constants:

Code:
public final int[] ULTRASONIC_PING_CHANNELS = {1, 3}; //The digital output channels where the cRIO sends a signal to the utrasonic sensor
public final int[] ULTRASONIC_PONG_CHANNELS = {2, 4}; // The digital input channels where the cRIO reads the output from the ultrasonic sensor
In the Robot() constructor:

Code:
leftSensor = new Ultrasonic(ULTRASONIC_PING_CHANNELS[0], ULTRASONIC_PONG_CHANNELS[0]);
leftSensor.setEnabled(true);
leftSensor.setAutomaticMode(true);
rightSensor = new Ultrasonic(ULTRASONIC_PING_CHANNELS[1], ULTRASONIC_PONG_CHANNELS[1]);
rightSensor.setEnabled(true);
rightSensor.setAutomaticMode(true);
Called every loop in operatorControl():
Code:
private void storeUltrasonicDistances() {
ultrasonicDistances[0] = leftSensor.getRangeInches();
ultrasonicDistances[1] = rightSensor.getRangeInches();
}
We're using SimpleRobot.

Since we don't know whether to plug the INPUT plug into the ping port and the OUTPUT plug into the pong port or vice versa, we tried both combinations (to no avail).

Thanks!

Last edited by Fej : 12-03-2014 at 16:28.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-03-2014, 12:01
Fej Fej is offline
Registered User
FRC #1672
 
Join Date: Jan 2014
Location: Mahwah, NJ
Posts: 8
Fej is an unknown quantity at this point
Re: VEX Ultrasonic Sensor not functioning

Bump.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-01-2015, 16:33
FurryFaust's Avatar
FurryFaust FurryFaust is offline
Registered User
FRC #0334
 
Join Date: Nov 2014
Location: Brooklyn, New York
Posts: 4
FurryFaust is an unknown quantity at this point
Re: VEX Ultrasonic Sensor not functioning

I am having the same issue so bump.
Reply With Quote
  #6   Spotlight this post!  
Unread 14-01-2015, 19:43
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,392
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: VEX Ultrasonic Sensor not functioning

The "input" of the sensor is what you trigger to send out the pulse.

The "output" of the sensor is what the time loop is looking for.

You need to have the white wire connected since that's the signal wire. Red is power, black is ground

In your example the sensor input would be 1,3. Output on 2,4
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
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 21:49.

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