1 / 20

DC motor and PWM

DC motor and PWM. Topics. DC motor Unidirectional control Bidirectional control PWM modes Wave generating using Fast PWM Wave generating using Phase correct PWM. DC motor. Current continues to flow after switch is opened.

juana
Télécharger la présentation

DC motor and PWM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DC motor and PWM

  2. Topics DC motor Unidirectional control Bidirectional control PWM modes Wave generating using Fast PWM Wave generating using Phase correct PWM

  3. DC motor

  4. Current continues to flow after switch is opened • Opening the switch does not stop current, immediately , in the motor windings.

  5. Reverse current • Charge build-up can cause damage

  6. Motor Model • Simple model of a DC motor: • Windings have inductance and resistance • Inductor stores electrical energy in the windings • We need to provide a way to safely dissipate electrical energy when the switch is opened

  7. Flyback diode or snubber diode • Adding a diode in parallel with the motor provides a path for dissipation of stored energy when the switch is opened

  8. Unidirectional control +12V Analog Ground Analog Power M AVR VCC GND TIP120 +5V Digital Ground

  9. Bidirectional control

  10. Bidirectional (clock wise)

  11. Bidirectional (counter clockwise)

  12. Bidirectional

  13. Using L298N

  14. Timer0 Review TCCR0 TCNT0 TOV0 = OCF0 OCR0

  15. Timer Mode (WGM) WGM00 WGM01 Comment 0 0 Normal 0 1 CTC (Clear Timer on Compare Match) 1 0 PWM, phase correct 1 1 Fast PWM Clock Selector (CS) CS02 CS01 CS00Comment 0 0 0 No clock source (Timer/Counter stopped) 0 0 1 clk (No Prescaling) 0 1 0 clk / 8 0 1 1 clk / 64 1 0 0 clk / 256 1 0 1 clk / 1024 1 1 0 External clock source on T0 pin. Clock on falling edge 1 1 1 External clock source on T0 pin. Clock on rising edge

  16. Compare Output Mode (COM) CTC or Normal (Non PWM) Fast PWM Phase Correct PWM

  17. TCNT0 0xFF OCR0 0 OC0 OC0 fclk FOC0= N(256) Fast PWM Duty cycle = changeable (0% to 100%) Frequency = selectable between limited choices Phase Correct PWM TCNT0 0xFF OCR0 0 OC0 COM=2 OC0 COM=3 Compare Output Mode (COM) CTC or Normal (Non PWM) Fast PWM

  18. Assuming XTAL = 8 MHz, make the following pulse duty cycle = 75% and frequency = 31.250KHz OCR0 = 0xBE; TCCR0 = 0x79; fclk FOC0= N(256) 8MHz 8MHz =1 31.250KHz= N = N(256) 31.250K*256 75/100 = (OCR0+1)/255  OCR0+1 = 191 = 0xBF  OCR0 = 0xBE LDI R20,0xBE OUT OCR0,R20 LDI R20,0x79 OUT TCCR0,R20

  19. Compare Output Mode (COM) CTC or Normal (Non PWM) Fast PWM Phase Correct PWM

  20. TCNT0 TCNT0 0xFF OCR0 OCR0 0 0 OC0 OC0 OC0 OC0 fclk FOC0= N(510) Phase Correct PWM Duty cycle = changeable (0% to 100%) Frequency = selectable between limited choices 0xFF COM=2 COM=3 Compare Output Mode (COM) CTC or Normal (Non PWM) Fast PWM Phase Correct PWM

More Related