# I down load the Motor Control Development Toolbox for MPC564xL v1.3.0,I used the GFLIB_ControllerPIp building a PI model,comparing the model built by the PI from simulink,the question is the paramater of Kp and Ki is the same ,but the answer is not

cancel
Showing results for
Show  only  | Search instead for
Did you mean:
SOLVED

## I down load the Motor Control Development Toolbox for MPC564xL v1.3.0,I used the GFLIB_ControllerPIp building a PI model,comparing the model built by the PI from simulink,the question is the paramater of Kp and Ki is the same ,but the answer is not

1,459 Views
Contributor V

The model buit by NXP GFLIB_ControllerPIp ,as shown Part B in the fig. 1:

Fig.1

The model buit by PI module from Matlab/Simulink,As shown Part A in the Fig. 1

The analysis of simuliation result as shown below:

why the result is arisen?I Cannt resolve the question,who can help me......

Tags (1)
1 Solution
1,248 Views
NXP Employee

Hi Eden Li,

The model used in GFLIB_ControllerPIp does not take into account the Ts/2 factor for discrete time domain trasformation using the bilinear method. This factor is transferred into the Integral gain to simplify the mathematical computations.

Therefore, if you implement your own controller in Simulink, just modify the Gain Value for the Discrete-Time Integrator to 2/(simulation sample time). This way you will get the same output as the GFLIB_ControllerPIp.

The other way around would be consider Ts/2 factor when computing the GFLIB_ControllerPIp.s32IntegGain.

Hope this helps!

Daniel

3 Replies
1,249 Views
NXP Employee

Hi Eden Li,

The model used in GFLIB_ControllerPIp does not take into account the Ts/2 factor for discrete time domain trasformation using the bilinear method. This factor is transferred into the Integral gain to simplify the mathematical computations.

Therefore, if you implement your own controller in Simulink, just modify the Gain Value for the Discrete-Time Integrator to 2/(simulation sample time). This way you will get the same output as the GFLIB_ControllerPIp.

The other way around would be consider Ts/2 factor when computing the GFLIB_ControllerPIp.s32IntegGain.

Hope this helps!

Daniel

1,248 Views
Contributor V

Thank you very much!

1,248 Views
NXP Employee

FYI, this is a model and the corresponding comparison results:

InputValue =  Controllers Error (simulated as a sine wave)

PIPvalue = output of NXP controller (yellow)