S32K396 Change sampling & switching frequency

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

S32K396 Change sampling & switching frequency

Jump to solution
1,491 Views
agus_idiada
Contributor III

Hello,

I am using S32K396-BGA-DC1 board, with Simulink in matlab2024a. I am working on the S32K396_MBDT_BASED_MC_0_9_0 Motor Control Example Project.

In my setup I have the nxp connected with a HIL-RT hardware emulating the power stage and a motor.

I would like to change the sampling & switching frequency relationship. I found that the Fsam = 0.5 Fsw. So when I change the period on the pwm channel - Fsw (fig 1), Fsam change in the same way.

Where can I set up this? I would like to be able to do Fsam = Fsw and Fsam = 2Fsw

Moreover, modifying this, should I change the configuration somewhere for the resolver also?

Thanks, Agustin.

0 Kudos
Reply
1 Solution
1,407 Views
Vincent_Deng
NXP Employee
NXP Employee

Hi Agustin,

In the demo, the MasterReload signal of the FlexPWM is used as the ADC trigger. For your requirement, please change the following item:

Vincent_Deng_0-1731999268024.png

For more details please refer to the Reference Manual, Chapter eFlexPWM, register Submodule a Control(SM0_CTRL-SM3_CTRL). 

Vincent_Deng_0-1731999573769.png

 

Thanks,

Vincent

View solution in original post

1 Reply
1,408 Views
Vincent_Deng
NXP Employee
NXP Employee

Hi Agustin,

In the demo, the MasterReload signal of the FlexPWM is used as the ADC trigger. For your requirement, please change the following item:

Vincent_Deng_0-1731999268024.png

For more details please refer to the Reference Manual, Chapter eFlexPWM, register Submodule a Control(SM0_CTRL-SM3_CTRL). 

Vincent_Deng_0-1731999573769.png

 

Thanks,

Vincent

%3CLINGO-SUB%20id%3D%22lingo-sub-1988657%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K396%20Change%20sampling%20%26amp%3B%20switching%20frequency%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1988657%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20am%20using%20S32K396-BGA-DC1%20board%2C%20with%20Simulink%20in%20matlab2024a.%20I%20am%20working%20on%20the%20S32K396_MBDT_BASED_MC_0_9_0%20Motor%20Control%20Example%20Project.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20my%20setup%20I%20have%20the%20nxp%20connected%20with%20a%20HIL-RT%20hardware%20emulating%20the%20power%20stage%20and%20a%20motor.%3C%2FP%3E%3CP%3EI%20would%20like%20to%20change%20the%20sampling%20%26amp%3B%20switching%20frequency%20relationship.%20I%20found%20that%20the%20Fsam%20%3D%200.5%20Fsw.%20So%20when%20I%20change%20the%20period%20on%20the%20pwm%20channel%20-%20Fsw%20(fig%201)%2C%20Fsam%20change%20in%20the%20same%20way.%3CBR%20%2F%3E%3CBR%20%2F%3EWhere%20can%20I%20set%20up%20this%3F%20I%20would%20like%20to%20be%20able%20to%20do%20Fsam%20%3D%20Fsw%20and%20Fsam%20%3D%202Fsw%3CBR%20%2F%3E%3CBR%20%2F%3EMoreover%2C%20modifying%20this%2C%20should%20I%20change%20the%20configuration%20somewhere%20for%20the%20resolver%20also%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EThanks%2C%20Agustin.%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996881%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K396%20Change%20sampling%20%26amp%3B%20switching%20frequency%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996881%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Agustin%2C%3C%2FP%3E%0A%3CP%3EIn%20the%20demo%2C%20the%20MasterReload%20signal%20of%20the%20FlexPWM%20is%20used%20as%20the%20ADC%20trigger.%20For%20your%20requirement%2C%20please%20change%20the%20following%20item%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Vincent_Deng_0-1731999268024.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Vincent_Deng_0-1731999268024.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311168i35D7D353DB574D81%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Vincent_Deng_0-1731999268024.png%22%20alt%3D%22Vincent_Deng_0-1731999268024.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFor%20more%20details%20please%20refer%20to%20the%20Reference%20Manual%2C%20Chapter%20eFlexPWM%2C%20register%20Submodule%20a%20Control(SM0_CTRL-SM3_CTRL).%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Vincent_Deng_0-1731999573769.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Vincent_Deng_0-1731999573769.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311169i6E5F33A021BEF860%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Vincent_Deng_0-1731999573769.png%22%20alt%3D%22Vincent_Deng_0-1731999573769.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThanks%2C%3C%2FP%3E%0A%3CP%3EVincent%3C%2FP%3E%3C%2FLINGO-BODY%3E