2025-03-10 10:04 PM
Hello everyone,
We constantly receive orders from our customers that they got some motors which their nominal speed, nominal voltage, and etc. are approximately similar to each other, but their Rs, Ls, Ke, and pole pairs may differ.
They want us to design an inverter board in such a way that it can get these motors running, providing the capability to see if their motors are damaged or not, just by using a single board without the need to customize the firmware or the hardware for each motor. So, we need to somehow get pole pairs of the motor from the user, change it in the firmware and run the profiling process.
For such purposes,
What can we do by using ST motor control workbench?
What are the related APIs to achieve this goal?
Is this even possible?
Thank you!
Solved! Go to Solution.
2025-04-14 6:53 AM
Hello @MotorHobbyist,
If you generate a project a Profiler project, you can launch a motor profiling using API MC_StartMotor1().
Wait until OTT.bState reachs OTT_END state (refer to mp_one_touch_tuning.h file. Replace "OTT_State_t bState;" by "volatile OTT_State_t bState;" for read purpose) to call MC_StopMotor1().
During profiling, check with MC_GetSTMStateMotor1() API, that MC state is not equal to FAULT_OVER (exit error case).
2025-04-14 1:04 AM
Hello dear @GMA !
Could you please read this topic and help me achieve this goal?
I want something similar to Motor Profiler version 5.4.8 procedure which it can take parameters before starting the procedure, profile a motor, then stop the motor and if desirable, play with the motor.
Instead of using motor profiler I want to use APIs and implement it in my own code and disable the USART peripheral.
Huge thanks to you!
2025-04-14 6:53 AM
Hello @MotorHobbyist,
If you generate a project a Profiler project, you can launch a motor profiling using API MC_StartMotor1().
Wait until OTT.bState reachs OTT_END state (refer to mp_one_touch_tuning.h file. Replace "OTT_State_t bState;" by "volatile OTT_State_t bState;" for read purpose) to call MC_StopMotor1().
During profiling, check with MC_GetSTMStateMotor1() API, that MC state is not equal to FAULT_OVER (exit error case).
2025-04-14 10:02 PM
Thanks a lot @GMA
I successfully profiled the motor the way you told me.
if you don't mind, I got 2 more questions:
1. I also intend to set pole pairs, nominal speed, and nominal current before starting the procedure using MC_StartMotor1(). By referring to mp_self_ctrl.h I found these APIs:
Are they OK for this goal? Don't they affect the profiling process?
2. I also want to have a feature like the play section in the motor profiler v 5.4.8. So, after my motor being profiled, applying some delay, I use a potentiometer to get the ref. speed and apply it to the firmware by:
MCI_ExecSpeedRamp(pMCIN,RPM2MEC01HZ(firstSpd), 7500);
MC_StartMotor1();
unfortunately, the motor does not bother to rotate and after just one sec or so I always get SPD_FDBK_ERR.
In this scenario, would the firmware try to get the motor running by the parameters initially set during generating the project by cubemx, so it fails to run a different motor compared to the one I chose for just generating the project?
I really appreciate your help
2025-04-15 12:39 AM
Hello @MotorHobbyist,
1. If your goal is only a matter of detecting that a motor is functional or not, Pole Paire setting is not mandatory.
2. Calling MC_StartMotor1(); you will restart the profiler...
2025-04-20 12:33 AM
Hello @GMA This way the motor was profiled successfully, but when the firmware reaches this point to start the motor again,2. Calling MC_StartMotor1(); you will restart the profiler...
I always get the speed feedback error, and it sops only one second after receiving my command. I have almost changed every parameter in drive_parameters.h and it wouldn't be really useful or make a difference.
Do you have any idea to start the motor after being profiled once?
sincerely