0 оценок0% нашли этот документ полезным (0 голосов)
67 просмотров10 страниц
This document discusses pulse width modulation (PWM) and how to use it with a PIC18F452 microcontroller to control motors. It describes how PWM works by regulating current through varying pulse widths. It also discusses using an H-bridge circuit and associated registers to interface a microcontroller with a motor for PWM control, including parameters of the CCP module, registers associated with PWM, and how to set up the PWM modules.
This document discusses pulse width modulation (PWM) and how to use it with a PIC18F452 microcontroller to control motors. It describes how PWM works by regulating current through varying pulse widths. It also discusses using an H-bridge circuit and associated registers to interface a microcontroller with a motor for PWM control, including parameters of the CCP module, registers associated with PWM, and how to set up the PWM modules.
Авторское право:
Attribution Non-Commercial (BY-NC)
Доступные форматы
Скачайте в формате PPTX, PDF, TXT или читайте онлайн в Scribd
This document discusses pulse width modulation (PWM) and how to use it with a PIC18F452 microcontroller to control motors. It describes how PWM works by regulating current through varying pulse widths. It also discusses using an H-bridge circuit and associated registers to interface a microcontroller with a motor for PWM control, including parameters of the CCP module, registers associated with PWM, and how to set up the PWM modules.
Авторское право:
Attribution Non-Commercial (BY-NC)
Доступные форматы
Скачайте в формате PPTX, PDF, TXT или читайте онлайн в Scribd
regulate the current sent to a motor or any other modules. PWM controls produce smoother current at higher switching frequencies, typically between 1 and 20 kHz. At 20 kHz, the switching frequency is inaudible to humans, thereby eliminating the hum which switching at lower frequency produces. Pulse width Modulation (PWM) Very efficient way of providing intermediate amounts of electrical power between fully on and fully off DC Brushed Motor Controlling
A PWM controller typically contains a large reservoir
capacitor and an H-bridge arrangement of switching elements (thyristors, mosfets or transistors).
Eg :- L298 (typical solid state H-Bridge).
Basics Construction of a H-Bridge
A solid state H-bridge is typically constructed using
BJTs or MOSFETs Interfacing a microcontroller/H-bridge and motor Parameters of the CCP module Registers/Modules associate with PWM TMR2 module and associated registers. CCPXCON - capture/compare/pwm x control CCPRXL - capture/compare/pwm x register low CCPRXH (Read only) - capture/compare/pwm x register high Etc.. All these associated registers’ functionality and configurations settings can be found in the PIC18F452 data sheet.
X – can be either 1 or 2 for the 2 modules in a 18f452
Setting up the PWM modules
Set the CCPX pins and directional control I/O pins as
out puts. Set the PWM period by writing to the PR2 register. Set the PWM duty cycle by writing to the CCPXRL and CCPXCON<5:4> registers. SET the Timer2 prescaler and enable Timer2. Configure the CCPX module for PWM operation Example Using C18 library