El eskager Un Pavam mümkün mikro kristal

Başlatan buntger, 11 Şubat 2016, 13:05:17

buntger

Merhaba forum,

Ben PWM HPWM Proton komutları yapmak için, ben PIC 18F26K22 olduğunu kullanmak Micro, cam kullanmak zorunda olduğunu bilmek istiyorum.

Sintax:
HPWM Channel, Dutycycle, Frequency

Ben kristaller 8 ve 16MHz (değil HPWM komutu) ile 20KHz için PWM gördüm esque anlamıyorum.
manuel Proton pág.235 sayfalarında mikro koymak için çeşitli kristaller koyar
Frekans ve asgari 2.442KHz yapmak bir 40MHz kristal kullanmak zorunda.
Nasıl mümkün .... ben hiçbir şey anlamıyorum olduğunu.

Ben hesaplayabilirsiniz olarak ...


Teşekkürler Selamlar.

Maxim

ingilizce yazabilirsiniz.

18F26K22 (int osc 4mhz) ile 250hz-500khz arası pwm çıkışı alabilirsiniz.
18F26K22 (int osc 8mhz) ile 500hz-1mhz arası pwm çıkışı alabilirsiniz.
18F26K22 (int osc 16mhz) ile 1khz-2mhz arası pwm çıkışı alabilirsiniz.

buntger

Hello Maxim,

Well I am sorry , PWM This is the first time. it's complicated.

I was referring to the crystal outside Micro the (int osc 4mhz) is inside pll micro.

The question is how to know, what is the best frequency for a Brushed DC motor , It is works: 36V, 35.5A and 3000RPM.
As it calculated?

IF 1 RPM = 0.016 666 666 667 1/second

Freq= 0.016666666667 * 3000RPM=50Hz
or
Freq= 3000RPM/60s=50Hhz

3000 RPM = 50Hhz

To be able to control the motor correctly How often should I apply for the PWM 50Hhz or other upper> 20Khz and why?

Code Example (mini):

Device = 18F26K22
Xtal = 20
Declare CCP2_Pin = PORTB.3

HPWM 2,127,50 ' = 50Hz
'or
HPWM 2,127,20000 ' = 20Khz


THX.

skara1214

for microcontroller  the fastest is the best. both for adjusting pwm frequency and also calculations. for motor applicaiton,I use 20 khz for motor applicaitons because ears can not hear that frequency. if use higher frequency ,you lose duty cycle resolution. 20khz is ideal for most applications.
Herkes ölür ama herkes gerçekten yaşamaz

buntger

Hello skara1214,

But, how to calculate the 20 Khz, as you know that frequency?
You use the Command HPWM of Proton.

Sintax:
HPWM Channel, Dutycycle, Frequency

THX.


Maxim

@buntger I think you mixture what is pwm and duty?

you dont need any frequency calculate for dc motor or rpm
HPWM 2,127,20000 (second pwm channel, %50 duty, 20khz)
when use this command, your pwm output frequency is 20khz
because 20khz is better for dc motor (you can run it with 1khz too but you hearing some unwanted voice from dc motor)

127 mean %50 duty... (scale is 0 to 255 ..8bit)
now your dc motor turn half speed (1500rpm)

if you use 255 your motor turn full speed %100 duty (3000 rpm)
HPWM 2,255,20000

finally, you just need change duty value if you want to change motor rpm.

Karamel

Electric motors are the whole new ball game for engineering but i guess, there must be some calculation-ways for the best frequency of pwm. the best mentor of electric motors is here @z you may ask him, your all questions.