Output Override and Fault Protection for MPC574xP (Model Based Tools)

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

Output Override and Fault Protection for MPC574xP (Model Based Tools)

635 Views
abhishek_kumar1
Contributor IV

Hello All

I am trying to implement Output Override and Fault protection as shown below in the Diagram (Red Rectangle).

I want to have my PWM being disabled without any Software logic if I receive a fault from Motor Driver IC. How can I configure the PWM blocks for this purpose.

Thank you for the help. 

pastedImage_1.png

0 Kudos
1 Reply

545 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com

Unfortunately, the MBDT Blocks for MPC574xP does not currently support the hardware FlexPWM Fault Mechanism configuration. 

However, the fault mechanism can be enabled by injecting custom code in the model by using Simulink Custom Code blocks. Those blocks can be found in the Simulink Coder (see the image attached), from the Simulink library. The System Initialize block will inject the code in the generated initialize function and the System Outputs blocks will put your code in the step function.

pastedImage_2.png

Now, for enabling the fault mechanism, you need to:

  • set the fault states for each output pins, (see regs FlexPWM_SUBn_OCTRL, bits PWMAFS and PWMBFS)
  • enable the fault pin number that will stop the pwm generation on each submodule (see regs FlexPWM_SUBn_DISMAP)
  • set the Fault Control Register for pin level and auto clearing (see reg FlexPWM_FCTRL)
  • enable the pin needed to be used as PWM fault input. 

To have an idea on how the bits are set by the MBDT, the FlexPWM_pnt_library.c file can be analysed in any generated code folder of a model that uses the PWM blocks. 

Hope this helps you!

Best regards, 

Marius

0 Kudos