Will this design work for SimpleFOC?

Hey all,

I’m looking forward to create my own board.
While I impressed from integrated DRV8313 solutions, I want to create a design with independent components for educational purposes.
I have came across this design:
Arduino Based: Sensorless BLDC motor control with Arduino - DIY ESC - Simple Projects
PIC Based: Sensorless BLDC motor controller using PIC18F4550 microcontroller

Should it work? are there any modifications that shall be done?
In addition, I would like to add hall sensor circuitry, help will be greatly appreciated.


Both IR2101 and IR2104 mosfet drivers should work with simpleFoc, but the circuits you shared are using bemf to calculate the posotion of the rotor which I think is not available in SimpleFoc, but you have hall sensors so you will probably use those.

You should remove the part of the circuit for BEMF sensing, and attach the hall sensors output to the mcu instead.

I don’t think you need any circuitry for hall sensors other that maybe the pullup resitors - it could work with mcu internal pullups, but you have way more flexibility to fix issues with external pullups if you run into issues with noisy signals from hall se sors.

Try it all out on a breadboard first with low voltage/amps.


Thank you very much for the replay.

I might be wrong here, but isn’t BEMF sensing like current sensing?
Some current sensing methods are supported in SimpleFOC - Current Sensing | Arduino-FOC (simplefoc.com)

Attached the schematic for easier reference:

I plan on using STM32F0 or STM32G0 instead on the Atmel chip used in Arduino.
The end goal is to use current sensing + hall effect sensors.

Are there any improvement that you would recommend for this design?
The ESC is aimed for high RPM motors, not gimbal motors.

I have not yet touched current sensing, so I’m as far from an expert as one can get, but for inline current sensing, you should have a current sense resistor which you do not have in this configuration. I think that low side sensing is supported on some mcu as well.
Every solution I’ve seen here is based on some current sense IC (INA, ACS…) and I guess that’s the way to go with current sensing.

BEMF on the other hand is monitored for voltage (not current). Extremely simplified, it works this way: you spin the motor, turn it of, and check the voltage on phases to estimate the magnet position at that precise moment.

Someone else might have a more educated answer

Maybe someone has more information to add?

Hi @Dodo,

Here’s my 2 cents:

The driver portion of the design looks ok. One thing you should watch out for is the state during startup, after power-on, before the MCU pins are set to a defined state. I think you want to pull your shutdown pins low, to ensure the motor doesn’t get accidentally powered during the startup phase.

For the sensing portion, you have BEMF sensing designed here. I think its ok for lower power motors, for higher power I would add some ESD protection to protect the MCU pins against spikes.

But SimpleFOC at the moment does not use the BEMF. As others have pointed out, we support current sensing, in-line or low-side, with 2 or 3 shunt resistors.
For current sensing you need a different circuit, with a shunt resistor and op-amp (or current sense amp).

Consider adding some debouncing to your buttons, a capacitor doesn’t cost much and can make the operation more reliable.

I’m only looking at the picture in a high level way. I didn’t check the details of your circuit:

  • gate resistor sizing and FET timings
  • UNO pin assignment, make sure the pins used for IN signals are PWM pins
  • voltage levels for all components

Design questions: Mosfet timings

This picture is from the Diy Esc that casainho introduced in this forum.

I have made a few pcbs, with different drivers(ir2101, u3216, fd6288,eg2134), different mcus(stm32f103,stm32g070,stm32G030), and different mosfet(To220, SO8). For reference I also got a G_431_ESC.

The drivers are based on schematics found on this forums. The difference between them lies in the parts highlighted in the picture.
The one like this works like the G_431_ESC at 25khz,
for others, that only have a gate resistor , I have to decrease the PWM Frequency to 15Khz, one even to 5khz(side effects are more current draw while spinning, or motor not spinning at all and drawing a lot of current even at 1V).

The Questions are:
1: Can I calculate these parts for individual mosfets(Gate resistor, Capacitor OC1)? The gate resistors in example schematics are different, ranging from 2R2 to 1K.
2: Why is there even the capacitor OC1? I have read that the mosfets gate charge capacitance should be low. Does this capacitor increase it?
3: What is the purpose of RS1 and CS1?

Hey @2hry ,

These are good questions!

I think you might really like this link.

  1. Yes, see the link. It is a matter of the gate capacitance and the drive strength of your driver.
  2. It prevents self-turn on, and yes, it does affect the gate capacitance… see section 4.4.3 in the linked document for better alternatives.
  3. Good question. I am not sure, but would be very interested to find out!