Appearance
PWM subsystem
A closed-loop PWM power regulator whose switching stage runs in a faster Subsystem.
A PID compares the measured power against a setpoint and trims the duty of a PWM stage that switches an IGBT into a 5 Ω load. This is the same regulator as the PWM power controller, rearranged to show a multi-rate Subsystem: the switching stage runs at a finer time step than the controller around it.
The main time step is 50 µs and the Subsystem runs 20 sub-steps per main step, so everything inside it (the 50 V bus,
Signals cross the Subsystem boundary through GoTo / From pairs, never through wires. The whole power measurement stays inside: the instantaneous power P_inst is formed and filtered at every sub-step, so the filter sees the real switching waveform. Only the smooth P_avg crosses out, read with a From whose rate_policy is average (the mean over each 50 µs main step; with a signal this smooth it is practically the same as the default last). The duty travels the other way through another GoTo / From pair. Over the 3 s run P_avg settles within about ±0.15 W of the 30 W setpoint and the duty settles near 0.068; probe inside and outside the Subsystem to compare the 2.5 µs and 50 µs traces.