Is current control with ACS712 feasible for BLDC FOC?

Hello everyone,

I’m working on a BLDC control project and I would like to get your opinion on using the ACS712 (5A version) for current control with SimpleFOC.

My setup:

  • Microcontroller: Teensy 4.1

  • Motor: GM3506 BLDC (11 pole pairs)

  • Driver: SimpleFOC Shield v3.2

  • Position feedback: AS5048A via SPI (working well)

  • Current sensing: ACS712-05B modules

    • Phase A → A17

    • Phase B → A16

    • Phase C → not connected

    • Supply: 5V

    • Sensitivity: 185 mV/A

  • Supply voltage: 12V

What works so far:

  • Position control with voltage torque mode → motor moves correctly to the target angle.

  • Current sensing works for monitoring: when running the motor open-loop I can see nice sinusoidal waveforms for Ia and Ib in the Serial Plotter.

The problem:

  • When I switch to TorqueControlType::foc_current and enable current control, the motor feels like it is off.

  • No matter what target torque or position I set, the motor does not move.

  • The currents read by the ACS712 show only small fluctuations around zero, basically just noise (~20–30mA).

  • With voltage torque mode everything works fine.

My goal / use case:
I want to build a torque transfer system (force feedback, haptic control) using two BLDC motors. I’ve already implemented the “steer-by-wire” example project from the forum, but the restoring forces from the steering system alone are not strong enough to rotate the feedback motor. For a realistic feel, the feedback motor must respond more sensitively and directly.
My understanding is that with proper current control (instead of voltage control) I could achieve much finer torque control and therefore better force feedback behavior.

My question:
Is it fundamentally impossible to use ACS712 modules for FOC current control due to their noise and bandwidth limitations?
Or is there a way to configure SimpleFOC (filters, gains, etc.) to make it work at least for low-bandwidth torque control?

I understand that normally FOC current control expects shunt resistors with high bandwidth op-amps, but since ACS712 is such a popular and cheap sensor I wanted to check if anyone has had success using it for actual current regulation (not just monitoring).

Any insights or suggestions would be very welcome!

Thanks a lot in advance
Roman

Hi @roman , welcome to SimpleFOC!

I believe the consensus here was that the hall based current sensor was too noisy for effective control at low current levels, and the newest version of the SimpleFOC shield is switching back to shunt resistors and current sense amplifiers for that reason…

Hi @runger,

thanks for the detailed information!
I’m currently working on a force feedback (steer-by-wire) setup, where it’s essential that motor1 can drive motor2 with very low input torque — ideally the system should feel as smooth and low-friction as possible when back-driving.

Is there a way to achieve this behavior without using current sensing?
If not, what shunt resistor value would you recommend for accurate current sensing in this case?
And would it be possible to use an external breakout board or current-sense module together with the SimpleFOC Shield v3.2?

Thanks a lot for your help and great work on the project!

Regards

Roman

The trick to getting good performance from hall current sensors is oversampling with custom ADC code. Since they can be sampled any time unlike lowside shunts, you can set up the ADC to run continuously in the background, and override the function _readADCVoltageInline to return values from your buffer.

Hi @roman,

Yes, you could use an external breakout board for the current sensing, you just have to find a way to interface it to the ADC pins of your MCU board…

The value of a current sense shunt has to be calculated based on the expected maximum current you want to read, and the gain of the opamp circuit you use to amplify it, and taking into account the power dissipated as heat. So I can’t really answer that question without knowing more information.

You can certainly try first with just voltage control and no current sensing. The result may be sufficient for your needs already and then you save yourself the work. On the other hand a working voltage control is like a precursor to real current control so if you decide to add it afterwards you won’t have wasted the effort so far.