Shop OBEX P1 Docs P2 Docs Learn Events
Servo motor control — Parallax Forums

Servo motor control

Jeff R.Jeff R. Posts: 1
edited 2004-12-17 07:05 in General Discussion
I'm trying to learn how to program the SX28AC for my assembly class. the book that came with the kit isn't very good, and is more of a reference book. I've mounted the board on the BOEbot chasis, and connected the servo motors to RC bit 6 and 7. I can program it to turn the motors on and off, but since the motors are mounted on seperate side of the chasis, the bot spins.

Does anyone know how to control the direction of the motors?
If the bits can only be set to 0 or 1, can the motors spin in both directions?
Does anyone know any good sites or book to learn how to program?

The class is an assembly class, but we learned how to program the 8085 processor. Now, stepping to something else seems impossible compared to the 8085 instuction set.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-15 23:06
    Guenther Daubach's book goes into very specific details on servo control and other things related to the Boe-Bot chassis.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • kjennejohnkjennejohn Posts: 171
    edited 2004-12-16 05:10
    Since the motors are180 degrees out in this configuration, they must rotate in opposite directions to drive the wheels in the same direction. Try reversing the power leads to ONE motor, if possible.

    Happy Holidays!
    KenJJ
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-16 09:09
    NO - NO- DO NOT DO THIS !!!

    You can't reverse roatation of one servo by reversing the power leads this might kill the servo.

    The direction of the servo rotation is controlled by the pulse width of the signal that controls the servo input. A pulse width of 1.5 ms should stop the servo (when correctly calibrated) longer or shorter pulses make it turn in one or the other direction with speeds controlled by the pulse width.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,


    G
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2004-12-16 15:59
    Gunther is very right.

    BUT, I have created a spin on another manufacturer's wheeled bot (r/c servo drive) by running on low batteries.

    What happens is that the drain of the batteries causes the microcontroller to reboot. This in turn causes both servos to get a spurious startup pulse and they jump in the same rotational sync (either clockwise or counter-clockwise) in responses to receipt of a similar width pulse.

    Thus, the little guy spins and spins in a loop created by the servos once again draininng the microprocessor down to restart.
    You never get into the actual program on the microprocessor.

    SO, you might make sure that your batteries are fully up to snuff if you are getting an uncontrollable spin.
    Alternatively, you might provide separate power to the servo motors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • kjennejohnkjennejohn Posts: 171
    edited 2004-12-17 07:05
    Sorry 'bout that, I was thinking simple DC motors. I somehow managed to miss the mention of servos. *sigh* Hope I didn't lead you to fry your motors.

    HAppy Holidays!
    kenjj
Sign In or Register to comment.