Thread Subject: PWM signal with variable duty cycle

Subject: PWM signal with variable duty cycle

From: Chris

Date: 27 Jul, 2010 05:23:05

Message: 1 of 7

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

Subject: PWM signal with variable duty cycle

From: Jean Baptiste Lanfrey

Date: 27 Jul, 2010 08:46:29

Message: 2 of 7

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 " <christopher.woodruff@samsung.com> a crit dans le message de news:
i2lqfo$doc$1@fred.mathworks.com...
> 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
>

Subject: PWM signal with variable duty cycle

From: Chris

Date: 28 Jul, 2010 05:15:27

Message: 3 of 7

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" <jlanfrey@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 " <christopher.woodruff@samsung.com> a crit dans le message de news:
> i2lqfo$doc$1@fred.mathworks.com...
> > 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
> >
>

Subject: PWM signal with variable duty cycle

From: Jean Baptiste Lanfrey

Date: 28 Jul, 2010 07:47:21

Message: 4 of 7

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 " <christopher.woodruff@samsung.com> a crit dans le message de news:
i2oedf$coc$1@fred.mathworks.com...
> 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" <jlanfrey@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 " <christopher.woodruff@samsung.com> a crit dans le message de
>> news: i2lqfo$doc$1@fred.mathworks.com...
>> > 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
>> >
>>

Subject: PWM signal with variable duty cycle

From: Chris

Date: 29 Jul, 2010 04:45:20

Message: 5 of 7

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" <jlanfrey@mathworks.com> wrote in message <i2onac$4f8$1@fred.mathworks.com>...
> 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

Subject: PWM signal with variable duty cycle

From: Menaka seeni

Date: 27 Aug, 2010 10:38:04

Message: 6 of 7

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 " <christopher.woodruff@samsung.com> wrote in message <i2r110$lbo$1@fred.mathworks.com>...
> 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" <jlanfrey@mathworks.com> wrote in message <i2onac$4f8$1@fred.mathworks.com>...
> > 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

Subject: PWM signal with variable duty cycle

From: Hossein

Date: 8 Dec, 2011 14:13:08

Message: 7 of 7


Hi Jean-Baptiste
would you please upload the link ...
thanks
"Chris" wrote in message <i2oedf$coc$1@fred.mathworks.com>...
> 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" <jlanfrey@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 " <christopher.woodruff@samsung.com> a crit dans le message de news:
> > i2lqfo$doc$1@fred.mathworks.com...
> > > 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
> > >
> >

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
variable duty c... Leoo Chang 29 Apr, 2011 02:49:12
variable duty c... harithaa 27 Aug, 2010 06:39:20
duty cycle Chris 27 Jul, 2010 01:24:09
pulse width mod... Chris 27 Jul, 2010 01:24:09
pwm Chris 27 Jul, 2010 01:24:09
simscape Chris 27 Jul, 2010 01:24:09
rssFeed for this Thread

Contact us at files@mathworks.com