INTERNET OF EVERYTHING SDU 2016 Week 9. Physical Output  Make things move by controlling motors with Arduino  Servo-motors  Rotary actuator that allows.

Slides:



Advertisements
Similar presentations
Sensing and Control.
Advertisements

KEB COMBIVERT F5-M Exercises.
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Basic DC Motor Circuits
Servos The material presented is taken from a variety of sources including:
Servos The material presented is taken from a variety of sources including:
EET 2261 Unit 13 Controlling Stepper Motors and Servos  Read Almy, Chapter 21.  Lab #13 due next week.  Final Exam next week.
1 EECS 373 Design of Microprocessor-Based Systems Student Presentations Tianhua Zheng and Jason Shintani Motor control November 27 th, 2012.
Design Realization lecture 20 John Canny 10/30/03.
L.
DC Motors DC Motors are widely used in robotics because of their small size and high energy output. Key characteristics of DC motors include: 1. High Speed.
Living with the Lab Using servos with an Arduino EAS 199A Fall 2011.
SERVO MOTORS Tech Topic By Ryan Bidlack. Background A servo motor is composed of a DC, AC, or an AC induction motor and a feedback control. A servo motor.
Stepper Motors. Motors coils of conductive wire magnetic fields rotational motion –except for linear induction motor everywhere from the very large (LRT)
Embedded Control Applications IIMP10-1 weeklecturetopics 10Embedded Control Applications II - Servo-motor control - Stepper motor control.
DC Motors, Stepper Motors, H-bridges DC Motors Stepper Motors Motor Control Circuits – Relays – H-bridges.
ECGR-6185 Advanced Embedded Systems University Of North Carolina at Charlotte A. Srinivas Reddy Stepper/Servo/DC Motors.
Micromouse Meeting #3 Lecture #2 Power Motors Encoders.
1 Motors & Motor Controllers ECE AC or DC Motors AC –Few robots use AC except in factories –Most of those that use AC first convert to DC DC –Dominates.
1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
1  Actuators are used in order to produce mechanical movement in robots.
ELECTRIC MOTORS An Introduction to DC and Stepper Motors.
Working with Arduino: Lesson #4: Servos EGN1007. Learning Goals Learning Goals: The student will be able to: 1.Build a complete circuit using the Arduino.
Instrumentation & Control Engg. Section Electrical Engineering Department Ahmedabad , Gujarat.
University of Tehran 1 Microprocessor System Design IO Applications Omid Fatemi
Motors & Motor Drivers ECE 450.
Electrical Actuation System Lecture 9 (Chapter 9).
Servos The material presented is taken from a variety of sources including:
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Arms, Legs, Wheels, Tracks, and What Really Drives Them Effectors and Actuators.
Microcontroller and Interfacing ( ) TOPIC: STEPPER MOTOR INTERFACING WITH MICROCONTROLLER PREPARED BY: GUIDED BY: ARJUN GUPTA ( ) PROF.
INTRODUCTION TO ROBOTICS Part 3: Propulsion System Robotics and Automation Copyright © Texas Education Agency, All rights reserved. 1.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
Sitarambhai Naranjibhai Patel Institute Of Technology & R.C.
Limited rotation servo basics David Hall output shaft servo horn red wire = 5V + black wire = Gnd - white wire = control signal standard servo.
DC MOTOR. Magnetism Opposites Attract / Likes Repel.
DC motor principles Speed control Direction Stepper motor principles
Microcontroller basics Embedded systems for mortals.
A PRESENTATION ON RELAY, OPTOISOLATOR AND STEPPER MOTOR INTERFACING WITH AVR Prepared By:- Katariya Prakash[ ] Kathiriya Shalin[ ]
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
CNC FEED DRIVES Akhil Krishnan G M.Tech 1. CONTENTS 1.Introduction 2.Requirements of CNC feed drives 3.Servo motor 3.1 Servo drive control 3.2 Components.
CNC FEED DRIVES.
Motors & Motor Controllers
Microcontroller basics
Introduction to Motors, servos and steppers
DC Motors DC Motors are widely used in robotics because of their small size and high energy output. Key characteristics of DC motors include: 1. High Speed.
Servo’s and Motor’s with Arduino
Outline Introduction to digital-to-analog converter (DAC)
CU ATLAS Practical electronics Motion and Servos
Microcontroller basics
Servo Systems Servo is mechanism based on feedback control.
Stepper Motor A stepper motor or step motor or stepping motor is a brushless DC electric motor that divides a full rotation into a number of equal steps.
Group members MUHAMAAD DANISH 2015MC05 USMAN ALI JAT 2015MC14 MUREED SULTAN 2015MC18 AZAN ASHRAF 2015MC19 AYMEN.
Introduction to Servos
DC Motors Types: Continuous Rotation Servo (Remote Control)
Servos The material presented is taken from a variety of sources including:
Stepper motor.
Arduino - Introduction
Control a motors angular position with a flex sensor
Electric Motors.
Servo Systems Servo is mechanism based on feedback control.
Servos The material presented is taken from a variety of sources including:
ECGR-6185 Advanced Embedded Systems
MC3479P Stepper Motor and Stepper Motor IC
Arduino Application: Speed control of small DC Motors
Stepper Motors By Brian Tomiuk, Jack Good, Matthew Edwards, Isaac Snellgrove November 14th, 2018.
Assist. Prof. Rassim Suliyev - SDU 2018
UNIT 11: RC-SERVOMOTOR CONTROL
-Shweta Dubey.
Presentation transcript:

INTERNET OF EVERYTHING SDU 2016 Week 9

Physical Output  Make things move by controlling motors with Arduino  Servo-motors  Rotary actuator that allows for precise control of angular position  DC-motors  Converts direct current electrical power into mechanical power  Stepper-motors  Divides a full rotation into a number of equal steps

Brushed DC Motors  Simple devices with two leads connected to brushes (contacts)  Control the magnetic field of the coils  Drives a metallic core (armature)  Direction of rotation can be reversed by reversing the polarity  Require a transistor to provide adequate current  Primary characteristic in selecting a motor is torque  How much work the motor can do

Brushless Motors  More powerful and efficient for a given size  Three phases of driving coils  Require more complicated electronic control  Electronics speed controllers

DC Motor Parameters  Direct-drive vs. gearhead – built-in gears or not  Voltage – what voltage it best operates at  Current (efficiency) – how much current it needs to spin  Speed – how fast it spins  Torque – how strong it spins  Size, shaft diameter, shaft length

DC Motor Characteristics  When the first start up, they draw a lot more current, up to 10x more  If you “stall” them (make it so they can’t turn), they also draw a lot of current  They can operate in either direction, by switching voltage polarity  Usually spin very fast: >1000 RPM  To get slower spinning, need gearing

Driving DC Motor  To drive them, apply a voltage  The higher the voltage, the faster the spinning  Polarity determines which way it rotates  Can be used as voltage generators

Switching Motors with Transistors  Transistors switch big signals with little signals  Since motors can act like generators,  Need to prevent them from generating “kickback” into the circuit  Can control speed of motor with analogWrite()

Driving a Brushed Motor const int motorPin = 3; const int switchPin = 2; void setup() { pinMode(switchPin, INPUT); pinMode(motorPin, OUTPUT); } void loop() { digitalWrite(motorPin, digitalRead(switchPin)); }

Controlling Speed of DC-Motor const int motorPin = 3; const int potPin = A0; void setup() { } void loop() { int spd = analogRead(potPin); spd = map(spd, 0, 1023, 0, 255); analogWrite(motorPin, spd); }

Servo-Motors  Allow accurately control physical movement  Move to a position instead of continuously rotating  Rotate over a range of 0 to 180 degrees  Motor driver is built into the servo  Small motor connected through gears  Output shaft drives a servo arm  Connected to a potentiometer to provide position feedback  Continuous rotation servos  Positional feedback disconnected  Rotate continuously clockwise and counter clockwise with some control over the speed

Servo-Motors

 Respond to changes in the duration of a pulse  Short pulse of 1 ms will cause to rotate to one extreme  Pulse of 2 ms will rotate the servo to the other extreme Servos require pulses different from the PWM output from analogWrite

Servo-Motors  Come in all sizes  from super-tiny  to drive-your-car  All have same 3-wire interface  Servos are spec’d by:  weight: 9g  6V  torque: 6V  voltage: 4.6~6V  size: 21x11x28 mm

Servo Control  PWM freq is 50 Hz (i.e. every 20 millisecs)  Pulse width ranges from 1 to 2 millisecs In practice, pulse range can range from 500 to 2500 microsecs

Servo and Arduino const int servoPin = 7; const int potPin = A0; const int pulsePeriod = 20000; //us void setup() { pinMode(servoPin, OUTPUT); } void loop() { int hiTime = map(analogRead(potPin), 0, 1023, 600, 2500); int loTime = pulsePeriod - hiTime; digitalWrite(servoPin, HIGH); delayMicroseconds(hiTime); digitalWrite(servoPin, LOW); delayMicroseconds(loTime); }

Use the Servo library  servo.attach(pin[, min][, max]) – attach the servo  pin- the pin number that the servo is attached to  min (optional) - the pulse width, in microseconds, corresponding to the minimum (0-degree) angle on the servo (defaults to 544)  max (optional) - the pulse width, in microseconds, corresponding to the maximum (180-degree) angle on the servo (defaults to 2,400)  servo.write(angle) – turn the servo arm  angle – the degree value to write to the servo (from 0 to 180)

Servo sweeper #include Servo myservo; // create servo object to control a servo int angle = 0; // variable to store the servo position void setup(){ myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop(){ for(angle = 0; angle < 180; angle += 1){ // goes from 0 degrees to 180 myservo.write(angle); //tell servo to go to position in variable 'angle' delay(20); // waits 20ms between servo commands } for(angle = 180; angle >= 1; angle -= 1){ // goes from 180 degrees to 0 myservo.write(angle); delay(20); }

Controlling angle with pot #include Servo myservo; // create servo object to control a servo int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup(){ myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop(){ val = analogRead(potpin); // reads the value of the potentiometer val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo myservo.write(val); // sets position delay(15); }

Stepper Motors  Rotate a specific number of degrees in response to control pulses  Number of degrees for a step is motor-dependent  Ranging from one or two degrees per step to 30 degrees or more  Two types of steppers  Bipolar - typically with four leads attached to two coils  Unipolar - five or six leads attached to two coils  Additional wires in a unipolar stepper are internally connected to the center of the coils

Stepper Motors  Unipolar drivers always energize the phases in the same way  Single "common" lead, will always be negative.  The other lead will always be positive  Disadvantage - less available torque, because only half of the coils can be energized at a time  Bipolar drivers work by alternating the polarity to phases  All the coils can be put to work

Stepper Motors All of the common coil wires are tied together internally abd brought out as a 5th wire. This motor can only be driven as a unipolar motor. This motor only joins the common wires of 2 paired phases. These two wires can be joined to create a 5-wire unipolar motor. Or you just can ignore them and treat it like a bipolar motor! It can be driven in several ways: 4-phase unipolar - All the common wires are connected together - just like a 5-wire motor. 2-phase series bipolar - The phases are connected in series - just like a 6-wire motor. 2-phase parallel bipolar - The phases are connected in parallel. This results in half the resistance and inductance - but requires twice the current to drive. The advantage of this wiring is higher torque and top speed.

Driving a Unipolar Stepper Motor const int stepperPins[4] = {2, 3, 4, 5}; int delayTime = 5; void setup() { for(int i=0; i<4; i++) pinMode(stepperPins[i], OUTPUT); } void loop() { digitalWrite(stepperPins[0], HIGH); digitalWrite(stepperPins[1], LOW); digitalWrite(stepperPins[2], LOW); digitalWrite(stepperPins[3], LOW); delay(delayTime); digitalWrite(stepperPins[0], LOW); digitalWrite(stepperPins[1], HIGH); digitalWrite(stepperPins[2], LOW); digitalWrite(stepperPins[3], LOW); delay(delayTime); digitalWrite(stepperPins[0], LOW); digitalWrite(stepperPins[1], LOW); digitalWrite(stepperPins[2], HIGH); digitalWrite(stepperPins[3], LOW); delay(delayTime); digitalWrite(stepperPins[0], LOW); digitalWrite(stepperPins[1], LOW); digitalWrite(stepperPins[2], LOW); digitalWrite(stepperPins[3], HIGH); delay(delayTime); }

Driving a Bipolar Stepper Motor const int stepperPins[4] = {2, 3, 4, 5}; int delayTime = 5; void setup() { for(int i=0; i<4; i++) pinMode(stepperPins[i], OUTPUT); } void loop() { digitalWrite(stepperPins[0], LOW); digitalWrite(stepperPins[1], HIGH); digitalWrite(stepperPins[2], HIGH); digitalWrite(stepperPins[3], LOW); delay(delayTime); digitalWrite(stepperPins[0], LOW); digitalWrite(stepperPins[1], HIGH); digitalWrite(stepperPins[2], LOW); digitalWrite(stepperPins[3], HIGH); delay(delayTime); digitalWrite(stepperPins[0], HIGH); digitalWrite(stepperPins[1], LOW); digitalWrite(stepperPins[2], LOW); digitalWrite(stepperPins[3], HIGH); delay(delayTime); digitalWrite(stepperPins[0], HIGH); digitalWrite(stepperPins[1], LOW); digitalWrite(stepperPins[2], HIGH); digitalWrite(stepperPins[3], LOW); delay(delayTime); }

Arduino Stepper Library  Allows to control unipolar or bipolar stepper motors  stepper(steps, pin1, pin2, pin3, pin4) – attach and initialize stepper  steps: number of steps in one revolution of motor  pin1, pin2, pin3, pin4: 4 pins attached to the motor  setSpeed(rpms) - Sets the motor speed in rotations per minute (RPMs)  step(steps) - Turns the motor a specific number of steps, positive to turn one direction, negative to turn the other  This function is blocking  wait until the motor has finished moving before passing control to the next line in sketch

Arduino Stepper Library #include const int stepsPerRevolution = 200; // change this to fit the number of steps Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5); void setup() { myStepper.setSpeed(60); Serial.begin(9600); } void loop() { Serial.println("clockwise"); myStepper.step(stepsPerRevolution); delay(5); Serial.println("counterclockwise"); myStepper.step(-stepsPerRevolution); delay(5); }

Tasks  1 Ultrasonic, 1 Servo: Servo turns 90 degrees when object is too close, and turns back when it is far enough  1 temperature, 1 DC-motor: motor has 4 speed modes depending on temperature: off (when cold), slow(warm), fast(hot), very fast(too hot)  1 stepper: stepper must turn N steps provided via serial port together with direction (E.g.: 200f – means 200 steps forward, 123b – means 123 steps backward)

Tasks  1 Pot, 2 LDRs, 1 DC-motor, 1 Stepper, 1 Servo: Potentiometer controls the speed and direction of stepper (somewhere at the middle of the pot stepper stops), 1 st LDR controls the angle of the servo, and the 2 nd LDR controls the speed of the DC- motor.