cancel
Showing results for 
Search instead for 
Did you mean: 

Getting started with MCSDK and P-NUCLEO-IHM002

Keith Henrickson
Associate II

I'm using SDK version 5.Y.4.

I start by using the motor profiler and the included motor, with the settings 7 pole pairs, 18000 max rpm, 2.8Apk, 12V. It makes a profile, but gives warnings that stator resistance and stator inductance are < 1.

I can use the "play" mode to spin the motor at 16200 rpm, and my power supply delivers 480mA at 12V to do this.

Now I save the motor profile and load it into the workbench. I then make one single change... to change the current reading topology from 1 shunt to 3 shunt. The board is jumpered for 3 shunt after setting it up using the out of the box test program.

I generate the code. load it into STM32CubeMX. Make no changes, and generate code again, and load it into STM32CubeIDE. Load the code onto the board. Run it. Load up Motor Pilot and start playing. At low RPMs, everything is fine.. At high RPMs, either the FOC overrun fault occurs, or an overcurrent fault occurs.

I've tried a bunch of stuff after reading other posts:

  1. Lower the PWM frequency to 20kHz.
  2. Set the Release build in CubeIDE. Both Release and Debug seem to have been set for -Ofast
  3. Raise the Execution Rate value in the workbench to 2 PWM periods. This makes the overcurrent fault happen at lower RPMs
  4. Change the cut-off frequency down to 2000 or up to 9000

Is there anything I should try that I haven't yet?

One other tidbit... turning on FreeRTOS causes the same faults to occur at lower RPMs. It feels like the optimization level might not be right?

3 REPLIES 3
Keith Henrickson
Associate II

Hey.... did I miss any information that anyone needs?

I was thinking that since this is an ST designed board, and an ST selected motor... there should be a quick and easy answer?

Thanks for putting your question through OLS. You should see the reply there shortly. I'm answering here only because of your OLS request and the answer may benefit others. You chose the P-Nucleo-IHM002 motor control kit. That kit uses the Nucleo-F302R8 as the microcontroller board. As such the selection of the motor control GUI is X-Cube-MCSDK v5.4.8 as of this date. You should use STM32CubeMx v6.5.0 or later as of this date as well. You have chosen the combination of MCSDK v5.y.4 + CubeIDE. Note that MCSDK v5.y.4 is meant as a community beta to let the community see features to come later in 2022. MCSDK v5.y.x was never meant to be supported by CubeIDE. In fact, to lessen development issues, MCSDK + CubeMx generated code should use the Keil MDK-ARM or IAR EWARM as the IDE. Best of luck with your design.

Thank you so much for the info! I didn't realize that I'd gotten onto a beta build. Makes sense.

The main line code that you suggested works MUCH better!