Shop OBEX P1 Docs P2 Docs Learn Events
Timing rotations on a continuous rotation servo? — Parallax Forums

Timing rotations on a continuous rotation servo?

Hi folks,

Just got a contiguous rotation servo for my wheels. Is it possible to program timing of the servo turn? For example - turn clockwise for 2 seconds, turn counter for 2 seconds. I believe i cannot program fixed rotations like a standard servo, but perhaps timing is possible.

Thank you for your help! :)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2015-11-08 05:35
    Timing is possible, but isn't very accurate. The rotational speed of the servo depends partly on supply voltage which is affected by how fresh the batteries are. Wheels slip depending on the surface and wheel materials. Light loads slip more easily while heavy loads increase gear friction. The servo control pulses need to be generated every 20ms and 100 of them take approximately 2 seconds. You can adjust the time for each pulse to account for the width of the pulse as well as the time between pulses. If you try to do other work between pulses, you can compensate somewhat for that as well. Best thing to do is to add some kind of wheel encoder to come up with a count of the number of times the wheel goes around. Look at the wheel encoder for the BoeBot or the equivalent for the ActivityBot. These don't solve the slippage problem, but do tell you how far the wheel has gone. You can improve wheel traction.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-11-08 06:52
    I experimented with making and inexpensive robot. I wanted this "Cheap Bot" to drive in a figure 8 (there's a great thread in the robotics forum showing forum members' attempts to get their robot to drive in a figure 8 ).

    I kept trying to get my robot to perform the figure 8 but one attempt the robot went too far around a in a circle and the next attempt it wouldn't go far enough. I realized I was having the trouble Mike Green mentioned and the voltage of my batteries was changing which changed how fast my robot would travel.

    I finally ended up using a voltage regulator between the servos and the batteries. One I added this regulator the robot behaved much better and I was able to get the robot to perform repeatable figure 8s.

    While a voltage regulator will help, IMO, nothing beats encoders.

    There are a bunch of DIY encoder examples on the forum and of course Parallax sells encoders for both the BOE-Bot and the ActivityBot (they come with the ActivityBot but they can be ordered separately).

    I never purchased and ActivityBot myself. I converted one of my BOE-Bots into and ActivityBot by adding the various parts.
Sign In or Register to comment.