![](https://csdnimg.cn/release/download_crawler_static/10692653/bg5.jpg)
ECEN5807DM
5
As you work through modeling steps, it is a good idea to save your work (as usual, ctrl‐S is the key
shortcutforsave)
Double‐click on the PWM subsystem, add a Relay block (from Discontinuities), a Repeating Sequence
block(fromSources),andanAdd
block(fromMathOperations).ChangetheAddblockinputsto+and‐.
In theRelay block, zero isthedefault comparison threshold– that’s fine.Optionally, you mayrename
theblockstobetterdescribetheintendedfunctions.
Double‐clickonthePWMramp(RepeatingSequence)block.TheTimevalues
canbeusedtospecifythe
switchingperiod.Forexample,[01e‐6]wouldbecorrespondto1MHzswitchingfrequency.Betteryet,
we can enter an expression [0 1/fs] so that the same model can be used with switching frequency fs
specifiedexternallyasaparameter.Similarly,outputvalues[0
VM]willallowustoexternallyspecify the
PWMrampamplitudeVMasanotherparameter.