2025-10-06 1:49 AM
Hi!
I disassembled a BLDC motor from a popular hammer drill.
It has two pairs of windings and three PCBs:
- a main rectifier with a simple 16V voltage converter;
- a set of six IGBTs and one 5mΩ shunt resistor;
- a regulator with several drivers, operational amplifiers, and a microcontroller. It also has built-in HAL circuits.
I scrapped the last PCB and made my own driver and measurement circuit, copying the originals, but I used an STM32G431 for control and acquisition. The goal is to achieve stable and reliable torque in this machine.
The use of a single shunt resistor forced me to use a single-resistor circuit; I also copied and used the HAL circuits. I generated the code using MCSDK v6.4.0 in FOC mode. The PWM operates at 5 kHz—the same as in the original. I spent some time tuning the parameters, but now it works well. The rotation is stable in both directions, and MotorPilot allowed me to adjust the rotation accordingly. However, one important parameter is very unstable—the torque. This fluctuation is almost independent of the actual shaft load. The measurements on the shunt resistor are offset by 0.3 V (the same as in the original), and this offset is reset using the MC_StartPolarizationOffsetsMeasurementMotor1() function. I'm sure I'm using the correct ADC input for the current measurement.
I would appreciate any suggestions on how to obtain a stable torque value or what to do to detect problems.