cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with code generation for motor control

JBookhout
Associate

I am using a B-G431B-ESC1 inverter board to run a 36v 10A hub motor. The board is based on the STM32G431CB microcontroller so I am using the STM motor control environment to generate code for this project. Their Motor Control Workbench has a motor profiling program to get the specs from a custom motor like the one I am using. From this motor profile, along with many other parameters, STM32CubeMX generates code for the B-G431B-ESC1. We then upload this code through the STM32cubeIDE and try to run the motor with the ST motor pilot. The problem is the code never seems to work right. The motor doesn’t run and returns one of a few errors depending on the parameters we set up in the Motor control workbench. Is there some parameter we are missing that is important for this board? Since we are staying within the STM environment it doesn’t make sense that the generated code keeps failing. It’d be great to get a response soon as I am trying to figure this out in the next week. I can provide more information if needed.

1 ACCEPTED SOLUTION

Accepted Solutions
Gael A
ST Employee

Hello JBookhout,

If you are using an ESC-G431, I recommend you to profile your motor via the MotorProfiler tool. You can access it via MotorPilot and then clicking on Launch Profiler. You can either select the board you are using or let the Profiler detect your ESC. After giving essential information and connecting, the Profiler should flash the correct firmware directly onto your board, without requiring you to go through CubeMx or CubeIDE. You then only need to start profiling and get your profiled motor file that can be saved into the WorkBench database for a further use.
Be aware that the profiling may not complete properly on the first time and that you may need to test different values of Max Speed and Max Current to get a clean profiling.

Hope this will help,
Gaël

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.

View solution in original post

1 REPLY 1
Gael A
ST Employee

Hello JBookhout,

If you are using an ESC-G431, I recommend you to profile your motor via the MotorProfiler tool. You can access it via MotorPilot and then clicking on Launch Profiler. You can either select the board you are using or let the Profiler detect your ESC. After giving essential information and connecting, the Profiler should flash the correct firmware directly onto your board, without requiring you to go through CubeMx or CubeIDE. You then only need to start profiling and get your profiled motor file that can be saved into the WorkBench database for a further use.
Be aware that the profiling may not complete properly on the first time and that you may need to test different values of Max Speed and Max Current to get a clean profiling.

Hope this will help,
Gaël

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.