How to include PID library from processor expert into user written code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to include PID library from processor expert into user written code

跳至解决方案
3,470 次查看
ashishgholve200
Contributor I
Hello, Can anyone tell me how to include the PID controller library from processor expert into my code.I have tried this but it is giving linking error. I am using MC56F8037 DSC controller for my application.I will be glad if i get early response.
0 项奖励
回复
1 解答
2,854 次查看
LuisCasado
NXP Employee
NXP Employee

Hello,

 

I have used in the past the G.726 library in a QuickStart project.

Basically the steps I did were:

 

* I added the library I needed to my project from ".....\CodeWarrior for DSC56800E v8.3\ProcessorExpert\Drivers\56800\SDK

* You need mainly to replace PE dependent types by QS types defined in QS header files. Fortunately they are in most cases compatible.

* It requires modification of a standard linker command file (SDM_pFlash.cmd) in QS project

 For example:

 

        .ApplicationData :
        {
              # save space for the pROM data copy
              . = __xRAM_data_start + __data_size;

              # .bss sections
              * (rtlib.bss.lo)
              * (rtlib.bss)

......

 

# ****** SDK beans begin ******
              # G726 Internal Memory starts here
              #---------------------------------
              * (G726_INTERNAL_ROM.data)
              # G726 Internal Memory ends here
              #-------------------------------
              # ****** SDK beans end ******

....

 

 

But perhaps is easier to use the motor control library (GFLIB) that includes PI routines.

 

Frac16

GFLIB_ControllerPIp(Frac16 f16InputErrorK,

GFLIB_CONTROLLER_PI_P_PARAMS_T *pudtPiParams, const Int16 *pi16SatFlag)

 

 

I hope this helps.

 

Best Regards,

在原帖中查看解决方案

0 项奖励
回复
6 回复数
2,854 次查看
ProcessorExpert
Senior Contributor III

Hello,

 

could you please specify what do you mean by "PID controller library from processor expert" because as far as I know there is provided only the MC_PIController component for this family.

 

best regards
Vojtech Filip
Processor Expert Support Team

0 项奖励
回复
2,854 次查看
ashishgholve200
Contributor I
Exactly sir, i want to include MC:MC1_PIController function in my code so which files should i include.
0 项奖励
回复
2,855 次查看
LuisCasado
NXP Employee
NXP Employee

Hello,

 

I have used in the past the G.726 library in a QuickStart project.

Basically the steps I did were:

 

* I added the library I needed to my project from ".....\CodeWarrior for DSC56800E v8.3\ProcessorExpert\Drivers\56800\SDK

* You need mainly to replace PE dependent types by QS types defined in QS header files. Fortunately they are in most cases compatible.

* It requires modification of a standard linker command file (SDM_pFlash.cmd) in QS project

 For example:

 

        .ApplicationData :
        {
              # save space for the pROM data copy
              . = __xRAM_data_start + __data_size;

              # .bss sections
              * (rtlib.bss.lo)
              * (rtlib.bss)

......

 

# ****** SDK beans begin ******
              # G726 Internal Memory starts here
              #---------------------------------
              * (G726_INTERNAL_ROM.data)
              # G726 Internal Memory ends here
              #-------------------------------
              # ****** SDK beans end ******

....

 

 

But perhaps is easier to use the motor control library (GFLIB) that includes PI routines.

 

Frac16

GFLIB_ControllerPIp(Frac16 f16InputErrorK,

GFLIB_CONTROLLER_PI_P_PARAMS_T *pudtPiParams, const Int16 *pi16SatFlag)

 

 

I hope this helps.

 

Best Regards,

0 项奖励
回复
2,854 次查看
ashishgholve200
Contributor I

Thank u sir;

but i observed following things there,

Acc to ur steps i follow them but it is very confusing which library should i include , there is no dedicated library for PI in SDK of codewarrior v8.2.3.Secondly i make PE datatypes compatible with qs & most errors are not there but i am not understanding is it mandetory to change .cmd file also.The only one error is there as " function defined 'inline' after being used" what it means & how to fix it....

0 项奖励
回复
2,854 次查看
ProcessorExpert
Senior Contributor III

Hi,

 

have you created a project with Processor Expert enabled and added the MC_PIController component into the project?

The library is included to the project when the component is added. You should see it in the Processor Expert tab of the project panel. After that you can call methods of the component, for example MC1_controllerPItype1 or MC1_controllerPIDtype1 from main routine of your project.

 

best regards
Petr Hradsky
Processor Expert Support Team

2,854 次查看
ashishgholve200
Contributor I

Yes sir i have completed my task of including PI library.I am really thankful to all of you for ur worthful replies.

0 项奖励
回复