Question About Continuous Rotation Servos
amalfiCoast
Posts: 132
in Robotics
Hello,
I am working on a balancing ActivityBot using the continuous rotation servos (not the new 360 feedback servos). Whenever the servos change direction they seem to pause for a brief time (this can also be seen in the output stream in the terminal). I think this pause is enough to cause problems tuning the controller and the robot falls over. Is this pause something that can be eliminated? By the way, I'm using the abdrive.h library. I don't know if the library could have something to do with it. Thank you.
Regards,
David
I am working on a balancing ActivityBot using the continuous rotation servos (not the new 360 feedback servos). Whenever the servos change direction they seem to pause for a brief time (this can also be seen in the output stream in the terminal). I think this pause is enough to cause problems tuning the controller and the robot falls over. Is this pause something that can be eliminated? By the way, I'm using the abdrive.h library. I don't know if the library could have something to do with it. Thank you.
Regards,
David
Comments
Here is the code I am using to call the servos:
Please let me know what you think.
David
I realize you're using what you have, but it seems like you have a good idea hampered by a second choice for hardware. Mind you, I like these servos but what makes them special has little/no use in a balance robot.
-Phil
Thanks for your replies. I am using the continuous rotation servos with external optical encoders. How would I ignore the encoder information in the command?
I am interested in trying the gear motors as Gordon suggests. What would be the best way to drive a PWM command in C?
Thank you again.
David
-Phil
I believe I am using the old library. I am using the abdrive.h library rather than the abdrive360.h library. Please correct me if I am wrong. I should be able to use the gear motors with the abdrive.h library to drive the PWM signal. Are there specific gear motors you would recommend for this application?
Thanks,
David
-Phil
Regards,
David
I haven't looked at the Prop BOE libraries in a while, but to control a PWM motor you send it pulses of a specific duty cycle and frequency. The basic servo drive is sorta kinda like PWM, but the frequency is much, much slower (50 Hz). Most DC motors want a frequency in the 1-5 kHz range, sometimes higher. Also, in PWM it's the amount of on-time versus off-time that's important. In a servo, the length of the pulse -- from 1 to 2 ms -- is all that matters.
So, I don't think you can rely on the servo library unless you rewrite it. If you've got some spare cash, a motor driver with PWM control is a lot easier! It gives you PWM and provides an output stage for driving the motor from a microcontroller.
I'm not sure if Parallax carries any of these, but Pololu, Sparkfun, and Adafruit do. They';re about $5 to $10. You're looking for a basic DC controller for two motors with I2C control. Something with a max 1-1.5 amp current output should about do it. The DRV8833 module is popular, and used on a number of boards. You'll find it on lots of cheap boards from eBay China (a couple bucks each).
https://www.pololu.com/product/2135
and two micro gear motors to drive my robot's wheels. Can the Parallax servo library be used with the motor controller to drive the motors or is there other code that is required?
Would you be able to explain what the code would look like to run the motor driver?
Respectfully,
David
You may also find some examples in the BlocklyProp community site. You don't have to stick with blocks if you don't want to (though it's a robust environment in its own right). BlocklyProp creates PropC code in the background.
I'm sure you're aware that a self-balancing robot is one of the most difficult projects to take on, even for experienced builders. Pololu sells a kit for a small balancing robot and they spend a long time writing the support libraries. I doubt they have libraries for the Propeller, but you could look at the C code for the Arduino version and see if you could port it over. It would be a tall job in any case.
Thanks for all your help.
David