ah stop my friends welcome back this
will be a quite complicated project I
hope I will be able to explain all the
main problems of building an electronic
speed controller I hope that you know
what the brushless motor is and if not I
will explain you a little bit about this
kind of motors first of all it's a DC
motor but not a normal DC motor it has a
triple phase input which means it has
three wires as an input compared to a
normal DC motor which only has two so we
can't apply directly a normal
differential voltage to it it is a
little bit more complicated this diagram
shows exactly what voltage we have to
put in every moment in order to spin the
motor so we have our three wires that
create three coils inside of the motor
we do note the base of rotation of a
disc mode ER
the coil creates a magnetic field and
the motor spins due to repulsive forces
between the coil and some permanent
magnets but we have to change the
polarity of the applied voltage in order
to change the magnetic field direction
when needed in a normal DC motor this is
done directly with the rotating shaft of
the motor which has some copper contacts
on it and will change the voltage
polarity while spinning in case of a
brushless motor an electronic device has
to switch the priority of each of the
three inputs as the arrow show in this
diagram we start by applying a positive
voltage at the C input and ground to the
a input we leave the input be free the
rotor spins a few degrees after a few
moments we switch to ground the B input
the rotor spins a little bit more next
we switch the input a and so on there is
a special sequence that we have to
create in order to spin the motor and we
will see why and which is that along
this tutorial
as I said we need an electronic device
to fast switch the input of a brushes
motor and that is an ask or electronic
speed controller and that's what we are
going to build today but in order to
know how to build it we first have to
understand what we have to achieve for
that let's take a look at this animation
so we have our brushes motor with just
six poles in this case to make it easy
this here are the input of the motor we
can see red black and blue wire but all
the wires are black but blue represents
ground red represents high voltage and
black it's a free input on the Left we
have the sequence that we talked about
before the vertical blue line represents
the rotation angle of the motor we start
at angle 0 these are all the faces of a
full rotation the top side represents
that the input is set to high the low
side represents that the input is set to
ground and the middle side represents a
free input we will talk about these free
input a little bit later we see that we
start with the input be set to high and
input Z to low that means that the
current would flow from the B coils to
the sequel's
creating two different polarity magnetic
fields we can see a South polarity
painted with red and the North with blue
on the motor poles we can also see that
the inner rotor has four permanent
magnets on it the created magnetic field
of the poles will push or drag the rotor
in one or other direction in this case
the red coil will drag the north
polarized magnet and push the South one
the blue coil will do just opposite that
will create a rotor rotation to the
right as this arrow shows let's now look
close at this pole right in the moment
when the north magnet passes in front of
the pole we have to switch the input in
order to keep spinning the motor if we
don't reach the input the motor we stop
in this position but right in that
moment we switch the a input too low and
the seek to free and we leave the beat
too high now we still have this out
polarity in these two poles that will
push the South magnet and drag the north
ones in the next step we switch the C
input to high and the a input to low now
again these South fields will push the
South magnets due to the repulsive
forces we do the switches six time for a
full rotation and the sequence won't
depend on the number of the use poles
there are brushes model with four six
nine twelve or more poles and this
sequence will be the same and that's
because we have three inputs and each
has to be set to high or low in a
certain moment and that gives us a total
of six pairs of high and low inputs if
we had more ports on our brushless motor
we would have to repeat more times the
same sequence in order to achieve a full
rotation if we switch these inputs fast
enough the motor would spin like we can
see here and that's what we have to do
in this project okay so now we know that
by switching the inputs in this exact
sequence we can spin the motor and by
faster that we switch them the faster
the motor will spin but there is a
problem and that will be the tricky part
how to synchronize the real speed of the
motor rotation with the electronic
switch of the inputs with this schematic
we can know when to switch from one
state to another because we don't know
the real position of the rotor as you
can see if we switch a fraction of a
second before or after the perfect
moment the motor could stop or spin in
the opposite way and that would be
synchronize the motor
so how could we detect that perfect
switch moment
well it's quite easy remember that we
mentioned that on each state we'll leave
one input free by free I mean we want
apply neither hight voltage neither
ground that input will have a high
impedance now here is the awesome part
we all know the fire die law of
electromagnetic induction we know that
if we change the magnetic flux inside of
a coil an inductive current will flow to
this coil the higher the flux change is
the higher the current that flows will
be so we do have a magnet that creates a
magnetic field and we do have a coil and
these two elements together create a
simple magnetic sensor so let's take
this first state of the motor rotation
when B is high and Z is low the a input
is set free and with the high impedance
these are the coils of the a input and
this is the South polarized magnet that
will create a magnetic flux change
inside of that coil it's obvious that
the more centered the magnet is the
higher the magnetic field that passes
through the coil will be this arrows
simulates the magnetic field of this
magnet right in this position we can see
a few arrows that are passing through
the coil when the motor spins each time
more arrows enter the coil we will have
a maximum flux when the magnet is
exactly in the middle position of the
coil and that is just great if a coil is
inducted there will be a voltage drop on
that input and the great news is that we
could measure that voltage drop and if
we detect a maximum peak we will switch
to the next state of the sequence this
is the best way to control the position
of the rotor and that's easy because in
each state one input will be free and we
just have to measure the voltage drop on
that input in order to make the
mathematics and know when to switch to
the next state but it gets a little bit
more complicated than that
just by measuring one input we can know
directly the switch moment in order to
better understand let's take a look at
this graphic here we have the high and
low state of each of the a B and C input
the back end is the back electro-motive
force which basically is what we talked
about earlier is the representation of
the force of the magnetic field on each
coil in this case will be represented in
a voltage drop so we can see that we
have a positive and negative voltage
drop on each input we can also see that
each voltage drop signal has a different
phase with the 120 degree difference we
can see that it's signal passes through
a zero point when going from negative to
positive or vice-versa
this is the exact point when we have to
make the state switch but how could we
know which is that zero point because it
won't be zero volt if we look close in
each state the sum of the three signals
will give us the zero point let's look
at this first state the sum of the a
signal with the B signal will give us a
positive constant voltage because it's
the sum of two opposite ramps if we sum
the C input constant negative voltage we
obtain our viewer's zero point and this
happens on each state so all we need to
do is to sum the three signals to obtain
that zero point and after that every
time that one of the signal crosses that
value we make the state switch this is
called zero crossing and back and
control of the electronic speed
controller and this is the circuit that
we are going to create today we will use
a microcontroller to measure the voltage
drop on each input and to switch on and
off the state of each of those inputs of
course as always we will use Arduino
because that makes it all easy
before we start let's talk a bit about
the parts of an electronic speed
controller we have the microcontroller
which is the brain of the entire module
then we have a triple phase bridge made
with six transistors we will have to
switch the six transistor in order to
create our three input signals for the
brushless motor the top transistors are
connected to a positive voltage in this
case 11.1 volts from a lipo battery the
button transistors are connected to
ground so for example if we want to set
the a input to high and a bit low we
have to open the gate of these two
transistors the current will flow from
here to the a input and will go to
ground to the B input so basically we
have to control two transistor in each
state in order to create our sequence
for the brushless motor the problem is
that we are using MOSFET transistors
because we want a high current to flow
through the motor coils there are esque
that can deliver from 6 up to more than
100 amperes of current a MOSFET works
like a switch we apply a voltage at the
gate and it will give us a voltage at
its source but the voltage applied at
the gate has to be higher than address
hold voltage which usually is 0.7 volts
and the next problem is that the MOSFET
can give us a higher voltage output than
the voltage applied to the gate so for
example if we have 11 volts battery
connected to the drain of this
transistor and we apply 5 volts at the
gate the maximum voltage that we could
have at its source will be the gate
voltage minus the threshold voltage
which in this case would be 4.3 volts
but we want 11 volts at the source so we
will have to apply 11 volts at the gate
and this is the first problem our
maximum voltage that our microcontroller
can give is 5 volts so we will need
something in between of the triple phase
bridge and the microcontroller
that's something it's a driver
the driver receives a low-voltage signal
and will give the exact same signal at
its output but with a higher voltage so
we apply the five volts which signal to
the driver and the driver will play 11
volts in this case - the MOSFETs I'm
sure that you are now wondering why
apply 11 volts signal to the MOSFETs to
obtain 11 volts at the transistor output
well it's simple a microcontroller or a
driver will never supply a high corn to
our motor usually an microcontroller
output has a maximum current output of
maybe 200 milli amperes a brushless
motor it's a beast that consumes a huge
amount of current and that's why we use
MOSFETs for 11 volts high current
voltage okay so now we know the basic of
an electronic speed controller and also
the circuit that we have to build i've
kinetics and leads to each of the six
use output of the Arduino to simulate
the triple phase bridge at a very low
speed we can see how each sequence state
is switched we change the speed with
this potentiometer the switch is now
faster the same will happen with the
transistors okay so I've designed my PCB
in design spark I will leave all the
schematics project files and all the
info in the description down below if
you want to learn a little bit on how to
use design spark just watch my video
tutorial of design spark I've used an
Arduino Nano microcontroller
three IR 2301 dual mosfet drivers 6i RF
3205 MOSFET transistor and all these
extra components you will find a full
list in the description down below we
will also use capacitors voltage
regulators and some resistors this is
the schematic for this project
you could also find it in a link below
this is the basic configuration of a
dual mosfet driver always check the
datasheet of each component before you
design your PCB so take a look at the
Silkwood schematic and carefully make
each connection for thered we know to
the drivers and from the drivers to the
MOSFETs be very careful the maximum
voltage of the analog input of the
Arduino is 5 volts but the a B and C
output voltage will be around 12 volts
and that will burn the microcontroller
that's why I've put a voltage divider to
each analog input that will reduce the
voltage from 12 volts under 5 volts this
is my final PCB design you can design it
however you want or maybe use a stock
drill PCB to make your electronic speed
controller but these are my
recommendations the tracks that go from
the main power source to the MOSFETs and
then to the motors have to be very thick
I also filled those tracks with solder
because if not those tracks will burn
out due to the high current also fill
the transistor pads with solder and add
heat dissipators I've used zero-eight
zero-five sized SMD resistors and
capacitors I have used this AMS 1 1 1 7
5 volts voltage regulator to supplied
Arduino Nano the main input needs a
quite big capacitor I've used a 16 volt
480 micro farad capacitor I've used this
bottle shelter to control the speed
manually this is the final design and
these are the results
this is not an easy project and it would
work perfect from your first try I had
more than three months of testing and
testing to make it work you will have to
make a lot of research about each
component read more than 100 data sheets
test the back electromotive force of
each output change the code a hundred
times and so on anyway it's time to
program the Arduino the code is very
easy to understand you could download
the code from a link below we first
measure the voltage drop on each of the
three inputs and make the sum of those
three values this sum would be our zero
point become the time using the micro
function to control the sequence speed
we want to execute the sequence loop
each delay time this delay value is
controlled with the potentiometer that
we'd mentioned earlier this is the
switch case in each case we set to high
just two pins for two transistors of the
triple phase bridge the rest of the pins
are set to low this Delta variable is
very important we know that we could
have a zero crossing of the measured
voltage from negative to positive values
or from positive to negative we use this
actual Delta and the last Delta to
control that if the last Delta was
negative and this actual Delta is
positive it's clearly that we have a
zero cross from negative to positive
values if the deltas are vice-versa
we'll head across from positive to
negative we will have six cases when we
reach the sixth one we go back to the
first one this is it this is our
sequence loop compile and upload it to
the Arduino connect a power source to
the main input of the board and change
the speed with the potentiometer you
could change this code in order to
control the speed using PWM input signal
you could also design your PCB using
only SMD components in order to make it
quite small because mine it's huge this
board could deliver up to 60 amperes of
current this is a brushless motor as you
can see it has three wires input I'll
connect the input a B and C to my board
now when I connect the power source the
motor spins it has a quite powerful
torque in the description you will also
find a code that doesn't use the back
end detection with that code you could
reach higher speed but a very low torque
using this code if you stop the motor
with your hands the motor won't start
again that's the nice part of the FD
tection it changes the input signal
depending of the real speed of the motor
and that keeps it all synchronized so
now you know how an electronic speed
control works and how to build one if
you have any questions just leave them
in the comment section below or on my
Q&A page I hope that you enjoyed this
video please like share and subscribe in
order to motivate me for more videos
like this one thanks again and see you
later guys
[Music]