Brushless motor control using arduino

I am having problem in controlling speed of brushless motor using ESC .It move at certian angle then stop for few second then again start moving and stops.I tried reducing delay time but no success.

Could you explain your set-up in detail? How are you controlling the ESC? How are things powered?

I am giving seperate 9v supply to ESC which drives brushless motor.I did all connention as stated on website.It gives on beep then move at an certian angle and stops..these process repeats.Is there eroor in my logic in code...Here is my code ::

#include "Servo.h"

#define MOTOR_PIN 10
#define MOTOR_MAX_SPEED 180
#define MOTOR_START_SPEED 80

int motor_current_speed = 0;
int motor_increment = 1;
int max_reached = 0;

Servo motor;

void motorSetSpeed(int speed)
{

if (speed > MOTOR_MAX_SPEED)
speed = MOTOR_MAX_SPEED;
else if(speed < MOTOR_START_SPEED);
speed = MOTOR_START_SPEED;

motor.write(speed);
motor_current_speed = speed;

Serial.print("current motor speed = ");
Serial.println(motor_current_speed);
}

void motorSpeedUp()
{

int increment = (motor_current_speed < 100) ? motor_increment + 2: motor_increment ;
motorSetSpeed(motor_current_speed + increment);
}

void motorSlowDown()
{
int increment = (motor_current_speed < 100) ? motor_increment + 2: motor_increment ;
motorSetSpeed(motor_current_speed - increment);
}

void motorStop()
{
motor.write(0);
}

void motorStartAt(int start_speed)
{
int i;
for (i=0; i < start_speed; i+=5)
{
motorSetSpeed(i);
Serial.println(i);
delay(10);
}
}

void setup()
{

Serial.begin(9600);

delay(1000);
motor.attach(MOTOR_PIN);
motorStartAt(MOTOR_START_SPEED);
delay(1500);
}

void loop()
{

if (!max_reached)
{
motorSpeedUp();
} else
{
motorSlowDown();
}
if (motor_current_speed < MOTOR_START_SPEED)
{
max_reached = 0;
} else if (motor_current_speed > MOTOR_MAX_SPEED)
{
max_reached = 1;
}
delay(50);
}

Its possibly power related, what sort of 9 Volt battery are you using ?

If its a square one, check the two links in my signature

Duane B

rcarduino.blogspot.com