Skip to main content
Associate II
July 26, 2023
Question

X-CUBE-SPN7 motor control

  • July 26, 2023
  • 1 reply
  • 1965 views

Dear all,

I am using the STM32 Nucleo pack with a F302R8 card, the IHM07M1 and the associated motor.

The library for motor control (6Step_Lib.c) of  X-CUBE-SPN7 only provides a few functions, for ex MC_StartMotor, MC_StopMotor() and MC_Set_Speed().

I would thus be interested to know how to control the motor given a specific angle as input : it seems that only using theses 3 functions won't be precise enough : for example if we use MC_Set_Speed() to set the speed at w degree per second, and if we want a rotation of theta degree, rotate the motor (at speed w) for theta/w second won't enable to target a precise angle.

Thanks for your help & time ! :)

    This topic has been closed for replies.

    1 reply

    Gael A
    ST Employee
    July 31, 2023

    Hello user-stm,

    If you want to do position control, I recommend you to use the MCSDK 6.1.2. You might also want to switch to FOC instead of 6STEP (as its name indicate, you can only go through 6 positions aka a step equal 60° which is really not precise)
    Please refer to our Motor Control Wiki for how to use the Motor Control Suite.
    If you really need to use the X-CUBE-SPN7, you can still enable it via CubeMX once your project is generated by WorkBench.

    Hope this will help,
    Gaël A.

    If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.
    Associate II
    March 15, 2024

    Hi, Gael A,

    I am trying to develop a project with a BLDC motor and want to use X-CUBE-SPN7 but i don't know how can I start. Dou you know where can I find some examples to start a project from scratch with NUCLEO-F401RE, X-NUCLEO-IHM07M1? 

    Thank you in advance,

     

    Cristhian 

    cedric H
    Technical Moderator
    March 18, 2024

    Hello @cristhianchr ,

    X-CUBE-SPN7 is Not Recommended for New Design. The recommended starting point to generate a project with NUCLEO-F401RE and X-NUCLEO-IHM07M1 is with the MCSDK 6.2.1 available here.

    Regards

    Cedric