Even though it is many months ago that I wrote the first log in this project, I am a lot closer to my first design than I was then. As presented in the previous post, there are three main methods to control a brushless motor, each one having slightly different needs for the hardware design. Here I will present which components are needed for a BLDC controller, to be able to use all three methods. Read on for part selection and the reasoning behind my choices.
Let me start of by saying that I am of course not the first one or only one to develop a BLDC controller. Next to many commercial solutions there are two open-source projects that stand out in particular which are known as VESC and ODrive . ODrive targets itself towards servo and robotics applications, while VESC is very popular for things like DIY electric skateboard builds. Much of the inspiration for my own design comes from these two projects, but there are a few things that I wanted to do different as well. My wishlist is:
Next, I will go over all components that are needed and how I selected them. This post might be a bit dry, but if you are interested to do something similar I hope it will be useful.
As a microcontroller I decided to go for a relatively powerful STM32 in a small form factor. I selected the STM32G473CE with an FPU, 170Mhz and 512 kB of ROM. Within the same form factor, versions with different clock speeds, and available memory are typically pin for pin compatible. That makes it easy to downgrade after real-world testing to see how much of that I actually need.
Selecting the MOSFET was the hardest part, since there are so many options. This one is rated up to 60V and there are three main aspects I looked at:
Both VESC and ODrive use a TI gate driver from the same series, but the DRV8305 is unique in that it is compatible with 3 current shunts instead of 2. This allows for better sensing.
Another advantage of the DRV8305 is that you can configure the current to the MOSFETs. Normally you would need to put a resistor between the gate driver and the MOSFET to limit the current and prevent instabilities. Since I was not confident enough in my calculations for this, the DRV8305 is a nice choice because I can test different settings with the same design.
The only downside for this gate driver is that the max voltage is 45V which is slightly below what I wanted. But its a sacrifice I am willing to make since I have no actual short term applications where this will be needed anyway.
I will use a buck converter to generate 3.3V for the microcontroller. Next to that a small 5V supply is needed to power hall sensors or an encoder when available. The DRV8305 actually contains a very low current 5V supply, so we get this one for free.
That's it! I am currently designing the PCB with these components, and hope to be ready within a few weeks from now. At a first glance it seems feasible to package all of this in a one-sided PCB of roughly 4x7 cm. Stay tuned, because in the next update I hope to be able to show you the actual circuit board.