Example 12 Pulse-Width Modulation (PWM): Motors and Servos Lecture L8.1.

Slides:



Advertisements
Similar presentations
MICROPROCESSORS AND MICROCONTROLLERS
Advertisements

Steering Servo How to control the car heading via a steering servo Team: //noComment Leader : Christian Software Specialist : Matt Hardware Specialist.
Design Constraints. Abstract  Design and build a compact robot to traverse a maze.  Use the robot to generate an ASCII representation of the entire.
Example 11 Analog-to-Digital Converter Lecture L5.1.
The Solar Tracker. Solar Tracking Project Team Members: –Cristian Ruvalcaba –Ken Seal –David Clark –Mark McKinley –Richard DeJarnatt.
Pulse-Width Modulated DAC Lecture 11.3 Section 11.5.
Amr Aldaiel - Andrew Kravitz Katie Noble - Zack Taylor - Alan Yim.
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
The Serial Peripheral Interface (SPI) Chapter 8 CML9S12-DP256.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
PWM ECE 4437-EMBEDDED SYSTEMS DR. GLOVER CHRISTOPHER AHN & KHOA VAN.
Timers and Event Counters
The miniDragon+ Board and CodeWarrior Lecture L2.1.
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Hybrid I/O – Pulses.
Instrumentation & Control Engg. Section Electrical Engineering Department Ahmedabad , Gujarat.
FREQUENCY COUNTER USING Silicon Labs C8051F020 microcontroller
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Al-Najah National University
ELE22MIC Lecture 18 The AVR Sleep Modes The ATMEGA128’s Timer System
Engineering 1040: Mechanisms & Electric Circuits Winter 2015 Introduction to C Programming.
CCP MODULES  The CCP module (Capture/Compare/PWM) is a peripheral which allows the user to time and control different events.  Capture Mode provides.
Motors Discussion D10.2 Chapter 15. Hans Christian Oersted (1777 – 1851) Ref:
Example 11 Analog-to-Digital Converter Lecture L5.1.
1 Timers and Event Counters Lecture In These Notes... We learn the basics of the Timer/Counter peripheral –Called timers by Renesas We examine how.
PWM Test 2 UNIT 20 로봇 SW 교육원 조용수. 학습 목표 PWM Servo 제어 2.
ECE 371 Microprocessor Interfacing
Chapter 12 Some PIC Microcontroller Advances The aims of this chapter are to introduce: To introduce in overview two microcontrollers which show some enhanced.
1 4-Integrating Peripherals in Embedded Systems (cont.)
PIC18F4431. PIC18F1330 Infrared Encoder/Decoder.
PULSE WIDITH MODULATION EE 587 Presented by Viswanadha Kakarlapudi.
Timer 1 and 2 operation, PWM Principles. Timer 1 Operation.
SGDRS Software System Design Justin A. King WWU EET Senior project 2013.
Motor TYWu.
[Lab10] Output PWM  Output PWM Signal  Example  Exercise(Optional)
Team 6. Guitar Audio Amplifier Audio Codec DSP Wireless Adapter Motor Array PC LCD Display LED Arrays Pushbutton or RPG Input Device
Closed Loop Temperature Control Circuit with LCD Display Mike Wooldridge ECE 4330 Embedded Systems.
Examples Lecture L2.2. // Example 1a: Turn on every other segment on 7-seg display #include /* common defines and macros */ #include /* derivative.
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16.
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Sitarambhai Naranjibhai Patel Institute Of Technology & R.C.
A.D.Patel institute of technology Sub : LCD and Keyboard interfacing with AVR. prepared by, chokshi abhi p ( ) Guided by, Prof. Asif Thakor.
Module 8 Tutorial  An 8086 system is used for controlling the speed of a motor. The motor can operate at 5 different speeds (1- 5).  The speed.
Microcontroller basics Embedded systems for mortals.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
Team 7 Chaofan Chen Dhruvmin Gandhi Larry Gerhardt Pulse-width Modulation with the TIVA C.
ME6405 The George W. Woodruff School of Mechanical Engineering ME 4447/ME6405 Microprocessor Control of Manufacturing Systems/Introduction to Mechatronics.
ECE 382 Lesson 32 Lesson Outline Lab 6 Introduction Pulse Width Modulation Capture / Compare Example Lab 6 Tips Admin Lab#6 “prelab” due BOC lesson 33.
Why are Timer Functions Important?
Example 14 Real-time Interrupts
4-Integrating Peripherals in Embedded Systems
Example 19 Measuring Pulse Widths Using Interrupts
4-Integrating Peripherals in Embedded Systems
Example 10 ASCII String to Binary Conversion
Example 5 Pushbutton Switches: S1 and S2
Example 9 Binary to ASCII String Conversion
Example 6 Hex Keypad Lecture L3.2.
Pulse-Width Modulation (PWM)
Example 15 Interrupt-Driven Controller
Example 16 Circular Queue
Example 13 The Serial Peripheral Interface (SPI)
Analog-to-Digital Converters
Example 17 SCI Receive Interrupts
Example 7 Liquid Crystal Display
AUTOCAR Team #13 Greg Futia Greg VonFange Phil Kasper Ani Bhende.
The Two Wheel Deal Theory of Operation Team 12 Greg Eakins Eric Geier
Example 18 Pulse Train Using Interrupts
05 | Integrating Advanced Sensors and Shields
Presentation transcript:

Example 12 Pulse-Width Modulation (PWM): Motors and Servos Lecture L8.1

PIM_9DP256 Block Diagram PWM Port

PWM Pins PP0 – PP7 Pins 4,3,2,1, 112,111,110,109

PWM Pins PP0 – PP7 Pins 4,3,2,1, 112,111,110,109

Motor Driver Circuit Solid-state relay

G3VM-61B1 MOS FET Relays

Motor – Generator Experiment

Using an AC Relay

Pulse-Width Modulation

// Example 12a: Motor demo #include /* common defines and macros */ #include /* derivative information */ #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" void main(void) { int val; int speed; PLL_init();// set system clock frequency to 24 MHz ad0_enable(); // enable a/d converter 0 lcd_init(); // enable lcd motor1_init(); // enable 8-bit pwm1 for motor while(1) { val = ad0conv(7); // speed = val >> 2;// set_lcd_addr(0x40);// 2nd line of lcd display write_int_lcd(speed);// display speed motor1(speed); // set motor speed ms_delay(100);// delay 100 ms }

Controlling the Position of a Servo using PWM

// Example 12b: Servo demo #include /* common defines and macros */ #include /* derivative information */ #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" void main(void) { int val; int width; PLL_init();// set system clock frequency to 24 MHz ad0_enable(); // enable a/d converter 0 lcd_init(); // enable lcd servo1_init(); // enable pwm1 for servo while(1) { val = ad0conv(7); // width = (val << 1) ; // width: set_lcd_addr(0x40);// line 2 of lcd display write_int_lcd(width);// display width on lcd set_servo1(width); // move servo to pos width ms_delay(100);// delay 100 ms }