FORUM TOPIC · READ ONLY

Problem using PWM_motor - Solved

Problem using PWM_motor - Solved

Forum : General Remark and Questions

10 message(s) · archive en lecture seule

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 externe (non intégrée)
LubinKerhuel

Re: Problem using PWM_motor

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
murali

Re: Problem using PWM_motor

hi!

since i need it urgently, can you please send me the corrected blockset.
LubinKerhuel

Re: Problem using PWM_motor

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
murali

Re: Problem using PWM_motor

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
gladiac

Re: Problem using PWM_motor - Solved

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

Pièce jointe : New Picture.jpg

LubinKerhuel

Re: Problem using PWM_motor - Solved

Correction will be available in the next version of the blockset. It will be released within few days (3 to 10 days from now)
gladiac

Re: Problem using PWM_motor - Solved

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

Pièce jointe : New Picture.jpg

LubinKerhuel

Re: Problem using PWM_motor - Solved

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
gladiac

Re: Problem using PWM_motor - Solved

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.