Basic DC Motor Circuits

Slides:



Advertisements
Similar presentations
Sensing and Control.
Advertisements

Button Input: On/off state change Living with the Lab Gerald Recktenwald Portland State University
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Fair Use Building and Research Labs Presents
EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
Digital Tachometer ENGR 4803 Electromechanical Systems & Mechatronics.
Living with the Lab Using servos with an Arduino EAS 199A Fall 2011.
Arduino. Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source.
Secret Door Knock Detector
DC Motors, Stepper Motors, H-bridges DC Motors Stepper Motors Motor Control Circuits – Relays – H-bridges.
Digital I/O Connecting to the Outside World
Pulse Width Modulation (PWM) LED Dimmer Circuit
Pulse Width Modulation (PWM) LED Dimmer Circuit
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Chapter 6 Voltage Regulators - Part 2-.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Motors Make the world go ‘round By Jackson Greer, Room 305.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
1 Applied Control Systems Technology. 2 Pin configuration Applied Control Systems.
MUEV Phase III By: Kevin Jaris & Nathan Golick. Introduction Petroleum is a finite resource. Demand for clean energy is driving the increase in the production.
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.
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.
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-.
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
1 Electrical Fundamentals We need some understanding of electrical fundamentals to do the lab exercises. Electric Circuit Consists of: –Power Source: Battery,
Rebecca Bruce and Susan Reiser, May 2015 Analog Input and Output.
18240 Element two - Components INPUTS OUTPUTS PURPOSE TYPICAL USE.
Arduino Based DC Motor Speed Control
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)
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).
INTERNET OF EVERYTHING SDU 2016 Week 9. Physical Output  Make things move by controlling motors with Arduino  Servo-motors  Rotary actuator that allows.
Pulse-Width Modulation: Simulating variable DC output
Microcontroller basics Embedded systems for mortals.
Arduino Application: Speed control of small DC Motors
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
Microcontroller basics
simple example program to control a DC-Motor
Scrolling LCD using Arduino.
CU ATLAS Practical electronics Motion and Servos
Microcontroller basics
Microcontroller basics
Electronics Part 4 Electrical Components
Microprocessors Tutorial 1: Arduino Basics
Microcontroller basics
Cascade switching of an LED
A lecture for Arduino Course, Winter 2017/18
Arduino - Introduction
How to avoid catching things on fire.
Analog Input through POT
Electronic Education Kits
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Arduino Application: Speed control of small DC Motors
Secret Door Knock Detector
Arduino : Introduction & Programming
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Assist. Prof. Rassim Suliyev - SDU 2018
Sensors and actuators Sensors Resistive sensors
Arduino Motor Lab Inspired by NYU ITP project
UNIT 11: RC-SERVOMOTOR CONTROL
UNIT 5 Analog signals.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Basic DC Motor Circuits Living with the Lab Gerald Recktenwald Portland State University gerry@pdx.edu

DC Motor Learning Objectives Explain the role of a snubber diode Describe how PWM controls DC motor speed Implement a transistor circuit and Arduino program for PWM control of the DC motor Use a potentiometer as input to a program that controls fan speed

What is a snubber diode and why should I care?

Simplest DC Motor Circuit Connect the motor to a DC power supply Switch open Switch closed

Current continues after switch is opened Opening the switch does not immediately stop current 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 Inductor stores electrical energy in the windings We need to provide a way to safely dissipate electrical energy when the switch is opened

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

Pulse-width modulation (PWM) for DC motor speed control

Controlling DC Motor Speed The voltage supplied to a DC motor controls its speed Arduino cannot supply variable DC output Arduino lacks a true analog output Use Pulse-width modulation (PWM) to simulate a variable DC supply voltage PWM is a common technique for supplying variable power levels to “slow” electrical devices such as resistive loads, LEDs, and DC motors Arduino Uno has 6 PWM pins: Digital I/O pins 3, 5, 6, 9,10, and 11

Arduno Uno has 6 PWM pins Look for the ~ prefix on the digital pin label, e.g. ~3

PWM: Pulsed with modulation PWM simulates DC voltage control for slow loads The effective voltage is is called the duty cycle

Arduino PWM commands Configure the output pin: Set the duty cycle The duty cycle is an 8 bit value: 0 ≤ duty_cycle ≤255 PWM_pin = ... ; // one of 3, 5, 6, 9, 10, 11 void setup() { pinMode( PWM_pin, OUTPUT); } void loop() { int duty_cycle = 150; // between 0 and 255 analogWrite( PWM_pin, duty_cycle ); }

Using a transistor to switch the load

Transistor as the switching device Each Arduino output channels has a 40 mA limit The maximum current draw for an Arduino is 200 mA Use 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

Electronic components in the fan kit Transistor Diode 220 Ω or 330 Ω resistor

Replace the Switch with a Transistor A transistor allows on/off control to be automated and it allows switching of more current than an Arduino digital pin can supply. Pin 9 or another PWM pin drives the transistor base

Alternative locations for the transistor Moving the transistor (and any switch) between the power supply and the motor adds a bit of safety by tying the motor to ground when the system is idle

Diode and transistor orientation

Arduno Uno has 5 PWM pins Look for the ~ prefix on the digital pin label, e.g. ~3

DC Motor Circuit on tiny breadboard

+5V connections

PWM signal is connected to transistor base

Arduino program to spin the DC Motor Code is in spin_DC_motor.ino // spin_DC_motor.ino Use PWM to control DC motor speed int motorPin = 3; // Pin 3 has PWM, connected it to the DC motor void setup() { pinMode(motorPin, OUTPUT); // Set motor pin to output mode } void loop() { analogWrite(motorPin, 150); // Motor at 150/255 of full speed delay(1000); analogWrite(motorPin, 250); // Motor at 250/255 of full speed

User input to control fan speed

Adjust fan speed with potentiometer input Use the potentiometer circuit from the earlier analog input exercise

Adjust fan speed with potentiometer input Code is in DC_motor_speed_control.ino // File: DC_motor_speed_control.pde // // Use potentiometer input to set the speed of a DC motor // Output to the motor is PWM int motorPin = 3; // pin connected to the DC motor int potPin = 1; // analog input connected to the potentiometer void setup() { pinMode(motorPin, OUTPUT); } void loop() int PWMoutput, potReading; potReading = analogRead(potPin); PWMoutput = map(potReading, 0, 1023, 0, 255 ); analogWrite(motorPin, PWMoutput);

Adjust fan speed with potentiometer input void loop() { int PWMoutput, potReading; potReading = analogRead(potPin); PWMoutput = map(potReading, 0, 1023, 0, 255 ); analogWrite(motorPin, PWMoutput); } Each time through the loop: Read the voltage at the potentiometer wiper Input value is a 10-bit integer: 0 ≤ potReading ≤ 1023 Scale the 10-bit value (max 1023) to an 8-bit value (max 255) PWMoutput = map( potReading, 0, 1023, 0, 255 ); Update the PWM signal analogWrite(motorPin, PWMoutput); range for potReading range for PWMoutput