cancel
Showing results for 
Search instead for 
Did you mean: 

PID Tuning - TORQUE CONTROL

jocelync
Associate II

Hi,

In the document UM1052 page 37, it indicates that K_P/K_I = Ls/Rs for pole-zero cancellation in Figure 28.

 

The question is whether this is the value to use for the ratio K_P/K_I , or should the motor control workbench be used to determine the value for K_P/K_I ?   

Also, would the motor control workbench generate values for K_P/K_I that would be different from that in Figure 28 and if so, what would be the reason behind that?   Why would pole-zero cancellation not be used?

 

Thank-you and Best Regards,

Jocelyn

6 REPLIES 6
GMA
ST Employee

Hello,

Please, refer to "Motor Control Firmware Reference Documentation" available through Workbench tool (About->Documentations->Documentation). In "User Manual->A priori determination of flux and torque current PI gains" chapter, you can find the full PI parameter computation taken into account sampling time parameter that gives K_P/K_I=(Ls/(Rs*T)) that is used by Workbench to provide Torque/Flux PI parameters.

On the other hand, disabling "Auto Calculate Torque/Flux Kp & Ki" option in WB Drive Settings, you will be able to modify these parameters.

 

 

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

Dear GMA,

Thank-you very much! ... for your response and pointing out the sampling time T .

Regarding the value for the sampling time for the Torque PI controller, is the value of T given by:

 

                              T =  1 /  (PWM_FREQUENCY)    =  2e-5   seconds ?

 

Also, how is V_BusDC calculated?

 

Thank-you in advance!

Best wishes,

Jocelyn

Hello,

1- It is 1/(PWM FREQUENCY)

2- It is the Nominal Voltage on Motor characteristics:
 

GMA_0-1702895448396.png

 

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

Dear GMA,

Thank-you very much for your response and the confirmation of the sampling time T.

Regarding the V_BusDC, I understand that it is calculated.   Please note that in our setup, we are not able to use the MC Workbench to determine the V_BusDC.   Also, we are using MCSDK_v5.Y.4 software.

Hence, we would very much appreciate you providing us with the information regarding how V_BusDC is calculated, or what function in the MCSDK_v5.Y.4 software is used to calculate the V_BusDC voltage.  Is the V_BusDC  voltage calculated using the function:

/**
* @brief It actually performes the Vbus ADC conversion and updates average
* value
* @PAram pHandle related RDivider_Handle_t
* @retval uint16_t Fault code error
*/
__weak uint16_t RVBS_CalcAvVbus(RDivider_Handle_t *pHandle)
{         ...   }

 

 

or the function

 

/**
* @brief It actually performes the Vbus ADC conversion and updates average
* value
* @PAram pHandle related RDivider_Handle_t
* @retval uint16_t Fault code error
*/
__weak uint16_t RVBS_CalcAvVbusFilt(RDivider_Handle_t *pHandle)
{   ... }           

 

Thank-you very much in advance!

Best wishes,

Jocelyn

 

jocelync
Associate II

Dear GMA,

Regarding the documentation above:

"Please, refer to "Motor Control Firmware Reference Documentation" available through Workbench tool (About->Documentations->Documentation). In "User Manual->A priori determination of flux and torque current PI gains" chapter, you can find the full PI parameter computation taken into account sampling time parameter that gives K_P/K_I=(Ls/(Rs*T)) that is used by Workbench to provide Torque/Flux PI parameters."

it informs that the KI term needs to be multiplied by the sampling period T.

 

For the discrete differentiation when derivative feedback is used in PID control, would the Derivative Feedback parameter K_D need to be divided by the sampling period T?

 

Please let us know since we are not able to use the motor pilot in our setup.

 

Thanks and Best wishes for the New Year!

Jocelyn

jocelync
Associate II

Dear GMA,

On the same topic as the question above, and in reference to the ST User Manual  : "PID regulator theoretical background", it mentions that the sampling time, Tsampling, needs to be included with the integral coeefficient KI as a multiplicative factor due to discrete time calculation.   

 

Questions:

1. Does the ST code assumes that derivative coefficient KD also includes the (1/Tsampling) as a factor?

2. The document also discusses changing Tsampling.   Given that the Medium Frequency Task is 1 kHz, is the document suggesting that we need to change the frequency of the Medium Frequency Task as well?

 

Thanks and Best Regards,

Jocelyn