EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Similar documents
EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

TB6612FNG Hookup Guide

8 Channel 5V Optical Isolated Relay Module

Lab 4.4 Arduino Microcontroller, Resistors, and Simple Circuits

User's Manual. May 2013 V1.0. ROBOT. HEAD to TOE Product User s Manual HC SR04 Ultrasonic Sensor

Memorial University of Newfoundland Faculty of Engineering and Applied Science

Week 11. Module 5: EE100 Course Project Making your first robot

(for example A0) on the Arduino you can expect to read a value of 0 (0V) when in its upright position and 1023 (5V) when it is tilted.

Starter Robot Kit IR Version. Robot Tank Three-wheeled Robot Car

Permanent Magnet DC Motor Operating as a Generator

Lesson 1 - Make The Car Move Points of this section

PARTS LIST. Beams: 72x. 16x. 64x. 16x. 12x. 2x Breadboards CYB x TotemDuino 1x LabBoard 1x 30cm 34way Flat Cable 1x Power Supply 12v 1,5A

Driver Board User Manual

Mens et Manus. Controlling a Brushless Motor

The CMPE 118 Cockroach Robot Dept. of Computer Engineering, UCSC

The Fleming s Left Hand Rule shows what happens when electrons in a current enter a magnetic field.

8051 MICRO-CONTROLLER BASED ROBOTIC CAR

About the moto:bit Board

INTRODUCTION TO SENSORS, TRANSDUCERS & ACTUATORS

Permanent Magnet DC Motor

Dynamic Ferrofluid Lamp

Attitude Control. Actuators and Attitude Control

ANTI-LOCK BRAKES. Section 9. Fundamental ABS Systems. ABS System Diagram

The Easy Driver gives you the capability to drive bipolar stepper motors between 150mA to 700mA per phase.

Hello and welcome to training on general purpose motor drivers in the 3 to 15 volt range. I m Paul Dieffenderfer & I will be your host for this

System Integration of an Electronic Monitoring System in All-Terrain Vehicles

CS/ECE 5780/6780: Embedded System Design

User's Manual O

2.007 Design and Manufacturing I, Spring 2013 EXAM #2

Autonomously Controlled Front Loader Senior Project Proposal

Please Handle Carefully!

Exercise 2-1. The Separately-Excited DC Motor N S EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. Simplified equivalent circuit of a dc motor

Components of an Electric Linear Actuator

AGELKOM CAP04V-9 Plasma and Oxy Fuel Torch height control for sheet metal cutting machines Height Sensor & Controller

Final Report. James Buttice B.L.a.R.R. EEL 5666L Intelligent Machine Design Laboratory. Instructors: Dr. A Antonio Arroyo and Dr. Eric M.

FireBeetle Covers-DC Motor & Stepper Driver SKU:DFR0508

715B CONTROL SERIES. Instruction Manual Line Voltage DC Brushless Motor Control CONTROLS. Phone (317) Fax (317)

Office Automated Delivery Robot

SPH3U UNIVERSITY PHYSICS

MANTECH ELECTRONICS. Stepper Motors. Basics on Stepper Motors I. STEPPER MOTOR SYSTEMS OVERVIEW 2. STEPPING MOTORS

Sorting Line with Detection 24V

Note 8. Electric Actuators

Product Manual L293D BREAKOUT Updated on 24 June 2017

Kelly HPM High Power Full Bridge Permanent Magnet DC Motor Controller User s Manual

BELT-DRIVEN ALTERNATORS

Automated Seat Belt Switch Defect Detector

ARDUINO 2WD SMART ROBOT CAR KIT

1.0 Features and Description

Load Cell Amplifier HX711 Breakout Hookup Guide

DR8010 tm. Hardware Reference Manual. Document Revision B4 May 15, 2018

BLDC SPEED CONTROL INSTRUCTION MANUAL Low voltage Brushless DC control

(Let s first discuss in detail about Electric circuit of a kart and then evaluate the possible conditions for fire accidents.)

STR3. Step Motor Drive. User Manual

N1387 Series Troubleshooting Guide for N Alternators

RCP200 Series Motor Controls. Instruction Manual Model RCP Model RCP Model RCP202-BC1 Model RCP202-BC2 Model RCP205-BC2

Glow Plug for E Series Only

ENSC387: Introduction to Electromechanical Sensors and Actuators LAB 5: DC MOTORS WARNING:

CONTROL FEATURES AVAILABLE OPTIONS

Roll Up Door Operator

Solar based Automatic Harvesting Robot

Armature Reaction and Saturation Effect

CENTROIDTM. AC Brushless Drive. Product Spec Sheet

Working with VEX Parts

Science 30 Unit C Electromagnetic Energy

Freescale Semiconductor, I

Full Bridge Permanent Magnet DC Motor Controller User's Manual

LNII Series Motor and Drives

Kelly HSR Series Motor Controller with Regen User s Manual V 3.3. Kelly HSR Opto-Isolated Series Motor Controller with Regen.

TPM. w w w. n a v i t a s t e c h n o l o g i e s. c o m

1. Which device creates a current based on the principle of electromagnetic induction?

BLDC SPEED CONTROL INSTRUCTION MANUAL Line voltage Brushless DC control

Exercise 3-3. Basic Operations of GTO Thyristors EXERCISE OBJECTIVES

Installing the RT-50A Rain Tracker on a Toyota Prius 2010 (v3 European model)

Fixing and Positioning of the Object Based on RFID Technology using Robotic Arm

High Level Design ElecTrek

Troubleshooting Bosch Proportional Valves

o applied to the motor., 0, and Vo

ATOTH-G Series BLDC Motor Controller. User s Manual

A Comprehensive Study on Speed Control of DC Motor with Field and Armature Control R.Soundara Rajan Dy. General Manager, Bharat Dynamics Limited

Lab 6: Wind Turbine Generators

PROJECT IDEA SUBMISSION STUDENT

Exercise 7. Thyristor Three-Phase Rectifier/Inverter EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. Thyristor three-phase rectifier/inverter

30A BLDC ESC. Figure 1: 30A BLDC ESC

Two Wheeled Self balancing Robot

Application Information

Overview of operation modes

Troubleshooting Guide for N1225-1/N1237-1/N Alternators

SR3-mini. Step Motor Drive User Manual. AMP & MOONS Automation

Model 616 Rotating Disk Electrode Instruction Manual

Hashemite University Mechatronics Engineering Department Process Control Laboratory

Lesson Plan: Electricity and Magnetism (~100 minutes)

The Starter motor. Student booklet

Getting Started with the Digilent Electronics Explorer Board

WSS/WSS-L White paper

Basic Electricity. Mike Koch Lead Mentor Muncie Delaware Robotics Team 1720 PhyXTGears. and Electronics. for FRC

BATTERY BOOSTER SHIELD

Kelly KDHA High Voltage Series/PM Motor Controller User s Manual

BUMP AND SPIN KIT ESSENTIAL INFORMATION. Version 1.0 PROGRAM AND DESIGN YOUR OWN BUGGY WITH THIS

Unit 8 ~ Learning Guide Name:

Installation Instructions

Transcription:

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE LABORATORY 11: AUTOMATED CAR PROJECT DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING UNIVERSITY OF NEVADA, LAS VEGAS GOAL: This section combines the motor driver, distance sensor, and a tracked chassis to create an automated car chassis that reacts to the environment. OBJECTIVES: Learn the basics of Arduino Programming o Commands: setup() loop() Funtions DistanceGP2Y0A21YK Library Interface with the Sharp Distance Sensor Interface with the TB6612FNG motor driver Operate a DC motor Control various aspects of DC motor operation OVERVIEW AND REQUIREMENTS: This project uses components and methodologies discussed in the previous labs in addition to the Zumo Chassis. Zumo Chassis with 2 High-Power Brushed DC Motors The Zumo chassis kit contains the components necessary to build a small, high-performance tracked robot platform. Each side of the chassis has an idler sprocket that spins freely and a drive sprocket that connects to a micro metal gearmotor. The main body is composed of ABS plastic and has sockets for two micro metal gearmotors and a compartment for four AA batteries. The battery compartment terminals protrude through the chassis and can be accessed from the top side. A black acrylic plate is included with the chassis. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 1

Brushed DC Motors A DC motor is an electric motor that runs on direct current (DC) electricity. DC motors can operate directly from rechargeable batteries, providing the motive power for the first electric vehicles. Today DC motors are still found in applications as small as toys and disk drives, or in large sizes to operate steel rolling mills and paper machines. The brushed DC electric motor generates torque directly from DC power supplied to the motor by using internal commutation, stationary magnets (permanent or electromagnets), and rotating electrical magnets. The inside of a DC Motor DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 2

When the coil pictured above is powered, a magnetic field is generated around the armature. The left side of the armature is pushed away from the left magnet and drawn toward the right, causing rotation. The armature will then continue to rotate and when the armature becomes horizontally aligned, the commutator reverses the direction of current through the coil, reversing the magnetic field. This process then repeats, causing the motor rotation. Advantages of a brushed DC motor include low initial cost, high reliability, and simple control of motor speed. Disadvantages are high maintenance and low life-span for high intensity uses. Maintenance involves regularly replacing the brushes and springs which carry the electric current, as well as cleaning or replacing the commutator. These components are necessary for transferring electrical power from outside the motor to the spinning wire windings of the rotor inside the motor. H Bridge An H bridge is an electronic circuit that enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards. An H bridge is built with four switches. When the switches S1 and S4 (in the diagram pictured above) are closed, and S2 and S3 are open, a positive voltage will be applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the motor. The switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. The same applies to the switches S3 and S4. TB6612FNG Dual Motor Driver Carrier The TB6612FNG motor driver is a dual H Bridge based driver that can control up to two DC motors at a constant current of 1.2A (3.2A peak). Two input signals (IN1 and IN2) can be used to control the motor in one of four function modes - CW, CCW, short-brake, and stop. The two motor outputs (A and B) can be separately controlled, the speed of each motor is controlled via a PWM input signal with a frequency up to 100kHz. The STBY pin should be pulled high to take the motor out of standby mode. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 3

Logic supply voltage (VCC) can be in the range of 2.7-5.5VDC, while the motor supply (VM) is limited to a maximum voltage of 15VDC. The output current is rated up to 1.2A per channel (or up to 3.2A for a short, single pulse). Infrared Proximity Sensor - Sharp GP2Y0A21YK 1 Output 2 Ground 3 VCC (5V) The Sharp GP2Y0A21YK is an Infrared proximity Sensor. It shines a beam of IR light from an LED, and measures the intensity of light that is bounced pack using a phototransistor. This IR sensor is more economical than sonar rangefinders, yet it provides much better performance than other IR alternatives. Interfacing to most microcontrollers is straightforward: the single analog output can be connected to an analog-to-digital converter for taking distance measurements, or the output can be connected to a comparator for threshold detection. The detection range of this version is approximately 10 cm to 80 cm (4" to 32"); a plot of distance versus output voltage is shown below. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 4

As you can see the output from the sensor is not linear. In order to compensate for this we are using a library that contains a Look-up Table (LUT) that has stored distance values relative to the analog output voltage from the IR sensor. How the Sensor Works 1. A pulse of IR light is emitted by the emitter. 2. This light travels out in the field of view and hits an object. 3. The reflected light returns to the detector and creates a triangle between the point of reflection, the emitter, and the detector. 4. The angles in this triangle vary based on the distance to the object. 5. The receiver uses a precision lens to transmit the reflected light onto various portions of the enclosed linear CCD array based on the angle of the triangle described above. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 5

6. The CCD array can then determine what angle the reflected light came back at and therefore, it can calculate the distance to the object. COMPONENTS: Arduino Uno USB A-B Cable TB6612FNG Dual Motor Driver Carrier 6V DC Motor Breadboard Shield Jumper Wire Zumo Chassis Kit w/ 2 DC Micro Motors Sharp GP2Y0A21YK IR Proximity Sensor 4x AA Rechargeable Batteries 9V Battery Adapter w/ 9V Battery Host PC Installed Arduino Uno drivers and IDE DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 6

WIRING GUIDE: This is the layout for the breakout board of the TB6612FNG. Here is a short guide on how to connect the motor driver. The connection guide is given from the left side down, then the right side down. GND - Connect to the ground terminal on the Arduino board VCC - Connect to the 5V VCC on the Arduino board. AO1 - Connect to the negative lead of motor A. AO2 - Connect to the positive lead of motor A. BO2 - Connect to the positive lead of motor B. BO1 - Connect to the negative lead of motor B. VMOT - Connect to the positive side of the power source you are using to power the motors. GND - Connect to the negative side of the power source you are using to power the motors. PWMA - Connect to PWM pin on the Arduino. [Pins 3, 5, 6, 9, 10, 11] AIN2 - Connect to a digital pin on the Arduino. AIN1 - Connect to a digital pin on the Arduino. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 7

STBY - Connect to a digital pin on the Arduino. BIN1 - Connect to a digital pin on the Arduino. BIN2 - Connect to a digital pin on the Arduino. PWMB - Connect to a PWM pin on the Arduino. [Pins 3, 5, 6, 9, 10, 11] GND - Connect to the ground of the Arduino. For this exercise the following wiring was used for the Arduino: #define PWMA 3 #define AIN1 2 #define AIN2 8 #define BIN1 4 #define BIN2 5 #define PWMB 6 #define STBY 7 PROCEDURE: This is the final project for the class and there will be more time and less information provided than in previous projects. 1. Insert the 4x AA batteries into the Zumo Chassis. 2. Attach the Breadboard Shield to the Arduino, making sure to properly align the pins. If you are using an R3 revision of the Arduino UNO, there will be 2 pins on each side that will have no corresponding pins on the shield. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 8

3. Wire the circuit as shown in the wiring guide. Do not wire the circuit while the Arduino is powered. Omit wiring the DC motors until the Arduino has been mounted onto the chassis. Your final result should be something similar to the following snapshots. 4. A strip of velcro will be provided to mount the Arduino. Place one end on the bottom of the Arduino and the other on the chassis as pictured below. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 9

5. Connect the 2 DC motors to the motor driver as labeled in the wiring guide. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 10

6. Connect the VMOT pin and subsequent GND pin to the (+) and (-) Battery terminals respectively. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 11

7. Open the Arduino IDE and create a new sketch titled ArduinoCar. Verify that the correct COM port is in use. 8. The following sketch is a slightly altered version of the sketch from the previous lab. When this sketch runs, it will turn 1 DC motor. #define PWMA 3 #define AIN1 2 #define AIN2 8 #define BIN1 4 #define BIN2 5 #define PWMB 6 #define STBY 7 #define motor_a 0 #define motor_b 1 #define FORWARD 1 #define REVERSE 0 #define RIGHT 1 #define LEFT 0 void setup() pinmode(pwma,output); pinmode(ain1,output); pinmode(ain2,output); pinmode(pwmb,output); pinmode(bin1,output); pinmode(bin2,output); pinmode(stby,output); motor_standby(false); move //Must set STBY pin to HIGH in order to DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 12

void loop() motor_drive(forward, 255); delay(1000); motor_stop(); delay(1000); motor_drive(reverse, 255); delay(1000); motor_stop(); delay(1000); //Turns off the outputs of the Motor Driver when true void motor_standby(char standby) if (standby == true) digitalwrite(stby,low); else digitalwrite(stby,high); //============================================= //FUNCTIONS //============================================= //Stops the motors from spinning and locks the wheels void motor_stop() digitalwrite(ain1,1); digitalwrite(ain2,1); digitalwrite(pwma,low); //Controls the direction the motors turn, speed from 0(off) to 255(full speed) void motor_drive(char direction, unsigned char speed) if (direction == FORWARD) motor_control(motor_a, FORWARD, speed); //Control motor B Forward here else motor_control(motor_a, REVERSE, speed); //Control motor B Reverse here void motor_control(char motor, char direction, unsigned char speed) if (motor == motor_a) DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 13

if (direction == FORWARD) digitalwrite(ain1,high); digitalwrite(ain2,low); else digitalwrite(ain1,low); digitalwrite(ain2,high); analogwrite(pwma,speed); //Write Motor B code here. 9. Verify your results by checking to see that the Motor A rotates in one direction, then in reverse. 10. Modify the design so that Motor B simultaneously moves with Motor A in the same direction. 11. Attach the Sharp proximity sensor to the Arduino and modify the code so that the car simply goes forward until an object is within 10cm, in which case it will stop. 12. Modify the code so that whenever the car stops, it goes in reverse for a short period of time and then turns right or left (choose one) and continues to go forward. Once it continues to go forward it should still detect if an object is within range, then stop and turn before collision. 13. Once your code is uploaded and operational, the USB cable can be unplugged and the 9V battery adapter can be used to power the Arduino. TEST YOUR UNDERSTANDING: Write a detailed report on your project. Your report should include the code you used and a detailed explanation of the car s functionality. Please also include encountered problems, how they were solved, other descriptions and conclusions. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 14