About of the application of AMCLIB_FW_F16

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

About of the application of AMCLIB_FW_F16

1,431 Views
13226508
Contributor III

Hello,

 use MC9S12ZVML128 control my motor .In order  to get above motor base speed ,It  need to Field Weakening. I  found that NXP have provided related library functions —— AMCLIB_FW_F16 ,Where can I find the  demo code?

Best regards.

0 Kudos
2 Replies

1,314 Views
pachamatej
NXP Employee
NXP Employee

Hi,

The SW example you are looking for is already online and it is featured on our new S12ZVM High current board. If you are running standard EVB or devKit, you can easily port the application, keeping the single-shunt current reconstruction (the biggest difference is the external oscillator 8MHz vs 4MHz and application scales of current 125A vs 20A). The app can be also used with dual-shunt approach, but then it would be more work on the porting task. Unfortunately, the application note has not been updated yet due to planned integration with MCAT, which is still work in progress. Later this year, we are planning to release a bucket of SW and ANs for your convenience.

Meanwhile, please follow the link and explore the code. 

https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/magniv-and-s12-solu...

The field weakening function is placed in the stateRun() and guarded by an "if" block (main.c, line 967):

if(cntrState.usrControl.fieldWeakeningEnabled)
   AMCLIB_FW(drvFOC.iDQReq.f16Arg2,drvFOC.pospeControl.wRotElReq, &drvFOC.iDQReq,&drvFOC.FieldWeakening);

To tune up the FW, FreeMASTER project can be used (located in the {Projec}\FreeMASTER_control\MCSXSR1CS12ZVM_PMSM_SW_CW11.pmp). Navigate to the "Speed Control with Field Weakening" subblock and feel free to play around. However, it's worth to mention that the success of field weakening heavily depends on the motor type. For example, Linix motor 45zwn24-90-b can be forced to 1.4x speed above the base speed, while Linix 45zwn24-40 has difficulties to go beyond 1.1x of the base speed.

pachamatej_0-1609832316267.png

There is another example with a short paragraph in the application note, targeting S32K144 device. However, thanks to AMMCLib, it is similar approach as used for S12ZVM.

https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/arm-based-solutions...

I hope it helps,

Best regards,

Matej

1,353 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

Our AMMCLIB includes the AMCLIB_FW and AMCLIB_FWSpeedLoop function, but I'm afraid that there is no demo code. I recommend that you install the newest AMMCLIB and follow the AMMCLIB user guide. 

Best regards,

Diana

0 Kudos