Servo motor control
Jeff R.
Posts: 1
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.
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 Williams
Applications Engineer, Parallax
Dallas Office
Happy Holidays!
KenJJ
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
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
HAppy Holidays!
kenjj