CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

controller 3 phase motor with PWM

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

controller 3 phase motor with PWM
PostPosted: Thu Oct 22, 2009 4:56 am     Reply with quote

hi

I need controller 3 phase motor with PWM, I connect my PIC on IRF and it close circuit with an resistor (10Ohm/ 150W) to brake motor (reduce speed)...

But how I can know value of PWM?

I have this configuration on my program:
Code:

setup_ccp1(CCP_PWM);       
setup_timer_2(T2_DIV_BY_4, 255, 1);
(...)
set_pwm1_duty(0); //max speed
set_pwm1_duty(255); //min speed

I don't know how frequency I stay work with PWM.

PS: I use PIC18F252 with clock 20Mhz

best regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 22, 2009 12:02 pm     Reply with quote

PWM frequency forumla:
http://www.ccsinfo.com/forum/viewtopic.php?t=17993
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

PostPosted: Thu Oct 22, 2009 5:16 pm     Reply with quote

Hi

My frequency with this configurations is 4901hz correct?

I test it and I have very noise when I try set_pwm1_duty(1) at set_pwm1_duty(175).

How I can reduce this noise?

PS: I think put frequency more than 20Khz but I don't know how make that.

best regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 23, 2009 2:33 pm     Reply with quote

Quote:
My frequency with this configurations is 4901hz correct?

That's close enough to the calculated frequency.

Quote:
I test it and I have very noise when I try set_pwm1_duty(1) at set_pwm1_duty(175).

How I can reduce this noise?

I don't know what you mean by "noise". You should see a clean pulse
on the oscilloscope.

Quote:

PS: I think put frequency more than 20Khz but I don't know how make that.

Did you take Algebra ? Use the equation in the link that I gave you.
Set the Timer2 Divisor value to 1, in the setup_timer_2() function.
Then solve the equation for PR2. It will give you the value to use
for the middle parameter in setup_timer_2().
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

PostPosted: Fri Oct 23, 2009 6:14 pm     Reply with quote

Hi

noise is "iiiiiiiiiiiiiiiii" when I try break motor...

I have must algebra... but I don't know with is possible use divide timer for 1. I don't read this part of the post...

But now stay all ok, thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group