AC servo RC radio speed fix

tutorial:

Hi, this tutorial taught me how to move servo through RC radio via arduino....then i was able to move an AC servo that uses PUL and DIR, but it rotates very slowly, what can i fix to make it go fast....


// ***------ RC Servo control -----***
// ***---- K. Michalsky / 2015 ----***


//Arduino Pins
// Pin7 to channel2 of receiver
// Pin9 to Signal of Servo1

//Include Servo library.The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. 
#include <Servo.h>

#define dirPin 2
#define stepPin 3

//Create servo objects to control the servo motors
//Servo servoMotor1;

//Define variables for the position of the servos
//int posServo1 = 0;

//Define a variable for the channel of the Receiver with which you want to control the servos, in this case channel2 (ailerons channel from my receiver)
int channel2;

int mSpeed = 0;

//Attach each servo variable to a pin
void setup() { 

  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  // Set the spinning direction CW/CCW:
  digitalWrite(dirPin, HIGH);
  
  //servoMotor1.attach(9);   //Servo1 attached to pin 9

    //Define the input Pin for the Receiver
  pinMode(7, INPUT);
  Serial.begin(9600);     //Serial comunication for later monitoring of channel signal value
}

void loop() {
  //Read the pulse from Pin7 either HIGH or LOW
  channel2 = pulseIn(7, HIGH);

  //Monitor channel value
  Serial.print("Channel 2:");
  Serial.println(channel2);

  //Define a range of the channel value to center the servo when the stick of the transmiter is centered. This range can variate depending on which servos and Transmiter you are using. Servos are centered at 90 degrees
  //if((channel2 >= 1450) && (channel2 <= 1550)){
    //posServo1 = 0;
    //servoMotor1.write(posServo1);
  //}
  //If the channel value is bigger than the highest value of the range do following
  if(channel2 > 1550){
    digitalWrite(dirPin, HIGH);
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1);
  }

    delayMicroseconds(1);
  if(channel2 < 1450){
    digitalWrite(dirPin, LOW);
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1);
    
  }

        
          }                  
                 
   
  //Time for Monitoring values

Does it ever go fast without the Arduino?

Do you have any details?

o yes for sure.... if i use this sample code it spins so fast

// Define stepper motor connections:
#define dirPin 2
#define stepPin 3
void setup() {
  // Declare pins as output:
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  // Set the spinning direction CW/CCW:
  digitalWrite(dirPin, HIGH);
}
void loop() {
  // These four lines result in 1 step:
  digitalWrite(stepPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(stepPin, LOW);
  delayMicroseconds(5);
}

Oh, it's a stepper motor, not a servo?

Your loop() times in that are much faster - with pulseIn it's going to be a lot slower

they work the same exact way, PUL and DIR

what do you mean, what can i change?

If you say so. All my servos have a single line PWM control line, power and ground. 3 wires. By definition, steppers aren't servos, they have no positional feedback system.

I mean, if you're using pulseIn to read an RC PWM output, the pulses only happen every 20ms.
You could try not using pulseIn

solved, thank you