Professional Documents
Culture Documents
Driving An ESCBrushless Motor Using Raspberry Pi
Driving An ESCBrushless Motor Using Raspberry Pi
by AGTx
Hey there!!! In this instructable I will show you how to sending a sequence of output signals to it.
program an ESC and drive a brushless-motor in a
desired speed using Raspberry Pi 3. We can say that it is like a servo which also takes
input in pulsing signals so we will use Pi's Pulse
I recommend you to READ THE WHOLE Width Modulation (PWM) system.
INSTRUCTABLE BEFORE MAKING IT even though
I'm typing load of crap here. I am making this To use PWM in Raspberry Pi, we need to initialize
instructable because I didn't find any tutorial for this PIGPIO library in daemon(which means running the
topic, maybe because the ones who already knew process in background) which sends DMA timed
how to do it were too lazy and selfish to help others. pulses from Python. Then we will calibrate and arm
Also, make sure you are going through precautions the ESC and start giving some speed to the motor.
at every step, its kinda important if you don't wanna
screw up your life. Just to make it clear, Arming is like telling the ESC
"dude, you're good to go, start the motor now." just
An Electronic Speed Controller or simply called ESC like you have to pull the barrel of a pistol and put the
is an electronic circuit which is basically used to safety down before shooting. An ESC has a lot of
control a brushless-motor. It takes a signal from a modes but for the sake of this instructable we will not
micro-controller and convert it into three-phase output go in details but focus only in driving the motor.
of limited voltage. So, It runs a brushless-motor by
4. You're smart right.. I don't think I have to tell you 7. Make sure powering your pi good, isn't that
about the result if you have bad connections. As it is obvious.
said..
Brushless-Motor (.....obviously)
1 2
3 6
1. Raspberry Pi 3
2. ESC
3. Brusless-Motor
4. Li-Po Battery
5. Laptop or PC
6. Power Bank
Connect the parts like the above picture. Yes! That RED WIRE WITH THE YELLOW WIRE.
RED WIRE OF THE ESC HAS NO FUNCTION (at
least in this project). IT CAN BURN YOUR PI'S DO NOT CONNECT THE BATTERY YET, you will
PROCESSOR, so watch out for that or get yelled by do it while running the program. There's a reason
your mom ! behind everything, there's a reason that you are here
looking at this screen, there's a reason that you're still
You can connect the Motor wires however you alive.. and all that stuff.
want with the ESC i.e you can connect red wire to
the third blue wire and black wire with second blue I made these fritzing parts just for....... myself but you
wire and so on. IF YOU WANT TO REVERSE THE know "sharing is caring", download it from here :-
ROTATION OF THE MOTOR, JUST SWAP THE
4
1 2
Download (https://cdn.instructables.com/ORIG/FLI/EUPQ/J0COQTHV/FLIEUPQJ0COQTHV.fzpz)
http://www.instructables.com/ORIG/FLI/EUPQ/J0COQTHV/FLIEUPQJ0COQTHV.fzpz
…
(https://cdn.instructables.com/ORIG/FLI/EUPQ/J0COQTHV/FLIEUPQJ0COQTHV.fzpz)
Download (https://cdn.instructables.com/ORIG/FEL/YOVA/J0COQTHX/FELYOVAJ0COQTHX.fzpz)
http://www.instructables.com/ORIG/FEL/YOVA/J0COQTHX/FELYOVAJ0COQTHX.fzpz
…
(https://cdn.instructables.com/ORIG/FEL/YOVA/J0COQTHX/FELYOVAJ0COQTHX.fzpz)
Download (https://cdn.instructables.com/ORIG/FS0/QT6J/J0COQTHZ/FS0QT6JJ0COQTHZ.fzpz)
http://www.instructables.com/ORIG/FS0/QT6J/J0COQTHZ/FS0QT6JJ0COQTHZ.fzpz
…
(https://cdn.instructables.com/ORIG/FS0/QT6J/J0COQTHZ/FS0QT6JJ0COQTHZ.fzpz)
Download that python program below and execute it in your pi AFTER you have finished with the
connections.
When you will execute it, the program will give you five options like this :
You have to enter the option by typing the exact word. You can also switch among functions anytime.
calibrate
This function is for first time use or later if you see some throttle problems. Don't worry if you've done it again.
This option will automatically calibrate your motor's throttle, arm it and then switches to control function. The
calibrate procedure goes as follows as in manual mode :-
manual
You can use this function if you want to control or program your ESC manually.
control
This function lets you control the speed of motor using 'a','d','q' and 'e'. This function requires arming of the ESC
first.
This function will let you arm your ESC automatically and will switch to control function.
stop
This function is to stop the ESC and the program. Suppose, you screw up something you can execute this function
and stop everything.
https://youtu.be/1E8ehmX0qaI
Download (https://cdn.instructables.com/ORIG/F3N/FP21/J0MOOXHS/F3NFP21J0MOOXHS.py)
http://www.instructables.com/ORIG/F3N/FP21/J0MOOXHS/F3NFP21J0MOOXHS.py
…
(https://cdn.instructables.com/ORIG/F3N/FP21/J0MOOXHS/F3NFP21J0MOOXHS.py)
"Once we accept our limits, we go beyond them." - I will not be responsible for any damage done to your
Albert Einstein parts.
Once you're done with your ESC and mastered it Try to make your own program and experiment, it will
(kind of), its your turn to make your project out of it. give you more knowledge.
There are things I gotta say that :- Comment below for any issues or problems you
found regarding this instructable, I'm here to help.
I made this instructable just for fun and with heart.
More Instructables coming soon.... I guess?
I do not intend to violate someone with my words.