Page 1 of 1

Problem using PWM_motor - Solved

Posted: Sat Oct 04, 2008 2:48 pm
by murali
hi!
I am trying to use one of the PWM channels of dsPIC,but while generating the c-code..it is giving the following error:

PWM.c: In function 'PWM_initialize':
PWM.c:61: error: 'PWM_INT_DIS' undeclared (first use in this function)
PWM.c:61: error: (Each undeclared identifier is reported only once
PWM.c:61: error: for each function it appears in.)
PWM.c:61: error: 'PWM_FLTA_DIS_INT' undeclared (first use in this function)
PWM.c:61: error: 'PWM_INT_PR1' undeclared (first use in this function)
PWM.c:61: error: 'PWM_FLTA_INT_PR0' undeclared (first use in this function)
PWM.c:66: error: 'PWM_EN' undeclared (first use in this function)
PWM.c:66: error: 'PWM_OP_SCALE1' undeclared (first use in this function)
PWM.c:66: error: 'PWM_IPCLK_SCALE4' undeclared (first use in this function)
PWM.c:66: error: 'PWM_MOD_FREE' undeclared (first use in this function)
PWM.c:66: error: 'PWM_PEN1L' undeclared (first use in this function)
PWM.c:66: error: 'PWM_MOD1_IND' undeclared (first use in this function)
PWM.c:66: error: 'PWM_PDIS1H' undeclared (first use in this function)
PWM.c:66: error: 'PWM_PDIS2L' undeclared (first use in this function)
PWM.c:66: error: 'PWM_PDIS2H' undeclared (first use in this function)
PWM.c:66: error: 'PWM_PDIS3L' undeclared (first use in this function)
PWM.c:66: error: 'PWM_PDIS3H' undeclared (first use in this function)
PWM.c:66: error: 'PWM_SEVOPS1' undeclared (first use in this function)
PWM.c:66: error: 'PWM_OSYNC_TCY' undeclared (first use in this function)
PWM.c:66: error: 'PWM_UEN' undeclared (first use in this function)

Image

Re: Problem using PWM_motor

Posted: Sat Oct 04, 2008 7:52 pm
by LubinKerhuel
Thanks for the bug report.

I sucessfully reproduced it on the blockset version 0.98fe.

Workaround : open at least once the PWM dialog blox and close it before compiling. It seems that some parameters are not updated until the block is opened at least once.

Bug will be solved in the next release version.

Lubin

Re: Problem using PWM_motor

Posted: Sat Oct 04, 2008 8:09 pm
by murali
hi!
since i need it urgently, can you please send me the corrected blockset.

Re: Problem using PWM_motor

Posted: Sat Oct 04, 2008 8:35 pm
by LubinKerhuel
Hi Murali,

Note that with the current version, you will be able to compile your model. You just need to open the PWM block once before compiling!!

Anyway, I can provide you with the version being developed.
Which matlab version are you using?

Lubin

Re: Problem using PWM_motor

Posted: Sat Oct 04, 2008 8:44 pm
by murali
Hi Lubin!
I tried that,infact i have changed the period also before compiling ,but the same errors are appearing ..
I am using r2008a..It would be great if you can provide me the corrected version.
Thank you

Re: Problem using PWM_motor - Solved

Posted: Thu Oct 23, 2008 11:54 am
by gladiac
Hi Lubin

It seems I have a similar problem.Once I add the PWM bolckset to simulink model, the 'master' block couldn't be opened. The pic attached shows the error info. Also same error appears during compiling.

cheers

Re: Problem using PWM_motor - Solved

Posted: Fri Oct 24, 2008 12:11 am
by LubinKerhuel
Correction will be available in the next version of the blockset. It will be released within few days (3 to 10 days from now)

Re: Problem using PWM_motor - Solved

Posted: Thu Oct 30, 2008 1:22 pm
by gladiac
Hi Lubin,

I have upgraded to V0.99a for R2007b and R2006a, but the problem still exist, the picture shows the error info for R2007b

Re: Problem using PWM_motor - Solved

Posted: Thu Oct 30, 2008 1:34 pm
by LubinKerhuel
Hi Gladiac,

I check the dsPIC you are using 30f6014, it has no PWM motor peripheral ! I will try to update the error message to make it more clear.

You can generate PWM signal using the Output Compare block. 30f6014 has 8 OC channels capable to generate a PWM signal.

Lubin

Re: Problem using PWM_motor - Solved

Posted: Thu Oct 30, 2008 11:42 pm
by gladiac
Hi Lubin,

Thanks! The problem seems to be caused by myself. I just muddled up your 'PWM blockset' with the PWM mode of OC module. So your 'PWM blockset' works for MCPWM module. Thanks again for your help.