Shop OBEX P1 Docs P2 Docs Learn Events
Parallax Wheel Motor: Question about Encoder use — Parallax Forums

Parallax Wheel Motor: Question about Encoder use

TheGregsterTheGregster Posts: 3
edited 2010-02-28 02:45 in Robotics
I purchased the Parallax wheel/motor kit with encoders.· The system tots around a small laptop with its principal sensor being a camera using a reduced optical flow algorithm for obstacle avoidance.· The motors are controlled via a Phidgets 12V motor controller connected via USB to the laptop.··Navigation will be by dead reckoning, so the encoders are·critically important.·

The problem is the hardware connection to the encoders.··Apparently,·it would be difficult to attach them to a PC.· No·worries, I·have a·few microcontrollers (oopics)·sitting around which can talk to the PC via a serial port.· I·figured I could just connect the encoders to a couple pins on·a microcontroller.· And then have the microcontroller poll the encoders for position and speed·and then·relay the·results to the PC via the serial port. ·

This all sounded good until I looked at the documentation for the encoders.· It assumes I am using HB25 Motor Controllers.· I am not; I already have·a few·phidgets, and the phidgets interface·easily to PCs whereas·I am not sure he HB25s do.· So much of the documentation is irrelavant to me. So I have questions about this·"serial" data interface to the encoders.

From what I can tell, there·are not seperate send and receive pins for the serial interface (which would have made talking to it trivial).··Sure there are two pins marked as DATA to the controller, but from what I can tell, it appears they are shorted together (right?)· So if you are·using just one pin for both sending and receiving, you must have some protocol for deciding who can talk when on the line.· Where is this protocol documented?· Is this protocol usually implemented in software on the microcontroller, or is there some chip set I am supposed to be using?· Does an oopic microcontroller have that chip?· Does a·Basic stamp?· ········

Comments

  • W9GFOW9GFO Posts: 4,010
    edited 2010-02-26 03:14
    TheGregster said...
    So if you are using just one pin for both sending and receiving, you must have some protocol for deciding who can talk when on the line.

    When querying the position controller the command sent will include the ID of the position controller that you want to respond.

    Look here starting on page 11.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
  • TheGregsterTheGregster Posts: 3
    edited 2010-02-26 04:12
    I am fine with giving a seperate I/O line from my microcontroller to each of the encoders, so there will be no device ID conflicts (and it makes things less confusing to me). I was more worried that there were extra bits I have to send over the wire to support whatever clever protocol allows several devices to both send and receive on the same wire. So I guess you are saying there is no such clever protocol.

    I just simply sending out the eight bits for the command, then switch the microcontroller's I/O line from output to input (hopefully that happens before the response comes), and then listen to what bits come back.

    Thanks, I will give it a try and post the results here. (Sorry for the confusion, I am used to seperate send and recieve wires on serial protocols).
  • W9GFOW9GFO Posts: 4,010
    edited 2010-02-26 04:18
    TheGregster said...
    ... then switch the microcontroller's I/O line from output to input (hopefully that happens before the response comes), and then listen to what bits come back.
    If necessary you can use the STXD – Set Tx Delay command to increase the time it waits before responding.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.

    Post Edited (W9GFO) : 2/26/2010 6:01:23 AM GMT
  • johnsoperV52johnsoperV52 Posts: 10
    edited 2010-02-28 02:45
    the only good clue at all on how to communicate with position controller through one wire are seen in one code object that seems to work for me but it is a BS2 code object with HB-25. but·that setup·does work for me.



    to get to it:

    try going to Parallax.com then go to·accessories like you are going to buy the wheel kit on line.

    at the bottom of the wheel kit sales information page is a bit called downloads.

    there you will find:· Position Controller test interface:

    http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/PositionControllerTestInterface(v1_2_1).zip
Sign In or Register to comment.