Go to Post Our prototypes are good and running, now just need to do some magic to transform all that wood to aluminum. :eek: - FIRSTMa2104 [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2016, 10:30
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Maxbotix not working well with RoboRIO?

Hi,

We are trying to use the Maxbotix 1013 ultrasonic sensor but when we put it on the Rio, the range of values we get is just 233 to 350. On our arduino, we get a range of about 58 to 400ish. We were using the analog inputs on the arduino and on the Rio. All we are doing is analog.input() on the Rio. We are using pin 3 on the maxbotix sensor. Is that the actual range of the sensor? Or am I doing something wrong.

Thanks a bunch in advance!
  #2   Spotlight this post!  
Unread 30-01-2016, 10:50
jajabinx124's Avatar
jajabinx124 jajabinx124 is offline
Team 2052 Alumnus
AKA: Kshitij Wavre
no team
Team Role: College Student
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Madison, WI
Posts: 540
jajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond repute
Re: Maxbotix not working well with RoboRIO?

Post some code?

You can find the actual range limit and the width of the ultrasonic soundwaves when you look at the data sheet for the sensor.
__________________
FRC Volunteer CSA (MRI off-season event, 2017 Lake Superior Regional, 2017 10,000 Lakes Regional) 2016 - Present
FRC 2052 KnightKrawler (Team Captain, Strategist, Scouting, Programming) 2013 - 2016

1 Division Win & Einstein Appearance
3 Division Quarter-Finalists
1 Regional Chairman's Award
5 Regional Wins, 3 Regional Finalists
3 MN State Championship Wins, 1 MN State Championship Finalist
Thanks to all our alliance partners who krawled with us: 41, 70, 225, 525, 1595, 2054, 2062, 2122, 2175, 2227, 2472, 2526, 2883, 2990, 3018, 3244, 3276, 3310, 3313, 3360, 3538, 3692, 4011, 4198, 4536, 4607, 4778, 5172, 5690
  #3   Spotlight this post!  
Unread 30-01-2016, 12:15
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Maxbotix not working well with RoboRIO?

Quote:
Originally Posted by jajabinx124 View Post
Post some code?

You can find the actual range limit and the width of the ultrasonic soundwaves when you look at the data sheet for the sensor.
The code is as simple as it comes:

Code:
#in init code
ultrasonic = wpilib.analog.input(3)
#in teleop
print(ultrasonic.getValue())
I see on the datasheet that it is supposed to be able to output 0 to 1023 for analog, but since I get nothing close to that, does that mean my sensor has gone bad or something? Thanks!
  #4   Spotlight this post!  
Unread 30-01-2016, 12:26
jajabinx124's Avatar
jajabinx124 jajabinx124 is offline
Team 2052 Alumnus
AKA: Kshitij Wavre
no team
Team Role: College Student
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Madison, WI
Posts: 540
jajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond reputejajabinx124 has a reputation beyond repute
Re: Maxbotix not working well with RoboRIO?

Quote:
Originally Posted by team-4480 View Post
The code is as simple as it comes:

Code:
#in init code
ultrasonic = wpilib.analog.input(3)
#in teleop
print(ultrasonic.getValue())
I see on the datasheet that it is supposed to be able to output 0 to 1023 for analog, but since I get nothing close to that, does that mean my sensor has gone bad or something? Thanks!
Possibly. Try using ultrasonic.getVoltage() instead of getValue() and see what you find- this method returns the analog value in calibrated units. (maybe this is what the data sheet is referring to when it says analog voltage bits values should be in between 0-1023)
__________________
FRC Volunteer CSA (MRI off-season event, 2017 Lake Superior Regional, 2017 10,000 Lakes Regional) 2016 - Present
FRC 2052 KnightKrawler (Team Captain, Strategist, Scouting, Programming) 2013 - 2016

1 Division Win & Einstein Appearance
3 Division Quarter-Finalists
1 Regional Chairman's Award
5 Regional Wins, 3 Regional Finalists
3 MN State Championship Wins, 1 MN State Championship Finalist
Thanks to all our alliance partners who krawled with us: 41, 70, 225, 525, 1595, 2054, 2062, 2122, 2175, 2227, 2472, 2526, 2883, 2990, 3018, 3244, 3276, 3310, 3313, 3360, 3538, 3692, 4011, 4198, 4536, 4607, 4778, 5172, 5690
  #5   Spotlight this post!  
Unread 30-01-2016, 13:18
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Maxbotix not working well with RoboRIO?

Quote:
Originally Posted by jajabinx124 View Post
Possibly. Try using ultrasonic.getVoltage() instead of getValue() and see what you find- this method returns the analog value in calibrated units. (maybe this is what the data sheet is referring to when it says analog voltage bits values should be in between 0-1023)
Yeah I think the sensor is just not working. The voltage only changes for about 18 inches in range which is not even close to what it should be doing(5 meters). I think I'll give some other types of ultrasonic sensors a try. Thanks for the help!
  #6   Spotlight this post!  
Unread 01-02-2016, 13:35
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Maxbotix not working well with RoboRIO?

The RoboRIO has a 12-bit ADC, not a 10-bit ADC. The RoboRIO's ADC count value can range from 0 to 4095. You can right shift that value by 2 to get a value in the range from 0 to 1023.

Each count will relate to 5mm of range. So multiply that output by 5mm to get the correct distance.

The beam pattern of that ultrasonic sensor is wide. That means that anything near it's cone will cause a reflection. The floor or table counts.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Closed Thread


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 00:39.

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