Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PWM signal with variable duty cycle

555 views
Skip to first unread message

Chris

unread,
Jul 27, 2010, 1:23:05 AM7/27/10
to
Hi,
I'm trying to generate a PWM signal with a duty cycle that increases with time. I'm using the Simscape Controlled PWM Voltage block. Is it possible to have a block parameter vary with time? Or is there a different block that might accomplish the same goal?
Thanks,
Chris

Jean Baptiste Lanfrey

unread,
Jul 27, 2010, 4:46:29 AM7/27/10
to
Hi Chris,
Depending on the version you are using there are several ways to do it.
You can use built-in blocks (physical signals from simscape foundation
library) and for instance compare a triangle carrier with an input signal
that will determine the duty cycle.
You can also use the simscape language to build you own PWM generator with
either a time varying duty cycle defined in the ssc file
(http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/ref/time.html)
or as an input to your block.
HTH
Jean-Baptiste


"Chris " <christophe...@samsung.com> a écrit dans le message de news:
i2lqfo$doc$1...@fred.mathworks.com...

Chris

unread,
Jul 28, 2010, 1:15:27 AM7/28/10
to
Hi Jean-Baptiste,

Thanks for your reply. So far, I've been trying to generate the signal using built-in blocks (I'm not familiar enough with Simulink/PWM to try to build the generator myself). I'm a bit confused by the other method you suggest. I want the duty cycle to increase 10% every .1 seconds, so I created this signal using a ramp and rounding function. Can I input this as a parameter for another block? I don't really understand what you mean by "compare a triangle carrier with an input signal." Sorry for my simulink incompetence....

Thanks again!


"Jean Baptiste Lanfrey" <jlan...@mathworks.com> wrote in message <i2m6d7$4ie$1...@fred.mathworks.com>...


> Hi Chris,
> Depending on the version you are using there are several ways to do it.
> You can use built-in blocks (physical signals from simscape foundation
> library) and for instance compare a triangle carrier with an input signal
> that will determine the duty cycle.
> You can also use the simscape language to build you own PWM generator with
> either a time varying duty cycle defined in the ssc file
> (http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/ref/time.html)
> or as an input to your block.
> HTH
> Jean-Baptiste
>
>

> "Chris " <christophe...@samsung.com> a crit dans le message de news:

Jean Baptiste Lanfrey

unread,
Jul 28, 2010, 3:47:21 AM7/28/10
to
Hi Chris,
you can definetly do it and it is not that complicated.
The method I was proposing is a simple one that is using a few built-in
blocks (a triangle source, a comparator and a duty cycle input).

Have a look there : http://en.wikipedia.org/wiki/Pulse-width_modulation. It
explains the simplest method to generate a PWM.

Once you've built this simple model, just connect a ramp (slope 10%/0.1s) to
the duty cycle input and you're done.

Jean-Baptiste

"Chris " <christophe...@samsung.com> a écrit dans le message de news:
i2oedf$coc$1...@fred.mathworks.com...

Chris

unread,
Jul 29, 2010, 12:45:20 AM7/29/10
to
Yeah, I got it to work thanks. I actually had that wikipedia page bookmarked from about a month ago but didn't realize that it could be so helpful.

Thanks again for your help!

"Jean Baptiste Lanfrey" <jlan...@mathworks.com> wrote in message <i2onac$4f8$1...@fred.mathworks.com>...

Menaka seeni

unread,
Aug 27, 2010, 6:38:04 AM8/27/10
to
hi chris,
i am also seraching for variable pulse width(duty cycle) for regular interval of time.
ouput freq=50hz.switching freq=5khz.duty cycle is vary from time to time.
Is it possible to have a block parameter vary with time?how can i proceed to get that?
thanks,
harithaa


"Chris " <christophe...@samsung.com> wrote in message <i2r110$lbo$1...@fred.mathworks.com>...

Hossein

unread,
Dec 8, 2011, 9:13:08 AM12/8/11
to

Hi Jean-Baptiste
would you please upload the link ...
thanks
"Chris" wrote in message <i2oedf$coc$1...@fred.mathworks.com>...

kamilu sanusi

unread,
Apr 8, 2014, 12:54:07 PM4/8/14
to
please im trying to create PWM controled block for Z source inverter where i can control the duty cycle the sooth through state, and can not do it. please assist me with a model block for this.
Thank u
Sanusi Kamilu
0 new messages