PWM Pulse Width Modulation

Slides:



Advertisements
Similar presentations
By: Zak Ahmad Phuc Dao Joel Toussaint. Outline Introduction PWM Definitions Generation Types PWM on the HCS 12 Applications 2 Presented by Zak Ahmad.
Advertisements

Analog-to-Digital Converter (ADC) And
8253/54 Timer Section /54 Timer Description and Initialization
PWM Pulse Width Modulation
SPI Serial Peripheral Interface. SPI Serial Peripheral Interface is communication between two devices, one bit at a time sequential one bit at time over.
Abstract Conclusion PWM Modulating Signal Results Generation of DSP-based patterns to control three phase inverters substantially helped the development.
FREQUENCY SHIFT KEYING
Digital to Analog and Analog to Digital Conversion
Announcements Assignment 8 posted –Due Friday Dec 2 nd. A bit longer than others. Project progress? Dates –Thursday 12/1 review lecture –Tuesday 12/6 project.
Data Acquisition Risanuri Hidayat.
5/4/2006BAE Analog to Digital (A/D) Conversion An overview of A/D techniques.
Lecture 9: D/A and A/D Converters
1. Output signal alternates between on and off within specified period Controls power received by a device The voltage seen by the load is directly proportional.
DIGITAL SYSTEMS TCE INTERFACING WITH ANALOG DEVICES (Week 12)
Analogue to Digital Conversion
EET260: A/D and D/A converters
Part A: Controlling Oscillation Frequency with Capacitors and Resistors Part B: Diodes and Light Experiment Timer.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
COMP3221: Microprocessors and Embedded Systems Lecture 20: Analog Output Lecturer: Hui Wu Session 2, 2004.
Electronic Instrumentation 1 Experiment 7 Digital Logic Devices and the 555 Timer Part A: Basic Logic Gates Part B: Flip Flops Part C: Counters Part D:
IT-101 Section 001 Lecture #15 Introduction to Information Technology.
Pulse Width Modulation
Pulse Width Modulation Professor: Dr. Miguel Alonso Jr.
Pulse Width Modulation A Student Presentation By: Wayne Maxwell Martin Cacan Christopher Haile.
Digital I/O Connecting to the Outside World
Digital to Analog Converters
Electronic Metronome Using a 555 Timer.
General Licensing Class G7A – G7C Practical Circuits Your organization and dates here.
Power Electronics and Drives (Version ) Dr. Zainal Salam, UTM-JB 1 Chapter 3 DC to DC CONVERTER (CHOPPER) General Buck converter Boost converter.
Digital Fundamentals Floyd Chapter 1 Tenth Edition
8253 TIMER. Engr 4862 Microprocessors 8253 / 8254 Timer A.k.a. PIT (programmable Interval Timer), used to bring down the frequency to the desired level.
PIT: Programmable Interval Timer
ACOE2551 Microprocessors Data Converters Analog to Digital Converters (ADC) –Convert an analog quantity (voltage, current) into a digital code Digital.
PHY 202 (Blum)1 Analog-to-Digital Converter and Multi-vibrators.
PHY 202 (Blum)1 Analog-to-Digital Converter and Multi-vibrators.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals with PLD Programming.
PWM Circuit Based on the 555 Timer. Introduction In applications LED Brightness Control we may want to vary voltage given to it. Most often we use a variable.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
1 ELE5 COMMUNICATIONS SYSTEMS REVISION NOTES. 2 Generalised System.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
8254 Timer.
Floyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd © 2008 Pearson Education Chapter 1.
Digital to Analog Converter (DAC)
Mark Neil - Microprocessor Course 1 Digital to Analog Converters.
Guide Presented by Mr.M Cheenya V.Abhinav Kumar 11E31A0422 Asst.Professor K.Shiva Kumar 11E31A0423 K.Rajashekhar 11E31A0424 K.Chaithanya Sree 11E31A0428.
By: Devon Schmidt & Kyle Da Rif Instructor: Stanislaw Legowski Senior Design 2012/2013.
Chapter 9 CAPACITOR.
ARM CORTEX (STM32) BASED MOTOR SPEED CONTROL SUBMITTED BY EDGEFX TEAM.
Residential Audio & Video Systems Copyright © 2005 Heathkit Company, Inc. All Rights Reserved Presentation 15 – Digital Audio and Video.
UNIT III DC Choppers.
Why are Timer Functions Important?
PULSE MODULATION.
EKT124 Digital Electronics 1 Introduction to Digital Electronics
Timers and Event Counters
Homework Reading Machine Projects Labs
Digital Fundamentals Floyd Chapter 1 Digital concepts Tenth Edition
Chapter 13 Linear-Digital ICs
Digital Communication
Programmable Interval Timer
Oct 30 Announcements Code Marked and on Blackboard
Electronic Instrumentation
Pulse Width Modulation (PWM)
Oct 30 Announcements Code Marked and on Blackboard
CBC Fundamentals Lecture is based on material from Robotic Explorations: A Hands-on Introduction to Engineering, Fred Martin, Prentice Hall, 2001.
ECE 354 Computer Systems Lab II
Digital Theremin with LED
ME 4447/6405 Pulse Width Modulation (PWM)
General Licensing Class
Digital Fundamentals Floyd Chapter 1 Tenth Edition
Applications of Basic Electronics Components
Presentation transcript:

PWM Pulse Width Modulation ME 4447/6405 November 3rd, 2011 Gregory Bonisteel Bryan Oneal Jieun Yoo

Outline Introduction and Definition Types of PWM Method of Generation Duty Cycle Types of PWM Method of Generation Implementation on the HCS12 Applications of PWM Choosing PWM Frequency

Presenter: Jieun Yoo Introduction and Definition Types of PWM Duty Cycle Types of PWM Method of Generation Implementation on the HCS12 Applications of PWM Choosing PWM Frequency

Definition Pulse Width Modulation (PWM) is the way of controlling a digital signal simulating an analog signal. The on-off behavior changes the average power of signal. Output signal alternates between on and off with in specified period.

Duty Cycle A percentage measurement of how long the signal stays on. Period (T) Duty Cycle (D) VL VH On Off

Duty Cycle Duty Cycle: Average signal : (Usually, VL is taken as zero volts for simplicity.) Period (T) Duty Cycle (D) VL VH On Off

Duty Cycle Characteristic Presented by: Bryan O’Neal Duty Cycle Characteristic The average value of a PWM signal increases linearly with the duty cycle

Types of PWM – Lead Edge Modulation The lead edge is fixed at the lead edge of the window and the trailing edge is modulated.

Types of PWM – Trail Edge Modulation The trail edge is fixed and the lead edge is modulated.

Types of PWM – Centered Pulses The pulse center is fixed in the center of the time window and both edges of pulse are modulated

Analog Generation of PWM Analog PWM signals can be made by combining a saw- tooth waveform and a sinusoid PWM output is formed by the intersection of the saw-tooth wave and sinusoid

Digital Generation - Delta Method Output signal compared with limits Every time limits reached, changes state

Digital Generation - Delta Sigma Method PWM signal generated by Delta method Error = output – reference Error integrated State changes when integration reaches limits

Presenter: Gregory Bonisteel Introduction and Definition Duty Cycle Types of PWM Method of Generation Implementation on the HCS12 Applications of PWM Choosing PWM Frequency

Pulse Width Modulator: PWM8B6CV1 Similar to output compare Port P Six 8-bit channels or three 16-bit channels for greater resolution Four clock sources (A, B, SA and SB) provide for a wide range of frequencies Emergency shutdown Modes of operation Wait mode Freeze mode

PWM Block Diagram Each Channel has; Enable/disable switch Dedicated counter Programmable period and duty cycle Programmable center or left aligned Programmable clock select logic Software selectable duty pulse polarity

PWM Register Memory Map

PWM Enable Register Located at $00E0 Set PWMEx to 0 to disable the channel Set PWMEx to 1 to enable it Note: Channel is activated when bit is set If 16-bit resolution used, then PWME4/2/0 are deactivated

PWM Polarity Register Located at $00E1 Set PPOLx to 0, signal goes from low to high Set PPOLx to 1, signal goes from high to low

PWM Clock Select Register Located at $00E2 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

PWM Prescale Clock Select Register Located at $00E3 Used to prescale clocks A and B

PWM Center Align Enable Register Located at $00E4 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 Signal changes when counter is equal to period register

Left vs. Center Aligned In the left aligned mode, the PWM counter is a up-counter and rests to zero when it overflows In the center aligned mode, the PWM counter goes from a down-count to a up-count to down-count, etc.

PWM Control Register Located at $00E5 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). x becomes the high byte and y becomes the low byte Channel y determines the configuration Bits PSWAI and PFRZ set either wait or freeze mode Note Changes only occur when channels are disabled

PWM Scale A Register Located at $00E8 Programmable scaling of clock A to generate clock SA Note

PWM Scale B Register Located at $00E9 Programmable scaling of clock B to generate clock SB Note

PWM Channel Counter Register Located at $00EC through $00F1 One per channel It tracks the cycle counts When channel is enabled up-count starts Note Writing to counter while a channel is enable can cause irregular PWM cycles

PWM Channel Period Register Located at $00F2 through $00F7 PWMPERx Store a hexadecimal value to limit maximum value of counter Changes occur when one of following happen Current period ends Counter is written to Channel is disabled

PWM Channel Duty Register Located at $00F8 through $00FD Store a hexadecimal value to control when signal changes Changes occur when: Current period ends Counter written to Channel is disabled

PWM Shutdown Register $00FE

Example: Configuring PWM Channel 0 Frequency: 40 kHz Period = 1/Frequency = 25μs Duty Cycle = 50% Positive polarity Left aligned output To choose clock source, consider resolution of PWM Number of distinct duty cycle values is equal to the PWM period in clock cycles Bus clock period is 125 ns  200*125ns = 25μs Since 200 < 255, we can use clock A with a prescaler=1

PWMCLK = #$00 - PWM0 uses clock A PWMPRCLK = #$00 - Prescaler = 1 Example: Configuring PWM Channel 0 PWMCLK = #$00 - PWM0 uses clock A PWMPRCLK = #$00 - Prescaler = 1 PWMPOL = #$01 - Positive polarity PWMCAE = #$00 - Left aligned PWMPER0 = #$C8 - Period = 200 PWMDTY0 = #$64 - Duty cycle = 100/200 = 50% PWME = #$01 - Enable PWM channel 0

Assembly Code PWME EQU $00E0 PWMCAE EQU $00E4 PWMDTY0 EQU $00F8 PWMPER0 EQU $00F2 PWMPOL EQU $00E1 PWMCLK EQU $00E2 PWMPRCLK EQU $00E3 ORG $1000 LDAA #$00 STAA PWMCLK ;Use Clock A STAA PWMPRCLK ;Clock A prescaler = 1 STAA PWMCAE ;Left aligned output LDAA #$01 STAA PWMPOL ;Positive polarity (starts high) LDAA #$C8 STAA PWMPER0 ;Period = 200 (25μs) LDAA #$64 ;100 decimal STAA PWMDTY0 ;Duty cycle = 50% (100/200) LDAA #$01 STAA PWME ;Enable PWM Channel 0 ...

Configuring Channel 0 in C Code // Setup chip in expanded mode MISC = 0x03; PEAR = 0x0C; MODE = 0xE2; TERMIO_Init(); // Init SCI Subsystem EnableInterrupts; PWMPER0 = 200; // set PWM period (125 ns * 200 = 25 us = 40 kHz) PWMDTY0 = 100; // set initial duty cycle (100/200 = 50%) // setup PWM system PWMCLK_PCLK0 = 0; // set source to clock A PWMPRCLK_PCKA0 = 0; // set prescaler for clock A = 1, so clock A = bus clock PWMPRCLK_PCKA1 = 0; PWMPRCLK_PCKA2 = 0; PWMCAE_CAE0 = 0; // "left aligned" output PWMPOL_PPOL0 = 1; // set duty cycle to indicate % of high time PWMCNT0 = 0; // write to counter to make changes take effect PWME_PWME0 = 1; // enable PWM 0

Presenter: Bryan Oneal Introduction and Definition Duty Cycle Types of PWM Method of Generation Implementation on the HCS12 Applications of PWM Choosing PWM Frequency

PWM Video Into to Applications You Tube search: PWM Tutorial OR Click Link

Motivation for PWM In the past, motors were controlled at intermediate speeds by using variable resistors to lower delivered power For example, a variable resister located in the foot pedal and connected in series with the motor of a sewing machine was used to control its speed. This method was inefficient PWM provided a great way to have compact and low cost means for applying adjustable power for many devices.

PWM Applications Use as ADC DC Motors Telecommunications Voltage regulation RC devices Audio/Video effects Power delivery Amplification

PWM used with D/A conversion commonly used in toys lowpass filter smooths out transients from harmonic effects frequency values of harmonics doesn’t change, but the amplitude does, which adjusts the analog output signal

Application to DC Motors Voltage supplied is directly proportional to the duty cycle Ability to control the speed of the motor via the duty cycle Example Can be used in regulating room temperature. A PC can sense the current temperature (using an analog-to-digital converter) and then automatically increase/decrease the fan's speed accordingly.

PWM used to transmit data in telecommunications clock signal is found “inside” PWM signal more resistant to noise effects than binary data alone effective at data transmission over long distance transmission lines The widths of the pulses correspond to specific data values encoded at one end and decoded at the other. Pulses of various lengths (the information itself) will be sent at regular intervals (the carrier frequency of the modulation).

Using PWM to generate an analog voltage level Any shape waveform can be created PWM frequency should be much higher than the frequency of waveform generated

RC Devices Transmitters send PWM signals to the receivers on board of Radio controlled devices for specific control.

Audio devices Used in audio amplifiers to generate output signals for cellphone speakers to high-power stereo systems Produce less heat than traditional analog amplifiers Saving energy. Critical for hand held electronics. Gives a sound effect similar to chorus when used in audio circuit.

Video devices PWM dimming provides superior color quality in LED video display With a 12 bits resolution the TLC5940 PWM dimming can provide up to 68.7 million colors to a pixel.

Power delivery effective at data transmission over long distance transmission line Power transfer: PWM used to reduce the total power given to a load without relying on resistive losses

Example: PWM with 555 Timer Potentiometer is used to adjust the duty cycle

Brightness controlled with a PWM circuit.

Frequency of the PWM Signal Lower Limits Upper Limits Must be at least 10 times higher than the control system frequency Higher than 20kHz – audible frequency of sounds to avoid annoying sound disturbances. If too low the motor is pulsed, not continuous, because the motor’s inductance can not maintain the current Inverse of frequency should be much less than the motor/load time constant Higher error from ripple voltages If too high the inductance of the motor causes the current drawn to be unstable MOSFET transistor generates heat during switching Limited by resolution of controller Eddy currents generated in electromagnetic coils which lead to adverse heating Heat losses in electromagnetic materials is proportional to frequency squared

Choosing your PWM frequency Input signal (PWM) Output signal (actuator response)

Matlab can do PWM! The procedure works similar to the generation of analog PWM using a sinusoid and saw-tooth wave

HUGE Where can I buy a PWM controller? Large - Texas Instruments - Digikey - Mouser Electronics - Critical Velocity Motor Control HUGE Large 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