Arduino Quadcopter ESC Programming

Hi Everyone,

I'm on my way to building a quadcopter based on the Arduino Uno R3. I've recently received my 20A Hobbuyking ESCs and some motors, and I've just been playing with them to see how to program them.

I followed the instructions here: http://www.instructables.com/id/ESC-Programming-on-Arduino-Hobbyking-ESC/?ALLSTEPS

which I thought was perfect as the ESCs are exactly the same as the ones I've purchased, though I seem to be having some trouble programming them.

For starters, (and I'm not sure if this is relevant) I'm using a DC power supply that I've set to ~14V but can only provide a maximum of 2amps.

Anyway, I started by entering the max throttle setting as mentioned in the instructables (2000), and the motor starts to power up but of course doesn't get there because the power supply stalls out and it resets to 0. I then enter around 700, and sometimes I get a beep depending on which one I'm using.
I do get the motors to eventually start spinning, but I cannot seem to access the menu where the repetitive beeps start. Could this be because of my power supply? I don't see why the motors would try to start spinning if I've entered a throttle high setting before I've actually armed the ESC.

Any links to more information would be appreciated. The hobbyking esc manual doesn't seem to be of much help and there isn't that much information available on the internet (that I can find anyway)

Thanks for your time.

There is no point in even trying to program the ESC using that minimal power supply.

jremington:
There is no point in even trying to program the ESC using that minimal power supply.

You're saying that I need to be able to supply the full 20amp load in order to program it? I thought that the motor doesn't need to spin during programming so there shouldn't be any need for anything more than the 2amps the power supply can provide.

I thought I solved my own problem, but now I'm stuck again...

I tried a different power supply, one that could provide up to 13 amps. No problems spinning the motor.

I'm still having difficulty entering programming mode though. As per the instructable I tell my arduino to sen 2000us to the esc, then power it up. This should theoretically make the ESC go into programming mode, but thats not what happens. I shot a quick video to show you:

Theres something funny as well. If I power up the ESC while my arduino is sending 2400us+ then after about 2-3 seconds of it being on, a short beep cycle starts and keeps beeping. Initially I thought I had entered the programming menu but it remains a short beep and a long pause and carries on like this indefinitely.

Any information would be greatly appreciated.

Do you have an RC transmitter and receiver to control the quadcopter with ? If no then why not ? If yes then why not just program the ESCs using them ? It is so much easier to move the throttle stick at the right time than to get the Arduino to do it.

Another piece of advice. Take the propeller off that motor otherwise it will literally bite you at some time, particularly when it is controlled by the Arduino. NEVER install the propeller when testing.

UKHeliBob:
Do you have an RC transmitter and receiver to control the quadcopter with ? If no then why not ? If yes then why not just program the ESCs using them ? It is so much easier to move the throttle stick at the right time than to get the Arduino to do it.

Another piece of advice. Take the propeller off that motor otherwise it will literally bite you at some time, particularly when it is controlled by the Arduino. NEVER install the propeller when testing.

Cheers, yes I do realise that the prop shouldn't be on, I bought these second hand and they came with the props on and I can't figure out how to get them off. If you have an idea then pls let me know :slight_smile:
As of yet I don't have a transmitter and receiver because money is ever so scarce so I thought I could just send the signals straight to the ESC using the arduino. Is that whats keeping me from getting to programming mode you reckon? I don't quite understand how it would be any different. The signals being sent to the ESCs are the same.

Edit: Just got the prop off haha

Just got the prop off haha

Thank goodness. I will sleep sounder for knowing that you will keep all your fingers during bench testing.

You should be able to program the ESCs using the Arduino by sending the right commands at the right time. When doing it using the RC Tx and Rx you can respond to the signals (beeps) produced by the ESC (actually the beeps come from the motor windings not the ESC itself) at the correct time but this is much harder using the Arduino because it is all in the timing.

What I don't understand is why you feel the need to program the ESCs when you don't have any RC gear as you will not need them to respond properly until you connect up the RC gear. Which ESC parameter(s) are you trying to change and what is the aim of your project exactly ?

UKHeliBob:
Thank goodness. I will sleep sounder for knowing that you will keep all your fingers during bench testing.

You should be able to program the ESCs using the Arduino by sending the right commands at the right time. When doing it using the RC Tx and Rx you can respond to the signals (beeps) produced by the ESC (actually the beeps come from the motor windings not the ESC itself) at the correct time but this is much harder using the Arduino because it is all in the timing.

What I don't understand is why you feel the need to program the ESCs when you don't have any RC gear as you will not need them to respond properly until you connect up the RC gear. Which ESC parameter(s) are you trying to change and what is the aim of your project exactly ?

Well for the moment I have an IMU board and have planned to build in a stabilisng algorithm to run in conjunction with my RC controls (when I get it), so I'm just trying to get as much done as possible before that day comes. I mainly want to enter programming mode so I can factory reset all of the ESCs to default as they are second hand, though I suppose it can wait until I get the RC stuff.

The transmitter / receiver will be running through the Arduino though so I'm i'm also trying to get my head around all the values they deal with.

edit: I suppose the project on the whole is me just designing a run of the mill quad that I can attach different modules and stuff on and program them in easily enough.

Have you got any of the necessary sensors such as accelerometers, gyros etc ? You can write and test a lot of the code for these without needing to program the ESCs or using any RC gear.

Yes I have an IMU (gyro, accel, magneto). Pulling readings off the thing seems straight forward enough, though writing a smoothing algorithm is proving difficult. I'm usure whether to use hte Arduino PID or another algorithm to combine the data for the motor speeds.