Hi!
Is there a simple way to generate a PWM with variable phase and frequency? I know that there are variable phase and variable frequency PWM blocks, but unfortunately without any success.
I tried combining the two blocks by combining their C-Scripts, but I’m not sure if that is possible.
Kind regards,
Milad
Milad,
At this time the most straightforward solution is to use a PWM block from one of the target support libraries. For example the “PWM (Variable)” block from the TI C2000 Target Support Library or the “PWM Out (Variable)” block from the RT Box Target Support Library. Place the PWM modulator in a subsystem and you will note the subsystem now contains an additional signal outport where you can access the switching signals.
Regards,
Bryan
Hey Bryan,
thank you. The TI C2000 PWM Out didn’t have the option for a variable frequency but the RT Box PWM does. Thank you for the help!
Kind regards,
Milad
Glad to hear you have a solution!
FYI the C2000 PWM does support variable frequency and variable phase, but one has to explicitly enable the variable frequency option in the highlighted menu.
Hi!
I have a question regarding the phase shift. Let’s say I want to update the phase shift two times during the period of the PWM signal. What would be the best way to do that? As far as I can see the PWM blocks only support updating when the counter reaches 0.
Thanks!
Milad