cancel
Showing results for 
Search instead for 
Did you mean: 

EVLSPIN32G4-ACT button doesn't spin motor, motor buzzes for a second

shane mattner
Associate III

Version: MCSDK v6.3.0, CubeMX v6.9.2, STM32 FW V1.5.2 (using HAL)
Tool: Firmware generated by MCWB, no modification
Details: Pressing button SW1 on EVLSPIN32G4-ACT is supposed to start the motor, but instead makes the motor buzz for a second, then stop. I successfully ramped the motor with B-G431B-ESC1 dev kit and I'm using the same `mc_parameters.c` file (14 pole motor, RS=0.11836, LS=0.04).  I also tried the same main.c code on the EVLSPIN32G4-ACT as the B-G431B-ESC1 main loop.
Expected Behavior: motor should spin as it does in this demo video https://www.youtube.com/watch?v=DIMeHnKfJZ8
How to reproduce: Use EVLSPIN32G4-ACT, generate default project from MCSDK, press SW1 to try and run motor.

Can anyone tell me what variables I might look at to troubleshoot this issue?  Or possibly some more example code to try?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

The motor profiler allows to estimate parameters for the motor.
In your case motor parameters are already known so there is no need to use this tool.

Please re start from a clean project in the motor control work bench and upload the generated firmware on the board. Then open the Motor Pilot from the drop down list as shown below.

STMCWB-Tools-menù.pngAfter connecting the board you can start your motor.

Please report the error that is eventually shown in the panel below.

STMCWB-Errors.png

 

If you feel a post has answered your question, please click "Accept as Solution"

View solution in original post

5 REPLIES 5
Cristiana SCARAMEL
ST Employee

Hello @shane mattner,

to better understand the root cause of this behavior in your application,

could you please try to spin the motor using the motor control pilot software?

Check if any error is returned on motor start.

 

If you feel a post has answered your question, please click "Accept as Solution"

After successfully running the motor profiling tool the button now works as expected and starts/stops the motor.  What's interesting is that yesterday I ran the motor profiling tool and the motor spun, but the tool got stuck at 28%.  Now today the Profiling tool ran (after several attempts) successfully to 100% completion. And now the button seems to work to make the motor spin as expected.

 

However, after power-cycling the mcu the button no longer works to spin the motor.  Does that mean the profiler tool sends some parameters to the MCU that it needs to spin the motor?  Can I set those parameters somewhere in firmware myself and not require profiling?

The motor profiler allows to estimate parameters for the motor.
In your case motor parameters are already known so there is no need to use this tool.

Please re start from a clean project in the motor control work bench and upload the generated firmware on the board. Then open the Motor Pilot from the drop down list as shown below.

STMCWB-Tools-menù.pngAfter connecting the board you can start your motor.

Please report the error that is eventually shown in the panel below.

STMCWB-Errors.png

 

If you feel a post has answered your question, please click "Accept as Solution"

The Motor Profile tool will not connect to the debugger

 

shanemattner_0-1727131488613.png

 

But the Motor Profile tool connects right away:

shanemattner_1-1727131560914.png

 

But either way I don't want to run the motor through the Pilot program, I just want the firmware to boot up and spin the motor when I press the button. This currently takes me to successfully run the motor profiler in order to have the button work.  I've also tried a basic ramp command from boot and the motor makes a slight buzz before doing nothing:

 

```

    MC_ProgramSpeedRampMotor1(1000, 500);
    MC_StartMotor1();
    HAL_Delay(5000);
    MC_StopMotor1();
```

 

 

I believe I understand what you were saying in your previous post @Cristiana SCARAMEL: I regenerated the project and selected the motor profile that I completed with a different firmware, while also leaving the "Motor Profiler" option off.  Now the firmware works as expected with this code:

    MC_ProgramSpeedRampMotor1(1000, 500);
    MC_StartMotor1();
    HAL_Delay(5000);
    MC_StopMotor1();

 

Thank you for the support!  Perhaps I overlooked this step in the documentation but it was not obvious to go through this motor profile generation and then generating a new project based on that profile.