Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Bond_007
Level 3
Level 3
10 questions asked 25 sign-ins 10 replies posted

Hi Team,

We are working on speed current control scheme using XMC1300 kit (XMC1302 MCU). Project we are using  "BLDC_SCALAR_HALL_XMC13_Power_Tool" and the reference document is "DEMO-PTOOL-300W user guide".

Now we need to run the motor so that we need to calculate Speed Kp & Ki. But in software he has mentioned formula only to calculate Current Kp & Ki. There is a difference in Speed and Current Kp, Ki Calculation right.

Below is the calculation for Current Kp, Ki.

 

 

 

/* Current Control */
#if ((MOTOR0_BLDC_SCALAR_CTRL_SCHEME == BLDC_SCALAR_CURRENT_CTRL) || (MOTOR0_BLDC_SCALAR_CTRL_SCHEME == BLDC_SCALAR_SPEEDCURRENT_CTRL))
/**
* Proportional gain of current PI. Range: 0 to 32767
* Kp = (2* 3.14 * Ls * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * 2^scale)
* For MOTOR_EC_MAXON_267121, Kp = 1.517 for Ls = 3865 uH and bandwidth = 500 Hz
*/
#define MOTOR0_BLDC_SCALAR_CURRENT_KP (20972)//(24853U)
/**
* Integral gain of current PI. Range: 0 to 32767
* Ki = (2* 3.14 * Rs * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * MOTOR0_BLDC_SCALAR_CCU8_PERIOD_uS * 2^scale)
* For MOTOR_EC_MAXON_267121, Ki = 0.134 for Rs = 6.85 ohms and bandwidth = 500 Hz
*/
#define MOTOR0_BLDC_SCALAR_CURRENT_KI (2)//(2202U)
#define MOTOR0_BLDC_SCALAR_CURRENT_PI_SCALE (15U)//(14U) /*!< Scale of Kp and Ki parameters.*/
#define MOTOR0_BLDC_SCALAR_CURRENT_PI_LIMIT (100.0F) /*!< in % with respect to base voltage */

 

 

 

 

But Speed Kp, Ki is mentioned directly as Macros as below.

 

 

 


#define SPEED_KP		(20972U)   								/*!< Proportional gain of speed PI in Q15. Range: 0 to 32767*/
#define SPEED_KI		(2U)									/*!< Integral gain of speed PI in Q15. Range: 0 to 32767 */

#define   MOTOR0_BLDC_SCALAR_SPEED_KP             SPEED_KP   /*!< Proportional gain of speed PI in Q15. Range: 0 to 32767*/
#define   MOTOR0_BLDC_SCALAR_SPEED_KI             SPEED_KI       /*!< Integral gain of speed PI in Q15. Range: 0 to 32767 */
#define   MOTOR0_BLDC_SCALAR_SPEED_PI_SCALE       (15U)       /*!< Scale of Kp and Ki parameters.*/
#define   MOTOR0_BLDC_SCALAR_SPEED_PI_LIMIT       (100.0F)   /*!< in % with respect to base current in speed inner current control mode

 

 

 


Why it is mentioned as above. Is there any formula to calculate Speed Kp, Ki that is different from Current Kp, Ki Formula ?  
Please help me to solve this issue. Any help would be very thankful.

0 Likes
1 Solution
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @Bond_007,

Thanks for posting in the Infineon Community!

Yes, Speed Kp and Ki are different from Current Kp and Ki. 

For current Kp and Ki Please refer to a section: Calculation of Current PI controller based Motor Resistance and Inductance: in BLDC_SCALAR_HALL_UserGuide.chm 

Speed Kp and Ki should be calculated based on the speed and load characteristics. You can also determine Kp and Ki values based on the step response of the system.

 

Thanks,

Krupashankar

View solution in original post

0 Likes
3 Replies
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @Bond_007,

Thanks for posting in the Infineon Community!

Yes, Speed Kp and Ki are different from Current Kp and Ki. 

For current Kp and Ki Please refer to a section: Calculation of Current PI controller based Motor Resistance and Inductance: in BLDC_SCALAR_HALL_UserGuide.chm 

Speed Kp and Ki should be calculated based on the speed and load characteristics. You can also determine Kp and Ki values based on the step response of the system.

 

Thanks,

Krupashankar

0 Likes

Hi @Krupashankar ,

I have done the changes and tested as per above suggestion. We done hall learning procedure with Golden motor (3KW) and Updated the six patterns to Run the Golden Motor. 

1
0x021
0x201
0x210
0x012
0x102
0x120

But when we try to rotate the POT, The motor didn't Run. Generated a "Stall Detection Error". Stall Detection Time is set for 1second in software.
RAMP_UP_RATE            is 200Rpm
RAMP_DOWN_RATE    is 200Rpm
I have increased the POT, It has to run but it doesn't. whatever the MC_Pattern Applied to motor has not executed. What might be the reason to cause this Error ? 
The remaining parameters are not modified. I had modified required parameters according to the Document when motor has changed. Is this Hardware or Software Issue. How can we conclude from this.

Did I miss Anything in software to update. Please help me to solve this issue.

0 Likes
Krupashankar
Moderator
Moderator
Moderator
500 replies posted 50 likes received 25 likes received

Hi @Bond_007,

Could you please share the motor parameter, your configuration, and details of the power board?

This will help us to understand the issue better 

Could you Please make sure if the hall sensor signals are proper.

 

Thanks,

Krupashankar

0 Likes