Skip to content
/ pipwm Public

Arm, calibrate, and control Electronic Speed Controllers (ESC) with Raspberry Pi GPIOs, Python, and pigpio.

Notifications You must be signed in to change notification settings

csindle/pipwm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiPWM (Pi Pulse Width Modulation): Arm & Calibrate your ESC

This tutorial / example shows how to use a Raspberry Pi's GPIO pins to control an Electronic Speed Controller (ESC). Specifically, the manufacturer specific arming and calibration procedures (there are many other tutorials on controlling servos, etc. with pigpio, Pis, and Python).

Project Goals:

Collect the ESC manufacture specific procedures for:

  • arming
  • calibration (throttle)
  • modes switching (braking, response-rate, music-tunes (!), etc).

Currently supported ESCs:

  • Turnigy:
    • Plush (6A, 10A, 12A, 18A, 25A, 30A, 40A, 60A, 80A)
    • Basic (18A, 25A))

Warning: Remove propellers, etc. before testing, and don't chop off anything important.


Everybody loves a code example:

Calibrating a Turnigy ESC for full scale throttle/controller throws:

self.pwm(width=self.MAX_WIDTH)
input("Connect power and press Enter to continue...")
self.pwm(width=self.MAX_WIDTH, snooze=2)   # Official docs: "about 2 seconds".
self.pwm(width=self.MIN_WIDTH, snooze=4)   # Time enough for the cell count, etc. beeps to play.

Requirements:

Installation:

sudo apt install python3-pigpio
# if you want it to start on boot.
sudo systemctl enable pigpiod
# in this directory.
pipenv sync

Setup:

Components:

Components

GPIO:

GPIO

The red ESC 5 volt Vcc is not connected. The white signal wire is here connected to GPIO4, or pin number 7.

Video description:

Setup

Usage:

  • Read the code,
  • Disconnect propellers, etc.
  • python3 esc_demo.py

Turnigy ESC

Calibration

A demonstration of calibrating the ESC's maximum and minimum throttle range can be seen here:

Calibration

Arming and Running

A demonstration of arming an ESC, and a subsequent full power range test can be seen here:

Arming and running

Contributing:

Please open and issue or create a merge request if you can contribute more working devices or timings. Thanks!

About

Arm, calibrate, and control Electronic Speed Controllers (ESC) with Raspberry Pi GPIOs, Python, and pigpio.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages