I’m putting a quadcopter together. I’m using a python script to calibrate the ESCs... they beep like a blinking led when I give them power. Then I run the calibrate script and they give me the proper beep beep ... beeeeeep. To indicate they are ready.

Unfortunately they still give different throttle like I never calibrated them. Any suggestions? I’m using the standard raspberry pi GPIO library. The motors do get power. Here are is my calibration and flight controller as gists.

Calibrate https://gist.github.com/Hart87/ce05a66deb7fb4a9f387f3c712d3dacf

And then after the proper tone. I run the flight controller to use it https://gist.github.com/Hart87/a1999b61d8a43fed74cc0df29442771d

Any suggestions? Would a hardware pwm help, like pigpio?

  • I read your two python programs and found them straight forward Rpi.GPIO. I don't see any problems. I wonder you have compared other similar software. I have been playing with PWM using Rpi.GPIO and also PCA9685 (Ref MagPi84 Page 44). I am using a scope to display the PWM waveform with different duty cycles and found everything easy to debug. I use PWM to control servos and DC motors, and also BLDC motors, but almost always low current, less than 2A motors. I have no experience in using ESC RC BLDC motors which I know take big current. Perhaps there are high noise problems.
    – tlfong01
    Commented Aug 22, 2019 at 1:46
  • I must confess that though I know quite a bit of Rpi python PWM controlling servos/dc motors, I understand too little quadcopter arming to understanding your problem. I am googling to catch up - Arming the motors: ardupilot.org/copter/docs/arming_the_motors.html
    – tlfong01
    Commented Aug 22, 2019 at 2:48
  • Now I am thinking of getting a quadcopter with GPS, to start my learning experience : Top 5 Best Quadcopters with GPS 2019 Reviews - Pierce Lancaster 2019aug20 thewiredshopper.com/quadcopters-with-gps
    – tlfong01
    Commented Aug 22, 2019 at 3:14
  • You are using very odd values to drive your ESCs. At 100 Hz a 11% dutycycle results in a pulse width of 1100 µs. I'd expect to see 2000 µs for the maximum. A 3% dutycycle results in a 300 µs pulse. Well below the expected minimum of 1000 µs. I suggest you use (my) pigpio to properly drive these ESCs.
    – joan
    Commented Aug 22, 2019 at 8:41

1 Answer 1


I'm going to post this as an answer because I had a lot of trouble researching how to drive an ESC with just a Rasp Pi(using a zero w) and it works now, Hopefully someone having the trouble finding out how will see this:

Joan was completely right with the 1000 low and 2000 ms high pulse width.

I ran the GPIO pins at 50 hz. Here is some light arithmetic that helped ...

1,000,000 / 50hz = 20,000 a low of 1000ms is 5% (20,000 / .05) a high of 2000ms is 10% (20,000 / .10)

I calibrated the ESCs at 10% duty cycle and then let the low drop to 5%. The result was an arming beep - BEEP BEEP ..... BEEEEEEEP.

Both ESCs ran at the right and same values inputted into my flight controller algorithm.

The motors did run and transition well but a little bit choppy. I'm going to try running it with PIGPIO now to drive it better.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.