How to modify the "Sub-cycle average "model to a Mosfet with diode?

I need control a Mosfet with a diode in Rt-box . But when i use a PWM capture component ,

there is a error “If the control signal comes from a PWM Capture, consider replacing this switch with a suitable Power Module in “Sub-cycle average” mode.”

cascade_currentfed_pushpull.plecs (35.3 KB)

There is not a sub-cycle average implementation for a single MOSFET with diode nor for your specific topology. You can eliminate the error message by using the Data Type block from the PLECS library and convert the sensed switch input signal, whether from the PWM Capture or Digital In, to the MOSFET input.

The model fidelity in this case will be very sensitive to the discretization step size and the PWM input frequency. You can use the CodeGen mode to evaluate this. Review the RT Box tutorials on timing and step-size selection if you are unfamiliar. You should also change to a variable step step solver.

I should note that the buck input stage to your converter lends itself to a sub-cycle average implementation. Use the Chopper (High-Side Switch) and the PWM Capture block.