Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Parallax and Maxbotix ultrasonic sensors (http://www.chiefdelphi.com/forums/showthread.php?t=62043)

Lucretius 19-01-2008 12:14

Parallax and Maxbotix ultrasonic sensors
 
Does anyone know if there are device drivers for the Parallax Ping))) and the Maxbotix EZx written for WPIlib? I've looked at the SONAR driver and Qbranch's Ping))) code, but it's based off the default IFI code, and I have no idea any of it works.

We're using a makefile with mcc18 under Wine.

BradAMiller 21-01-2008 09:01

Re: Parallax and Maxbotix ultrasonic sensors
 
I was just reading the spec sheet for the Maxbotix EZ1 sensor. It looks like one of it's outputs is analog. So you should be able to connect it directly to an analog input and read range values. The datasheet lists the output at about 9.8mV/inch, so with some simple scaling you could convert the 0-1023 analog input value directly to inches. It also looks like if you use the pulse output it may be directly compatible with the existing driver, but I haven't tested it.

The sensor looks really good - I'm going to order one to play with. More news as it happens.

The Parallax sensor uses timing much like the supported SRF04 (or Vex) sensor, the problem is it does the trigger (digital output) and echo (interrupt) on the same pin. The driver would have to be modified slightly to flip the pin from an output to an input to make it work.

Phalanx 21-01-2008 10:41

Re: Parallax and Maxbotix ultrasonic sensors
 
We used the Maxbotics EZ-1 last season using analog with good results.

The formula we used:
Mv =( (adc * 5000) / 1024 )
Inches = Mv / 10
Gave use the distance in inches for the version that used 10mV per inch.

It was changed from 10mV to 9.8mV
So in your case you might want to try:
Mv =( (adc * 5000) / 1024 )
Inches = Mv * 10 / 98

Lucretius 21-01-2008 15:56

Re: Parallax and Maxbotix ultrasonic sensors
 
Thanks for the tips regarding the Maxbotix EZ sensors (we'll be using the EZ0).

We actually got the Parallax Ping))) working with the built-in WPIlib functions. The only modification was to convert the two ends of a PWM Y-connector to female so we could plug them into two digital in/outs. Worked like a charm! :yikes:

pogenwurst 20-02-2008 00:39

Re: Parallax and Maxbotix ultrasonic sensors
 
Quote:

Originally Posted by Phalanx (Post 682726)
We used the Maxbotics EZ-1 last season using analog with good results.

The formula we used:
Mv =( (adc * 5000) / 1024 )
Inches = Mv / 10
Gave use the distance in inches for the version that used 10mV per inch.

It was changed from 10mV to 9.8mV
So in your case you might want to try:
Mv =( (adc * 5000) / 1024 )
Inches = Mv * 10 / 98

I was just looking at the datasheet for the newer versions with 9.8 mV / in. scaling, and it does not specify "9.8" but rather "~9.8". The exact scaling factor for 5V power is (5000 / 512) mV / in.

It shouldn't make much of a difference, but that sort of thing bothers me.

d235j 20-02-2008 14:34

Re: Parallax and Maxbotix ultrasonic sensors
 
We just divide the analog output by 2 to get the reading in inches.


All times are GMT -5. The time now is 18:29.

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