Beginner PING))) lowing sensitivity
Villarose
Posts: 5
I'm new to using the PING))) ultrasonic sensor for the boe-bot, and I'm confused about how to do some things. I found a basic code on Parallax about how to sense and turn away from objects, but how can I lower the sensitivity, so it'll get closer to the object before backing up and turning? Thanks.
Comments
http://www.parallax.com/Portals/0/Downloads/src/prod/RoamingWithPING-V1.0.zip
I've made quite a few small changes in mine, but none of them seemed to work for what I wanted to do, most likely because I was changing the wrong thing.
Since the BoeBot first checked forward for at least 30cm of clear space, then checked again on the scan (Ping_Around), if the scan indicates that the forward direction is best, there must be a problem there (because the first check was ok) and the BoeBot turns around.
Post Edited (Mike Green) : 10/7/2009 9:42:42 PM GMT
____________
|................. .^
|.................20cm
|.............___ ^
|......_....||
|.....[noparse][[/noparse]_]...||
|............||
That's an odd picture, but imagine the lines are walls and the box-like shape is the bot. Right now, it's scanning before it reaches the turn, and either turns into the right wall, or attempts to do a 180. I want it to get into the open space between the two routes before scanning, and then turn right.
You really want to make significant changes in the way the program behaves. You're going to have to study the program (and the comments) and understand how it works, then modify it.
You will probably have to change the algorithm because of the close walls. It's easy to change the two places where there's a 30 to something like 20 or 15, but I don't think that will really do what you want.
If the BoeBot is not precisely aligned with the walls, it will gradually drift into a wall as it moves along and you want to catch and correct that. You also want to detect when the BoeBot has emerged into the open space and perhaps change its behavior completely.
http://www.parallax.com/Portals/0/Downloads/src/prod/RoamingWithPING-Simple-V1.0.zip
My mistake. Maybe this will clear up some of my confusion. Would the same type of thing apply to this?
This is not a terribly complicated program. The main portion simply positions the PING servo to several positions in a sweep from one side to the other, then reverses the sweep. At each position, it PINGs and looks at the returned value. If it's less than 600, the BoeBot "takes evasive action" depending on the position of the PING servo, either turning right or left or backing up.
You really need to take the time to understand how the program works. You could just change the 600 to something else and see if that works for you, but the logic of the program really needs to be changed for your circumstances. What rules could you come up with for how the BoeBot should behave? I'm not talking yet about the programming ... Lay out a list of rules for the BoeBot's behavior under different circumstances.