Laboratory: Introduction to Mechatronics. Lab 5. DC Motor Speed Control Using PWM

Similar documents
For the op amp circuit above, how is the output voltage related to the input voltage? = 20 k R 2

Lab Exercise 6: Digital/Analog conversion

ME 4447 / ME 6405 MICROPROCESSOR CONTROL OF MANUFACTURING SYSTEMS / INTRODUCTION TO MECHATRONICS

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

University of Pittsburgh

Designing with a Microcontroller (v6)

EMBEDDED BOOST CONVERTER USING VOLTAGE FEEDBACK TECHNIQUE

Direct Current Waveforms

Pulse Width Modulation

6. HARDWARE PROTOTYPE AND EXPERIMENTAL RESULTS

EE 3101 ELECTRONICS I LABORATORY EXPERIMENT 9 LAB MANUAL APPLICATIONS OF IC BUILDING BLOCKS

LINEAR IC APPLICATIONS

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

Intro To Engineering II for ECE: Lab 7 The Op Amp Erin Webster and Dr. Jay Weitzen, c 2014 All rights reserved.

PWM CONTROL USING ARDUINO. Learn to Control DC Motor Speed and LED Brightness

Laboratory Design Project: PWM DC Motor Speed Control

MAE106 Laboratory Exercises Lab # 3 Open-loop control of a DC motor

CHAPTER 4 CONTROL ALGORITHM FOR PROPOSED H-BRIDGE MULTILEVEL INVERTER

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

Experiment 9 : Pulse Width Modulation

When you have completed this exercise, you will be able to relate the gain and bandwidth of an op amp

University of Pennsylvania. Department of Electrical and Systems Engineering. ESE Undergraduate Laboratory. Analog to Digital Converter

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 3157 Electrical Engineering Design II Fall 2013

LINEAR APPLICATIONS OF OPERATIONAL AMPLIFIERS

ASTABLE MULTIVIBRATOR

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss

Calhoon MEBA Engineering School. Study Guide for Proficiency Testing Industrial Electronics

Learning Objectives:

o What happens if S1 and S2 or S3 and S4 are closed simultaneously? o Perform Motor Control, H-Bridges LAB 2 H-Bridges with SPST Switches

ECE 363 EXAM #2 (F18) 4 problems for 100 pts Problem #1: Amplifier Output Error (25 pts)

BANGLADESH UNIVERSITY OF ENGINEERING & TECHNOLOGY

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab Timer: Blinking LED Lights and Pulse Generator

CHAPTER 7 MAXIMUM POWER POINT TRACKING USING HILL CLIMBING ALGORITHM

Lab 5 Timer Module PWM ReadMeFirst

Field Effect Transistors

Pulse-Width-Modulation Motor Speed Control with a PIC (modified from lab text by Alciatore)

Electronics Design Laboratory Lecture #6. ECEN2270 Electronics Design Laboratory

EDE1204 Bi-Polar Stepper Motor IC

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Lab 8. Stepper Motor Controller

Lab 2 Operational Amplifier

Analog Electronic Circuits Lab-manual

EE 110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab 0: Course Introduction

Physics 335 Lab 7 - Microcontroller PWM Waveform Generation

MICROCONTROLLER TUTORIAL II TIMERS

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

Activity 4: Due before the lab during the week of Feb

Carleton University. Faculty of Engineering and Design, Department of Electronics. ELEC 2507 Electronic - I Summer Term 2017

Module 9C: The Voltage Comparator (Application: PWM Control via a Reference Voltage)

Control System Circuits with Opamps

Project Proposal. Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen

EE 308 Lab Spring 2009

Touchless Control: Hand Motion Triggered Light Timer

CENG4480 Embedded System Development and Applications The Chinese University of Hong Kong Laboratory 1: Op Amp (I)

Electronic Concepts and Troubleshooting 101. Experiment 1

Cornerstone Electronics Technology and Robotics Week 21 Electricity & Electronics Section 10.5, Oscilloscope

Prelab 10: Differential Amplifiers

Training Schedule. Robotic System Design using Arduino Platform

Stepping motor controlling apparatus

Dev Bhoomi Institute Of Technology Department of Electronics and Communication Engineering PRACTICAL INSTRUCTION SHEET REV. NO. : REV.

Electronics. RC Filter, DC Supply, and 555

School of Engineering Mechatronics Engineering Department. Experim. ment no. 1

MD04-24Volt 20Amp H Bridge Motor Drive

CHAPTER ELEVEN - Interfacing With the Analog World

ARDUINO BASED SPWM THREE PHASE FULL BRIDGE INVERTER FOR VARIABLE SPEED DRIVE APPLICATION MUHAMAD AIMAN BIN MUHAMAD AZMI

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

DESIGN OF SWITCHED MODE POWER SUPPLY

LM4: The timer unit of the MC9S12DP256B/C

ET475 Electronic Circuit Design I [Onsite]

ME 461 Laboratory #2 Timers and Pulse-Width Modulation

Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some

ELCT 912: Advanced Embedded Systems

Minnesota State College Southeast ELEC 2260: Linear Integrated Circuits

DC motor control using arduino

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

CHAPTER 4 FUZZY BASED DYNAMIC PWM CONTROL

Electronics I. laboratory measurement guide

5 TIPS FOR GETTING THE MOST OUT OF Your Function Generator

ECEN Network Analysis Section 3. Laboratory Manual

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

Modeling, Simulation and Implementation of Speed Control of DC Motor Using PIC 16F877A

Digital to Analog Converters (DAC) Adam Fleming Mark Hunkele 3/11/2005

Chapter 5: Signal conversion

EE 314 Spring 2003 Microprocessor Systems

EE 230. Electronic Circuits and Systems. Randy Geiger 2133 Coover

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview

Massachusetts Institute of Technology MIT

DIGITAL ELECTRONICS ANALOG ELECTRONICS

PreLab 6 PWM Design for H-bridge Driver (due Oct 23)

EE 230 Lab Lab 9. Prior to Lab

Micro Controller Based Ac Power Controller

PIC Analog Voltage to PWM Duty Cycle

P a g e 1. Introduction

Pulse-Width Modulation (PWM)

COSC 3215 Embedded Systems Laboratory

Timer A (0 and 1) and PWM EE3376

MD03-50Volt 20Amp H Bridge Motor Drive

Experiment (2) DC Motor Control (Direction and Speed)

PWM LED Color Control

Standard single-purpose processors: Peripherals

Transcription:

Laboratory: Introduction to Mechatronics Instructor TA: Edgar Martinez Soberanes (eem370@mail.usask.ca) 2017-03-15 Lab 5. DC Motor Speed Control Using PWM

Lab Sessions Lab 1. Introduction to the equipment and tools to be used in the lab, which include the development board (PICDEM 2 Plus),the microcontroller (PIC 16F1937), and the USB Oscilloscope (Analog Discovery). Lab 2. Experiment 2: Transistor Operation, Experiment 3: Passive filters, and an Op-Amp circuit experiment. Lab 3. Experiment 7: LED Control and Interruptions. Lab 4. Experiment 10: Stepper Motor Motion Control. Lab 5. Experiment 11: DC Motor Speed Control Using PWM. Lab 6. Experiment 12: Closed Loop DC Motor Position Control. 2

Lab 1. Outline Objective. Lecture o o Pulse Width Modulation (PWM). H-Bridge Circuit Time for the experiments. 3

Objective Objectives o To control the speed of a DC motor using a PWM signal from the PIC microcontroller in conjunction with an H-bridge amplifier circuit 4

Pulse Width Modulation (PWM) PWM signals are ON OFF signals (Pulses) whose HIGH or ON duration is changed (Width Modulation) in accordance with our requirements. o PWM is one of the simple and most commonly used techniques to produce analog voltages from digital signals. o Applications: Digital to Analog Converter (DAC), DC Motor Speed Control, Sine Wave Inverters, Brightness control etc. 5

This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. 6

The PWM frequency is generally constant in the khz range. It has to be high enough to be seen by the powered system as a continuous signal. Duty Cycle is the percentage time that the signal is in the ON state versus the OFF state. DDDDDDDD CCCCCCCCCC % = PPPPPPPPPP WWWWWWWWW PPPPPPPPPPPP 100 7

PWM in the PIC microcontroller PWM signal can be easily generated using CCP modules available in the PIC microcontroller. CCP stands for Capture / Compare / PWM, which means that it can be used for Capture or Compare or PWM operations. The PWM standard mode makes use of one of the 8-bit timers (Timer2/4/6) to specify the PWM period. The period, duty cycle, and resolution are controlled by the following registers: o PRx registers o TxCON registers o CCPRxL registers o CCPxCON registers 8

The PWM period is specified by the PRx register of Timer2/4/6. The PWM period can be calculated using the formula: PPPPPP PPPPPPPPPPPP = (PPPPPP + 1)(4) 1 FFFFFFFF TTTTTTTT PPPPPPPPPPPPPPPP VVVVVVVVVV The PWM duty cycle is specified by writing a 10-bitvalue to two registers: CCPRxL register and DCxB<1:0> bits of the CCPxCON register. TheCCPRxL contains the eight MSbs and the DCxB<1:0>bits of the CCPxCON register contain the two LSbs. PPPPPPPPPP wwwwwwwwww = (CCCCCCCC) 1 FFFFFFFF TTTTTTTT PPPPPPPPPPPPPPPP VVVVVVVVVV 9

Example Suppose PR register of Timer2 has a value of 0x50 and the Internal clock is set at 4MHz. We want to determine the PWM Period and the CCPR value that would result in a Duty Cycle of 50%. PPPPPP PPPPPPPPPPPP = (PPPPPP + 1)(4) 1 FFFFFFFF TTTTTTTT PPPPPPPPPPPPPPPP VVVVVVVVVV = 80 + 1 4 1 4MMMMMM 1 = 8888 nnnn PPPPPPPPPP wwwwwwwwww = (CCCCCCCC) 1 FFFFFFFF TTTTTTTT PPPPPPPPPPPPPPPP VVVVVVVVVV CCPR = PPPPPPPPPP wwwwwwwww FFFFFFFF TTTTTTTT PPPPPPPPPPPPPPPP VVVVVVVVVV CCPR = 40.5 nnnn 4MMMMMM 1 = 111111 = 0000 11111111 00000000 10

Summary To setup a PWM signal in the PIC: 1.Select a timer to use (Timer 2/4/6) 2.Set the PWM period by writing a value in the PRx register of the Timer chosen. 3.Define the Duty Cycle by writing the CCPR value. 11

H-Bridge Circuit The H-bridge circuit enables a voltage to be applied across a load in either direction. In DC motor applications this is required to be able to change direction of rotation. A H-bridge comprises four MOSFET power transistors (two PNP and two NPN) 12

PWM Signal 1 PWM Signal 2 13

14

Code Example 15

Thanks 16