Let's Make Robots!

Sharp GP2D120 vs SRF05

Hi everyone,

I just completed the "Start Here" robot. I used a Sharp GP2D120 for the eyes and I used Fritsl's programming for the "Start Here" robot. I do not have any experience with programming but once I get this robot done then I will be able to learn more.

I have noticed that the robot is very slow, i.e.: It drives a little forward, then stops, and takes a reading, repeat. I assume this is because the robot is stopping to take a reading. If that is correct, then the SRF05 is better because it can take readings without having to stop the motors?

 If that isn't correct I will have to re-write the program, which could be fun, but before I do I was wondering if the Sharp GP2D120 is even capable of continous readings?

Thanks,

-Jinn-

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks for the help everyone!

I think i'm just going to "re-code using Fritsl's code as a guide rather than a direct copy". I figure that will force me to learn more instead of just learning how to fix a small problem.

Like Fritsl says, "Don't program your robot.. Teach it!". In order to do that i'm going to have to use my robot to teach me first, which sounds fun!!

So I guess even though my robot isn't fully functional yet, he deserves a robot page!

Make way for Codename Peek-E!!

-Jinn-

 

 

Looking at the video on your blog, I can see your bot seems to never feel safe to drive forward.  Here are some troubleshooting suggestions.

  1. Use the "debug" command in your code and with the bot still hooked up to your computer, confirm what your readings are for range. Try placing objects at varying distances to the sensor, and see if the values the sensor is spitting out are making any sense.
  2. If that works OK, follow Gareth's advice and break your code down into sections to test. Your little bot is getting confused about something. You just need to figure out where.
  3. Don't give up! I ran into similar issues when I built my own Start Here Robot. I wound up re-coding using Fritsl's code as a guide rather than a direct copy and eventually got the bot working OK.

You're doing great. Keep it up!

 

 

First what is so cool - ........ your bot works ..yeah......... (-: it just needs al little more encouragement :-)

The two distancing modules you mention are fast enough for most scanning applications Check Here for additional info, and they are both overkill for your interesting bot.

Break your code down into smaller parts and test each part separately.

BTW:- the sharp has a minimum detect range ie around 4cm - so if an object is closer than this (ie your coffee cup in video) then it will not detect it as an object.

Neither sensor is cabable of "continous readings". Both send out a pulse (IR or Ultrasonic) and look for an echo response. By timing when (or if) a response is received, both sensors can report range to a detected object.

You can adjust the programming so that the scanning behavior is different. I suspect your bot is detecting obstacles nearly constantly, which is why it is stopping and taking a reading to determine which way to go. What sort of obstacles do you have where your bot is driving? You may need to adjust the "safe" distances or move your bot to a more open area so that it doesn't keep stopping.

Posting a video of your bot in action may help us see what is actually going on.

Uhh, a GP2D120 spits out a reading every 39 ms or so, about 25 per second. I'd say that is pretty "continuous" or at least faster than the robot can probably react to.

The SRF05 has to be triggered to send out a ping, where the Sharp sensors just keep giving readings.

 Might be good to throughly recheck code, as it could be that some little typo is causing a delay.  

Thanks for the correction.

In any case, it sounds like a bug in the code to me as well.

When I test the robot it is on clear floor without any obstacles within three feet of it. If I put a cup in front of it, it will hit the cup.

I will have a video posted to my blog just as soon as it uploads to youtube, which could take forever, lol.

Thanks for your help,

-Jinn-