cancel
Showing results for 
Search instead for 
Did you mean: 

Profiling Any Motor using Firmware (APIs) not Motor Profiler

MotorHobbyist
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions

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).

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

View solution in original post

5 REPLIES 5
MotorHobbyist
Associate II

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!

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).

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
MotorHobbyist
Associate II

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:

SPD_SetElToMecRatio(&STO_PLL_M1._Super, POLE_PAIRS);
SPD_SetElToMecRatio(&VirtualSpeedSensorM1._Super, POLE_PAIRS);
SCC_SetPolesPairs(&SCC, POLE_PAIRS);
OTT_SetPolesPairs(&OTT, POLE_PAIRS);
 
SCC_SetNominalCurrent(&SCC, NOM_CURR);
SCC_SetNominalSpeed(&SCC,NOM_SPEED);
OTT_SetNominalSpeed(&OTT,NOM_SPEED);

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

 

 

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...

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA


2. Calling MC_StartMotor1(); you will restart the profiler...


Hello @GMA This way the motor was profiled  successfully, but when the firmware reaches this point to start the motor again, 

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