Using Servos with an Arduino

Similar documents
Learning Objectives. References 10/26/11. Using servos with an Arduino. EAS 199A Fall 2011

Arduino. AS220 Workshop. Part II Interactive Design with advanced Transducers Lutz Hamel

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

Assignments from last week

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

100UF CAPACITOR POTENTIOMETER SERVO MOTOR MOTOR ARM. MALE HEADER PIN (3 pins) INGREDIENTS

Servo Sweep. Learn to make a regular Servo move in a sweeping motion.

Design with Microprocessors Year III Computer Science 1-st Semester

LED + Servo 2 devices, 1 Arduino

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

ABCs of Arduino. Kurt Turchan -

Lab 06: Ohm s Law and Servo Motor Control

Figure 1. Digilent DC Motor

Arduino and Servo Motor

Analog Feedback Servos

Coding with Arduino to operate the prosthetic arm

Introduction: Components used:

Programming 2 Servos. Learn to connect and write code to control two servos.

FABO ACADEMY X ELECTRONIC DESIGN

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

Robotic Arm Assembly Instructions

DC motor control using arduino

Automobile Prototype Servo Control

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

Arduino Advanced Projects

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

Lecture 6. Interfacing Digital and Analog Devices to Arduino. Intro to Arduino

Disclaimer. Arduino Hands-On 2 CS5968 / ART4455 9/1/10. ! Many of these slides are mine. ! But, some are stolen from various places on the web

Parts List. Robotic Arm segments ¼ inch screws Cable XBEE module or Wifi module

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

Arduino Digital Out_QUICK RECAP

Using Transistors and Driving Motors

Feed-back loop. open-loop. closed-loop

Lab Exercise 9: Stepper and Servo Motors

the Board of Education

FlareBot. Analysis of an Autonomous Robot. By: Sanat S. Sahasrabudhe Advisor: Professor John Seng

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School

1. Controlling the DC Motors

Operating Mode: Serial; (PWM) passive control mode; Autonomous Mode; On/OFF Mode

About New FT-SCServo (Smart Control Servo)

Project 27 Joystick Servo Control

DA 20 Technical Specification

Pulse Width Modulation and

PWM CONTROL USING ARDUINO. Learn to Control DC Motor Speed and LED Brightness

Actuators. DC Motor Servo Motor Stepper Motor. Sensors

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

E11 Lecture 11: Sensors & Actuators. Profs. David Money Harris & Sarah Harris Fall 2011

Control Robotics Arm with EduCake

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

Introduction to the VEX Robotics Platform and ROBOTC Software

Peek-a-BOO Kit JAMECO PART NO / / Experience Level: Beginner Time Required: 1+ hour

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

MICROCONTROLLERS Stepper motor control with Sequential Logic Circuits

MAE106 Laboratory Exercises Lab # 3 Open-loop control of a DC motor

DC Motor and Servo motor Control with ARM and Arduino. Created by:

Arduino Application: Speed control of small DC Motors

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones

Motors and Servos Part 2: DC Motors

URM37 V3.2 Ultrasonic Sensor (SKU:SEN0001)

THE IMPORTANCE OF PLANNING AND DRAWING IN DESIGN

HOW TO BUILD A CAR PARK WITH INTEL GALILEO!

Hobby Servo Tutorial. Introduction. Sparkfun:

Understanding RC Servos and DC Motors

Jaguar speed controllers

Experiment 4.B. Position Control. ECEN 2270 Electronics Design Laboratory 1

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Lesson4 Obstacle avoidance car

GE 320: Introduction to Control Systems

4WD Mobile Platform SKU:ROB0022

Rodni What will yours be?

Arduino: Sensors for Fun and Non Profit

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

Interfacing dspace to the Quanser Rotary Series of Experiments (SRV02ET)

The plan... CSE 6324 From control to actuators Michael Jenkin Office Hours: Sherman 1028 Wed 3-4. From the bottom up...

ELECTRICAL ENGINEERING TECHNOLOGY PROGRAM EET 433 CONTROL SYSTEMS ANALYSIS AND DESIGN LABORATORY EXPERIENCES

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Sensors and Sensing Motors, Encoders and Motor Control

EXPERIMENT 6: Advanced I/O Programming

Yihao Qian Team A: Aware Teammates: Amit Agarwal Harry Golash Menghan Zhang Zihao (Theo) Zhang ILR01 Oct.14, 2016

The Motor sketch. One Direction ON-OFF DC Motor

VEX Robotics Platform and ROBOTC Software. Introduction

Adafruit 16-Channel Servo Driver with Arduino

Robotic Navigation Distance Control Platform

Automatic Control Systems 2017 Spring Semester

DA 22 Technical Specification

Sensors and Sensing Motors, Encoders and Motor Control

Arduino Programming Part 3

Advanced Mechatronics 1 st Mini Project. Remote Control Car. Jose Antonio De Gracia Gómez, Amartya Barua March, 25 th 2014

Sensors and Motor Control Lab Individual lab report #1 October 16, 2015

NAMASKAR ROBOT-WHICH PROVIDES SERVICE

Built-in soft-start feature. Up-Slope and Down-Slope. Power-Up safe start feature. Motor will only start if pulse of 1.5ms is detected.

Programming PIC Microchips

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

Available online Journal of Scientific and Engineering Research, 2018, 5(4): Research Article

Sidekick Basic Kit for Arduino V2 Introduction

Module: Arduino as Signal Generator

Lab 5: Arduino Uno Microcontroller Innovation Fellows Program Bootcamp Prof. Steven S. Saliterman

1. Introduction to Analog I/O

Intelligent Systems Design in a Non Engineering Curriculum. Embedded Systems Without Major Hardware Engineering

Transcription:

Using Servos with an Arduino ME 120 Mechanical and Materials Engineering Portland State University http://web.cecs.pdx.edu/~me120

Learning Objectives Be able to identify characteristics that distinguish a servo and a DC motor Be able to describe the difference a conventional servo and a continuous rotation servo Be able to use the Arduino Servo library to control servo position

References Information on Arduino Servo library: http://www.arduino.cc/en/reference/servo http://www.arduino.cc/playground/learning/singleservoexample Additional descriptions of servos http://makeprojects.com/wiki/servos http://www.seattlerobotics.org/guide/servos.html

Living with the Lab What is a servo? A servo-motor is an actuator with a built-in feedback mechanism that responds to a control signal by moving to and holding a position, or by moving at a continuous speed.

Living with the Lab Servo in the Sparkfun Inventor s Kit

Servo in the Sparkfun Inventor s Kit

DC Motors and Servos DC Motor Motion is continuous Speed controlled by applied voltage Servo Capable of holding a position Speed controlled by delay between position updates Hybrid of motor, gears and controller.

Conventional and Continuous Rotation Two types of servos continuous rotation can rotate all the way around in either direction standard can only rotate 180 degrees pulse tells servo which way to spin & how fast to spin pulse tells servo which position to hold

Control signal is a pulse train 20 ms constant pulse timing 1 ms = pulse width 1 ms Pulse frequency is fixed Typical: 20 ms Pulse width determines position Typical: 1ms to 2 ms 1.5 ms 2 ms

Living with the Lab Servo components 1. Small DC motor 2. Gearbox with small plastic gears to reduce the RPM and increase output torque 3. Special electronics to interpret a pulse signal and deliver power to the motor

Servo from the Sparkfun kit The micro servo from the Sparkfun Inventor s kit is a conventional servo, i.e. the control signal results in moving the shaft to an angular position. White: Control signal (Arduino pin 9 or 10) Black: Ground Horn Red: Power (5V)

Arduino Servo library handles the details Must connect servos on pin 9 or pin 10 From the Aduino web site: use of the library disables analogwrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins http://www.arduino.cc/en/reference/servo

Arduino Servo library handles the details Three components of the Servo Library Create the servo object Servo my_servo_object;! Attach the object my_servo_object.attach(servo_pin);! Name of the object is like a variable name. Send control signal my_servo_object.write(pos);! attach and write are pre-defined methods that act on the servo object.

Modified version of the sweep function // File: sweep_variable_wait! //! // Modified version of Sweep by BARRAGAN <http://barraganstudio.com>! // Use variable dtwait to make the speed of sweep apparent!! #include <Servo.h> // Make code in Servo.h available to this sketch!! Servo myservo; // Create servo object called "myservo"! int servo_pin=9; // The servo must be attached to pin 9 or pin 10!! void setup()! {! myservo.attach(servo_pin); // attaches the servo pin to myservo object! }!! void loop()! {! int pos = 0; // variable to store the servo position! int dtwait=15; // duration of wait at the end of each step!! for(pos = 0; pos < 180; pos += 1) {! myservo.write(pos); // Move to position in variable 'pos'! delay(dtwait); // wait dtwait for the servo to reach the position! }! for(pos = 180; pos>=1; pos -= 1) {! myservo.write(pos); // Move to position in variable 'pos'! delay(dtwait); // wait dtwait for the servo to reach the position! }! }!

Experiment What happens when you adjust dtwait? Can adjust the sweep angle? Make new variable to define end angle of the loop Open the Knob demo from the Arduino IDE Connect a potentiometer to an analog input Use the potentiometer to control the servo position