cancel
Showing results for 
Search instead for 
Did you mean: 

What to change in FOC code for lower inertia?

BTrem.1
Senior II

I have a BLDC motor running reliably with FOC code on a STM32G431 MCU. For unrelated mechanical reasons we need to drop our inertia by about 4x from where it is running today. For the speed loop I fully understand lowering inertia raises the loop gain and I'll need to lower the gain in the speed loop.

What I need some guidance on is how to adjust the spin up ramp and whether I need to change the observer gains. Without any changes to the code I am now getting a MC_SPEED_FDBK error.

I cannot run this motor on the profiler because it is using a custom MCU board and driver not supported by the profiler. The motor Rm, Kt, Lm and Kb are exactly the same; we are just removing mechanical inertia.

Any guidance is appreciated.

2 REPLIES 2
Laurent Ca...
Lead II

Dear @BTrem.1​ 

Welcome to the STM32 Community

Sorry for late answer.

Could you give more details to the STM32 Community about your setup -the material you use- ?

(HW and also SW: CPU(s), tools and versions, board(s), motor(s) and so on)

And more especially did you use STM32 MC tools (such as MC_suite, STM32 MC Motor Profile, STM32 MC SDK, STM32 MC Workbench, the used example, the origin of the base of your application source code, and so on)?

Best regards

BTrem.1
Senior II

For tools I use the STM32CubeIDE v1.5.0 and the Segger J-Link debugger. The MCU is a STM32G431 64kRAM 48-pin device. The board is a custom board with a STSPIN233 5V driver. The start current I use is about 500mA and the run current is about 40mA. The motor control software is MCSDK_v5.4.4. I'm using the FOC sensorless control with 3-shunt current feedback. The original code was profiled on a Nucleo board (64-pin STM32G431) with a IHM17M1 adapter with the STSPIN233 driver.

I don't use the profiler now because it is not compatible with my custom board. I do use the MCSDK software (WorkBench) to manually adjust registers for tuning the software. I had everything working fine with the larger inertia but now the very low inertia load is very unstable and I can't seem to stabilize it by changing just the velocity loop PI controller.