Go to Post If we're engineers, I feel we shouldn't be content with the what without the why... - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 01-12-2018, 09:12 PM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Exclamation VEX digital ultrasonic range finder issue

I'm trying to use a Vex ultra sonic range to detect obstacle but I can't get any value from the sensor except 0.0


I Instantiated the Ultra sonic object in my code by giving as parameters the ports number where the Range finder is connected

But when I call the method getRangeInches I still got 0.0

Can someone help me ?
Reply With Quote
  #2   Spotlight this post!  
Unread 01-12-2018, 09:19 PM
pkrishna3082's Avatar
pkrishna3082 pkrishna3082 is offline
love/hate relationship with swerve
AKA: Parthiv Krishna
FRC #3082 (Chicken Bot Pie) and FTC #13471 Mentor (Minnetonka)
Team Role: Programmer
 
Join Date: Mar 2017
Rookie Year: 2016
Location: Minnetonka, MN, USA
Posts: 311
pkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond repute
Re: VEX digital ultrasonic range finder issue

Do you have a picture of the wiring we can look at?
__________________
My posts constitute my opinions, and mine alone, and are not representative of the views held by my team.
2010-2011: FLL 11083, 13873 (Minnetonka Silver) - Programmer
2016-: FRC 3082 (Chicken Bot Pie) - Captain (2+ yrs), Programming Lead (3+ yrs), Driver (2+ yrs), Operator (1 yr), 2017 Dean's List Finalist
2017-: FTC 13471 (Minnetonka/Tater Bot Hot Dish) - Mentor
2017-: FIRST Volunteer - 2017 North Champs Student Ambassador
Reply With Quote
  #3   Spotlight this post!  
Unread 01-12-2018, 09:24 PM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Re: VEX digital ultrasonic range finder issue

no the robot stayed at the school but I get the Output cable connected to DIO port 0 and the Input cable connected to DIO port 1


and instantiated my object like this :
static Ultrasonic rangefinder = new Ultrasonic(0,1);
Robotmap.rangefinder.setAutomaticMode(true);
Reply With Quote
  #4   Spotlight this post!  
Unread 01-12-2018, 09:34 PM
pkrishna3082's Avatar
pkrishna3082 pkrishna3082 is offline
love/hate relationship with swerve
AKA: Parthiv Krishna
FRC #3082 (Chicken Bot Pie) and FTC #13471 Mentor (Minnetonka)
Team Role: Programmer
 
Join Date: Mar 2017
Rookie Year: 2016
Location: Minnetonka, MN, USA
Posts: 311
pkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond repute
Re: VEX digital ultrasonic range finder issue

Quote:
Originally Posted by Jude99999 View Post
no the robot stayed at the school but I get the Output cable connected to DIO port 0 and the Input cable connected to DIO port 1


and instantiated my object like this :
static Ultrasonic rangefinder = new Ultrasonic(0,1);
Robotmap.rangefinder.setAutomaticMode(true);
I am assuming you are talking about this one: https://content.vexrobotics.com/docs...instr-0312.pdf

In that case, the INPUT and OUTPUT cables seem to refer to the input and output to the rangefinder. Those should be swapped on the Rio, since output from rio = input to range finder and vice versa. Your instantiation seems to declare 0 as the Output from the Rio (INPUT to rangefinder) and 1 as the Input to Rio (OUTPUT to rangefinder). I might be mistaken, but maybe try swapping these either in code or in wiring?
__________________
My posts constitute my opinions, and mine alone, and are not representative of the views held by my team.
2010-2011: FLL 11083, 13873 (Minnetonka Silver) - Programmer
2016-: FRC 3082 (Chicken Bot Pie) - Captain (2+ yrs), Programming Lead (3+ yrs), Driver (2+ yrs), Operator (1 yr), 2017 Dean's List Finalist
2017-: FTC 13471 (Minnetonka/Tater Bot Hot Dish) - Mentor
2017-: FIRST Volunteer - 2017 North Champs Student Ambassador
Reply With Quote
  #5   Spotlight this post!  
Unread 01-12-2018, 09:40 PM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Re: VEX digital ultrasonic range finder issue

Yes I'm talking about this one, I tried to swap them a couple of times, tomorrow I will retry.

Ugh this thing is driving me crazy!!!!!!!!!!
Reply With Quote
  #6   Spotlight this post!  
Unread 01-13-2018, 10:11 AM
Dave Campbell's Avatar
Dave Campbell Dave Campbell is offline
Miami Valley Planning Committee
FRC #0144 (ROCK Robotics)
Team Role: Teacher
 
Join Date: Dec 2003
Rookie Year: 1999
Location: Cincinnati
Posts: 195
Dave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant futureDave Campbell has a brilliant future
Re: VEX digital ultrasonic range finder issue

The WPILib VI we used last year for that exact sensor 'bricked' our roboRio twice. We can not recommend using that sensor with LabView, nor the sensor. For details, PM me and I can have our programmer give you extensive info.

Just to be clear - we love the sensor, VEX products are great, just not how it killed our Rio...
__________________
"Great spirits have always encountered violent opposition from mediocre minds." - Albert Einstein

FRC Team #144 Advisor

Last edited by Dave Campbell : 01-13-2018 at 01:53 PM.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-13-2018, 05:38 PM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Exclamation ultrasonic range finder issue

Finally I think that the VEX range finder is not compatible with the roborio, so we decided to use an analog range finder from maxbotic

does anyone knows how to calculate the voltage scaling ?
Reply With Quote
  #8   Spotlight this post!  
Unread 01-13-2018, 06:16 PM
bgg's Avatar
bgg bgg is offline
Registered User
FRC #3679
 
Join Date: Nov 2011
Location: San Marcos
Posts: 29
bgg is an unknown quantity at this point
Re: VEX digital ultrasonic range finder issue

Our students hooked one up today and printed the voltage to the smart dashboard. They put a stack of totes 1 foot in front and reocorded voltage.
Repeat at 2 feet, 3. . .10. They found a linear relationship somewhere around .3v = 1ft.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-13-2018, 06:33 PM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Exclamation Re: VEX digital ultrasonic range finder issue

Ok thanks you.

I found that formula I don't know how to get the Vcc, the supplied voltage



that formula is for calculating the voltage scale factor
[(Vcc/512) = Vi]
Vcc = Supplied Voltage
Vi = Volts per inch (Scaling)

Example 1: Say you have an input voltage of +5.0V the formula would read:
[(5.0V/512) = 0.009766V per inch = 9.766mV per inch]


and that formula for calculating the range

The range formula is:
[(Vm/Vi) = Ri]
Vm = Measured Voltage
Vi = Volts per Inch (Scaling)
Ri = Range in inches

Example 2: To get comfortable with this equation use a known distance by using a ruler. Say the multimeter shows 292.98mV then you use the calculations as follows:
[(292.98mV/9.766mV) = 30 inches]


I don't know how to get supplied voltage
Reply With Quote
  #10   Spotlight this post!  
Unread 01-13-2018, 07:18 PM
bgg's Avatar
bgg bgg is offline
Registered User
FRC #3679
 
Join Date: Nov 2011
Location: San Marcos
Posts: 29
bgg is an unknown quantity at this point
Re: VEX digital ultrasonic range finder issue

Vcc should be in the neighborhood of 5v.
Reply With Quote
  #11   Spotlight this post!  
Unread 01-13-2018, 07:20 PM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Re: VEX digital ultrasonic range finder issue

yeah maybe, soon we will get one, I will see .

thank you.
Reply With Quote
  #12   Spotlight this post!  
Unread 01-13-2018, 10:20 PM
Tungrus Tungrus is offline
Registered User
no team
 
Join Date: Mar 2013
Location: Somewhere
Posts: 498
Tungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant futureTungrus has a brilliant future
Re: ultrasonic range finder issue

Quote:
Originally Posted by Jude99999 View Post
Finally I think that the VEX range finder is not compatible with the roborio, so we decided to use an analog range finder from maxbotic

does anyone knows how to calculate the voltage scaling ?
VEX ultra sonic sensor is compatible with roboRIO.

On VEX Cortex the OUTPUT pins must plug into higher port number than the INPUT pins.
Reply With Quote
  #13   Spotlight this post!  
Unread 01-14-2018, 07:33 AM
Jude99999 Jude99999 is offline
Registered User
FRC #6911 (SOBOTZ)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2018
Location: USA
Posts: 38
Jude99999 is an unknown quantity at this point
Re: ultrasonic range finder issue

Quote:
Originally Posted by Tungrus View Post
VEX ultra sonic sensor is compatible with roboRIO.

On VEX Cortex the OUTPUT pins must plug into higher port number than the INPUT pins.
I tried several times to swap them several, it never worked.
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 05:48 AM.

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


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