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 CCS Technical Support

PWM -- motor

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







PWM -- motor
PostPosted: Fri Apr 01, 2005 8:01 am     Reply with quote

How does the ECCP (or CCP) get 10-bit resolution, if the period register PR2 is only 8 bits long?

If I set ECCPR1L (duty cycle register) to zero, and the 2 LSbits to something non-zero, will i get tiny brief pulses a fraction of a duty cycle of '1'?

Furthermore, i need to get these tiny little micropulses working so that I can drive a 24V motor off a rectified line voltage! (120VAC x 1.4 = 170VDC).

So long as I have galvanic isolation and the proper fuses to protect against locked rotor overcurrent, will UL still sneer upon me overdriving a motor with little micropulses well above the motor rating? After all, the "average" of the PWM duty cycle is still within ratings.
Ttelmah
Guest







Re: PWM -- motor
PostPosted: Fri Apr 01, 2005 10:03 am     Reply with quote

valemike wrote:
How does the ECCP (or CCP) get 10-bit resolution, if the period register PR2 is only 8 bits long?

If I set ECCPR1L (duty cycle register) to zero, and the 2 LSbits to something non-zero, will i get tiny brief pulses a fraction of a duty cycle of '1'?

Furthermore, i need to get these tiny little micropulses working so that I can drive a 24V motor off a rectified line voltage! (120VAC x 1.4 = 170VDC).

So long as I have galvanic isolation and the proper fuses to protect against locked rotor overcurrent, will UL still sneer upon me overdriving a motor with little micropulses well above the motor rating? After all, the "average" of the PWM duty cycle is still within ratings.


Is the peak voltage within the insulation ratings of the motor though...
Seevn times the rated voltage, is beyond the 'test' requirements for most countries, and may well risk insulation breakdown. I think UL would require that the motor has an insulation test well above this working voltage to be acceptable.

The PR register, does not control the width. It controls the overall frequency. The pulse width is determined by the CCPR1L, plus two extra 'low' bits in CCP1CON. To use these, make sure you select 'CCP_PWM', in the configuration (the other three options 'CCP_PWM_PLUS_x', set these extra bits. Then make sure that the variable you send to SET_PWM1_DUTY, is a 16bit value. If you us a constant, ensure the constant is terminated with an 'L' to force it to be a long.
Basically, if the compiler 'sees' an 8bit value, it feeds it directly into the register, ignoring the two low bits (effectively multiplying the value by four). If it sees a 16bit value, it takes the low two bits and feeds these to the extra register.

Best Wishes
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