The Secret Behind Electric Motors: Inverter Explained
By Munro Live
Summary
Topics Covered
- Inverters Convert DC to AC via Six Switches
- Switches Create Rotating Magnetic Field
- PWM Smooths Current to Sine Waves
- Regen Delays Switch Timing for Drag
- Boost Regen at Low Speeds with PWM
Full Transcript
[Music] Hi, welcome to Monro Live. I'm Paul
Turble. Today we're going to talk a little bit about inverters. I did
promise that I would do an inverter video and so I'm going to try to follow through on that. Uh
here we have the Tesla Cybert truck inverter. And I want to show you, you
inverter. And I want to show you, you know, what it looks like when it's all put together. This bolts right onto the
put together. This bolts right onto the side of the motor. And these three uh connections drive the three-phase motor. Um and it
has uh the DC connection going into the back. So what an inverter does is it
back. So what an inverter does is it turns the DC from the battery, DC electricity, direct current into alternating current that the motor needs
to produce rotation and torque. And I,
you know, saying that is one thing. It
ends up being kind of magic. The control
board, here's the computer. it controls
the switches that are inside this um in order to turn that DC into AC.
But saying those things really doesn't tell you how it works. And for an engineer, we kind of need to know how it works and
not just what it does. So
again, here this one is from the Model Y. It's uh sort of taken apart. There's
Y. It's uh sort of taken apart. There's
the control board. And one of the things I wanted to point out on the control board is that there's this low circuit
and this high circuit which refers to the low side of the battery or negative pole and the high side of the battery.
So this is the DC low and high connecting to all the switches. And then
there are these six gate drivers that and the six identical circuits that drive the the switches and turn tell
them to turn on and off.
They also have this A C and B. Um so
that's this is a collection of switches that are all connected to the one phase A the A phase. This one's these are all
connected to the B the Cphase and these are connected to the Bphase.
So again this is sort of the same thing but here we're seeing the switches. In
this case the switches are done with discrete components. These are MOSFET
discrete components. These are MOSFET switches. They're all transistors. Uh so
switches. They're all transistors. Uh so
it's a kind of uh uh solid state switch.
In this group, there's a a group of four switches that are all connected together and switch at the same time and then another group of four and another group
of four to for a total of six groups of switches. And then there's this big
switches. And then there's this big capacitor. This capacitor
capacitor. This capacitor helps store energy because the things are happening here so fast that the
battery cannot accept the energy at that rate of speed. And so we need the capacitor to smooth things out so that the energy can to and from the battery
is at a rate that the battery can accept it. So if we look inside of these
it. So if we look inside of these switches, uh we see we'll see something like this.
Integrated circuits that are mounted on a copper uh plate so that the heat can get from the switches to the heat sink
underneath. And we flow coolant through
underneath. And we flow coolant through this array of uh fins to help cool um the switches. And why do you need to
cool them? Because through these tiny
cool them? Because through these tiny integrated circuits, we're going to put hundreds of amps of current. And the
hundreds of amps of current produces some heat because there's a small amount of resistance as you go through the switch. There's also a small amount of
switch. There's also a small amount of energy that's used to flip the switch.
And so they call that switching loss.
And so the the combination of the conduction loss and the switching loss produces a little bit of heat and we have to get rid of that heat or or
manage it because we're continuing to make things smaller. You can see this was the Model Y and then the Cybert truck which actually is twice the
voltage and the same current. So more
power but a smaller package. So we
continue to make uh the package size of these things smaller and smaller. Uh and
that drives the the heat to uh you know making a having to do real serious engineering on the on the thermal side.
Even though these things are very nearly 99% efficient in their at their peak um you know 97% efficient even when they're
operating at relatively low efficiency operating points. So these things are
operating points. So these things are amazingly efficient. The power coming in
amazingly efficient. The power coming in in the form of direct current and the power going out in the form of alternating current. So all that's
alternating current. So all that's great. So now you know what it does,
great. So now you know what it does, but how does it do it? And so I've put
together a little science project to be able to show you how it's done. I I went looking on the on the internet for how
these things work. And most of the videos that are out there uh they immediately go into circuit
diagrams and start talking in uh in jargon that is fine for electrical engineers but I couldn't find anything
that was uh at a higher level and make making so that someone could really see how it works. So I decided to go ahead and
works. So I decided to go ahead and build one. Um so this is an inverter.
build one. Um so this is an inverter.
There are six switches.
It's going to be a handdriven inverter.
So I'm going to perform the function of the control board. The inverter the the six switches these two switches are connected together
and then also connected to all connected to the top side the high side of the power supply.
Um the power supply is set at one and a half volts. I could be using a del
half volts. I could be using a del battery. Um but instead I wanted to use
battery. Um but instead I wanted to use a power supply just so I uh can you can see the values.
All these switches are connected together at the top and then at the bottom the they are connected this one is connected to this coil. So these two
switches are connected to this coil.
These two switches are connected to this coil.
And these two switches are connected to this coil. And these coils are held
this coil. And these coils are held together with twisty ties. And uh I've got a compass in the middle to show you
the direction of the magnetic field. Uh
and it's all taped down with scotch tape onto a piece of scrap flooring. All
right. So, I've seen second grade science projects that are have better build quality, but if we can just get past the janky setup, I think we'll be
able to see how these inverters work.
So, the way that h it works is we close these switches. So, we have DC power
these switches. So, we have DC power coming in and we close these switches. I
can close one. Now, if I close this switch here, then the DC power will shoot straight through and go straight here. So, that's a dead short right to
here. So, that's a dead short right to back to the power supply.
Um, this would be a bad thing. Uh if you do that with a 800vt system on a battery that can deliver thousands of amps, then
your switches turn into smoke very quickly and then you have lengthy meetings about how you're never going to
do that again. So we don't turn both switches on.
We we either have this switch on or we have this switch on. Never both. So, we
set it up so that we can't have both switches on at the same time. If we have this switch um connected, we'll label that as a zero because it's connected to
ground.
If we have this switch connected, we'll label that as a one because we have it connected to the high side.
So, this switch is now in the one position.
And then I can close these two. And then
it gives a circuit so that the the electricity goes in here, goes through the coil.
All the coils are connected together here in what's called a Y connection. So
the the electricity goes 100% electricity goes into this coil, then it goes to the Y connection, and then 50% of the electricity goes out through each
of these two coils and back to the power supply.
All right. So, I'm going to actually graph and plot what is happening with the current.
So, when we have things set up here with one 0 0, so we say this is one 0 0. Then
we have the current going into aphase.
100% of the current is going to the Aphase and then 50% of the current is coming
out of the B and the C phase. So we've
got B and and C.
If we we'll call current going in positive and current coming out negative. So I've got 100% of the
negative. So I've got 100% of the current going in the Aphase, 50% of the current coming out of each of the B and
the C phases. Okay. So when we do that, we've got the magnetic field is aligned directly with that Aphase and we got the compass needle pointing
up.
So now if I want to make things turn, I want to rotate the compass needle, I'm going to open one switch and then close another.
Now 100% of the current is leaving the Cphase.
And so the south pole is now pointed at the Cphase.
And 50% of the current is going in each of the A and the B phases. I only had to switch one of the pairs of switches, change the state of one. I didn't have
to touch these two. And I moved the the magnetic field from this direction. Now
it's over to this direction.
So again, I've got 50% of the current going into the A phase and
50% going into the Bphase B coil. I why I'm calling them phases.
B coil. I why I'm calling them phases.
We'll we'll talk about that in a little bit. They're just coils, but I'm calling
bit. They're just coils, but I'm calling them phases. and then 100% of the
them phases. and then 100% of the current is coming out of the C CI.
Okay, so that's the the second part.
There's a total of six of these. So bear
with me here.
So this the next set here is uh by the way that was uh this was
um one one zero.
Now I've got 0 1 0.
So 0 1 0 is the setup for the switches.
And I've now moved the the magnetic field so that it has rotated again to
the north is pointed directly at the Bphase, the B coil here. So 100% is
going into the B phase using the word phase and coil interchangeably. And we'll see why in a
interchangeably. And we'll see why in a little bit.
And then 50% of the current is coming out of each of the A and the C phases.
So I've got A and C.
Okay, now to the next position.
Now I've got the south pole is aimed up at the at phase A.
Um 100% of the current is leaving from phase A and the north pole of the of the compass is now halfway between
the B and the Cphase.
So this is again 0 one one.
It's how I've got the switches set up.
And that gives me 180 degrees now of rotation on the uh 180 degrees of rotation on the ro on the rotor.
So I'm using the compass as a a a motor rotor.
Okay. So I'm going to plot this again.
The uh 50% in the B and C and 100% coming out of the A.
So we got A 100% coming out negative and then B and C 50%
going in.
Halfway there.
Okay.
Now close open this one and close this one. Again
only switching only changing the state of one pair of switches leaving the other two switches alone. And it has moved
now so that the north pole of the compass is pointed towards the Bphase.
I'm sorry the Cphase which is where all the current is going in. So we have the Cphase has all the current 100%.
And then the A and B phases have 50% of the current coming out.
Okay, now we close this one. We have 50% of the current going in A and C and 100% of the current coming out of B. So the
south pole of the magnet aligns with C.
I'm sorry, the B Bphase.
So 100% of the current is coming out the Bphase.
and 50% of the current is going in from the A and the C phases.
And then the last one, just back to where we started, um, which is
open this and close that. And we're back to where we started with, uh, I forgot to put on the the You get the
idea, though. We get different
idea, though. We get different ways of assigning the states.
We end up with A back at the top and B and C at 50%.
So I could run I could operate a motor just like this but just by slamming a switches home. There are six different
switches home. There are six different stapes steps of this um arrangement. And
so we call this kind of control it's one example of sixstep control but we can do better.
So, we we're able to sort of click it from one step to the next.
And if I did this then um and put the current in 100% and then switched it just as the needle just before the needle
arrives perfectly aligned, then I could get smooth rotation. But it would still be a little bit jerky because the current is jumping from one coil to
the next. So we'd like to have nice
the next. So we'd like to have nice smooth transition transitions from one coil to the next. There is a way we can do that.
So let me show you what that trick is. We
call that we just going to turn the the I'm going to turn the switches on and off really fast. I can't do it by hand, but we'll show you. So, if I go here and
there, that's the next switch. But I can go back and forth really fast and get something that's halfway in between.
So, if I switch the switches really fast, on average, it's half over here, half over here, I can get
something that looks halfway in between.
We call that switching the switches really fast.
We call that pulse with modulation. So,
you're just turning the switch on and off really fast.
This would be sometimes we do this uh about 10,000 times per second. So this
would be 100 micros secondsonds. And so if we turn it on and spend half of the time on
and half of the time off, we call that a 50% duty cycle.
And that will as we turn it on, the voltage immediately changes.
And that causes the current to start to rise. So why doesn't the current
rise. So why doesn't the current immediately rise and go up to the higher value?
And that's because the rising current in the coil produces a magnetic field. And a
changing magnetic field as the current is rising produces a voltage in the coil which fights against the voltage from
the power supply. And so the current isn't able to rise immediately because it has to fight against this voltage
that's generated in the coil. So it
rises slowly and then just as it gets to some this point we turn it off and why doesn't the current immediately drop? It's the now
suddenly an open circuit. And so why doesn't how does the current continue to flow even though I've opened the circuit?
And the answer is because that same thing as the current starts to drop the magnetic field from the coil collapses.
And that's a change in the magnetic field. And the changing magnetic field
field. And the changing magnetic field generates a voltage. And that voltage that's generated by the coil keeps the current moving. And so the current keeps
current moving. And so the current keeps going, but it does start to drop off.
And then we turn it back on and turn it off, turn it on, turn it off. And we end up with an average current that is equal to half of what it would be if we just
had left the current left the switches on continuously.
And so you can we can choose when we turn the switch on and off.
If we turn it off right away, we might have a 1% duty cycle. If we wait and turn it off right at the last second, we might have a 90% duty cycle or 95. And
so we can choose anything in between.
We could even smoothly ramp from 1% to 100% as we do this. And that smoothly creates
uh a ramp of current between this switch position and this switch position.
So by pwmming we can fill in all of the positions between this position and that position. And so if I
go back to that my graph and I look at A, if I use PWM, the current in A will
change smoothly and go from this point to that point. Then change smoothly again from this point to this point and
again here.
and we end up with something that looks pretty close to a sine wave.
And the same thing happens with with C the C coil and the B oil.
and we end up with three sine waves or something very close to a sine wave.
Um, and each sine wave is shifted by 120 degrees.
So the the Bphase is at 120° looks exactly like the Aphase and the Cphase is exactly like the Aphase but shifted
240 degrees. And since they're shifted
240 degrees. And since they're shifted in time, we call that each coil is has the same current in it shifted in time.
We call that a phase shift. And that's
why uh Charles Steinmets when he first figured this out in the 1880s called these different phases. So it's AC
current three phases each one shifted by 120 degrees and that produces smooth rotation and the
magnetic field smoothly rotates. With
just three coils, I get a smoothly rotating magnetic field that will drive this compass needle
round and round. So that is how we control electric motors. How we produce
three-phase AC with six switches to turn uh a compass needle or a motor and make
it rotate around. The way we do that is to always turn the switches on just before
in advance of the needle lining up perfectly. So just before it turns it
perfectly. So just before it turns it lines up with the next pole, we turn on the next switch and so it moves on to the next one and on around the the
circle.
Um, so always when we're motoring, always turning on the switches a little bit in advance of when the compass needle is pointed perfectly at the
phase.
So, every time I do these videos and I tell people about how motors work, I get questions about, hey, what about regen
or recuperation or generation? We know
that these same motors also do regen.
So, how do I control it for regen? And
that's the beauty of this is it's almost exactly the same thing only instead of turning on the switches just before the
uh compass needle gets aligned with the switches, we wait and we turn on the switches just after the compass needle
has passed. So, something else is
has passed. So, something else is driving the compass needle. somebody
else is driving the rotor and as we drive the rotor past the magnetic field then we do the switching and that
produces a drag torque. It's a little bit like spark advance in an in internal combustion engine. So normally you would
combustion engine. So normally you would fire the piston just after it reaches top dead center and that pushes the piston down and you get motor. But if
you wanted to to produce a engine drag torque, you could fire the the piston just a little before top dead center and that would produce a drag torque. And
that's kind of what we're doing with turning the switches on a little bit after the magnetic field. So the
magnetic field is constantly producing a drag on the rotor as it's going around.
So that's how this operates as a um as a generator.
There is a little bit more to it though.
Uh so yes, we turn on the switches as we as the rotor has passed the magnetic field.
But so if the motor is spinning fast enough, then the changing magnetic field produces a voltage that's higher than the battery voltage and the current will
flow back to the battery.
It would be nice if we had a switch that would kind of automatically as soon as the voltage is higher than the battery voltage allow conduction
back into the battery. And in fact, that's what we have. Uh we put in addition to these switches, we put a
little diode uh actually a pretty big diode uh between the positive positive and negative. And the diode is is what a
and negative. And the diode is is what a diode is is it is like a one-way switch.
It doesn't allow current to flow this way through the switch, but it does allow current to go this way through a switch. And so if something should
switch. And so if something should happen here with the motor where the voltage from the coil is higher than the
battery voltage, the current will immediately begin to conduct back up through the diode and charge the battery. So if the if the motor is
battery. So if the if the motor is spinning fast enough, then it will charge through the dodes back to the battery. and the diodes sort of
battery. and the diodes sort of automatically turn on at exactly the right moment to allow that conduction for each of the phases.
What if the motor is not spinning fast enough and the voltage from the motor is too low to charge the battery?
So, we want to regen all the way down to the stop. So as we're coming to a stop,
the stop. So as we're coming to a stop, we need to collect that um kinetic energy and turn it into electricity and
store it in the battery. So if the voltage from the coils is too low to punch through that diode and charge the
battery, what do we do?
Well, we can use that PWM trick where we turn the switches on and off really quick.
And every time we open the switch, the collapsing magnetic field from the coil now the coil is that collapsing magnetic field is happening very fast, much
faster than the rotor is spinning. And
that produces a very brief spike in voltage.
And that spike in voltage is higher than the battery voltage and drives the current back through the diode and charges the battery. But it's so quick,
it's so in such a short pulse that the battery cannot accept that rate that charge at such a high rate. And that's
why we use a capacitor. So we have a big old capacitor. This capacitor is able to
old capacitor. This capacitor is able to accept that charge that super brief moment just as you open the switch where the voltage spikes
and that so we using the magnetic collapsing magnetic field of the coil to generate this little brief spike of of current and it's stored in the in the
capacitor and then over time the capacitor sends that power back to the battery or in this case the power
supply. So that is how we're able to do
supply. So that is how we're able to do this um charging re regen even at very low speeds when the voltage from the
motor is lower than the battery voltage.
We use PWM to turn the inductance.
Inductance is the rate of magnetic field, the amount of magnetic field you get per amp in the coil. So the
inductance of the coil and the switching here produces a boost converter that boosts the voltage up to
the battery voltage and we store that energy in the capacitor um so that it can uh be very smoothly generated out to
the to the uh to the battery. So
motoring generating you can go forward or backwards just by changing the way you the order that you turn the switches on and off
forward backwards motoring and generating all from controlling six switches. So this is the how inverters
switches. So this is the how inverters work. It's why they call them motor
work. It's why they call them motor controllers because this is controlling that motor and also why it's called speed
controllers at in hobbies in at the hobby level. So, we've got uh
hobby level. So, we've got uh u a very simple uh circuit that was sort of easy to
demonstrate and even at a second grade science project level, uh you get an incredibly deep understanding of how electric motors work.
And so, that's all we have for you today here at uh Monroe Live. Thanks for
tuning in. I really appreciate you guys.
Uh, and it was a tricky question when you asked it. I'm glad I was able to answer. Thanks a lot. Bye-bye.
answer. Thanks a lot. Bye-bye.
[Applause]
Loading video analysis...