Go to Post So Love your robot, and it will love you. - Not2B [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 18-01-2009, 15:58
Phoenix Spud's Avatar
Phoenix Spud Phoenix Spud is offline
Everyone. Everywhere.
FRC #3132 (Thunder Down Under)
Team Role: College Student
 
Join Date: Jan 2009
Rookie Year: 2004
Location: Sydney, Australia
Posts: 703
Phoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond repute
Question Analog ultrasonic sensor class?

Has any one implimented a class for an analog ultrasonic sensor to go with the WPILib? We are using the Max Botix EZ1, and therefore cannot use the WPILib class--which is for a digital ultrasonic sensor. We have started to create such a class but we think that the FPGA does not oversample the channel we are using (module 1, port 3). Because we created our code to do this we are getting "fatal errors." Have you found any documentation for the FPGA on the analog module?

Thanks
__________________
Sarah Heimlich
Outreach Mentor | Business Mentor
FIRST® TEAM 3132
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2009, 16:02
Phoenix Spud's Avatar
Phoenix Spud Phoenix Spud is offline
Everyone. Everywhere.
FRC #3132 (Thunder Down Under)
Team Role: College Student
 
Join Date: Jan 2009
Rookie Year: 2004
Location: Sydney, Australia
Posts: 703
Phoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond repute
Re: Analog ultrasonic sensor class?

We found part of the problem, we were plugged into a none accumulator channel. Only ports 1 or 2 are!!!

But if you have created such a class still let us know, it would be great if I did not have to pull my hair out again...
__________________
Sarah Heimlich
Outreach Mentor | Business Mentor
FIRST® TEAM 3132
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2009, 17:14
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Analog ultrasonic sensor class?

From the FAQ on the Maxbotix site, it looks like the output is a straight 10mV/inch signal.

I'm not sure why you want to use an accumulator for the ultra sonic sensor. I think you actually want to use the oversampling engine. The accumulator is for signals that need to be integrated, like gyros. The oversampling engine is for signals that could use some basic filtering. All analog input channels can be oversampled, but only the first two channels can use the accumulators.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2009, 17:20
ScottW of MaxBo ScottW of MaxBo is offline
Registered User
no team
 
Join Date: Feb 2008
Location: Brainerd, MN
Posts: 17
ScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of light
Software support for the MaxSonar sensor line.

Quote:
Originally Posted by Phoenix Spud View Post
Has any one implimented a class for an analog ultrasonic sensor to go with the WPILib? We are using the Max Botix EZ1, and therefore cannot use the WPILib class--which is for a digital ultrasonic sensor. We have started to create such a class but we think that the FPGA does not oversample the channel we are using (module 1, port 3). Because we created our code to do this we are getting "fatal errors." Have you found any documentation for the FPGA on the analog module?

Thanks
Dear Phoenix Spud,

We have had a number of teams that have requested assistance with code support for the MaxSonar line of sensors. These are the EZ0, EZ1, EZ2, EZ3, EZ4, and the new WR1 (narrow beam sensor in a rugged PCV package).

All of these sensors are backward compatible with the Vex ultrasonic rangefinder, and the Daventech SRF04 rangefinder. As such the MaxBotix Inc., sensors are all compatible with software provided in the C/C++ WPI Robotics Library. For revision 0.5 – 28 December 2008 this is located on page 46.

Specifically the section “Ultrasonic rangefinder”.

The SRF04 is shown in the photo, but any of the MaxSonar sensors can be substituted. Just follow the pin out below.

Then just follow the application note.
__________________
Best regards,

Scott Wielenberg
Technical Support & Sales
of MaxBotix Inc.
Phone: (218) 764-2489 Ext. 2
Fax: (218) 764-2194
Email: scott@maxbotix.com
Web: www.maxbotix.com
Reply With Quote
  #5   Spotlight this post!  
Unread 24-01-2009, 13:14
loafdog loafdog is offline
Registered User
AKA: Maciej
FRC #2876 (DevilBotz)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Burlington, MA
Posts: 35
loafdog is an unknown quantity at this point
Re: Analog ultrasonic sensor class?

My team is trying to use the EZ4 version sensor. We don't have any electrical people so we are having trouble figuring out how to wire it up. We used a pwm cable. The red and black wires are hooked up to GND and +5. The white wire is hooked up to the PW pin. The sensor is plugged into the analog bumper. The RX pin is not connected which means the sensor will send pings constantly. Does that sound right?

If we only connect the PW pin, will the Ultrasonic class still be usable? What would use as an arg for the ping channel for the constructor if we don't have it hooked up?

We plugged in the PW signal pwm wire into the analog bumper, channel 3.
We tried instantiating an instance of Ultrasonic with ping channel = 0 and echo channel = 3. IsRangeValid() returns false and GetRangeInches() returns 0. We aren't calling Ping() because the sensor should be sending out pings. We also tried instantiating with ping channel = 3 and echo channel = 3. Same result.

What are we doing wrong? Do we need to use a different class to use this sensor? Is the FPGA bug I've seen on other threads causing problems with readings?

Do we need to wire up the RX pin to another channel on the analog bumper? If so, do we only connect the white wire since the echo channel pwm already has power wires hooked up?

Thanks in advance.

Last edited by loafdog : 24-01-2009 at 13:18.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-01-2009, 13:47
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Analog ultrasonic sensor class?

Whoops! I was coding this, but never had the chance to test it.
I've attached a .zip with the .cpp and .h. It compiles, but I'm not sure if it works, and the coding style is not completely in line with WPILib. It should, however, be a good starting place.
Attached Files
File Type: zip analogultrasonic.zip (1.5 KB, 90 views)
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

Reply With Quote
  #7   Spotlight this post!  
Unread 27-01-2009, 09:44
ScottW of MaxBo ScottW of MaxBo is offline
Registered User
no team
 
Join Date: Feb 2008
Location: Brainerd, MN
Posts: 17
ScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of light
Re: Software support for the MaxSonar sensor line.

All,

Here is the link http://first.wpi.edu/Images/CMS/Firs...ming_Guide.pdf to the referenced document in the above post C/C++ WPI Robotics Library.For revision 0.5 – 28 December 2008 this is located on page 46.

If you have any question please let me know.
__________________
Best regards,

Scott Wielenberg
Technical Support & Sales
of MaxBotix Inc.
Phone: (218) 764-2489 Ext. 2
Fax: (218) 764-2194
Email: scott@maxbotix.com
Web: www.maxbotix.com
Reply With Quote
  #8   Spotlight this post!  
Unread 27-01-2009, 09:46
ScottW of MaxBo ScottW of MaxBo is offline
Registered User
no team
 
Join Date: Feb 2008
Location: Brainerd, MN
Posts: 17
ScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of lightScottW of MaxBo is a glorious beacon of light
Re: Analog ultrasonic sensor class?

Dear Loafdog,

Please call me at MaxBotix Inc., (218) 764-2489 so we may discuss this in detail.

I look forward to your call.
__________________
Best regards,

Scott Wielenberg
Technical Support & Sales
of MaxBotix Inc.
Phone: (218) 764-2489 Ext. 2
Fax: (218) 764-2194
Email: scott@maxbotix.com
Web: www.maxbotix.com
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Maxbotix Ultrasonic Sensor Help... manderson5192 Programming 9 22-02-2008 14:25
ultrasonic sensor problems... couldntthinkofa Programming 2 05-01-2008 12:29
Programming ultrasonic sensor in MPlab AdamHeard FIRST Tech Challenge 1 09-05-2006 00:40
Ultrasonic Sensor output Dillon Compton Programming 5 03-02-2006 10:20
Ultrasonic Sensor winners Programming 3 02-01-2006 20:55


All times are GMT -5. The time now is 15:31.

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