About eTPU Resolver Extrapolated Channel Trigger on S32K396

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

About eTPU Resolver Extrapolated Channel Trigger on S32K396

130 Views
小小灬li
Contributor I

Hi.I am using EB to configure the eTPU Resolver on the S32K396.
Currently, I encounter an issue when calling Etpu_Resolver_Ip_GetExtrapolatedOutputs(&Etpu_Resolver_Ip_Instance_I0, &pResolverOutputsExtrapolated);—the extrapolated output values are always zero.

From the code, I noticed that the Extrapolated channel is configured as rising-edge triggered, but in the demo project I cannot find where or how this trigger actually occurs, nor which configuration enables it.

li_0-1780480443788.png

 

Additionally, the manual states that the Extrapolated thread can be triggered in three ways.
I tried the first method (Host Service Request) by calling Etpu_Resolver_Ip_Sample(&Etpu_Resolver_Ip_Instance_I0);

inside the ATO Notification (on ATO Update 2nd) callback. This indeed triggers the Extrapolated channel, and I can then read valid data using the function above. However, I am not sure if this is the correct or intended approach.

For reference, I configured the project based on S32K3_ETPU_SW_4.7_2.0.0_CD04_D2502_MotorControlExample in EB. My environment details are:

  • RTD version: SW32K3_S32M27x_RTD_R21-11_5.0.0

  • eTPU version: S32K3_ETPU_SW_4.7_2.0.0_CD04

  • Compiler: GHS

Could you please help clarify how the Extrapolated channel is supposed to be triggered in this configuration, and whether my current method aligns with the intended design,Thanks!

0 Kudos
Reply
8 Replies

26 Views
TomasKulig
NXP Employee
NXP Employee

can you share with me the elf file, please?

When using the Design studio for the compilation can you share the whole project please?

Thnak you,

 

Regards,

Tomas.

0 Kudos
Reply

23 Views
小小灬li
Contributor I

Yes, please give me your email address.

 
0 Kudos
Reply

55 Views
TomasKulig
NXP Employee
NXP Employee

i believe that you are properly routing the LCU output to the eTPU channel A7 in the TRGMUX_APP. I think you are missed the IMCR configuration for the eTPU channel A7

/* Assign eTPU input from TRGMUX */

Siul2_Port_Ip_SetInputBuffer(NULL_PTR, 0U, 1, 458, 4U);

 

TomasKulig_0-1780560858123.png

This configuration is mentioned in the TRGMUX spreadsheet by note for the orange labeled cells:

TomasKulig_1-1780560947594.png

 

0 Kudos
Reply

29 Views
小小灬li
Contributor I

In addition, based on the same project setup, I added a test in the ATO Notification (on ATO Update 2nd) function to manually write the HSR of the Extrapolated channel. This works correctly. The following image shows the function I added in the interrupt callback.

li_0-1780566232449.png

The following image shows the Extrapolated data that I can observe in the debugger.

li_1-1780566260318.png

If I comment out the call to Etpu_Resolver_Ip_Sample(&Etpu_Resolver_Ip_Instance_I0);, I observe the following state in the debugger, where all Extrapolated values remain zero.

li_2-1780566331333.png

 

 

 

 

0 Kudos
Reply

34 Views
小小灬li
Contributor I

I previously configured this register, and after replacing my earlier configuration with the function you provided, the eTPU is still not being triggered.

li_0-1780564484839.png

 

As shown in the figure below, the trigger signal has a pulse width of 8.4 µs.

li_1-1780564504314.png

 

Below is my EB configuration where LCU0_LC0_OUT1 is routed to eTPU A7 channel.

li_2-1780564560083.png

 

This is the TRGMUX configuration I observed in the debugger.

li_3-1780564572233.png

 

 

 

0 Kudos
Reply

63 Views
小小灬li
Contributor I

Thank you for your previous response. I would like to follow up with an additional question regarding the triggering of the eTPU Resolver Extrapolated.

In my current setup, the PWM trigger signal is first routed to the LCU through TRGMUX. The LCU applies the required delay, and then its output is routed—again through TRGMUX—to both an external IO pin and the eTPU Extrapolated channel.

On the oscilloscope, I can clearly observe the expected signal on the IO pin. However, the eTPU Extrapolated channel still does not get triggered.

Could you please advise what might cause this issue. Is there any additional configuration required for the Extrapolated channel to accept trigger signals from the LCU via TRGMUX.

The two images below show the Resolver channel configuration in EB and the corresponding peripheral initialization code in my project.

li_0-1780559921816.png

li_1-1780560009010.png

 

 

0 Kudos
Reply

70 Views
TomasKulig
NXP Employee
NXP Employee

TomasKulig_0-1780556414839.png

TomasKulig_1-1780556469542.png

 

 

0 Kudos
Reply

70 Views
TomasKulig
NXP Employee
NXP Employee

Hello Li Zhe,

It depends on your application. I believe that you will control the motor. So you need to trigger the extrapolation in the same time as you are measuring the motor current to have all data necessary for motor control algorithm in the same time (phase currents, Udcbus, position and speed of the motor).

We are using the same trigger as we are using for the BCTU/SARADC phase current measurement for the extrapolation in our motor control. It is generated by the FlexPWM. And routed through LCU and TRGMUX to the eTPU. The LCU is there to do the trigger pulse longer to be visible by the eTPU logic.

 

You can check the configuration in the S32K396 Single motor control kit SW.S32K396 BLDC/PMSM Motor Control Development Kit | NXP Semiconductors. The code is using the RTD low level driver but the eTPU configuration is closly the same.

 

Regards,

Tomas.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2375731%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAbout%20eTPU%20Resolver%20Extrapolated%20Channel%20Trigger%20on%20S32K396%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2375731%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi.I%20am%20using%20EB%20to%20configure%20the%20eTPU%20Resolver%20on%20the%20S32K396.%3CBR%20%2F%3ECurrently%2C%20I%20encounter%20an%20issue%20when%20calling%20Etpu_Resolver_Ip_GetExtrapolatedOutputs(%26amp%3BEtpu_Resolver_Ip_Instance_I0%2C%20%26amp%3BpResolverOutputsExtrapolated)%3B%E2%80%94the%20extrapolated%20output%20values%20are%20always%20zero.%3C%2FP%3E%3CP%3EFrom%20the%20code%2C%20I%20noticed%20that%20the%20Extrapolated%20channel%20is%20configured%20as%20%3CSTRONG%3Erising-edge%20triggered%3C%2FSTRONG%3E%2C%20but%20in%20the%20demo%20project%20I%20cannot%20find%20where%20or%20how%20this%20trigger%20actually%20occurs%2C%20nor%20which%20configuration%20enables%20it.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22li_0-1780480443788.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22li_0-1780480443788.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387681i7C978D3A3080A305%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22li_0-1780480443788.png%22%20alt%3D%22li_0-1780480443788.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAdditionally%2C%20the%20manual%20states%20that%20the%20Extrapolated%20thread%20can%20be%20triggered%20in%20three%20ways.%3CBR%20%2F%3EI%20tried%20the%20first%20method%20(Host%20Service%20Request)%20by%20calling%20Etpu_Resolver_Ip_Sample(%26amp%3BEtpu_Resolver_Ip_Instance_I0)%3B%3C%2FP%3E%3CP%3E%3CSPAN%3Einside%20the%20%3CSTRONG%3EATO%20Notification%20(on%20ATO%20Update%202nd)%3C%2FSTRONG%3E%20callback.%20This%20indeed%20triggers%20the%20Extrapolated%20channel%2C%20and%20I%20can%20then%20read%20valid%20data%20using%20the%20function%20above.%20However%2C%20I%20am%20not%20sure%20if%20this%20is%20the%20correct%20or%20intended%20approach.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EFor%20reference%2C%20I%20configured%20the%20project%20based%20on%20%3CSTRONG%3ES32K3_ETPU_SW_4.7_2.0.0_CD04_D2502_MotorControlExample%3C%2FSTRONG%3E%20in%20EB.%20My%20environment%20details%20are%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3E%3CSPAN%3ERTD%20version%3A%20%3CSTRONG%3ESW32K3_S32M27x_RTD_R21-11_5.0.0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E%3CSPAN%3EeTPU%20version%3A%20%3CSTRONG%3ES32K3_ETPU_SW_4.7_2.0.0_CD04%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E%3CSPAN%3ECompiler%3A%20%3CSTRONG%3EGHS%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%3ECould%20you%20please%20help%20clarify%20how%20the%20Extrapolated%20channel%20is%20supposed%20to%20be%20triggered%20in%20this%20configuration%2C%20and%20whether%20my%20current%20method%20aligns%20with%20the%20intended%20design%2CThanks!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2376594%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20About%20eTPU%20Resolver%20Extrapolated%20Channel%20Trigger%20on%20S32K396%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376594%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20believe%20that%20you%20are%20properly%20routing%20the%20LCU%20output%20to%20the%20eTPU%20channel%20A7%20in%20the%20TRGMUX_APP.%20I%20think%20you%20are%20missed%20the%20IMCR%20configuration%20for%20the%20eTPU%20channel%20A7%3C%2FP%3E%0A%3CDIV%20style%3D%22background-color%3A%20%23ffffff%3B%20padding%3A%200px%200px%200px%202px%3B%22%3E%0A%3CDIV%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23ffffff%3B%20font-family%3A%20'Courier%20New'%3B%20font-size%3A%2010pt%3B%20white-space%3A%20pre%3B%22%3E%0A%3CP%20style%3D%22margin%3A%200%3B%22%3E%3CSPAN%3E%2F*%20Assign%20eTPU%20input%20from%20TRGMUX%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200%3B%22%3E%3CSPAN%3E%20Siul2_Port_Ip_SetInputBuffer(NULL_PTR%2C%200U%2C%201%2C%20458%2C%204U)%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22TomasKulig_0-1780560858123.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22TomasKulig_0-1780560858123.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387870i35354AE832133F1C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22TomasKulig_0-1780560858123.png%22%20alt%3D%22TomasKulig_0-1780560858123.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3EThis%20configuration%20is%20mentioned%20in%20the%20TRGMUX%20spreadsheet%20by%20note%20for%20the%20orange%20labeled%20cells%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22TomasKulig_1-1780560947594.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22TomasKulig_1-1780560947594.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387871i640C8A2EB98B2FE8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22TomasKulig_1-1780560947594.png%22%20alt%3D%22TomasKulig_1-1780560947594.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2376583%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20About%20eTPU%20Resolver%20Extrapolated%20Channel%20Trigger%20on%20S32K396%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376583%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20your%20previous%20response.%20I%20would%20like%20to%20follow%20up%20with%20an%20additional%20question%20regarding%20the%20triggering%20of%20the%20eTPU%20Resolver%20Extrapolated.%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20my%20current%20setup%2C%20the%20PWM%20trigger%20signal%20is%20first%20routed%20to%20the%20LCU%20through%20TRGMUX.%20The%20LCU%20applies%20the%20required%20delay%2C%20and%20then%20its%20output%20is%20routed%E2%80%94again%20through%20TRGMUX%E2%80%94to%20both%20an%20external%20IO%20pin%20and%20the%20eTPU%20Extrapolated%20channel.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOn%20the%20oscilloscope%2C%20I%20can%20clearly%20observe%20the%20expected%20signal%20on%20the%20IO%20pin.%20However%2C%20the%20eTPU%20Extrapolated%20channel%20still%20does%20%3CSTRONG%3Enot%3C%2FSTRONG%3E%20get%20triggered.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECould%20you%20please%20advise%20what%20might%20cause%20this%20issue.%20Is%20there%20any%20additional%20configuration%20required%20for%20the%20Extrapolated%20channel%20to%20accept%20trigger%20signals%20from%20the%20LCU%20via%20TRGMUX.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20two%20images%20below%20show%20the%20Resolver%20channel%20configuration%20in%20EB%20and%20the%20corresponding%20peripheral%20initialization%20code%20in%20my%20project.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22li_0-1780559921816.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22li_0-1780559921816.png%22%20style%3D%22width%3A%20279px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387865iE098F80F82107CC7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22li_0-1780559921816.png%22%20alt%3D%22li_0-1780559921816.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22li_1-1780560009010.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22li_1-1780560009010.png%22%20style%3D%22width%3A%20383px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F387867i662A55F8C792C4F0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22li_1-1780560009010.png%22%20alt%3D%22li_1-1780560009010.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2376499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20About%20eTPU%20Resolver%20Extrapolated%20Channel%20Trigger%20on%20S32K396%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Li%20Zhe%2C%3C%2FP%3E%0A%3CP%3EIt%20depends%20on%20your%20application.%20I%20believe%20that%20you%20will%20control%20the%20motor.%20So%20you%20need%20to%20trigger%20the%20extrapolation%20in%20the%20same%20time%20as%20you%20are%20measuring%20the%20motor%20current%20to%20have%20all%20data%20necessary%20for%20motor%20control%20algorithm%20in%20the%20same%20time%20(phase%20currents%2C%20Udcbus%2C%20position%20and%20speed%20of%20the%20motor).%3C%2FP%3E%0A%3CP%3EWe%20are%20using%20the%20same%20trigger%20as%20we%20are%20using%20for%20the%20BCTU%2FSARADC%20phase%20current%20measurement%20for%20the%20extrapolation%20in%20our%20motor%20control.%20It%20is%20generated%20by%20the%20FlexPWM.%20And%20routed%20through%20LCU%20and%20TRGMUX%20to%20the%20eTPU.%20The%20LCU%20is%20there%20to%20do%20the%20trigger%20pulse%20longer%20to%20be%20visible%20by%20the%20eTPU%20logic.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EYou%20can%20check%20the%20configuration%20in%20the%20S32K396%20Single%20motor%20control%20kit%20SW.%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2FMCSPTR2AK396%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ES32K396%20BLDC%2FPMSM%20Motor%20Control%20Development%20Kit%20%7C%20NXP%20Semiconductors%3C%2FA%3E.%20The%20code%20is%20using%20the%20RTD%20low%20level%20driver%20but%20the%20eTPU%20configuration%20is%20closly%20the%20same.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3ETomas.%3C%2FP%3E%3C%2FLINGO-BODY%3E