3 axis auto stabilized platform

hi... thanks for your help so far.. i managed to get it working already. :slight_smile:

void PulseServo(int channel,int pulsewidth)
{
  //   your code here to pulse the servo for the given channel with the given pulse width 
  // you should check that pulsewidth is within the valid range for your servos

  int pulse = 0;
  int pin_num = 0;
  
  pin_num = channel + 1; 
  pulse = pulsewidth;

  if ((pulse <= 2200) && (pulse >= 600)) 
  {
    digitalWrite(pin_num, HIGH);  
    delayMicroseconds(pulse);
    digitalWrite(pin_num, LOW);
  }

}

however... the servo is a litter jerky..... i check the pulse on the scope.... when everything is stationary... the PWM seems a bit unstable.. the pulses keeps moving left right right left... though the time between pulses is still ok..

do you have any idea what is causing the pulses to be moving?