Hello Yanshu,
I understand you want to know how the "PWM Modulator" block works internally, including how it generates the modulation index and how it triggers the converter.
When you open the Block Parameters of the "PWM Modulator" block in the FOC example or the "SVPWM Modulator" block in the DTC example, the description says it is setup as a Unified PWM modulator for a 2-level, 3-phase converter for both blocks. For a detailed explanation of how this "PWM Generator (Three-phase, Two-Level)" block functions, you can refer to the following link:
Additionally, you can peek under the block's mask to inspect its subsystems by following these steps:
- Select the “PWM Modulator” block.
- Right-click on the block, choose ‘Mask’ > ‘Look Under Mask’.
Alternatively, you can select the block and press CTRL+U to perform the task directly.
Inside the subsystem, you will find a custom MATLAB function block where the “PWMmethod” parameter is passed. This parameter varies based on the PWM method you have selected from the drop-down menu in the block's configuration parameters.Follow the below steps to see the values assigned to this parameter:
- Right-click on the “PWM Modulator” block, select ‘Mask’ > ‘Edit mask…’.
- Go to the ‘Code’ tab to check the parameter callback section.
I hope you find this helpful.