Blueprint

FOC BLDC Driver

BLDC Motor Driver with FOC capabilities, intended for drone motors.

Created by Lingfeng Wang Lingfeng Wang

Tier 2

2 views

0 followers

No Demo Yet

Lingfeng Wang Lingfeng Wang added to the journal ago

Buck Converter Swap and Circuit

Doing some research, I found out that my LDO would not work at higher voltages, such as 12v. Then, I decided to use the MP1584 buck converter.
image

Since it was not available in the KiCad Library, I had to make it myself.
image

image
This is probably super messy, but hopefully it works.
I also changed R9 to 127k, so the converter will output 3v3.

Lingfeng Wang Lingfeng Wang added to the journal ago

Finished H-Bridge

image
The H bridge and mosfet driver circuits should be finished now. Following both the datasheet and some other people's circuits, I was able to finish the mosfet driver. If the examples differed from the datasheet, I still stuck with the datasheet's instructions, such as using a 1uF cap instead of a 0.1uF cap.

I also selected the pins on the STM32, such that each phase were on the same timer (TIM1_CH1, CH2, CH3).

Lingfeng Wang Lingfeng Wang added to the journal ago

Encoder Wiring & LDO

I chose a 3v3 LDO, since the STM only uses 3.3V, the DRV8323 uses 1.8/3.3/5V, and the AS5068A uses 3.3/5V.

I chose the MCP1700-3.3 LDO, since it has enough power and is cheap.
image

Then, using the datasheet, I wired up the AS5068A.
image

image
This encoder will be separate from the main PCB, probably connected with some sort of JST connector.

Lingfeng Wang Lingfeng Wang added to the journal ago

Made IRF7821 Footprint and Symbol

I couldn't find the IRF7821 in KiCAD's library, so I decided to make my own.

Since the IRF7821 is in a SOP-8 footprint with 8 pins, I had to stack the extra pins on top of each other.
image
I used the datasheet to make my own version.
image

The footprint was just the SOP-8 footprint, which KiCAD already has.
image

Lingfeng Wang Lingfeng Wang added to the journal ago

Chose Components

Controller: STM32F3

  • Popular and works well enough

Encoder: AS5048

  • SPI & absolute

Mosfets: IRF7821

  • Cheap and popular

Gate Driver & Current Sensing: DRV8323

  • Seems cheap and popular
  • Originally wanted these to be separate, but it is much cheaper to just use this one.

image

Most of these components have been selected to be either as popular or cheap. SPI was preferred, because it is much faster than I2C for the encoder.

Lingfeng Wang Lingfeng Wang started FOC BLDC Driver ago

1/3/2026 5:25 PM - Chose Components

Controller: STM32F3

  • Popular and works well enough

Encoder: AS5048

  • SPI & absolute

Mosfets: IRF7821

  • Cheap and popular

Gate Driver & Current Sensing: DRV8323

  • Seems cheap and popular
  • Originally wanted these to be separate, but it is much cheaper to just use this one.

image

Most of these components have been selected to be either as popular or cheap. SPI was preferred, because it is much faster than I2C for the encoder.

1/3/2026 5:52 PM - Made IRF7821 Footprint and Symbol

I couldn't find the IRF7821 in KiCAD's library, so I decided to make my own.

Since the IRF7821 is in a SOP-8 footprint with 8 pins, I had to stack the extra pins on top of each other.
image
I used the datasheet to make my own version.
image

The footprint was just the SOP-8 footprint, which KiCAD already has.
image

1/3/2026 6 PM - Encoder Wiring & LDO

I chose a 3v3 LDO, since the STM only uses 3.3V, the DRV8323 uses 1.8/3.3/5V, and the AS5068A uses 3.3/5V.

I chose the MCP1700-3.3 LDO, since it has enough power and is cheap.
image

Then, using the datasheet, I wired up the AS5068A.
image

image
This encoder will be separate from the main PCB, probably connected with some sort of JST connector.

1/3/2026 10:16 PM - Finished H-Bridge

image
The H bridge and mosfet driver circuits should be finished now. Following both the datasheet and some other people's circuits, I was able to finish the mosfet driver. If the examples differed from the datasheet, I still stuck with the datasheet's instructions, such as using a 1uF cap instead of a 0.1uF cap.

I also selected the pins on the STM32, such that each phase were on the same timer (TIM1_CH1, CH2, CH3).

1/3/2026 10:58 PM - Buck Converter Swap and Circuit

Doing some research, I found out that my LDO would not work at higher voltages, such as 12v. Then, I decided to use the MP1584 buck converter.
image

Since it was not available in the KiCad Library, I had to make it myself.
image

image
This is probably super messy, but hopefully it works.
I also changed R9 to 127k, so the converter will output 3v3.