Shop OBEX P1 Docs P2 Docs Learn Events
Controlling Motors with Stamp — Parallax Forums

Controlling Motors with Stamp

stuartXstuartX Posts: 88
edited 2012-01-25 06:49 in Robotics
Hi all.
I'll be starting on my MCU work for my robot. I have a question in terms of the MCU sending signals to the motor.
I went through the Boe-Bot book and still refer to it. But that Bot used servo motors. In order to get to a position or
make the servo move using the PULSOUT command.
Now, I have a homemade robot with NPC T64 motors which is not a servo.
I use a Sabertooth 2x25 controller, Vantec RDFR36E Speed Controller and RoboClaw 2x25. I swap them in and out using one at a time to test.

My questions are:

-Is there a standard number that I use with the MCU PULSOUT command to adjust speed (fast, slow), direction (right, left, forward, reverse)? Or is it trial and error with testing?
-Does the type of speed controller vary with the PULSOUT command from the MCU?

Please feel free to correct any incorrect statements that I've made. I'm a 47year old that is doing this stuff for fun and learning. I'm not enrolled in any school or class. I'm not enrolled in any school or class and this is not associated with any project or assignment.

Thanks, any help will be appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-25 06:07
    The Robotics with the BoeBot manual discusses this. Although there's always some "slop", standard servos expect a control pulse from 1ms to 2ms in length (produced by the PULSOUT statement). 1ms corresponds to one end of the range of movement and 2ms corresponds to the other. Some servos will respond to values from a wider range (0.5ms to 2.5ms). 1.5ms always corresponds to the center of the range. If you have continuous motion servos, like the wheel servos of the BoeBot, they respond to the same pulses, but 1ms corresponds to maximum speed in one direction and 2ms corresponds to maximum speed in the other direction. 1.5ms is the stopped pulse width.

    If you would read the chapter in the Basic Stamp Syntax and Reference Manual (or the section of the on-line help in the Stamp Editor) on the PULSOUT statement, you'll see that pulse width values in the PULSOUT statement correspond to 0.2us units, so 750 causes a 1.5ms pulse to be produced.

    Motor speed controllers either are designed to accept servo control pulses or something else like asynchronous serial commands (sent with the SEROUT statement). You'd have to look at the documentation for the controller.

    Added: The Sabertooth controller looks like it will accept either servo control pulses (R / C) or serial commands ... your choice. The serial commands would probably give you finer control.
  • stuartXstuartX Posts: 88
    edited 2012-01-25 06:49
    Thank you for the information. I have to read those sections more. I'm not grasping your information to go and try it right away. I will have to soak it in to better understand it.
    Thank you very much.
Sign In or Register to comment.