1/22/16. You Tube Video. https://www.youtube.com/watch?v=ympzipfabyw. Definitions. Duty Cycle: on-time per period (specified in per cent)



Similar documents
Pulse Width Modulation Applications

Timer A (0 and 1) and PWM EE3376

Pulse Width Modulation

Display Board Pulse Width Modulation (PWM) Power/Speed Controller Module

Microcontroller for Variable Speed BLDC Fan Control System. T.C. Lun System Engineer, Freescale Semiconductor, Inc.

EET272 Worksheet Week 9

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

Technical Manual. FAN COIL CONTROLLER COOLING or HEATING ANALOG or PWM Art A

Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Current Loop Tuning Procedure. Servo Drive Current Loop Tuning Procedure (intended for Analog input PWM output servo drives) General Procedure AN-015

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

Pulse Width Modulation (PWM) LED Dimmer Circuit. Using a 555 Timer Chip

Freescale Semiconductor, I

AP TriCore. Sinusodial 3-Phase Output Generation Using The TriCore General Purpose Timer Array. Microcontrollers

Decimal Number (base 10) Binary Number (base 2)

Selecting and Implementing H-Bridges in DC Motor Control. Daniel Phan A

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Talon and Talon SR User Manual

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

Ignition Alert Anti-Theft Security System for Motorbikes with Remote Control Amit Yadav, Anushri Jha, Neelesh Gupta

Series AMLDL-Z Up to 1000mA LED Driver

Flexible Counter Series in DIN size 24 x 48 mm

Adding Heart to Your Technology

Constructing a precision SWR meter and antenna analyzer. Mike Brink HNF, Design Technologist.

Design and Construction of Variable DC Source for Laboratory Using Solar Energy

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

MicroMag3 3-Axis Magnetic Sensor Module

Flexible Active Shutter Control Interface using the MC1323x

User and installation manual

Rectifier filter stage post filtering sense

HT46R14A Single Phase AC Induction Motor Frequency Converter Application

Single Phase Two-Channel Interleaved PFC Operating in CrM

AC/DC Power Supply Reference Design. Advanced SMPS Applications using the dspic DSC SMPS Family

Atmel Norway XMEGA Introduction

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

Lab 4: Pulse Width Modulation and Introduction to Simple Virtual Worlds (PWM) (PWM)

Single Phase Two-Channel Interleaved PFC Operating in CrM Using the MC56F82xxx Family of Digital Signal Controllers

A Practical Guide to Free Energy Devices

LOW COST MOTOR PROTECTION FILTERS FOR PWM DRIVE APPLICATIONS STOPS MOTOR DAMAGE

Section 14. Compare/Capture/PWM (CCP)

DC Motor control Reversing

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Programmable Single-/Dual-/Triple- Tone Gong SAE 800

VICOR WHITE PAPER. The Sine Amplitude Converter Topology Provides Superior Efficiency and Power Density in Intermediate Bus Architecture Applications

Theory of Operation. Figure 1 illustrates a fan motor circuit used in an automobile application. The TPIC kω AREF.

Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold

ABB i-bus EIB Universal Interfaces US/U 4.2 US/U 2.2

AN4646 Application note

Hello, and welcome to this presentation of the STM32 SDMMC controller module. It covers the main features of the controller which is used to connect

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

Developments in Point of Load Regulation

Interfacing Analog to Digital Data Converters

How To Control Gimbal

Analog Representations of Sound

DS1621 Digital Thermometer and Thermostat

Micro-Step Driving for Stepper Motors: A Case Study

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

APPLICATION NOTE. Atmel AVR443: Sensor-based Control of Three Phase Brushless DC Motor. Atmel AVR 8-bit Microcontrollers. Features.

B.IQ push button 3-5gang with room thermostat and display V2, flush-mounted x, x, x

DC/DC power modules basics

Push button 2, 3, 5gang with room thermostat (RTR) and display flush-mounted xx, xx, xx

Solid-State Relays (SSRs) vs Electromechanical Relays (EMRs)

Product Information. Gateway For Connecting EnDat Encoders to PROFIBUS-DP

Build A Video Switcher. Reprinted with permission from Electronics Now Magazine September 1997 issue

Chapter 13. PIC Family Microcontroller

AP-1 Application Note on Remote Control of UltraVolt HVPS

Voltage boost and buck circuits using Atmel AVR Tiny13V for driving a white LED.

Analog Servo Drive 25A8

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

ABB i-bus EIB Logic Module LM/S 1.1

Drive circuit basics + V. τ e. Industrial Circuits Application Note. Winding resistance and inductance

Fundamentals of Power Electronics. Robert W. Erickson University of Colorado, Boulder

Software Manual RS232 Laser Merge Module. Document # SU Rev A

Harmonics and Noise in Photovoltaic (PV) Inverter and the Mitigation Strategies

AN Application Note: FCC Regulations for ISM Band Devices: MHz. FCC Regulations for ISM Band Devices: MHz

Relationship between large subject matter areas

FREQUENCY RESPONSE ANALYZERS

TDA CHANNEL VOLUME CONTROLLER 1 FEATURES 2 DESCRIPTION. Figure 1. Package

If an occupancy of room is zero, i.e. room is empty then light source will be switched off automatically

APPLICATION NOTES: Dimming InGaN LED

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

INSTRUMENTATION AND CONTROL TUTORIAL 3 SIGNAL PROCESSORS AND RECEIVERS

DS1621 Digital Thermometer and Thermostat

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

SIMATIC. ET 200S distributed I/O 2AO I ST analog electronic module (6ES7135-4GB01-0AB0) Preface. Properties 1. Parameters 2.

Motor Control using NXP s LPC2900

AVR442: PC Fan Control using ATtiny13. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Switch Mode Power Supply Topologies

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Tire pressure monitoring

Design and Construction of Microcontroller Based Charge Controller for Photovoltaic Application

M25P05-A. 512-Kbit, serial flash memory, 50 MHz SPI bus interface. Features

Analog Inputs and Outputs

Introduction to Electronic Signals

Transcription:

Definition Pulse Width Modulation (PWM) is simply a way of getting the micro-controller to manage pulsing a pin on and off at a set period and duty cycle. The LPC11U24 has four timers with four match registers each that can be used to create a PWM output on a pin. The period is the inverse of frequency of the pulses and the duty cycle is the ratio of the on time vs. off time. Using a timer or a PWM peripheral of a micro-controller has the benefitof not needing software intervention to toggle the pin, freeing the software to execute less time critical tasks. The PWM output can be used for a variety of things including dimming an LED, controlling motor speed, or setting a servo s position. 2 1

You Tube Video https://www.youtube.com/watch?v=ympzipfabyw 3 Definitions Duty Cycle: on-time per period (specified in per cent) 4 2

Types of Pulse Width Pulse center fixed, edges modulated Leading edge fixed, tailing edge modulated Trailing edge fixed, leading edge modulated Pulse width constant, period modulated 5 Types of Pulse Width 6 3

Applications to DC Motors The average voltage supplied to a DC motor is proportional to the duty cycle. Both brushed and brushless motors can be used with PWM. Both analog and digital control techniques and components are available. 7 Advantages of PWM Average value proportional to duty cycle. Fast switching possible due to MOSFETS and power transistors at speeds in excess of 100 khz. Digital signal is resistant to noise. Less heat dissipated versus using resistors for intermediate voltage values. 8 4

Applications of PWM Motor control. Electric stove heater. Lamp dimmers. Voltage regulation convert 12 volts to 5 volts by having a 41.7% duty cycle. Sound production: PWM controlled signals give sound effects similar to a chorus. Power transfer: PWM used to reduce the total power given to a load without relying on resistive losses. 9 Average Value in PWM Low-pass filter smooths out transients from harmonic effects. 10 5

PWM Used to Transmit Data Clock signal is found inside PWM signal. More resistant to noise effects than binary data alone. Effective at data transmission over long distances. 11 Frequency of the PWM Signal Lower Limits Upper Limits 1. Must be at least 10 times higher than the control system frequency. 2. Higher than 20kHz audible frequency of sounds to avoid annoying sound disturbances, caused by magnetostriction. 3. If too low the motor is pulsed, not continuous, because the motor s inductance can not maintain the current. 4. Inverse of frequency should be much less than the motor/load time constant. 5. Higher error from ripple voltages. 1. If too high the inductance of the motor causes the current drawn to be unstable. 2. MOSFET transistor generates heat during switching. 3. Limited by resolution of controller. 4. Eddy currents generated in electromagnetic coils which lead to adverse heating. 5. Heat losses in electromagnetic materials is proportional to frequency squared. 12 6

1/22/16 Where can I Buy a PWM Controller? Texas Instruments Digikey Mouser Electronics Critical Velocity Motor Control SMALL Texas Instruments TAS5508B 8-Channel Digital Audio PWM Processor 64 pin chip, max 192 khz frequency $7.25 18 khz frequency Continuous 28 amps $55.95 120 amps, used for hybrid vehicles $469.00 H U G E 13 PWM Module Each channel has a dedicated counter Programmable duty and period Independently adjustable clock, polarity, and alignment 14 7

PWM Module - Other Features 16-bit and 32-bit resolution supported Two PWM channels can be concatenated together Four source clocks (A, SA, B, SB) Emergency Shutdown Some changes take a complete cycle to be implemented Modes of Operation: Normal: everything is available Wait: Low-power consumption and clock disabled Freeze: Option to disable clock is available 15 PWM Enable Register Located at $00E0 Code Warrior variable: PWME Set PWMEx to 0 to disable the channel Set PWMEx to 1 to enable it Channel is activated when bit is set If 16-bit resolution used, then PWME4/2/0 are deactivated 16 8

PWM Polarity Register Located at $00E1 Code Warrior variable : PWMPOL Set PPOLx to 0, signal goes from low to high Set PPOLx to 1, signal goes from high to low 17 PWM Clock Select Register Located at $00E2 Code Warrior variable : PWMCLK Set PCLK5/4/1/0 to 0 to use clock A Set PCLK5/4/1/0 to 1 to use clock SA Set PCLK3/2 to 0 to use clock B Set PCLK3/2 to 1 to use clock SB 18 9

PWM Prescaler Register Located at $00E3 Variable: PWMPRCLK Used to prescale clocks A and B Presclarer = Bus Clock Frequency ( Resolution ) ( PWM Frequency) Bus Clock Frequency = N (2 1) ( PWM Frequency) 19 PWM Scale A Register Located at $00E8 Code Warrior variable: PWMSCLA Store a hexadecimal value in order to change the clock frequency of SA Note: if set to $00, PWMSCLA is set to 256 Clock A Frequency Clock SA Frequency = 2 PWMSCLA 20 10

PWM Scale B Register Located at $00E9 Code Warrior variable: PWMSCLB Store a hexadecimal value in order to change the clock frequency of SA Note: if set to $00, PWMSCLB is set to 256 Clock B Frequency Clock SB Frequency = 2 PWMSCLB 21 PWM Center Align Register Located at $00E4 Code Warrior variable: PWMCAE Set CAEx to 0 for left align signal Set CAEx to 1 for center align signal Note: can only be set when channel is disabled 22 11

Signal Alignment Signal changes when counter is equal to period register In the center aligned mode, the PWM counter goes from a down-count to a up-count to down-count, etc. In the left aligned mode, the PWM counter is a up-counter and rests to zero when it overflows 23 PWM Control Register Located at $00E5 Code Warrior variable: PWMCTL Set CONxy to 0 to keep PWM channels separate (8-bit) Set CONxy to 1 to concatenate PWM channels x and y together (16- bit). Channel y determines the configuration x becomes the high byte and y becomes the low byte Bits PSWAI and PFRZ set either wait or freeze mode Changes only occur when channels are disabled 24 12

PWM Counter Register Located at $00EC through $00F1 Code Warrior variable: PWMCNTx One per channel It tracks the cycle counts It can be read If written to, the count is reset to $00 and a up-count starts 25 PWM Period Register Located at $00F2 through $00F7 Variable: PWMPERx Store a hexadecimal value to limit maximum value of counter Changes occur when: Current period ends Counter is written to Channel is disabled Left-Aligned: PWM Source Frequency PWMPERx = PWM Signal Frequency Center-Aligned: PWM Source Frequency PWMPERx = 2 PWM Signal Frequency 26 13

PWM Duty Register Located at $00F8 through $00FD Code Warrior variable: PWMDTYx Store a hexadecimal value to control when signal changes Changes occur when: Current period ends Counter written to Channel is disabled Duty Cycle PWMPERx Polarity = 0: PWMDTYx = PWMPERx - 100 Duty Cycle PWMPERx Polarity = 1: PWMDTYx = 100 27 PWM Shutdown Register Located at $00FE Code Warrior variable: PWMSDN PWMENA: Enables and disables emergency shut down PWMIF (Interrupt flag): Set when an input is detected in pin 5 PWMIE (Interrupt Enable): Enables and disables CPU interrupts PWMRSTRT: Resets the counters PWMLVL (Shutdown Output Level): Determines if output is high or low when shutdown PWM5IN (Input Status): Reflects status of pin 5 PWM5INL: Determines active level of pin 5 28 14

How it all works Clock A, SA, B, or SB 29 Example Desired Signal: 8 khz PWM signal Duty Cycle of 30% Left Aligned Channel 1 Low High 8-bit channel 6 8 10 Prescaler = 8 3 (2 1) ( 8 10 ) = 3.91 4 PWMPRCLK = $02 6 8 10 4 6 2 10 PWMPER1 = = = 250 $FA 3 3 8 10 8 10 30 250 PWMDTY1 = 250 - = 175 $AF 100 PWMCLK = $00 PWMCAE = $00 PWMPOL = $00 PWMCTL = $00 PWME = $02 30 15