Arduino Application: Speed control of small DC Motors

Slides:



Advertisements
Similar presentations
Welcome to Workshop 88’s Arduino 301: Control the World! Please have your Arduino, IDE, and breadboard fired up and ready to go. ver 1.0 2/2/14.
Advertisements

Basic DC Motor Circuits
PHY 235 Robotics Workshop Day 6 DC Motors, H-Bridge Board, Simple Lego/Boe Bot.
EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller.
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
L.
Secret Door Knock Detector
DC Motors, Stepper Motors, H-bridges DC Motors Stepper Motors Motor Control Circuits – Relays – H-bridges.
Digital Outputs 7-Segment Display
Digital I/O Connecting to the Outside World
Electronic Components
Chapter 6 Voltage Regulators - Part 2-.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
Cascade switching of an LED EAS 199B Winter 2013.
Electronic Components. Battery A portable power source that has a positive and negative. Electronics works on Direct Current (DC) where electrons flow.
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.
Chapter 6 Voltage Regulators - Part 2-.
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.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
MOTORS. Definition Of Motor That powered by electricity or internal combustion, that supplies motive power for a vehicle or for some other device. A device.
A3144 SENSITIVE HALL-EFFECT SWITCHES & AH Linear Hall sensor
NATCAR SUMMER CLASS II 6 July 2004 Chung Hsieh. Topic of Discussion Power Supply Motor Drive Circuits Braking.
SMV Electric Tutorials
18240 Element two - Components INPUTS OUTPUTS PURPOSE TYPICAL USE.
Motor TYWu.
Arduino Based DC Motor Speed Control
Arduino DC Motor Motion Control Instructor: Dr Matthew Khin Yi Kyaw.
6.2 ELECTRONICS. CAPACITOR An electrical device used to store electrical charge.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
INTERNET OF EVERYTHING SDU 2016 Week 9. Physical Output  Make things move by controlling motors with Arduino  Servo-motors  Rotary actuator that allows.
DC motor principles Speed control Direction Stepper motor principles
Pulse-Width Modulation: Simulating variable DC output
Microcontroller basics Embedded systems for mortals.
Arduino Application: Speed control of small DC Motors
ME 120: Photoresistors and Arduino Programming Arduino Programming Case Study: Photoresistor Measurements ME 120 Mechanical and Materials Engineering Portland.
Regions of a Transistor A Bipolar Junction Transistor is a three terminal device containing 3 regions: Emitter, Base and Collector.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
BASICS OF ELECTRONICS.
Microcontroller basics
Introduction to Motors, servos and steppers
ARDUINO BASED UNDERGROUND CABLE FAULT DETECTION
Servo’s and Motor’s with Arduino
MICROCONTROLLER AND INTERFACING
simple example program to control a DC-Motor
Microcontroller basics
A3144 SENSITIVE HALL-EFFECT SWITCHES & AH Linear Hall sensor
INDUSTRIAL ELECTRONICS/ELECTRICITY
Arduino Based Industrial appliances control system by decoding dual tone multi frequency signals on GSM / CDMA network. Submitted by:
FOUR QUADRANT DC MOTOR SPEED CONTROL WITHOUT MICROCONTROLLER
Electronics Part 4 Electrical Components
Cascade switching of an LED
ARDUINO FOUR QUADRANT DC MOTOR CONTROL
A lecture for Arduino Course, Winter 2017/18
ARDUINO LINE FOLLOWER ROBOT
Controlling a Motor with Cascading Switches
QUIZ COMPETITION SENSOR FOR FASTEST FINGER PRESS
DC MOTOR SPEED CONTROL 1. Introduction
Control a motors angular position with a flex sensor
FOUR QUADRANT DC MOTOR CONTROL WITHOUT MICROCONTROLLER
Chapter 22 Bipolar Transistors.
Electronic Education Kits
Lesson 9: Digital Input-Output Signal Interfacing
Servos and Stepper Motors
Bipolar Transistors AIM:
Principles & Applications Large-Signal Amplifiers
Secret Door Knock Detector
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Assist. Prof. Rassim Suliyev - SDU 2018
Arduino程式範例.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Arduino Application: Speed control of small DC Motors ME 120 Mechanical and Materials Engineering Portland State University http://web.cecs.pdx.edu/~me120 Fall 2017

Learning Objectives Be able to describe the use of PWM for motor speed control Be able to explain the role of a snubber diode Be able to implement PWM speed control of a DC motor Be able to use the H-Bridge with the Sparkfun Tinker Kit to control a small DC Motor Additional references: Experiment 9 in the Sparkfun Tinker Kit experiment guide ME 120 course notes on PWM http://learn.adafruit.com/adafruit-arduino-lesson-13-dc- motors/overview

Using a transistor as a high speed switch

Transistor as a switching device Each Arduino output channel has a 40 mA limit Only current to power a very small DC motor Arduino is not designed as a power supply Maximum current draw for an Arduino is 200 mA Use the Arduino as the brain Let another switching element be the brawn

Use an NPN Transistor as a switch This device is designed for use as a medium power amplifier and switch requiring collector currents up to 500 mA

Use Digital I/O pin to switch LED on/off Digital I/O pin → LED

Code to control brightness of an LED int LED_pin = 11; // PWM pin LED or motor control void setup() { pinMode( LED_pin, OUTPUT ); } void loop() { int duty, pot_pin=0, reading; reading = analogRead(pot_pin); // read potentiometer duty = map(reading,0,1023,0,255); // rescale to 8-bit duty = constrain(duty,0,255); // be safe analogWrite(LED_pin,duty); // set duty cycle In the following examples, the Arduino code does not need to change when the electrical circuit is changed. The Arduino code only needs to used a single digital output pin, which in this code is LED_pin.

Use a Transistor to switch LED on/off Digital I/O pin → Transistor → LED

NPN Transistors as Switches Transistors can be used as switches: By applying relatively small voltage to the base, electrical current will flow from the collector to the emitter. C is the collector B is the base E is the emitter

NPN Transistors as Switches When used as a switch, ICE, the current from the collector to the emitter is large compare to IBE, the current from the base to the emitter. C is the collector B is the base E is the emitter

What is a snubber diode, and why should I care?

Simplest DC Motor Circuit Connect the motor to a DC power supply

Current continues after the switch is opened Opening the switch does not immediately stop current from flowing in the motor windings

Reverse current Charge build-up can cause damage

Motor Model Simple model of a DC motor: Windings have inductance and resistance Electrical energy is stored in the windings – the inductance effect We need a way to safely dissipate electrical energy when the switch is opened after the motor has been running

Flyback diode or snubber diode Adding a diode in parallel with the motor provides a path for the dissipation of stored energy when the switch is opened

DC motor speed control circuit The circuit for DC motor speed control uses the idea from the LED brightness control circuit. Replace the LED circuit with the DC motor and snubber diode

Motor control with an H-Bridge

H-Bridges simplifies motor control and enable features not possible with a single transistor An H-bridge Uses logic-level signals to switch higher current power to the motor – just like a transistor Allows polarity of motor power, and hence direction of rotation, to be reversed, Includes fly-back diodes (snubbers) Is available in a single IC package Image of L293DNE quadruple half-H motor driver from Sparkfun.com

Basic H-Bridge has four switches Note that there are many ways to implement this concept. For example, 24 different designs are shown at http://www.talkingelectronics.com/projects/H-Bridge/H-Bridge-1.html

Closing two switches supplies power that causes motor to turn one way

Closing two other switches supplies power that causes motor to turn the opposite way

Using the H-bridge from the Tinker kit Motor + Motor –

Using the H-bridge from the Tinker kit

Using the H-bridge from the Tinker kit //define the two direction logic pins and the speed / PWM pin const int DIR_A = 5; const int DIR_B = 4; const int PWM_pin = 6; void setup(){ // -- set all motor control pins as output pinMode(DIR_A, OUTPUT); pinMode(DIR_B, OUTPUT); pinMode(PWM_pin, OUTPUT); Serial.begin(9600); // Used to display motor speed values } // Code continued on next slide

Using the H-bridge from the Tinker kit // Code continued from previous slide void loop(){ int motorSpeed, potpin=3, potval; // -- Set control lines to drive forward digitalWrite(DIR_A, HIGH); digitalWrite(DIR_B, LOW); // -- Read potentiometer to set PWM for motor speed potval = analogRead(potpin); motorSpeed = map( potval, 0, 1023, 0, 255); motorSpeed = constrain( motorSpeed, 0, 255); analogWrite(PWM_pin, motorSpeed); Serial.print(potval); Serial.print(" "); Serial.println(motorSpeed); }

Next Steps After getting the basic code to work Find the minimum PWM setting that will make the motor spin Use the minimum PWM setting in the constrain() command Make a servo sweep back and forth while the DC motor is running Add a button to change direction of the motor