Shop OBEX P1 Docs P2 Docs Learn Events
different speed on wheels — Parallax Forums

different speed on wheels

HoffaHoffa Posts: 46
edited 2006-08-12 14:57 in BASIC Stamp
Why does the wheels have different speed when I compile this program:

DO

PULSOUT 12, 750
PAUSE 20
PULSOUT 13, 750
PAUSE 20

LOOP

?!?!

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-08-12 13:57
    Because the wheels are driven by modified Servo's. "Matching" the speed of one servo to another has not been a goal of the manufacturer. It's also possible that the variable resistor current position is slightly different on each servo.

    Both of these mean that two off-the-shelf servo's may need a little tweaking to match speed. You can 'tweak' them in software by finding the exact speed numbers for each, and in hardware by adjusting the 'center position' variable resistor.
  • DaveGDaveG Posts: 84
    edited 2006-08-12 14:02
    Try Taking out one "PAUSE 20".
    The servos need to be updated approx. every 20ms, 40ms is too long.
    Notice that your loop, as written, takes 40ms to get back to each of the PULSOUT instructions.

    DaveG
  • Mike GreenMike Green Posts: 23,101
    edited 2006-08-12 14:03
    You probably have continuous rotation servos. They have to be calibrated. There are instructions in the "Robotics" manual which you may already have or you can download from the Parallax website. Even when calibrated, there may be slight differences between individual servos and you may need an adjustment factor, but try calibration first. This is particularly true with standard servos which don't have an adjustment. An example:
    CenterAdj1 = 0
    CenterAdj2 = 5
    
    do
     pulsout 12,CenterAdj1+750
     pause 10
     pulsout 13,CenterAdj2+750
     pause 10
    loop
    
    


    By the way, you need to have all the pauses in your loop add up to less than 20ms. The servos need to see a pulse about every 20ms. Your example would pulse each servo only every 40ms. What you'd see would be some "stuttering" with the slower pulses
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-08-12 14:57
    Agreed.

    Note that each servo needs to be updated every 20 mSec. This means you can update 2 or more in a 'block', then have a single 20 mSec delay before updating everything again.
Sign In or Register to comment.