SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By Skriptkid
#145969
Hey,
I'm a complete newbie to Helis and the electronics related to it, and am trying to build a quadrocopter(first one.) I want it's motors(brushless) to be Arduino Uno-controlled and have three doubts related to this:

1. I have no idea about how to connect an ESC to it. I've read that it can be connected to one of the digital PWM pins and controlled using the Servo library, but, if this is done, wouldn't it, although it'll have a separate power source, draw current from the board and burn it, since the board provides only about 20mA?

2. Are all ESCs programmable from an Arduino, or are only some microcontroller-programmable?

3. (This might be stupid - ) I've checked out some ESCs on websites, but haven't seen their max voltage written anywhere. So do the ESCs also have a voltage limit or can the voltage supplied be the same as that for the motor?

I'd be really glad if anybody could answer these.
Thank you.
By fll-freak
#145972
ESC designed for RC control (model cars and planes) use a pulse width modulation scheme for control. Connecting the ESC to an Arduino is as simple as using the servo library. The ESC does not draw its power for the motor from the PWM control lines. There are separate leads for the motor, the battery, and the PWM control.

You will get two flavors of RC ESCs. The type to drive brushless motors and those to control brushed motors. In each category you will also find maximum voltage/current specifications. Some ESCs will not spec the voltage/current but rather tell you want type of batteries and motors they can handle. Something like a N-cell NiCad with a N-turn brushed motor. This equates back to voltage and current with the appropriate knowledge of how many volts a single cell produces and how much current various motors consume.

Going outside the specs for an ESC will either cause them to power down to save themselves or to simply burn up (if no safety features implemented).
By Philba
#145981
There are a couple of issues with using straight PWM. These come from the 1-2mS pulse width in a 20 mS period (50 hZ) typically used to control the ESC. The default PWM frequency for some of the PWM pins is 488 hz, others are 1Khz. Depends on the arduino model. Not every ESC responds to that cleanly. On a 488 hz pin, for very large duty cycles, there could be an issue because 2 mS is 500 hZ so you clearly can't represent a 2mS pulse (close though, may be good enough). On a 1Khz pin, you can't even do 1 mS pulses - I be surprised if it worked at all. You can change the PWM frequency though it's dependent on which Arduino (actually on the specific ATMega). You'd want to slow it down but you'll have to experiment with the PWM frequency. I'd guess 250 hz would be OK. Google finds a number of places that describe how to do it.
By fll-freak
#145988
Philba,

I was under the impression that the Arduino Servo library did the 1 to 2 ms pulse every 20 ms as is required by most servos and ESC. Although this is a PWM scheme it is not the traditional square wave PWM that you might use to directly control a motor via an H-Bridge. I hope I am right because, I plan on connecting up a servo and an ESC tonight!
By Skriptkid
#146028
Thanks a lot fll-freak and Philba :) @fll-freak: Exactly wanted I wanted to know :D. @Philba: Didn't know that :o So thanks for letting me :D Thanks again, guys. Really helpful :D
By Philba
#146030
Skye, you are right, I misread using PWM. I've seen postings from a fair number of people talking about using analogwrite to control servos and such.