PWM output

Create new topics, add your comment, remark, bugs...
Defe

PWM output

Postby Defe » Mon May 26, 2008 7:52 pm

Dear Lubin,

I'm working in a small project for my university. I'm trying to generate the code for the 30f2010. I'm in a preliminary process. I try to use the PWM exit control a chopper, with the duty cicle and period as variables.

I've tried with the OC compare block, and also with the PWM motor output block, but i don't success. Can you help me? I've read all the forum and seen all the examples, but I'm blocked at this position.

At this moment I can't do a print screen, I hope tomorrow I could do.

Thanks

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: PWM output

Postby LubinKerhuel » Tue May 27, 2008 8:10 am

Hi Defe,

Could you upload your Simulink model file ? or a screenshoot as you like...

Defe

Re: PWM output

Postby Defe » Tue May 27, 2008 2:01 pm

Hi,

here's a pic of the model. Ocmax is the period and Ocmax/3 is the duty cycle. Is anything wrong?

The PWM output has only one input. Can I use this block and how?

My objetive is have a PWM output which variables are the duty cycle and period.

Thanks
Attachments
model.jpg
model.jpg (23.71 KiB) Viewed 3491 times

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: PWM output

Postby LubinKerhuel » Tue May 27, 2008 9:03 pm

Hi Defe,

This model should work. You should get a duty cycle of 1/3. If it doesn't, try forcing the sampling rate of the constant to .001 for example.

Using the OC block, you will be able to get a PWM signal with variable duty cycle and period. You just have to care about scaling theses two values with regards to OC?max.

The PWM Motor block has only one entry for duty cycle. Thus, it is not possible to get a variable period with this block. The period is fixed in the dialog box parameters.

Lubin

jmednick
Posts: 3
Joined: Fri Mar 12, 2010 9:02 pm

Re: PWM output

Postby jmednick » Fri Mar 12, 2010 9:03 pm

So wait, you can't change the duty cycle of the PWM wave?

EDIT: Never mind, I need to learn to read

jmednick
Posts: 3
Joined: Fri Mar 12, 2010 9:02 pm

Re: PWM output

Postby jmednick » Fri Mar 12, 2010 9:14 pm

What I am asking is how can I change the duty cycle in the PWM block?

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: PWM output

Postby LubinKerhuel » Fri Mar 12, 2010 10:53 pm

On OC block, duty cycle is set for example throw the OCx_Up. Period is set throw period. But theses input can be change into OCx_Up and OCx_Down in the dialog box.

skumar
Posts: 1
Joined: Tue May 04, 2010 8:09 am

Re: PWM output

Postby skumar » Tue May 04, 2010 8:25 am

hie sir..

i am a undergraduate student.. i am doing a project where i want to control the output voltage of the BOOST converter..
the controller i am using is PI control.. i am giving the error voltage to the PI controller.. this controller will give a signal and i am comparing that signal with a ramp wave which which give the pulse to switch on the MOSFET... i tested that circuit in matlab simulink and it is working also..but for implemeting that with DSPIC toolbox what i have to change..
i am very new to this microcontroller....i tried for many days but i am unable to move furture..

waiting for u r reply..


Return to “General Remark and Questions”

Who is online

Users browsing this forum: No registered users and 1 guest