DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN857 データシートの表示(PDF) - Microchip Technology

部品番号
コンポーネント説明
メーカー
AN857
Microchip
Microchip Technology Microchip
AN857 Datasheet PDF : 48 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
We are using PWM to control start-up current, so why
not use it as a speed control also? We will use the Ana-
log-to-Digital Converter (ADC), of the PIC16F877 to
read a potentiometer and use the voltage reading as
the relative speed control input. Only 8 bits of the ADC
are used, so our speed control will have 256 levels. We
want the relative speed to correspond to the relative
potentiometer position. Motor speed is directly propor-
tional to applied voltage, so varying the PWM duty
cycle linearly from 0% to 100% will result in a linear
speed control from 0% to 100% of maximum RPM.
Pulse width is determined by continuously adding the
ADC result to the free running Timer0 count to deter-
mine when the drivers should be on or off. If the addi-
tion results in an overflow, then the drivers are on,
otherwise they are off. An 8-bit timer is used so that the
ADC to timer additions need no scaling to cover the full
range. To obtain a PWM frequency of 10 kHz Timer0
must be running at 256 times that rate, or 2.56 MHz.
The minimum prescale value for Timer0 is 1:2, so we
need an input frequency of 5.12 MHz. The input to
Timer0 is FOSC/4. This requires an FOSC of 20.48 MHz.
That is an odd frequency, and 20 MHz is close enough,
so we will use 20 MHz resulting in a PWM frequency of
9.77 kHz.
AN857
There are several ways to modulate the motor drivers.
We could switch the high and low side drivers together,
or just the high or low driver while leaving the other
driver on. Some high side MOSFET drivers use a
capacitor charge pump to boost the gate drive above
the drain voltage. The charge pump charges when the
driver is off and discharges into the MOSFET gate
when the driver is on. It makes sense then to switch the
high side driver to keep the charge pump refreshed.
Even though this application does not use the charge
pump type drivers, we will modulate the high side driver
while leaving the low side driver on. There are three
high side drivers, any one of which could be active
depending on the position of the rotor. The motor drive
word is 6-bits wide, so if we logically AND the drive
word with zeros in the high driver bit positions, and 1’s
in the low driver bit positions, we will turn off the active
high driver regardless which one of the three it is.
We have now identified 4 tasks of the control loop:
• Read the sensor inputs
• Commutate the motor drive connections
• Read the speed control ADC
• PWM the motor drivers using the ADC and Timer0
addition results
At 20 MHz clock rate, control latency, caused by the
loop time, is not significant so we will construct a simple
polled task loop. The control loop flowchart is shown in
Figure 6 and code listings are in Appendix B.
2002-2011 Microchip Technology Inc.
DS00857B-page 7

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]