[QUESTION] Synchronized continuous servo motor speed

I recently purchased 4 new servo motors which I have modified to be continuous. I want to connect them to the mecanum wheels of the machine I am about to create.
However, the problem that I have came across is that they all rotate at slightly different speeds.

All the continuous servos have all been modified and set at 90° and the angle they are supposed to rotate to are all the same.

I have 2 ideas to fix this problem.

  1. is to find a perfect gear ratio so that they all the output shafts rotate at the same speed.
  2. is to switch back and forth the speeds with code so that they rotate at the same speed.

Any ideas or help would be greatly appreciated.

the problem that I have came across is that they all rotate at slightly different speeds.

No surprise there

Even if you manage to get the servos to rotate at the same speed under some conditions that will not be the case under all conditions. Then there is the problem that the wheel diameters will not all be exactly the same

Your only hope is to add some feedback, such as a rotary encoder, to each wheel so that you can monitor its rotation directly and adjust the wheel speeds in software to make them the same whilst applying a fudge factor to account for the different wheel diameters. This is basically your idea 2 but you need to be able to accurately measure the rotation.

"2. is to switch back and forth the speeds with code so that they rotate at the same speed."

This is about the only choice you have. If you use writeMicroseconds you will get better control than if using degrees. Below is some servo test code I've used setting up continuous rotation servos.

// zoomkat 3-28-14 serial servo incremental test code
// using serial monitor type a character (a to increase or s 
// to decrease) and enter to change servo position 
// strings like aaa or ssssss can be sent (use delay to slow)
// for IDE 1.0.5 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include<Servo.h>
Servo myservo;
char dir; //direction character

// possible starting points for servo testing

//microseconds:
//int pos=2400; //microseconds
int pos=1500; //~neutral value for continuous rotation servo
//int pos=600;

//degrees:
//int pos=170; 
//int pos=90; //~neutral value for continuous rotation servo
//int pos=10;

void setup()
{
  myservo.attach(7, 400, 2600); //servo control pin, and range if desired
  Serial.begin(9600);
  Serial.println("serial servo incremental test code");
  Serial.println("type a character (a to increase or s to decrease)");
  Serial.println("and enter to change servo position");
  Serial.println();

}
void loop()
{
  if(Serial.available()>0)
  {
    dir = Serial.read(); //get direction character

    if(dir =='a'){ //decrease value
      (pos=pos-1); //use larger numbers for larger increments
      if(pos<0) (pos=0); //prevent negative number
    }
    if (dir =='s'){  //increase value
      (pos=pos+1);
    }
   
    if(pos >= 400) //determine servo write method
    {
      Serial.println(pos);
      myservo.writeMicroseconds(pos);
    }
    else
    {   
      Serial.println(pos);
      myservo.write(pos); 
    }
  } //delay(250); //can be used to slow string increments
}

Whilst it is true that writeMicroseconds will give finer control, without feedback as to the actual speed then no amount of fine control is going to help synchronise the wheel speeds

"Whilst it is true that writeMicroseconds will give finer control, without feedback as to the actual speed then no amount of fine control is going to help synchronise the wheel speeds"

Moving on a geared track encoders can be accurate. Typically on a wheeled bot (may not apply to a mecanum wheel setup) in a turn the wheels will slip unless precise calculations are made for each wheel's rotation. Not sure encoders would be worth the effort. The servos I've modified typically have about a 5us control dead band that can be worked with to have fairly stationary wheels when desired.

Before going to the trouble of adding sensors to measure wheel speed I think it would be worth building in a fudge adjustment for the speeds of 3 of the motors to try to match them to the 4th. That could take the form of a constant amount to be added or subtracted or a constant factor to multiply the motor value by - for example motorX may always need 5% more.

Another key factor is the control system. If the machine is radio controlled then it may well be that the differences in wheel speed get absorbed by the control system - for example if you hold the joystick (or the steering wheel) a little off-centre the machine will go straight.

...R