Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 with Parallax wheels and encoders — Parallax Forums

HB-25 with Parallax wheels and encoders

RandyManRandyMan Posts: 2
edited 2011-06-30 08:17 in Robotics
Good afternoon,

I purchased Motor Mount and Wheel Kit with Position Controller and been trying to get it to work properly. This is a great product.
Coming along but I have a problem that perhaps someone has experienced.

I send the command to "Travel number of positions" which it goes and ramps down to a stop. Once it reached it's destination then I give it another command to travel again, which it works fine and then comes to a stop but the third command it travels past the end point then backs up.
Just a loop in the code to test the communications adn response.

Example Travel 900 works fine, travel another 900 works fine then travel another 900 then it goes past end point and backs up.

My testing is done with the wheels not touching the ground....just testing the commands.

Anyone seen this before?

Thanks
Randy

Comments

  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-06-28 11:02
    Hello Randy,

    I heard of that happening before. Can you give us a few more details on your setup?

    - What controller are you using to tell the wheel kits what to do (BASIC Stamp, Propeller, etc)?

    - How is this wired up? Are you using a single serial line to drive both controllers?

    - Can you post some example code that you've used to test the motor kit?

    - Does this happen with both wheels or just one of the wheels?

    - If it is happening with just one wheel is that one set to use the reversed wiring and encoder values?

    The wheel/encoder kit is a really nice setup for sure. The only issue I have run into is in regards to setting one wheel up for reversed rotation. Until the encoder board has been told it should be reversed the motor can take off on it's own if you bump it. That board really should have had a jumper to set the initial value for the motor/encoder reversal. Since it doesn't the best way to handle it is to use a relay to control power to the HB-25's. The encoder boards can be powered by your controller. Once you've set (and confirmed) that the one controller is set to match the reversed motor you can turn on the relay to power the H-25's and everything is fine. If you don't then the motor kit really isn't in a safe state since it can take off on you if that setting hasn't been configured yet. I've run into this firsthand and now use the relay method to power the HB-25's.

    A very, very minor code change to the position controller firmware and the addition of a jumper (or grounding/pulling up an I/O pin) would fix it and put that issue to rest.

    Robert
  • RandyManRandyMan Posts: 2
    edited 2011-06-28 19:02
    Hi Robert,

    Thanks for the reply...
    I was afraid someone would ask for more details. I'm using the Arduino micro, could be a problem in my code but I was fishing to see if anyone else had the problem.
    Both wheels respond with the same issue.
    I am using a single wire to send commands to the position controllers which looks good. I receive the speed and position. I display the values as I troubleshoot..
    The relay is an excellent idea.
    Thanks again for your comments.
    Randy
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-06-30 08:17
    Hello Randy,

    Don't worry about it. You should be able to use the Parallax Wheel kit with just about any micro out there. Besides, the position controllers happen to be based on an Atmel controller too...

    If both wheels are reacting the same (and since I haven't heard of similar issues before) I would lean toward an issue in the Arduino code.

    - How are you keeping track of things in your code?

    - Are you using a variable that may be overflowing?

    - What if you use smaller or larger values? Does this still happen? If so is it always the third time or is it less often with small #'s and more often with larger ones?

    With some more testing and a review of the code you should be able to pinpoint the issue.

    Robert
Sign In or Register to comment.