Shop OBEX P1 Docs P2 Docs Learn Events
Need help in programming wheel encoders!! — Parallax Forums

Need help in programming wheel encoders!!

allan_melvinallan_melvin Posts: 16
edited 2009-02-23 16:57 in Robotics
Hi..

I am doing a project to design a mobile robot for blind people navigation. I am using 9 parallax ultrasonic sensors, 2 parallax wheel encoders, 2 DC geared motor and BS2p as the microcontroller. It supposed to sense the obstacles in an array of semi-circle and avoid the obstacle before return to the pre-defined target. I already managed to do the programming for sensor detection and wheel control to avoid the obstacle. I am facing problem to program the encoders to return to the original path and continue to its pre-defined target.

I need your help in the encoder programming and how to make the mobile robot to reach the pre-defined target. I have an idea of using XY grid system for the obstacle avoidance and returning to pre-defined target. But I have no clue where to start. Please kindly drop your idea in helping me with the programming and if possible, please include any related source code. Thank you.


-allan-

Comments

  • LilDiLilDi Posts: 229
    edited 2009-02-13 00:12
    This is almost impossible with a wheel encoder because there is the inevitable wheel slippage on uneven surfaces and wheel skip on turns. A beacon would work well for returning to the original launch location.
  • ercoerco Posts: 20,256
    edited 2009-02-13 01:08
    Do have any idea of the degree of difficulty your project entails? If it was easy, everyone would be doing it!·smile.gif·I was quite happy to get a Scribbler robot with encoders to run a simple square pattern. http://forums.parallax.com/showthread.php?p=772850

    Suggest you read·everything you can find·on PID navigation. Start here: http://www.seattlerobotics.org/encoder/200108/using_a_pid.html

    With real world factors (wheel slippage, odometry errors, etc) it's very challenging to do basic dead reckoning with any repeatable accuracy. Avoiding obstacles 100% reliably is also a major challenge. Marrying the two together (ie, avoid a·random obstacle and then return accurately to known path) is frought with peril. Not saying it can't be done, but teams of people at the·commercial and·university level have been working on the problem for a long time with mixed results. They will usually resort to GPS or the Northstar system by Evolution robotics. Cheaper solutions involve IR homing beacons.

    The best pure odometry robot I've seen is Cye, by Probotics. http://www.personalrobots.com/home.html·It navigates from waypoint to waypoint and periodically bumps into walls and corners to zero out accumulated errors.

    Long story short, you can only go so far (literally) using·pure wheel odometry in the real world.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • allan_melvinallan_melvin Posts: 16
    edited 2009-02-13 01:38
    The robot is allowed to have tolerance of few centimeters from the target..since it will not give any effect to the blind man..i am aware of the complexity of the project..
  • LilDiLilDi Posts: 229
    edited 2009-02-13 16:22
    It sounds like you are not so aware of the complexity of this project like erco mentioned. Just a couple of turns will cause more that a few centimeters error. Traveling straight on carpet a few meters will result in more than a few centemeters error. The IR beacon idea merits your attention I think!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-02-13 17:01
    Duplicate post in the BASIC Stamp forum was removed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • ercoerco Posts: 20,256
    edited 2009-02-16 20:27
  • JRod1JRod1 Posts: 7
    edited 2009-02-21 03:34
    well I wonder how the Roomba from iRobot navigates? This autonomous robot wanders around the room to clean so it must have obstacle avoidance and it's advertised as automatically returning to its docking station to recharge whenever it senses low volotage. Do you suppose it uses a beacon?

    And it's advertised to work on carpet and wood floors.
  • EzsynnEzsynn Posts: 119
    edited 2009-02-23 09:01
    To save money use a camera, instead of the 9 PING))) Sensors. Which is an awful lot, too much to be exact.
    I'm not trying to call you stupid, but it's a good idea to think over it.
    And Give yourself a budget. (My budget was $300 US worth of Parallax Items at a time)
    One or two of them is enough, if you use a servo turret that is.
    Another alternative is to use one PIR sensor which gives all round motion sensing.
    Costs considerately less at $8.99. only takes one Pin whereas 9 PING))) Sensors take up like 9 pins.
    This is only a suggestion. If you've already bought the 9 PING))) Sensors.
    Then I said nothing, okey?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BWIN ON DA POWAH WIFIN U!!!
    (This means the Plutonium Isotope Nuclear Fission And Fusion Reactor Battery Pack you've been hiding inside your jacket!!!)

    Post Edited (Ezsynn) : 2/23/2009 9:08:38 AM GMT
  • GWJaxGWJax Posts: 267
    edited 2009-02-23 14:44
    JRod1 said...
    well I wonder how the Roomba from iRobot navigates? This autonomous robot wanders around the room to clean so it must have obstacle avoidance and it's advertised as automatically returning to its docking station to recharge whenever it senses low volotage. Do you suppose it uses a beacon?


    And it's advertised to work on carpet and wood floors.

    The Roomba navigates by starting off in a circle until it hit an object via a bumper switch. Once the switch is pressed then it goes into a random routine in cleaning. As of docking and room avoidance it has an IR receiver on the top which looks for an IR beam from the room stopper unit and turn back around to continue cleaning. As of the docking unit, once the batteries are getting low it starts to look for the beacon IR pulse from the docking station and once found it will track this beam and realign it's self to dock. After docking it sees that the batteries are being charged then it stops at that location and ends it's program.

    Hope that makes sense to you. I have 2 of them, one with a docking station and the other an older version that does not incorporate docking sensing, and they both work great in cleaning and docking, so the advertising is correct.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • GWJaxGWJax Posts: 267
    edited 2009-02-23 14:58
    Ezsynn said...
    To save money use a camera, instead of the 9 PING))) Sensors. Which is an awful lot, too much to be exact.
    I'm not trying to call you stupid, but it's a good idea to think over it.
    And Give yourself a budget. (My budget was $300 US worth of Parallax Items at a time)
    One or two of them is enough, if you use a servo turret that is.
    Another alternative is to use one PIR sensor which gives all round motion sensing.
    Costs considerately less at $8.99. only takes one Pin whereas 9 PING))) Sensors take up like 9 pins.
    This is only a suggestion. If you've already bought the 9 PING))) Sensors.
    Then I said nothing, okey?

    Ezsynn, the PIR has too much of an area of sensing for object detection plus it looks for heat changes as well, so this unit will not work well for his robot. Also one camera is just not enough for this as well. IR sensing would wok great if the unit was only for indoors but the Ping))) is a better choice for the robot since it can be used indoors/outdoors, plus using the BS2p40 you have 32 I/O ports to work with. And if I'm not mistaken the motors if they were setup as servos they can be controlled in the background with some advanced codes while the program continues to check the sensor in the foreground, I'll have to recheck the manual for this though.
    When making a bot for the handicap, cost should not be a factor as they depend on this unit to move around as we do with our eyes..

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • LilDiLilDi Posts: 229
    edited 2009-02-23 16:57
    Just to clear thing up. Is the blind person riding the robot or is the robot making sounds the blind person can follow or maybe a leash like a seeing eye dog.
Sign In or Register to comment.