SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Jun 25, 2012, 10:12 AM
Registered User
Joined Jun 2012
12 Posts
Help!
Controlling Brushless Motor through ESC using Arduino

Hey,
I have a brushless motor and ESC, which I'm trying to control using an Arduino Uno for my first quadrotor project. And I'm failing miserably, which is why I'm here. I tried connecting the Arduino to the ESC and using the Servo library, but it didn't work. I even tried sending 10 pulses of width 1ms, with an interval of 20ms, but that didn't work either. All I get are three continuous short beeps on power and then short single beeps. I'm probably not able to even arm the ESC. This is the motor I'm using(Emax CF2822): http://www.yinyanmodel.com/En/ProductView.asp?ID=58 This is the Red Brick ESC's manual(Mine's the 20Amp Aircraft one, with Ni-MH and LiPo Auto-detect. Table 1.1): http://www.hobbyking.com/hobbyking/s...2X53414X39.pdf It's meant for an RC receiver and I have no idea how I can emulate one through my Arduino. All in all, I'm totally blank. If anybody could please help, I'd be real grateful. It'd be great if I could get the Arduino code also.

Thanks a lot.
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Sign up now
to remove ads between posts
Old Jun 25, 2012, 11:37 AM
Trying to learn.
leprud's Avatar
Moscow, Russia
Joined Jun 2010
181 Posts
At power-up, you need to send 1ms pulse to "init" ESC for couple of seconds (usually, until you here starting sounds, like three continuous short beeps in your case). Only after that you can increase pulse up to 2ms (for full throttle). It's preprogrammed in ESC, as you can mistakenly power up ESC with your throttle signal not in lowest position.

PS Hope, you are trying without prop?
leprud is offline Find More Posts by leprud
Reply With Quote
Old Jun 25, 2012, 11:44 AM
Registered User
Joined Jun 2012
12 Posts
Yes, I'm trying without props. And I tried doing what you said(sending a 1ms and then increasing throttle.) But it still doesnt spin. When I connect the ESC to the battery, I hear three beeps and then short single beeps of every 1s. Could you please give me the code? That would make me understand much better.
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Old Jun 25, 2012, 11:53 AM
Trying to learn.
leprud's Avatar
Moscow, Russia
Joined Jun 2010
181 Posts
Actually, single beeps indicate either not 1ms pulse, or lack of pulses!
If all connections are right then, you can try this code http://www.rcgroups.com/forums/showp...7&postcount=21
Also, please see post 24 in the same thread. It's related to "throttle range calibration" setting in particular ESC
leprud is offline Find More Posts by leprud
Reply With Quote
Old Jun 25, 2012, 12:10 PM
Registered User
Joined Jun 2012
12 Posts
Oh, okay Thanks a lot, Leprud. Really helped
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Old Jun 25, 2012, 12:18 PM
Trying to learn.
leprud's Avatar
Moscow, Russia
Joined Jun 2010
181 Posts

Please post success story soon!
leprud is offline Find More Posts by leprud
Reply With Quote
Old Jun 26, 2012, 07:56 AM
Registered User
Joined Jun 2012
12 Posts
No success
This is my code:

#include <Servo.h>

Servo esc;
int j;

void setup()
{
delay(5000); //Delay to give me enough time to control esc to battery
esc.attach(9);

for(int i=0; i<1000; i++) //Arming
{
esc.write(0);
delay(20);
}
}

void loop()
{
for(j=0; j<180; j++) //Running the motor
{
esc.write(j);
}
for(j=180; j>=0; j--)
{
esc.write(j);
}
}

It beeps till the setup() is done. and then goes blank.
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Old Jun 26, 2012, 08:00 AM
Trying to learn.
leprud's Avatar
Moscow, Russia
Joined Jun 2010
181 Posts
Double checked connections? Maybe post a picture?

Also, instead of
Quote:
for(int i=0; i<1000; i++) //Arming
{
esc.write(0);
delay(20);
try

Quote:
for(int i=0; i<1000; i++) //Arming
{
esc.write(45);
delay(20);
as mentioned in thread i linked
leprud is offline Find More Posts by leprud
Reply With Quote
Old Jun 26, 2012, 08:20 AM
Registered User
Joined Jun 2012
12 Posts
I tried the code you gave. It goes "beep beep beep" continously turning just slightly. And I've attached the pictures.
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Old Jun 26, 2012, 08:25 AM
Ape-pilot Extraordinaire
TS00's Avatar
Canada, NB, Moncton
Joined Jun 2011
1,508 Posts
Please say you aren't powering that ESC from a PP3 battery...
TS00 is offline Find More Posts by TS00
Reply With Quote
Old Jun 26, 2012, 08:28 AM
Registered User
Joined Jun 2012
12 Posts
Currenlt, yes. I'm trying with the 9V battery
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Old Jun 26, 2012, 08:29 AM
Ape-pilot Extraordinaire
TS00's Avatar
Canada, NB, Moncton
Joined Jun 2011
1,508 Posts
Use something that can deliver more current. That battery will cause you problems, and is unlikely to ever run the motor.
TS00 is offline Find More Posts by TS00
Reply With Quote
Old Jun 26, 2012, 08:31 AM
Registered User
Joined Jun 2012
12 Posts
So can that be the cause my motor isn't running? I'll use NiMH or LiPo(As it's writtent on the ESC.)
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Old Jun 26, 2012, 08:35 AM
Ape-pilot Extraordinaire
TS00's Avatar
Canada, NB, Moncton
Joined Jun 2011
1,508 Posts
I'm not saying it's the only cause, but it's almost certainly one of the causes.

First, a PP3 won't deliver enough current - the voltage will drop very low as soon as the ESC puts a load on it.

Second, most ESCs (I don't know for certain that yours does) detect the voltage and try to figure out the battery type from the voltage (multiple of 1.2 or 3.7). They then cut off when the voltage drops below a preset level. So when you connect a 9V PP3, if your ESC is in NiMH mode it will think you have a weak 8-cell pack attached. It will cut out as soon as the voltage drops to ~7.5V, which it will do instantly.
TS00 is offline Find More Posts by TS00
Reply With Quote
Old Jun 26, 2012, 08:38 AM
Registered User
Joined Jun 2012
12 Posts
Oh...okay. thanks TS00 I'll try using an NiMH. But is the code fine for running it?
Skriptkid is offline Find More Posts by Skriptkid
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question How is the way to use arduino to control ESC? windhamwong DIY Electronics 26 Oct 17, 2012 06:29 AM
Wanted 2800kv Brushless Motor/30A Brushless ESC for Multiplex EasyStar upgrade davidjrojas Aircraft - Electric - Power Systems (FS/W) 1 Jun 25, 2012 01:33 PM
Help! Controlling a Brushless Motor through ESC using Arduino Skriptkid Beginner Training Area (Heli-Electric) 2 Jun 25, 2012 08:34 AM
Sold CC Phoenix-25 Brushless motor control (ESC) pro bro steve Aircraft - Electric - Power Systems (FS/W) 0 Jun 06, 2012 04:49 PM
Discussion Brushless Motor+ Speed Controller+ Arduino Uno= Problems d4n1s Power Systems 3 Nov 26, 2010 02:03 PM