Brushless motor control using Serial

#include <Servo.h>

Servo esc;

void setup() {
  esc.attach(9);
  Serial.begin(9600);
}

void loop() {
  for (int i = 1000 ; i < 2000 ; i += 10) {
    esc.write(i);
    delay(300);
  }
}

the code above not work.

ESC: E329530
Motor: A2212/5T 2450KV

what is the basic concept to control the brushless motor?

Do you have any links to the motor and the ESC?
Can you post your wiring diagram?

Do you have access to a hobby servo? It is often helpful to confirm that your wiring and code are doing what you expect by plugging in a servo and seeing it move.

Many ESCs have an 'arming' sequence. Power up the ESC with zero throttle. Send a full throttle signal. Then send a zero throttle signal again.
There may be beeps involved.
Then it is armed and ready to drive the motor.

But without information on your hardware we will just be guessing.

the ESC white line connect to arduino pin9,
and the brushless motor will run when i is between 1150~1500 plus delay

But don't know how to keep the motor running.

ESC: https://www.google.com.tw/search?q=E329530+esc&rlz=1C5CHFA_enTW713TW713&source=lnms&tbm=isch&sa=X&ved=0ahUKEwi-6aPqlIDTAhUDfrwKHZKUCBMQ_AUICSgC&biw=1357&bih=711#imgrc=T49tZCPi-lv6UM:

Motor: https://www.google.com.tw/search?q=A2212/5T+2450KV&rlz=1C5CHFA_enTW713TW713&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjfm8mAlYDTAhUGx7wKHXscDX8Q_AUICCgB&biw=1357&bih=711#imgrc=MkyyjkSQ3GUZNM:

easonwang01:
the ESC white line connect to arduino pin9,
and the brushless motor will run when i is between 1150~1500 plus delay

But don't know how to keep the motor running.

Have you tried a simple

esc.write(1150);

...R

It should be high-to-low transition not a steady value.

I'm trying to search the datasheet of the motor but only find this http://www.batteryheatedclothing.com/pages/A2212-6T-Technical-Data.html

How do people know it need to between 1000~2000 for Servo write value?
And the Dead band width?

servo.write() sends pulses (high to low). That's what it does. A constant value keeps the motor running at a constant speed. Changing the value changes the speed.

Servos and ESCs are standardised on 1-2ms pulses (1000-2000us) at approx. 50-100Hz. Any deadband is minimal and I've never seen it specified for hobby ESCs or servos.

Steve

easonwang01:
How do people know it need to between 1000~2000 for Servo write value?

Maybe they read the instructions ?

...R

Robin2:
Maybe they read the instructions ?

Always a good idea but in this case to understand what is going on in the code the OP may also need to know that if you use servo.write() with value greater than 180 it will try to default to writeMicroseconds() instead. That explains why a command that normally takes a value from 0-180 degrees works with values like 1150. When I first met that I had to look through the header code (often a good idea) to find out what was going on.

Steve

thanks,but why the code above will not works.
The motor keeping "bee" for the delay time.

easonwang01:
thanks,but why the code above will not works.
The motor keeping "bee" for the delay time.

Are you still referring to the code in your Original Post?

Have you tried any of the suggestions you have been given? Which ones? What happened?

Especially, what about Reply #1?

People take some time to offer suggestions. The least you can do is respond to each of them. If you don't understand something then say so.

...R

thanks for reply.
There are three bees when init.
Then run the code the motor will keep beeing and rotate for 5 degree and rotate back.

the black line to Arduino GND and white to pin9.