1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

DIY Quadrature Decoder/Counter Interface

Discussion in 'Robotics & Mechatronics' started by AllanBertelsen, Apr 7, 2007.

  1. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Well it's an old Parallax app note, see the section on reading rotary encoders with schematic & source code.
    Parallaxes manuals are usually excellent.
     

    Attached Files:

  2. AllanBertelsen

    AllanBertelsen New Member

    Joined:
    Apr 5, 2006
    Messages:
    89
    Likes:
    0
    Location:
    Denmark
    Hi Hank,
    I agree. Knowing what the motors do is not the same as knowing where the robot is. But it is the basis for knowing it. Slow start and stop as well as the effect of a heavy robot make odometry data more reliable. The biggest contribution to errors will be the fact that the terrain is rather rough. It’s the lawn in my garden.
    I bought a Devantech Compass. I hope it will be useful as a key component for adjusting direction drift. David P. Anderson describe method pros and cons on this page: http://www.seattlerobotics.org/encoder/200610/article3/IMU Odometry, by David Anderson.htm

    Then I bought four Devantech SRF05 ultrasonic rangers. With those I might be able to use the ultrasonic fingerprint for landmark identification. I know this is a complex challenge. So before anything else the rangers are of course for collision avoidance.

    I have been reading about using PS/2 mouse signals. The first references I read did not look so promising. But I since found that it surely is a possibility. But then – I already got all the logic circuits to implement my idea. I redesigned my project a bit. It's now a regular PID controller. And I find it challenging to implement it. Specs are: 2 x 12 bit encoder readings (mouse is 2 x 8 + 1 bit) The PID loop is 50Hz. The controller is initialized serial by values for Kp, Ki and Kd. When running it receives 7 or 8 bit speed signal and 1 bit direction signal for each wheel. It sends 7 bit signal for the each PWM generator and again one bit for direction.

    Hi Bill,
    Yes it's an excellent manual. The loop described in the code has to be constantly running or there is a risk for missing counts. But if the PIC should do noting much else, it's an excellent solution. As you can see of the answer above, my mind is pretty much set for trying to build the circuit I have in mind.
     
  3. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Since its a large robot, why not put a GPS on it?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. AllanBertelsen

    AllanBertelsen New Member

    Joined:
    Apr 5, 2006
    Messages:
    89
    Likes:
    0
    Location:
    Denmark

    GPS could be very interesting. It could be very expensive to. GPS modules cost around US$300. I would love to play with those modules. The positional accuracy is 1 to 5 metres. I can get a RFID receiver for around US$60. By placing tags in the lawn – as landmarks, the robot can get a very high precision for a fraction of the monies.
     
  6. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
  7. AllanBertelsen

    AllanBertelsen New Member

    Joined:
    Apr 5, 2006
    Messages:
    89
    Likes:
    0
    Location:
    Denmark
    OK That's very exciting. Then we only need better accuracy. It could be a useful method for getting a good approximation for where the robot is. Then the search for landmarks can be restricted to a small subset for all possible landmarks. The area the robot has to operate in is well-known. There is 5000 square metres of garden with beds, borders, trees, scrubs and other obstacles. But the robot can be provided with a map to navigate from. When the robot is moving it starts at its base station where batteries are charged. By odometry and landmarks it will be able to know better than by 5 metres accuracy where it is. GPS could of cause be useful if the robot where rebooted at an unknown place.
     
  8. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    The way to get really good accuracy with a GPS is two GPS units, one stationary on a PC and the mobile one. You subtract the difference as they will both be off by the same error. Use an XBee radio $20 to keep them syncronised. I think the method is called differential GPS.
     
  9. AllanBertelsen

    AllanBertelsen New Member

    Joined:
    Apr 5, 2006
    Messages:
    89
    Likes:
    0
    Location:
    Denmark
    Hi Bill,
    After I read your posting, I have been studying differential GPS. It's very interesting. And it's on the list for future consideration in this project. I just started building the robot two weeks ago. I got two good motors and the base of the robot is almost finished. There are a lot of steps to go through in such a project. When the robot is ready for the first run, I must be mastering odometry before considering navigational methods.
     
  10. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Aren't there a large number of articles going around in the media about the failings of the GPS system and how during a solar maximum GPS is going to be anything but reliable?
     
    Last edited: Apr 15, 2007
  11. AllanBertelsen

    AllanBertelsen New Member

    Joined:
    Apr 5, 2006
    Messages:
    89
    Likes:
    0
    Location:
    Denmark
  12. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    The ds PIC30F2010 can interface directly with quadrature encoders
     

Share This Page