Lab 4: Motor Control

Similar documents
6. Friction, Experiment and Theory

Delft. Matlab and Simulink for Modeling and Control. Robert Babuška and Stefano Stramigioli. November 1999

MECH Statics & Dynamics

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

Report b Measurement report. Sylomer - field test

Ohm s Law. Ohmic relationship V=IR. Electric Power. Non Ohmic devises. Schematic representation. Electric Power

Chapter 3 Torque Sensor

Physics 111. Exam #1. January 24, 2014

INTRODUCTION TO SERIAL ARM

Performance of a Browser-Based JavaScript Bandwidth Test

Project Management Basics

Solution of the Heat Equation for transient conduction by LaPlace Transform

v = x t = x 2 x 1 t 2 t 1 The average speed of the particle is absolute value of the average velocity and is given Distance travelled t

An Automatic Noise-Figure Meter

DISTRIBUTED DATA PARALLEL TECHNIQUES FOR CONTENT-MATCHING INTRUSION DETECTION SYSTEMS. G. Chapman J. Cleese E. Idle

Module 8. Three-phase Induction Motor. Version 2 EE IIT, Kharagpur

Wireless and Battery-less Sensor Using RF Energy Harvesting

Unit 11 Using Linear Regression to Describe Relationships

Simulation of Sensorless Speed Control of Induction Motor Using APFO Technique

Name: SID: Instructions

DISTRIBUTED DATA PARALLEL TECHNIQUES FOR CONTENT-MATCHING INTRUSION DETECTION SYSTEMS

On Reference RIAA Networks by Jim Hagerman

Towards Control-Relevant Forecasting in Supply Chain Management

2. METHOD DATA COLLECTION

Pin-Selectable Watchdog Timers MAX6369 MAX6374

Design of The Feedback Controller (PID Controller) for The Buck Boost Converter

Simple Modular Half-Bridge

Using the Motor Controller

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

Bob York. Simple FET DC Bias Circuits


Linear Momentum and Collisions

Servo Info and Centering

12.4 Problems. Excerpt from "Introduction to Geometry" 2014 AoPS Inc. Copyrighted Material CHAPTER 12. CIRCLES AND ANGLES

Six-servo Robot Arm. DAGU Hi-Tech Electronic Co., LTD Six-servo Robot Arm

Servo Motors (SensorDAQ only) Evaluation copy. Vernier Digital Control Unit (DCU) LabQuest or LabPro power supply

Rotation of an Object About a Fixed Axis

Warehouse Security System based on Embedded System

MSc Financial Economics: International Finance. Bubbles in the Foreign Exchange Market. Anne Sibert. Revised Spring Contents

Figure 2.1. a. Block diagram representation of a system; b. block diagram representation of an interconnection of subsystems

EasyC. Programming Tips

Tracking Control and Adaptive Local Navigation for Nonholonomic Mobile Robots

Optical Illusion. Sara Bolouki, Roger Grosse, Honglak Lee, Andrew Ng

Assessing the Discriminatory Power of Credit Scores

Exposure Metering Relating Subject Lighting to Film Exposure

Chapter 10 Velocity, Acceleration, and Calculus

Mixed Method of Model Reduction for Uncertain Systems

Progress 8 measure in 2016, 2017, and Guide for maintained secondary schools, academies and free schools

A Note on Profit Maximization and Monotonicity for Inbound Call Centers

Design of Compound Hyperchaotic System with Application in Secure Data Transmission Systems

dspace DSP DS-1104 based State Observer Design for Position Control of DC Servo Motor

Work with Arduino Hardware

A COMPARATIVE STUDY OF THREE-PHASE AND SINGLE-PHASE PLL ALGORITHMS FOR GRID-CONNECTED SYSTEMS

Pulse Width Modulation Applications

EXPERIMENT 11 CONSOLIDATION TEST

CHAPTER 5 BROADBAND CLASS-E AMPLIFIER

Measuring Resistance Using Digital I/O

Research Article An (s, S) Production Inventory Controlled Self-Service Queuing System

Queueing systems with scheduled arrivals, i.e., appointment systems, are typical for frontal service systems,

CASE STUDY ALLOCATE SOFTWARE

Two Dimensional FEM Simulation of Ultrasonic Wave Propagation in Isotropic Solid Media using COMSOL

Large Generators and High Power Drives

A note on profit maximization and monotonicity for inbound call centers

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

ECE 495 Project 3: Shocker Actuator Subsystem and Website Design. Group 1: One Awesome Engineering

Support Vector Machine Based Electricity Price Forecasting For Electricity Markets utilising Projected Assessment of System Adequacy Data.

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

Software Engineering Management: strategic choices in a new decade

UPS PIco. to be used with. Raspberry Pi B+, A+, B, and A. HAT Compliant. Raspberry Pi is a trademark of the Raspberry Pi Foundation

Arduino Lab 1 - The Voltage Divider

SIMULATION INVESTIGATIONS OF ELECTROHYDRAULIC DRIVE CONTROLLED BY HAPTIC JOYSTICK

CHAPTER 11: Flip Flops

You may use a scientific calculator (non-graphing, non-programmable) during testing.

TRADING rules are widely used in financial market as

Air-to-Fuel and Dual-Fuel Ratio Control of an Internal Combustion Engine

σ m using Equation 8.1 given that σ

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

A) When two objects slide against one another, the magnitude of the frictional force is always equal to μ

INTERACTIVE TOOL FOR ANALYSIS OF TIME-DELAY SYSTEMS WITH DEAD-TIME COMPENSATORS

Queueing Models for Multiclass Call Centers with Real-Time Anticipated Delays

Genuine Bendix. a l v e. c o m p r e. s o r s. s y e r. a i r. d r. s t r o n i c. e l e c. d i s c. b r a k e s. w h e e l. e n d X V.

REDUCTION OF TOTAL SUPPLY CHAIN CYCLE TIME IN INTERNAL BUSINESS PROCESS OF REAMER USING DOE AND TAGUCHI METHODOLOGY. Abstract. 1.

Utility-Based Flow Control for Sequential Imagery over Wireless Networks

How To Control A Power Plant With A Power Control System

Incline and Friction Examples

Single-phase ( V) voltage monitoring: Undervoltage Overvoltage Window mode (overvoltage + undervoltage) Voltage fault memory selectable

Three Phase Theory - Professor J R Lucas

Senior Thesis. Horse Play. Optimal Wagers and the Kelly Criterion. Author: Courtney Kempton. Supervisor: Professor Jim Morrow

EDK 350 (868 MHz) EDK 350U (902 MHz) EnOcean Developer Kit

International Journal of Heat and Mass Transfer

Ocean Controls RC Servo Motor Controller

MANUAL FOR RX700 LR and NR

DC Motor with Shaft Encoder

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Tap Into Smartphone Demand: Mobile-izing Enterprise Websites by Using Flexible, Open Source Platforms

EE 402 RECITATION #13 REPORT

Hand Gestures Remote Controlled Robotic Arm

Apigee Edge: Apigee Cloud vs. Private Cloud. Evaluating deployment models for API management

Product Information. Gateway For Connecting EnDat Encoders to PROFIBUS-DP

Digital Communication Systems

Transcription:

2.017 Deign of Electromechanical Robotic Sytem, Fall 2009 Lab 4: Motor Control Aigned: 10/5/09 1 Overview So far we have learnt how to ue the Arduino to acquire variou type of ignal from enor uch a the GPS receiver, temperature enor, potentiometer, photo reitor, puh button, Reed witche, etc. We will now turn our attention to actuator control, which i a critical part of an electromechanical robotic ytem. With both ening and actuator control capabilitie, the robotic ytem can actively interact with the environment that it i in. The goal of thi lab i to learn how to control a DC motor uing the Arduino microcontroller board and the Motor Shield. We will ue the reading from a rotary encoder attached to the back of the motor a our feedback ignal. You will then learn how to interpret the encoder ignal, deign a controller for the motor, and drive the motor to a et-point or to follow a pre-defined profile. After that we will experiment with an RC ervo by commanding the ervo to go to a et poition. We will pend the lat half hour of the lab for project dicuion. 2 DC Motor Experiment One Maxon F2140.937 DC bruhed ervo motor, one Arduino motor hield with encoder interface circuit, and one external power upply will be given to each group. Connect up the above component to your Arduino board and PC according to the photo hown in Figure 1. Download the file Lab4file.zip from http://web.mit.edu/hchin/public/2.017/ and upzip to your lab4 folder. Unzip ServoTimer1-fixedv13.zip and AFMotor_18-2-09.zip. Put the above two unzipped folder in your C:\...\Arduino\hardware\librarie folder. The ret of the file are decribed below: o DC_Motor_Encoder.pdf Reference document on DC motor, PWM, and encoder. o Maxon_motor_pec.pdf DC motor, encoder and gearhead data heet. o 94_pc6_dataheet_0.pdf Decoder circuit board document. o LS7183_LS7184.pdf Decoder IC chip document. o MotorControlEncoderTemplate3.pde Arduino template code for DC motor control. o Servo1.pde Arduino template code for ervo motor control. Read the above document. 2.017 Fall 2009 1

Figure 1. DC motor control lab etup. 2.1 Proceing Encoder Signal The encoder ignal are proceed by the decoder circuit provided with your motor. It help count the quadrature output and give a decoded ignal to the Arduino. We've choen thi etup becaue the Arduino ha only two interrupt pin available, one of which i ued by the motor hield. Thi make it difficult to keep an accurate record of the two channel of the quadrature input. The dedicated decoder chip tranlate the quadrature output into a ingle clock channel and a direction channel (ee Figure 2). The clock channel changing tatu indicate that a ingle tick for the encoder in the direction indicated by the direction output. Now the Arduino need only interrupt on one ignal, read the direction on a tandard digital pin intead of an interrupt, and update it count accordingly. Figure 2. PC6-C-X decoder circuit timing diagram. The circuit we ue i et up to be the X4 mode. 2.017 Fall 2009 2

Ue an Ocillocope to meaure the raw encoder ignal from either encoder channel. Meaure the clock channel from the decoder circuit. How many encoder count per revolution of the motor haft? Ue the provided pec heet to find the anwer. For the purpoe of thi lab, you can imply ue the encoder0po variable to give you the current encoder poition and allow the provided interrupt function to keep it updated. Capture encoder data by turning the motor by hand: o Upload the MotorControlEncoderTemplate3.pde ketch to Arduino. o The Arduino program continually print time and the current encoder poition. You can capture thi data with the RealTerm oftware. o Run RealTerm. In the Diplay tab, et Diplay a to the econd Acii, then under the Port tab, et the correct COM Port and the baud rate to match up with the one declared in the Arduino program, then click the change button with the green check mark. You hould now be able to ee reaonable data coming from the Arduino. o You can alo end command to the Arduino if you have et the Arduino program up to receive erial command. o To capture data, go to the capture tab. Specify the output location, then begin capturing data of interet by clicking Start Overwrite. When finihed, click Stop Capture. Now you have a text file you can import into Matlab and graph. Be ure that the firt and lat line are complete to avoid uploading partial data. Delete thee line if neceary. Uing the captured data, plot encoder poition v. time. Alo write code to calculate the derivative of the poition, and plot velocity v. time. Find the calibration factor between angle in radian and encoder count by manually turning the motor. I the number the ame a the one you found baed on the information on the pec heet? 2.2 Implementing Cloed-Loop Poition Control Now implement your poition controller on the Arduino. The command to drive the DC motor in the Arduino code i called etspeed() which can be et between 0 and 255, where 0 correpond to no voltage, 255 correpond to full voltage, and the duty cycle (the percent of the time the voltage i et to high) varie linearly in between. Start with a proportional controller and add a derivative term to make a PD controller. See how well your controller work by manually changing the et point. You can alo try uing the provided function generator which give you a low quare wave and a ine wave. Capture your controller' performance and make a plot in Matlab once you've found effective gain. A plot of the root locu ha been provided in Figure 3 to help you think about your controller deign. 2.017 Fall 2009 3

Figure 3. A root locu plot of an open-loop PD controlled motor. Your tak i to adjut the controller gain until the repone of the cloed-loop ytem i reaonably fat and well damped. 2.3 Higher Performance from the Control Sytem Thoe of you who have taken a more advanced cla in control ytem may wonder why we are uing PD control, rather than PID or Lead-Lag/Lag-Lead control. We can, in fact, ue PID control, but there are a few real-world conideration that need to be addreed. For extra credit, try to make a PID controller that follow the quare and the ine wave provided in the code. Remember that a PID compenator i a filter of the following form: G ( ) = K c p K + i K d + K = d 2 + K + K p i It ha two zero and one pole. For the moment, we will not think about thee a eparate gain, but a zero location: G ( z )( 1 2 c ( ) = K o We will aume that the plant i jut two pole at the origin, o the forward tranfer function of the ytem take the form: G( ) = G c ( ) G p ( ) = K o z ) ( z 1 )( z2) 3 2.017 Fall 2009 4

Ue the root locu tool (i.e., iotool) in Matlab to pick value of z 1 and z 2 that produce a reaonable root locu for thi open-loop tranfer function. The performance of the controller will be dominated by the location of the cloed-loop pole/pole pair cloet to the imaginary axi. Once you have choen thee value, ue the equation above to olve for the gain value. Once you have uccefully implemented thi PID controller and have it tracking the reference ine wave, connect it up to a quare wave reference. You will notice that the controller exhibit a huge amount of overhoot. Thi phenomenon i not predicted by the linear model of our ytem. It i due to the fact that the motor repone i rate limited. When a reference i given that the motor cannot follow, the integral error will increae very quickly. Once you are back on the reference, the integral error effectively act a a diturbance, cauing overhoot. Control deigner refer to thi problem a integrator wind-up. It can be olved either by pre-filtering the reference ignal by rate limiting and moothing o that the controller only receive input that it can follow, or by placing aturation limit on the integrator o that it can't wind up too far. Experiment with variou way to reduce wind-up. You may want to try etting aturation limit on the integrator firt. Print out one graph each howing the cloed-loop repone of the PID controlled ytem with the quare and the ine wave reference input repectively. I it better than the PD control and why? 2.4 Velocity Control Some application require motor peed control intead of controlling it poition. If you have time, deign a imple PI controller to control the peed of the motor by modifying the template code. 3 Controlling a Servo RC hobby ervo are the eaiet way to et up for motor control. They have a 3-pin 0.1" female header connection with +5V, ground and ignal input. The motor hield imply bring out the 16bit PWM output line to 2 3-pin header o that it i eay to plug in a ervo and tart ending command ignal to it. Typically an RC ervo can be poitioned from 0 to 180 degree. Inide the ervo there i a DC motor connected to a potentiometer. PWM ignal ent to the ervo are tranlated into poition command by the feedback circuitry inide the ervo. When the ervo i commanded to rotate, the motor i powered until the potentiometer reache the value correponding to the commanded poition. RC ervo are often ued in mall-cale robotic application due to their affordability, reliability, and implicity of control by microproceor. The ervo ha three wire: ground (uually black), power (red) and control (white). However the ervo we have in the kit ha a different color cheme which i wired a brown (negative), red (poitive) and orange (ignal). 2.017 Fall 2009 5

The ervo will move baed on the pule ent over the control wire, which et the angle of the actuator arm. The ervo expect a pule every 20 m in order to gain correct information about the angle. The width of the ervo pule dictate the range of the ervo' angular motion. The PWM pin of the ervo connector on the Arduino motor hield are etup to provide the required duty cycle to drive a typical ervo. Attach one of the haft attachment to the ervo. Connect the ervo to SER1 male connector on the motor hield. Make ure the brown wire i connected to ground pin. Open and upload the Servo1 ketch. Open the Serial Monitor and try ending different haft angle to the ervo. Modify the code o that you can ue a potentiometer to control the haft angle. 4 Project Dicuion Propoal feedback. 5 Deliverable Anwer all the quetion above. Plot. Show the teaching taff your lab notebook. 2.017 Fall 2009 6