Outline Introduction to digital-to-analog converter (DAC)

Slides:



Advertisements
Similar presentations
1. Instrument Clusters Theory Support Automotive – Displays & Accessories 1 of 13 Instrument Clusters Topics covered in this presentation: Analog Instrument.
Advertisements

EMS1EP Lecture 8 Pulse Width Modulation (PWM)
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Basic DC Motor Circuits
Potentiometer Electric circuit Cell or Battery Resistor Switch Bulb Earth/Ground LED.
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.
L.
SENIOR DESIGN 10/16.
Servo Control Using Analog Signal Obtain “analog” input using analogRead().
Micromouse Meeting #3 Lecture #2 Power Motors Encoders.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
September, 2007ENGR Low-Level Robot Control Mechatronics: Motors, sensors & embedded controls.
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi. Objectives 1. Control the rotation of standard servo motor  A standard servo motor is limited in its rotation.
Lecture 15: Digital to Analog Converters Lecturers: Professor John Devlin Mr Robert Ross.
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.
STEPPER MOTORS Name: Mr.R.Anandaraj Designation: Associate. Professor Department: Electrical and Electronics Engineering Subject code :EC 6252 Year: II.
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Microprocessors Tutorial 2: Arduino Robotics. Agenda 1. Robot Anatomy 2. Sensor Review 3. PWM 4. MAKE: Fade 5. Motors 6. H Bridge 7. Robot Control library.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Data Acquisition Device (DAQ) A DAQ is a cool little device that allows you to interface hardware to a computer. Here is what we will do:  Create a square.
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
Analog Output Materials: animatronic head Processing Quiz HW: code links.
Throttle Arduino RC Receiver Stock Golf Cart Motor Controller Motor 1 PWM signal: Voltage: 0 – 5V Period = 22ms Positive Pulse Width: 1ms – 2ms Digital.
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
DC motor principles Speed control Direction Stepper motor principles
Electronic instrumentation Digitization of Analog Signal in TD
Pulse-Width Modulation: Simulating variable DC output
INTERNET OF EVERYTHING SDU 2016 Week 8. Visual Output  Lets the Arduino show off  Arduino supports a broad range of LED devices  Use digital and analog.
Microcontroller basics Embedded systems for mortals.
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
Different Types of Voltage Regulators with Working Principle.
ME6405 The George W. Woodruff School of Mechanical Engineering ME 4447/ME6405 Microprocessor Control of Manufacturing Systems/Introduction to Mechatronics.
BM-305 Mikrodenetleyiciler Güz 2016 (3. Sunu)
Introduction to Motors, servos and steppers
Introduction In this lab , we will learn
simple example program to control a DC-Motor
What is a DAC? A digital to analog converter (DAC) converts a digital signal to an analog voltage or current output DAC.
Microcontroller basics
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Electronic Devices Ninth Edition Floyd Chapter 13.
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
Feedback No feedback : Open loop (used in comparators)
Predefined Speed Control of BLDC Motor
Prof. Chung-Ta King Department of Computer Science
AC and DC motors.
Arduino - Introduction
Inverters Dr John Fletcher.
DC MOTOR SPEED CONTROL 1. Introduction
BM-305 Mikrodenetleyiciler Güz 2017 (3. Sunu)
Electric Motors.
Pulse Width Modulation (PWM) Motor Feedback - Shaft Encoder
Binary Counter Thinking Digitally
Arduino Analog I/O Analog input pins: 0 – 5
CBC Fundamentals Lecture is based on material from Robotic Explorations: A Hands-on Introduction to Engineering, Fred Martin, Prentice Hall, 2001.
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Digital to Analog Converters (DAC)
Conversation between Analogue and Digital System
Arduino : Introduction & Programming
Assist. Prof. Rassim Suliyev - SDU 2018
Sensors and actuators Sensors Resistive sensors
Manual Robotics ..
Prof. Chung-Ta King Department of Computer Science
UNIT 11: RC-SERVOMOTOR CONTROL
Robotics System Lecture 11_12: DC Motor
UNIT 5 Analog signals.
Chapter 7 Converters.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

CS4101 嵌入式系統概論 DAC and PWM Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan

Outline Introduction to digital-to-analog converter (DAC) Pulse-width modulation (PWM) Introduction to stepper motor

ADC We have learned that we can quantify a nature value by ADC. We can also transform digital value into analog signals, e.g. control motors, generate sounds, ... Analog signal Digital signal DAC Analog signal Binary input IN OUT

Digital-to-Analog Converter (DAC) DAC converts digital values into analog signals by producing different proportions of voltage according to the binary input. Voltage can be generated by modifying different resistors I - + R 2R 4R 2n-1R Rf Vout Vref V1 V2 V3 Vn inverting summer Op Amp circuit MSB LSB (D. Hinckley, L. Huynh, D. Kim)

DAC Example – RGB LED If we give LED more power, it will be brighter. So we can use this feature to intensify Red, Blue and Green diode through a DAC.

RGB LED Animation Reference : Matthew Beckler's Home Page (https://www.mbeckler.org/microcontrollers/rgb_led/)

Outline Introduction to digital-to-analog converter (DAC) Pulse-width modulation (PWM) Introduction to stepper motor

Pulse-width Modulation (PWM) We can use DAC to control the output voltage, but this usually requires an additional chip. Pulse-width modulation (PWM) provides the ability to simulate varying levels of outputs. Thus, we can use PWM to convert digital signals into analog intensities without DAC.

Pulse-width Modulation A PWM signal: Different duty cycles imply different average power. Duty Cycle = (PW/T) * 100%, where PW is pulse width time and T is total period of a signal. Ex.: A 90% duty cycle means the signal is high 90% of the time and low 10% of the time. 

Example of Duty Cycle If high voltage = 5 V and duty cycle = 10%, then the average output voltage = 0.5 V

PWM for Driving RGB LED (https://developer.mbed.org/users/4180_1/notebook/rgb-leds/) (https://www.pjrc.com/teensy/rgb_led.gif)

PWM in Arduino 6 pins, 3, 5, 6, 9, 10, 11, marked by ~ can produce PWM output via analogWrite(pinNumber, dutyCycle)

PWM in Arduino - analogWrite() analogWrite(pin, value) Writes an analog value (PWM wave) to a pin. Value specifies the duty cycle between 0 (always off) and 255 (always on). Pin will generate a steady square wave of the specified duty cycle until the next call to analogWrite(). The frequency of the PWM signal on most pins is approximately 490 Hz. On Arduino UNO, pins 5 and 6 have a frequency of approximately 980 Hz. http://garretlab.web.fc2.com/en/arduino/inside/arduino/wiring_analog.c/analogWrite.html

Outline Introduction to digital-to-analog converter (DAC) Pulse-width modulation (PWM) Introduction to stepper motor

Stepper Motor An electromagnetic device that Precision Converts digital pulses into mechanical shaft rotation Ex. analog clock Precision Determined primarily by the number of steps per revolution (coecsl.ece.illinois.edu/ge423/sensorprojects/StepMotor.ppt)

Stepper Motor Controlled by a series of electromagnetic coils The coils are alternately given current. The creating magnetic fields will repulse or attract the magnets on the shaft, causing the motor to rotate. (http://www.electronics-tutorials.ws/io/io_7.html)

Example Stepper Motor: 28BYJ-48 Number of phases: 4 Step angle: 8-step sequence: 5.625° (64 steps per revolution) 4-step sequence: 11.25° (32 steps per revolution) Gear reduction ratio: 1/64 32*64 = 2048 steps per revolution in 4-step sequence

Stepper Motor Driver  The output voltage provided by Arduino UNO cannot drive 28BYJ-48. So we need to use an amplifier, ULN2003, to raise the output voltage. 4 LEDs indicate which coil is currently powered

Drive Methods Different drive methods for stepper motors. Different methods cause different shakiness, power consumption and accuracy. 1-phase excitation 2-phase excitation

Stepper.c Arduino stepper library uses 2-phase excitation to rotate the motor.

Sample Code for Stepper Motor #include <Stepper.h> // change this to the number of steps on your motor #define STEPS 100 // create an instance of the stepper class, specifying # of steps of the motor and the pins it is attached to Stepper stepper(STEPS, 8, 9, 10, 11); // the previous reading from the analog input int previous = 0; void setup() { stepper.setSpeed(30); // set the speed to 30 RPMs }

Sample Code for Stepper Motor void loop() { // get the sensor value from analog input A0 int val = analogRead(A0); // move a number of steps equal to the change in the // sensor reading stepper.step(val - previous); // remember the previous value of the sensor previous = val; }