[SOLVED] Quadcopter ESC restarts

Hello,

I am building a quad copter with an arduino nano and i am having a problem with the escs.

Project description:
I build an android app to control the motors power.
I build the arduino code to stabilized the quad

Parts:
Props
https://www.amazon.com/gp/product/B01CZJ5AA8/ref=ox_sc_act_title_2?ie=UTF8&psc=1&smid=A322YQE36W8B73
Bettery
https://www.amazon.com/gp/product/B00PQKQ22Y/ref=ox_sc_act_title_3?ie=UTF8&psc=1&smid=A20H555M9MROEP
Motors
https://www.amazon.com/2300KV-Brushless-SimonK-Controller-Quadcopter/dp/B01IBFD9CG/ref=pd_sbs_21_5?_encoding=UTF8&pd_rd_i=B01IBFD9CG&pd_rd_r=Z0KVZET55YBWT5W091BX&pd_rd_w=DQD8b&pd_rd_wg=4GOJM&psc=1&refRID=Z0KVZET55YBWT5W091BX
Arduino nano
Hc-05
mpu6050

Problem:
Randomly at any time any motor stops and the esc beeps as it starts. If i send a 0 power signal the esc beeps again and start working.

For the power of the ESC i am using protoboard cables i do not know if that can be a problem and i should be using 1mm cable

My arduino code is attached. Let me know any other info that can be usefull

Hope someone can help me,

Thanks,
Marco

quad_V2.ino (7.51 KB)

Hi Marco,

Normally, the ESCs need to be calibrated to throttle range expected from the receiver's throttle channel, however nowadays some multi-rotor ESCs come with a preset throttle range.

The standard procedure is:

  1. IMPORTANT: REMOVE THE PROPELLERS.
  2. Power up your transmitter and move your throttle stick to its maximum position.
  3. Power up your ESC, the ESC should detect the throttle high and enter calibration mode.
  4. Wait for the ESC to acknowledge the throttle max. positon with a beep or series of beeps.
  5. Move the throttle stick to the low position.
  6. Wait for the ESC to acknowledge the throttle min. position with a beep or series of beeps.
  7. The ESC has been calibrated.
    8 ) Unplug the ESC power cable.

Most RC commercial flight controllers have an ESC calibration mode that allows the throttle channel from the RC receiver to pass through to the motor outputs. (The latest pass through serial data to configure the ESCs). If you don't have an ESC calibration routine then it's possible to individually connect the ESCs to the RC receiver's throttle channel, repeating the procedure above 4 times (for a quadcopter). If you're not using an RC receiver then it's necessary for whatever device you're using on the throttle channel to produce 50Hz, PWM pulses within a 1000us to 2000us (min-max) range. Standard RC receivers produce pulses around 1100us to 1900us.

It's normal for some ESCs to generate a periodic beep when no signal is detected.

In the initial stages, I'd suggest just removing the props and driving the ESCs and motors directly with whatever device you intend to control your quadcopter. It won't fly, but will test your receiver and ESCs/motors are working correctly. Once you've got that going, only then add the gyro/accelerometer, PID loops and motor mixing.

Note: Don't run the motors at maximum throttle, (when you don't have the propellers attached for testing), or they'll burn out.

MartinL:
Hi Marco,

Normally, the ESCs need to be calibrated to throttle range expected from the receiver's throttle channel, however nowadays some multi-rotor ESCs come with a preset throttle range.

The standard procedure is:

  1. IMPORTANT: REMOVE THE PROPELLERS.
  2. Power up your transmitter and move your throttle stick to its maximum position.
  3. Power up your ESC, the ESC should detect the throttle high and enter calibration mode.
  4. Wait for the ESC to acknowledge the throttle max. positon with a beep or series of beeps.
  5. Move the throttle stick to the low position.
  6. Wait for the ESC to acknowledge the throttle min. position with a beep or series of beeps.
  7. The ESC has been calibrated.
    8 ) Unplug the ESC power cable.

Most RC commercial flight controllers have an ESC calibration mode that allows the throttle channel from the RC receiver to pass through to the motor outputs. (The latest pass through serial data to configure the ESCs). If you don't have an ESC calibration routine then it's possible to individually connect the ESCs to the RC receiver's throttle channel, repeating the procedure above 4 times (for a quadcopter). If you're not using an RC receiver then it's necessary for whatever device you're using on the throttle channel to produce 50Hz, PWM pulses within a 1000us to 2000us (min-max) range. Standard RC receivers produce pulses around 1100us to 1900us.

It's normal for some ESCs to generate a periodic beep when no signal is detected.

In the initial stages, I'd suggest just removing the props and driving the ESCs and motors directly with whatever device you intend to control your quadcopter. It won't fly, but will test your receiver and ESCs/motors are working correctly. Once you've got that going, only then add the gyro/accelerometer, PID loops and motor mixing.

Note: Don't run the motors at maximum throttle, (when you don't have the propellers attached for testing), or they'll burn out.

First of all thank you for taking the time.

What i am doing to arm the ESCs is sending a 1000ms pulse when the start but that seem to not be the right way to do it.

As you can see i am not using a transmitter, so how should i make the arm routine in arduino code?

This is what i am doing now
//Asignar un pin al ESC
motor1.attach(6);
motor3.attach(5);
motor2.attach(9);
motor4.attach(10);

//Activar el ESC
motor1.writeMicroseconds(1000); //1000 = 1ms
motor3.writeMicroseconds(1000);
motor2.writeMicroseconds(1000); //1000 = 1ms
motor4.writeMicroseconds(1000);
delay(5000);

How should i arm them correctly programatically since i do not want to use a transmitter

Let me know if there is some other usefull info that i can provide?

Your advice is really useful,
And thanks for this

Note: Don't run the motors at maximum throttle, (when you don't have the propellers attached for testing), or they'll burn out."

Thanks,
Marco

Hi Marco,

What i am doing to arm the ESCs is sending a 1000ms pulse when the start but that seem to not be the right way to do it.

Yes that's the right way. A 1000us pulse should put the ESC on standby and stop it from periodically beeping. Gradually increading the duty cycle (pulse width) from 1000us to 2000us should spool up the motor and slowly increase the motor's speed.

To control the ESCs for a quadcopter the frequency of the PWM needs to be somewhat faster than the 50Hz used by the Arduino servo library. For the Nano you'll need to use the analogWrite() function on the PWM pins that provide 490Hz, these are 3, 11, 9 and 10. As analogWrite() has an 8-bit resolution its range is from 0 to 255, therefore it's necessary to map the 0 to 2000 for the ESC on to 0 to 255 using the Arduino map() function, for example:

analogWrite(11, map(sensorVal, 0, 2000, 0, 255));

Obviously, mapping from 0 to 2000 down to 0 to 255 you're losing resolution, but that's the best PWM resolution on all 4 motors that the Nano can manage.

MartinL:
Hi Marco,

Yes that's the right way. A 1000ms pulse should put the ESC on standby and stop it from periodically beeping. Gradually increading the duty cycle (pulse width) from 1000us to 2000us should spool up the motor and slowly increase the motor's speed.

To control the ESCs for a quadcopter the frequency of the PWM needs to be somewhat faster than the 50Hz used by the Arduino servo library. For the Nano you'll need to use the analogWrite() function on the PWM pins that provide 490Hz, these are 3, 11, 9 and 10. As analogWrite() has an 8-bit resolution its range is from 0 to 255, therefore it's necessary to map the 0 to 2000 for the ESC on to 0 to 255 using the Arduino map() function, for example:

analogWrite(11, map(sensorVal, 0, 2000, 0, 255));

Obviously, mapping from 0 to 2000 down to 0 to 255 you're losing resolution, but that's the best PWM resolution on all 4 motors that the Nano can manage.

Martin thanks for al the advice i will add them to the code.

Yesterday night i spent some time trying to figuring out what was happening. I configure the esc properly as you mention, that was a good help.

After some test i found out this:
I am using a protoboard for the connections i am connecting the battery and two motors to one side of the proto and with prorboard cables (thick ones) i am sending energy to the other side of the proto to connect the other two motors.
What i found is that the side which is connected directly to the battery works great but the motors which are connected to the other side constantly failed.
It seems to be not a good idea to use proroboard cable to connect the battery to the other end of the proto where some motos are connected.

What i will do is a very simple power distribution board and use 1mm cable to send energy from the battery to the motors.

Anyways the advice you gave me were really useful to fix other issues.

Thanks a lot,

Marco