Brushless DC Speed Controller

preview_player
Показать описание
In this video I'm going to show how i built a brushless DC (BLDC) ESC (electronic speed controller) based on an Atmega328P microcontroller. This ESC was a prototype for a much larger one that I'll be using to drive the 1500-watt motors on my submarine. The video also explains the theory behind how a brushless DC motor works, and some troubleshooting tips that you may find helpful if you build one of these yourself.

The code i used for the first test can be found here:

I later modified it to add a reverse function and adjusted the startup sequence settings to get a smoother start to my motors.

A guide on using the Atmega328P microcontroller by itself (without the arduino board) can be found here:

Hardware used:

MOSFETs: IRLZ44
Flyback Diodes: MUR120G
MOSFET Drivers: IR2101
5V Linear Regulator: LM7805
MOSFET Driver supply regulator: LM317

The motor used in the first part of this video is a very old brushless motor i used to fly on a drone, and I'm not sure what the part number is or if it's still in production.

The submarine motors are Turnigy SK3 6374-192 kV brushless motors. I've replaced their ball bearings with bronze sleeves, and coated the rotor and stator with enamel to protect against saltwater.

Arduino Code:

Рекомендации по теме
Комментарии
Автор

I've updated the description with a link to the arduino code

HyperspacePirate
Автор

You know you're in for a treat when the video starts with the words "My submarine...".

AradijePresveti
Автор

As with any experimental project, you start from the basics, and when you get it kind'a working, you add other options to fine tune exactly what you really want. Amazing how large such circuits end up being. Been there done that so many times... Thumbs Up!

garymucher
Автор

Very nice video giving a lot of insight. Congratulations.

One humble improvement I can suggest is not to use a Linear Regulator (LM317 at 10:41) but instead, use a DC-DC converter (aka switching power supply to convert your 24-28V down to 14V).

When you use a linear regulator, you are burning half of your battery capacity [ (28V-14V)/28V = 50% ] on the LM317, basically converting it to heat.

Switching power supplies, on the other hand, can be as much as 99% efficient, and therefore use your battery capacity for propulsion instead of heat.

Keep designing

MuratIsikHome
Автор

It’s because the brushless controller, like servos don’t just take PWM control, they need an exact pulse timing to initialise. If you use a servo library it’ll solve your issues.

MakeTeachRepeat
Автор

Great video, BLDC motors and its ESCs are tricky and most videos available get some details wrong and drive viewers to non working solutions and broken code. Your solution works and your explanation is very good. Thanks

MarlosB
Автор

Very good! A very clean guide through ESC design. The only mistake (that actually, almost all hobby ESCs have) is that you should not switch phases at zero-crossing. Zero-crossing happens in the middle of the current phase, not at the end. So you switch phases a little bit too early. That still works obviously, but it reduces efficiency and increases torque ripple.

Positive_Altitude
Автор

I just wanted to say thanks for sharing your project, It provided inspiration and impetus. I had been putting my own ESC project off for a while. A combination of analysis paralysis and trying to think of all the required features. I decided to go with through hole components (majority) and an arduino after seeing this video. My motor is now up and running. Thanks again.

BS_Workspace
Автор

You say that a "Y" configuration produces more torque, but the more appropriate thing to say is that it produces more torque at a given current.

Assuming each phase is 1 ohm and we're powering the motor with 10V, at zero RPM the "Y" configuration will draw a maximum of 6.66A, while the delta will draw a maximum of 20A. At these respective currents though, the "Y" motor produces %66 of the torque of the Delta motor while only drawing %33 as much current.

My example and numbers assume that the all three half-bridges are either 'pushing' or 'pulling' at all times instead of only two at a time like yours, but the numbers are similar either way. If we leave one half bridge turned off, at zero RPM the Delta draws 10A, and the "Y" draws 5A but produces the same torque as the Delta.

Due to the increased inductance per phase of the "Y" type though, it will have a higher impedence at a given RPM, so you were right in saying that Delta is faster. The way I prefer to think about it is that "Y" configurations are good when current is the limiting factor, and Delta configurations are good when voltage is the limiting factor.

Fantastic video though! I love your channel.

EDIT:
I see you're using the IR2101. I was designing an ESC with those aswell, but I recently discovered the IRS2184. Just like the IR2101 it supports bootstrapping, but it also lets you switch from HIGH to LOW with a single input pin, and has a built in 400ns dead-time so your high side and low side MOSFETs dont transconduct. It also has a turn-off pin so that you can easily throttle your motor with a PWM signal generated by your Arduino.

BenjaminMarshallScienceMan
Автор

Now add PWM, current limiting and smooth start and you got a usable brushless motor controller. Probably better to move to STM32 micro with many needed hardware peripherals already built in.

antronx
Автор

This is so interesting and impressive! I finally really understand exactly why 3 phase motors have 6 wires, how all these coils relate to only 3 phases, and how the number of magnets are related to the number of coils per phase.

When you were talking about needing a hall effect sensor, I realized you could deactivate one phase and measure voltage on that phase - but then you mentioned using the inactive phase because there's always one that's not driven. Super clever.

There are only two things I may have missed or you didn't address them: the waveform (PWM, simulated sine, or simply square - which is what you're doing), and the other is timing: the ATmega328 does not have reliable timing because of its factory default interrupts. I believe people can get much faster execution and much more reliable timing by programming them in assembly. This probably doesn't matter since you're relying on an interrupt for your timing anyway - so the measurement from the motor is your clock in a way.

Gersberms
Автор

Wow well done and thanks for sharing the code. be careful out there the ocean has this way of destroying everything that sied it looks like you know what you are doing! having been on a submarine With The RCN and noting that they spend a lot of time in dry dock and almost never sail I have a lot of respect for what you are attempting.

scotticus
Автор

I was encouraged to see that you used a dual trace scope. I wanted to build my own esc but my motors are delta wound and I couldn't figure out how to detect the zero crossing point with my dual trace scope. I think I'll buy a wye motor and compare a phase with the neutral point as you did.

deeguy
Автор

I have to tip my hat off to you Sir. This video really refreshes my knowledge of electronics with all the buzz and straight information on the subject matter. I am looking forward to check out your other videos to bring my knowledge of electrical stuff to on par.
Job well done Sir too.
Have yourself a Merry Christmas and A Happy New Years fella. Hope great things for us both in the New Year.

victoryfirst
Автор

Holy shit, you did something most YouTubers failed badly to do without even needing external comparators.

rafa_br
Автор

Congratulations!
Your video is the best tutorial about the ESC for BLDC motors. Finally, I could understand how does work the BLDC with back EMF control.
Thank you, a lot.
The Arduino code is very optimized for speed, otherwise it would not usefull for this kind of motor control.
Your hardware considerations about the use of the Atmega328's internal analog comparator was great, as well as the Interrupt.
Did you finished the PCB design?
Do you think or plan to sell or share it?
I would like to get it.
Did you test your maximum speed acquired, at despite for your purpose you don't need very high speed, I think.

anibalvilelarj
Автор

I found my way here from the cryocooler videos, and YOU HAVE A SUBMARINE! This channel is amazing.

anomaly
Автор

You are a holy engineer. Whispering to esc and motors and stuff. So inspired by your work as a high school student!

emirhanb
Автор

peace be upon you
Thank you for sharing the brushless motor driver code, thank you very much❤🌺🙏

alimohammadi
Автор

You are the king!👑I didn't know you can use motor's coil for position sensing.

berver
welcome to shbcf.ru