cancel
Showing results for 
Search instead for 
Did you mean: 

How to control the power consumption of a motor using MCSDK

MotorHobbyist
Associate III

Hello everyone!

I use these tools:

MCSDK V6.3.2 

CUBEMX V6.14.1

KEIL Compiler

I am curious about controlling the power consumption of a motor (instead of having set point for the motor's speed, we want to define this set point for power).

Is there any CHANCE to somehow implement a power consumption control loop in the firmware? Is there any API?

Could we customize and change the firmware's default control loop for speed and modify it in header files and source files of a project to work based on the power consumption?

What are your suggestions?

I hope you get the idea. Thanks ALL

 

4 REPLIES 4
GMA
ST Employee

Hello @MotorHobbyist,

MC_GetAveragePowerMotor1_F is available (refer to mc_api.c file).
You can customize the FW, refer to License Agreement.

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

Hello dear @GMA 

Thanks for reply,

We'll definitely use the FW in compliance with the License. 

could you please see the shot I attached? Is this the right place to modify and customize the FW?

I know that for the F0 series, the fixed-point arithmetic is used for computational purposes.

Using MC_GetAveragePowerMotor1_F returns power in Watts. I suppose I should change the unit here, please correct me if I am mistaken.

How can we force the FW not to increase the torque ref. too much? I guess if I do not apply limitation, when motor is unloaded and the power set point is greater than the current power consumption, the firmware increases Iq current aggressively making my motor unstable.

Could you please walk me through?

I really recommend st to add the power consumption control loop, it is taking root nowadays, at least in my country

Regards!  

 

Hello @MotorHobbyist,

Did you try by using Torque Mode on Control mode? You will set the maximum Iq reference and then it will limit power consumption.

GMA_0-1747210868393.png

 

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

Hey @GMA 

Thank you for reply,

Yes, before coming up with the idea of customizing the FW, I played around with it and wasn't able to set the power consumption of the motor exactly.

It wasn't reliable at different situations of loading. So, I thought it would probably good idea to read the power consumption by using MC_GetAveragePowerMotor1_F, measure the error between this and my setpoint and feed it to the speed PI controller to set Iq for the FOC loop.

But here is the problem, when I got no load on the motor shaft, it increases speed of the motor harshly till I get the speed feedback error. (same happens with MC_ProgramTorqueRamp)

I don't even know if this idea is a doable one or how to prevent the speed feedback motor.

SO sorry to bother you this much but could you guide me on customizing the FW?

Thanks