PDA

View Full Version : Adding Sharp GP2D12 sensors to robot platform



cross1933
03-26-2009, 10:52 AM
I have a robot platform(MMP8) that is run with JAVA thru a wireless link to a Lantronix WBX2100. I need to add in obstacle avoidance for forward and rear movement. Once a object is detected in the range that movement direction is halted and only the opposite movement is allowed until the object is out of range. I have considered the Arduino Diecimila with the Sharp GP2D12 sensors to accompish this. Is this a good setup or is there a better option? Any suggestions on this?

Robot hardware,
MMP8 6 wheel platform
Lantronix WBX2100 wireless access
Super Logics CP8200, A/D converter
Servo8 board
Dlink DCS-6620G camera
Relays to control voltages to charging pads on bottom of platform( controlled from relay in Dlink camera). Docking/charging station, self design

jes1510
03-26-2009, 11:12 AM
Wow that's an expensive setup! If you are going to connect the arduino to the Lantronix box then you will probably need an RS-232 to TTL converter. The arduino only accepts TTL level data on it's serial line if you aren't using the USB.

The sharp sensors will work fine but with a machine that size you may want to consider adding sonar as well. If the sharp sensor misses a toddler wearing an all black ninja outfit you don't want to run him over and upset the toddler ninjas.

lnxfergy
03-26-2009, 11:54 AM
The sharp sensors will work fine but with a machine that size you may want to consider adding sonar as well. If the sharp sensor misses a toddler wearing an all black ninja outfit you don't want to run him over and upset the toddler ninjas.

Second what jes said. The IR rangers have a very narrow field of view, probably about 2-5 degrees wide. Most sonar sensors have a cone of detection that is 30-40 degrees wide. There is also the issue of what each sensor type will pick up... the IR sensors may wash out in the sun, or not detect a highly shiny surface, they also have limited range. Sonar on the other hand, has a much longer range, but may not detect objects that are acoustically challenging (unfortunately, baggy or thick clothing often falls in this category).

That said, you'll often hear me, jes, and adrenalynn yelling "One sensor is not enough!" and "One type of sensors is not enough!". It's especially true for bigger bots. I would use, at a minimum, a sonar, and several IR facing forward. I would also recommend some sort of a bumper, as a last resort... I always tell myself that my bots don't need bumpers, but eventually end up installing one, because even though you wont need it often, knowing that you are pushing a baby across the floor and are about to smush it against a wall is pretty important...

-Fergs

cross1933
03-26-2009, 12:40 PM
Wow that's an expensive setup! If you are going to connect the arduino to the Lantronix box then you will probably need an RS-232 to TTL converter. The arduino only accepts TTL level data on it's serial line if you aren't using the USB.

The sharp sensors will work fine but with a machine that size you may want to consider adding sonar as well. If the sharp sensor misses a toddler wearing an all black ninja outfit you don't want to run him over and upset the toddler ninjas.

Not sure about the cost, a coworker gave me the parts. The coworker had some units completed and wanted to get rid of some parts. The completed units were too large for my area of useage so I opted to assemble this one. The robot works well, the object avoidance is the only thing remaining.

My idea was to add the arduino after the output from the servo8 board, then connect the output of the arduino to the PWm board in the MMP8 base. In essence add the arduino board between the servo8 board and the pwm board in the base. Input the sensor readbacks into the arduino board for position location. Once a set postion is reached stop movement in that direction. I plan on adding the outputs from the sensor to the JAVA control page. I have added readback from the logic and motor batteries to the Java console page

I could add something into the JAVA control thru the a/d converter. The problem with this is when the wirless signal is lost the stop command is lost. I need to be able to stop the robot with wireless signal and without wireless signal.

I should have given more detail on its usage. The usage will be to check for possible problems in a underground tunnel. The main issues of detection will be water leaks. The tunnel housed a particle accelerator which uses water cooling for magnets. We do have issues with ground water leaks after large rains. I have upgraded the antennas to increase maximum coverage, the final test will be running the robot.

Any recommendations on a sonar sensor?

cross1933
03-26-2009, 12:52 PM
Second what jes said. The IR rangers have a very narrow field of view, probably about 2-5 degrees wide. Most sonar sensors have a cone of detection that is 30-40 degrees wide. There is also the issue of what each sensor type will pick up... the IR sensors may wash out in the sun, or not detect a highly shiny surface, they also have limited range. Sonar on the other hand, has a much longer range, but may not detect objects that are acoustically challenging (unfortunately, baggy or thick clothing often falls in this category).

That said, you'll often hear me, jes, and adrenalynn yelling "One sensor is not enough!" and "One type of sensors is not enough!". It's especially true for bigger bots. I would use, at a minimum, a sonar, and several IR facing forward. I would also recommend some sort of a bumper, as a last resort... I always tell myself that my bots don't need bumpers, but eventually end up installing one, because even though you wont need it often, knowing that you are pushing a baby across the floor and are about to smush it against a wall is pretty important...

-Fergs

A majority of objects to avoid will be of some form of metal.The range I am concerned about is detecting a object from 1' to 3'. The sharp sensor starts detection at 4" from the sensor. My goal is to stop the making contact with a object, that could be a bad thing. For the most part the center of the tunnel is open with plus and minus 5' on each side. There is one area where the beam pipe crosses over the center at 3' above the ground. There is ample clearance on both sides to safely navigate under the pipe. As I stated above the main concern is if the wireless signal is lost the robot can go wandering.

I had considered two forward and rear facing sensors angled slightly off center in opposite directions. My concern her is interference between the two sensors affecting the read back. The idea of bumpers is still a consideration and probably will happen, I can only control how I drive the robot. Maybe I need to issue drivers licenses for people who wish to use this?:rolleyes:

jes1510
03-26-2009, 01:03 PM
My idea was to add the arduino after the output from the servo8 board, then connect the output of the arduino to the PWm board in the MMP8 base. In essence add the arduino board between the servo8 board and the pwm board in the base. Input the sensor readbacks into the arduino board for position location. Once a set postion is reached stop movement in that direction. I plan on adding the outputs from the sensor to the JAVA control page. I have added readback from the logic and motor batteries to the Java console page



I'm fuzzy on what the servo8 is for in this case.

WGhost9
03-26-2009, 01:09 PM
If the majority of the objects you are avoiding are metal, I would caution against IR sensors. I have had very spotty results with them on reflective surfaces. Unless you hit the correct angle of reflection, the reflective surface is near invisible. You are probably best of using a bumper, or if physical contact is truly taboo, then a Sonar sensor is your best bet.

Adrenalynn
03-26-2009, 01:33 PM
I'm just going to reiterate, since Fergs invoked me and the response:

Never trust one type of sensor.

It's gonna happen. It always happens. In 115% of the samples with an n= of infinity. :tongue: Whatever sensor you pick won't detect the one thing you least want to smash into at 10+mph with a throttle stuck wide open and an emergency cut switch stuck closed.

cross1933
03-26-2009, 01:57 PM
I'm fuzzy on what the servo8 is for in this case.

A chain of 8 pulses comes in (serial link)and the servo board sends out one pulse to each of the 8 outputs, ability to control 8 motors. In this case only two of the outputs are used, previous model used more for a arm. The pulses are then sent to the driver card in the base of the platform.

cross1933
03-26-2009, 02:05 PM
If the majority of the objects you are avoiding are metal, I would caution against IR sensors. I have had very spotty results with them on reflective surfaces. Unless you hit the correct angle of reflection, the reflective surface is near invisible. You are probably best of using a bumper, or if physical contact is truly taboo, then a Sonar sensor is your best bet.

Bumping into one of the magnet power connections would be a big problem. An opinions on a sensor,http://www.trossenrobotics.com/store/Search.aspx?searchTerms=sonar&submit=true.Or do you know of different brand that you prefer?

jes1510
03-26-2009, 02:15 PM
I believe that these are the really nice ones but I have never personally used them:
http://www.trossenrobotics.com/devantech-srf10-ultrasonic-range-sensor.aspx

They are I2C so you can use the wiring library on the Arduino to talk to them and hang a bunch of them on the same line.

Regarding your failure to stop, you want to write your code in a fashion so that the arduino stops the robot if it stops talking to the base station or suffers x amount of packet loss.

Out of curiosity, which accelerator is this for? LHC, Fermilab, SNS?

cross1933
03-27-2009, 06:50 AM
I believe that these are the really nice ones but I have never personally used them:
http://www.trossenrobotics.com/devantech-srf10-ultrasonic-range-sensor.aspx

They are I2C so you can use the wiring library on the Arduino to talk to them and hang a bunch of them on the same line.

Regarding your failure to stop, you want to write your code in a fashion so that the arduino stops the robot if it stops talking to the base station or suffers x amount of packet loss.

Out of curiosity, which accelerator is this for? LHC, Fermilab, SNS?

Communication comes from the wireless network. I wanted to monitor the signal strength in the WBX2100 but I have not been successful.

Fermilab, antiproton source. Here is a link to the robots at Fermilab, http://www-inteng.fnal.gov/Integrated_Eng/MARV/acnetdevices.html. After the robot is finalized I will post pictures, and probably a short movie.

cross1933
03-27-2009, 09:56 AM
How can the Arduino board be interfaced with the ultrasonic sensor for drive interrupt? The IR sensors have analog output while the ultrasonic has a pw output. Can the digital pins be used as a input for a ultrasonic sensor and a pwm input from the servo8 board?

jes1510
03-27-2009, 10:30 AM
The I2C sensors would connect to the analog pins 4 and 5. They won't be used for analog though since these are the pins that the I2C interface uses. Here is a link to the I2C library for the Arduino:
http://www.arduino.cc/en/Reference/Wire

The IR sensors can connect to the other analog pins.

The Seervo8 can connect to any of the digital pins using the pulsein library:
http://www.arduino.cc/en/Reference/PulseIn

The driver boards in the chassis connects to the pwm pins and you would use the analogwrite library to drive the motors via PWM:
http://www.arduino.cc/en/Reference/AnalogWrite

The process would be that you read the pulse width from the Servo8 to determine how you want the robot to move. The robot would take range readings from the sensors to see if it's safe and then perform the move action that you requested. It continues to scan the sensors and interrupts any move actions based on the sensor readings. Of course all of this requires you to write code for the Arduino.

Make sense?

cross1933
03-27-2009, 10:47 AM
The I2C sensors would connect to the analog pins 4 and 5. They won't be used for analog though since these are the pins that the I2C interface uses. Here is a link to the I2C library for the Arduino:
http://www.arduino.cc/en/Reference/Wire

The IR sensors can connect to the other analog pins.

The Seervo8 can connect to any of the digital pins using the pulsein library:
http://www.arduino.cc/en/Reference/PulseIn

The driver boards in the chassis connects to the pwm pins and you would use the analogwrite library to drive the motors via PWM:
http://www.arduino.cc/en/Reference/AnalogWrite

The process would be that you read the pulse width from the Servo8 to determine how you want the robot to move. The robot would take range readings from the sensors to see if it's safe and then perform the move action that you requested. It continues to scan the sensors and interrupts any move actions based on the sensor readings. Of course all of this requires you to write code for the Arduino.

Make sense?


I missed what JES1510 wrote about connecting these to the Arduino, you links are welcomed. What you stated is what I want to accomplish with the sensors and the Arduino board.

cross1933
03-27-2009, 11:25 AM
Anyone have experience with the LV-MaxSonar-EZ0,http://www.trossenrobotics.com/maxbotix-lv-maxsonar-ez0.aspx? (http://www.trossenrobotics.com/maxbotix-lv-maxsonar-ez0.aspx)The analog output can also be run directly into the a/d for readback on the control window.

Adrenalynn
03-27-2009, 12:34 PM
Personally, I'm back and forth on the MaxSonar. When it works, it works fantastically. But it's finicky as all get-out.

Is your bot going to be operating in a high RF, EMF, or high magnetic environment? These hobby-grade components are pretty picky about their environment.

cross1933
03-27-2009, 01:07 PM
Personally, I'm back and forth on the MaxSonar. When it works, it works fantastically. But it's finicky as all get-out.

Is your bot going to be operating in a high RF, EMF, or high magnetic environment? These hobby-grade components are pretty picky about their environment.

It will be in a environment from a particle accelerator, not a nice environment.

Do you know of any that work better in adverse environments?

Adrenalynn
03-27-2009, 01:13 PM
How does the wireless hold up under these conditions? Are you using home/hobby grade wireless, or industrial?

I've done some work developing industrial grade gprs/gps and CDMA/gps hardware and it tended to be pretty testy. I've had the arduino get flakey near an old tube-amp that is pretty out-of-spec by today's standards.

I guess the question comes back to - if you're surviving in the literal same environment with home-grade wireless, you're probably OK. If you're industrial there, we'll need to help you shop industrial-grade shielded components.

lnxfergy
03-27-2009, 01:23 PM
Personally, I'm back and forth on the MaxSonar. When it works, it works fantastically. But it's finicky as all get-out.

Is your bot going to be operating in a high RF, EMF, or high magnetic environment? These hobby-grade components are pretty picky about their environment.

Agree, and more so actually. The analog output of the maxbotix is EXTREMELY finicky... the serial/pwm are rumored to work decently well, but from everything I've seen/experianced the sensors will probably require a seperate power supply (at least their own regulator circuit). Personally, I gave up on them and went back to the Devantech models.

-Fergs

cross1933
03-27-2009, 01:33 PM
How does the wireless hold up under these conditions? Are you using home/hobby grade wireless, or industrial?

I've done some work developing industrial grade gprs/gps and CDMA/gps hardware and it tended to be pretty testy. I've had the arduino get flakey near an old tube-amp that is pretty out-of-spec by today's standards.

I guess the question comes back to - if you're surviving in the literal same environment with home-grade wireless, you're probably OK. If you're industrial there, we'll need to help you shop industrial-grade shielded components.

The wireless has survived, no failures of antennas, but I have not had a use until now while running the accelerator. I recently upgraded the Orinoco antennas to a S2403BP from Cushcraft to increase coverage area. I built some corner reflector antennas for use around the penetrations, not pretty looking but they work. Another group has used a similar setup, no object detection, in one of the other tunnels here. A signal test was taken will the tunnel was in opertaion, signal was good. This same group has used a robot on different instances in that tunnel without issue. That does not mean that a issue could not arise where this robot is to be installed. The final outcome will be to test the robot during operation and after a extended period of time in the tunnel. We have had some issues with PLC's and radiation exposure over the years, internal power supply failure.

We have some twt amplifiers in one area, but if necessary that area can be avoided.

Adrenalynn
03-27-2009, 02:21 PM
The access points (APs) themselves are distanced from the "hot environment", though, I take it... I wouldn't expect an antenna to fail. Maybe get jammed, but there's no electronics there to get beaten on. If other hobby bots are surviving, well, there ya go. :)

It might be best to start hobby-grade and see if it works. If not, you're not out a bunch of dollars where if you were to install industrial from the get-go, you'd never know if you over-spent.

I think I'd pay some attention to shielding my electronics, at least making sure they were "in the guts" instead of with any kind of exposure. But it doesn't sound like I'm telling you anything you're not already well aware of, so I'll just stop now. :)

The Devantechs are probably your best bet from everything I've seen and heard. I get my Max's working now and again, but I wouldn't trust 'em in a non-failsafe environment. But you do have to consider risk. How much is it worth if a sensor array freaks out when it starts getting pounded by spurious signals and the bot starts pounding into things?

cross1933
04-01-2009, 01:17 PM
I received my two sensors, Sharp GP2D120 AND THE Devantech SRF04. I set a test area for to test the GP2D120 sensor. I mounted the sensor on a plate about 2" above the surface area. I set a block of aluminum at 1" increments( up to 19") away from the sensor to monitor the analog output.Changing the angle between the sensor and the object by moving the block of aluminum has a effect on the analog output. The output reaches its peak of 2.67 volts at 3" and then drops to .61 volts @ 19". This measurement can have a error factor based on the angle of the test object to the sensor.

Prior to to testing the Devantech SRF05 sensor I have a question regarding the amplitude of the trigger input signal. The informaition I have reviewed regarding this sensor only describes the the pulse width. What is the amplitude of the trigger pulse for this sensor?

lnxfergy
04-01-2009, 01:32 PM
The trigger signal is just a 5V pulse.

-Fergs

jes1510
04-01-2009, 01:42 PM
5v for the amplitude of the pulse I think:
http://www.robot-electronics.co.uk/htm/srf05tech.htm

Edit: I got interrupted while typing my reply and thus was beaten by Fergs. Carry on as if nothing happened...

cross1933
04-01-2009, 02:07 PM
Correct, I was low on my signal generator input. I am starting to question the possibility of measuring the echo out on a scope. My read back signal has alot of noise on it, any suggestions on a bench test setup?

jes1510
04-01-2009, 02:16 PM
Are you introducing the noise with the signal generator since the pin in both the input and output? The easiest test method I can think of is to connect it to a microcontroller such as an Arduino and take range measurements under various conditions.

ScuD
04-01-2009, 02:36 PM
You could use your trigger signal as an external trigger for the scope, though the resolution would be lower given the 700us offset, unless you can offset your trigger, though I don't know if all scopes have this ability.

Strange you're getting a lot of noise on the signal though, seems like the power supply should be sufficiently decoupled on the SRF itself. Maybe a schmitt trigger or comparator setup?

cross1933
04-02-2009, 06:02 AM
Noise was from bad connection. What is used to generate the trigger pulse on a robot?

jes1510
04-02-2009, 07:48 AM
In your case you would probably use the Arduino.

Set the pin as an output. Send the pulse. Set the pin as an input. Read the pulse width.