Embedded Controls Final Project. Tom Hall EE /07/2011

Similar documents
Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

DASL 120 Introduction to Microcontrollers

FABO ACADEMY X ELECTRONIC DESIGN

Sten-Bot Robot Kit Stensat Group LLC, Copyright 2013

Hardware Platforms and Sensors

Controlling an AC Motor

Module: Arduino as Signal Generator

Floating Ball Using Fuzzy Logic Controller

Written by Hans Summers Wednesday, 15 November :53 - Last Updated Wednesday, 15 November :07

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

Training Schedule. Robotic System Design using Arduino Platform

Control System for Lamp Luminosity. Ian Johnson, Tyler McCracken, Scott Freund EE 554 November 29, 2010

SPI, Talking to Chips, and Minimizing Noise

02 Digital Input and Output

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

Sten BOT Robot Kit 1 Stensat Group LLC, Copyright 2016

Sensors and Sensing Motors, Encoders and Motor Control

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

Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett

Measuring Distance Using Sound

Total Hours Registration through Website or for further details please visit (Refer Upcoming Events Section)

Portland State University MICROCONTROLLERS

Assignments from last week

USER MANUAL SERIAL IR SENSOR ARRAY5

Introduction: Components used:

Part 1: Determining the Sensors and Feedback Mechanism

Marine Debris Cleaner Phase 1 Navigation

Design of stepper motor position control system based on DSP. Guan Fang Liu a, Hua Wei Li b

C++ PROGRAM FOR DRIVING OF AN AGRICOL ROBOT

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

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

A Simple Design of Clean Robot

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

NAMASKAR ROBOT-WHICH PROVIDES SERVICE

Hydraulic Actuator Control Using an Multi-Purpose Electronic Interface Card

Sensor and. Motor Control Lab. Abhishek Bhatia. Individual Lab Report #1

Sensors and Sensing Motors, Encoders and Motor Control

Exercise 5: PWM and Control Theory

Hello, and welcome to this presentation of the STM32 Digital Filter for Sigma-Delta modulators interface. The features of this interface, which

The Motor sketch. One Direction ON-OFF DC Motor

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

MAKEVMA502 BASIC DIY KIT WITH ATMEGA2560 FOR ARDUINO USER MANUAL

Building a Microcontroller based potentiostat: A Inexpensive and. versatile platform for teaching electrochemistry and instrumentation.

Follow this and additional works at: Part of the Engineering Commons

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

CONSTRUCTION GUIDE Capacitor, Transistor & Motorbike. Robobox. Level VII

Digital Acquisition of Analog Signals A Practical Guide

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

Engine Control Workstation Using Simulink / DSP. Platform. Mark Bright, Mike Donaldson. Advisor: Dr. Dempsey

Mechatronics Laboratory Assignment 3 Introduction to I/O with the F28335 Motor Control Processor

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

1. Introduction to Analog I/O

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

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

DATASHEET. Amicrosystems AMI-AD1224 HIGH PRECISION CURRENT-TO-DIGITAL CONVERSION MODULE PRODUCT DESCRIPTION FEATURES

ENHANCED WIRELESS AUDIO AMPLIFIER

ECE 477 Digital Systems Senior Design Project Rev 8/09. Homework 5: Theory of Operation and Hardware Design Narrative

Distance Measurement of an Object by using Ultrasonic Sensors with Arduino and GSM Module

Motors and Servos Part 2: DC Motors

Embedded Hardware Design Lab4

Peripheral Link Driver for ADSP In Embedded Control Application

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

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

PCB & Circuit Designing (Summer Training Program 2014)

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

PHYSICS 124 PROJECT REPORT Kayleigh Brook and Zulfar Ghulam-Jelani

Arduino and Servo Motor

Application Note AN 157: Arduino UART Interface to TelAire T6613 CO2 Sensor

SCHOOL OF TECHNOLOGY AND PUBLIC MANAGEMENT ENGINEERING TECHNOLOGY DEPARTMENT

Electronics Design Laboratory Lecture #9. ECEN 2270 Electronics Design Laboratory

Lab 06: Ohm s Law and Servo Motor Control

Community College of Allegheny County Unit 4 Page #1. Timers and PWM Motor Control

Lab 23 Microcomputer-Based Motor Controller

AQuaH Autonomous Quad-Propeller Helicopter

Optimal Control System Design

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

Switch Mode Power Conversion Prof. L. Umanand Department of Electronics System Engineering Indian Institute of Science, Bangalore

DFRduino Romeo All in one Controller V1.1(SKU:DFR0004)

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

Arduino as a tool for physics experiments

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

Exercise 3: Sound volume robot

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

Robotics & Embedded Systems (Summer Training Program) 4 Weeks/30 Days

Design of Voltage Regulating Control Device of Improved PID Algorithm for the Vehicle AC Generator Based on DSP

Embedded Systems & Robotics (Winter Training Program) 6 Weeks/45 Days

PYKC 7 March 2019 EA2.3 Electronics 2 Lecture 18-1

A Low-Cost Control System Experiment for Engineering Technology Students

Application Note AN 102: Arduino I2C Interface to K 30 Sensor

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

Community College of Allegheny County Unit 7 Page #1. Analog to Digital

Design and implementation of GSM based and PID assisted speed control of DC motor

International Journal of Advance Engineering and Research Development

Introduction. Theory of Operation

EE 308 Spring Preparation for Final Lab Project Simple Motor Control. Motor Control

Robotic Arm Assembly Instructions

MICROCONTROLLER BASED SPEED SYNCHRONIZATION OF MULTIPLE DC MOTORS IN TEXTILE APPLICATIONS

CONSTRUCTION GUIDE Light Robot. Robobox. Level VI

Instrument Cluster Display. Grant Scott III Erin Lawler Mike Carlson

Electronics Design Laboratory Lecture #10. ECEN 2270 Electronics Design Laboratory

Transcription:

Embedded Controls Final Project Tom Hall EE 554 12/07/2011

Introduction: The given task was to design a system that: -Uses at least one actuator and one sensor -Determine a controlled variable and suitable sampling interval for this system -Model if possible the system and compare the behavior of the model to the behavior of the actual system -Design and tune a controller to meet your design specifications, and compare the simulated performance to the actual performance of the system The project developed to meet these criteria is to create a mobile unit that would avoid obstacles. This project was selected to create a platform that could be used and upgraded for other projects. Hardware Design: The hardware specifications designed for this project are as follows: -The unit needs to have at least one distance detecting sensor -The unit should use two motors -The controller should be an Arduino Duemilanove The arduino duemilanove is a microcontroller based on the Atmega328 chip. It has the following specifications: -Bootable Memory: 1 Kb -Clock Speed: 20 MHz -A/D: 8-channel 10-bit resolution -GPIO Lines: 23 -Temperature Range: -40 C to 85 C -Power Consumption: 0.2 ma Original Design The original system used two infrared emitter and detector pairs to determine the distance to an object. This combination detects the distance by emitting an infrared wave that would reflect off an object and return to the detector. As an object gets closer to the sensor the detector will receive the emitted wave faster. The original system also used a pair of low power motors that could be driven by the microcontroller through a pulse width modulated (PWM) signal. A PWM signal outputs a series of 5 volt pulses whose frequency is determined by a duty cycle. For example a duty cycle of 50% would have the motor running at half speed while a duty cycle of 100% would have the motor running at full speed. A diagram of the design can be seen in figure 1.

Arduino DAC ADC Motor Motor Sensor Sensor Figure 1: A block diagram of the original design Issues with the original design Due to funding and time constraints the parts to make the unit mobile were unable to be purchased. As a result an agreement was reached with Dr. Erives where the "mobile" unit could be laid out on a breadboard and tested to show a proof of concept. However a couple of hours before the project was to be presented the pair of infrared sensors were no longer responding to the program. The sensors output only zeros. After much troubleshooting it was necessary to start looking at another design. Current Design Because of the complications with the infrared sensors a new ultrasonic sensor was selected to replace the original sensors. This sensor measures distance by emitting a pulse that bounces off objects and reading the echo. The sensor requires a small 10us pulse to initiate the pulse sequence then requires 10ms to read the echo. To use this sensor a input capture device needed to be designed in order to determine the distance. An input capture device takes in a signal and determines the time between the current signal and the previous. Because of the limited amount of time, only one sensor could be implemented. This results in only one axis of movement because the sensor can only sense one dimension. Because of this there would only be a need for one motor which suited the time constraints. A diagram of this design can be seen in figure 2. Arduino DA Motor AD Sensor Figure 2: A block diagram of the current design Controller: The selected controller was a PID controller. This was because the PID is able to control an overshoot while keeping the system stable. The characterization of the infrared sensors can be seen in figure 3. This wave form is the readout from the sensor as the distance to an object is decreased. Figure 4 contains the characterization of the ultrasonic sensor. This characterization was used to calculate the tau value for the controller. The zeta value was then varied until a more stable signal was found. From there the other constants and coefficients were calculated. These values were then put into equation 1.

30 25 20 15 10 5 0 0 200 400 600 800 1000 1200 1400 1600 Figure 3: Characterization of the infrared sensor over time Figure 4: Characterization of the ultrasonic sensor over time Equation 1: Formula used to implement the PID controller Software Design: The software design was fairly straightforward. First the 10us pulse is sent to initiate the ultrasonic sensor. After reading the distance, the program applies the new value to the controller which then corrects the motor speed. Finally PWM's duty cycle is calculated by normalizing the sensor value and in the process adding in the correction value obtained from the controller. The code can be seen in appendix 1.

Results: The expected behavior of this system is to run the motor and adjust the motor speed as the object moves closer or further away. Since the system was immobile a distance was set that the motor had to get to. Next an object was moved closer and further away to the sensor to simulate the system moving. When the object was moved closer the motor would slow and when the object was moved further away the motor sped up. When the object would approach the desired distance the motor would stop. There was a slight margin of error that the controller could reduce with more time, however for this project the system was successful. Conclusion: The system that was designed met all applicable criteria that was needed for the project. The system used one motor as an actuator and one ultrasonic sensor as a sensor, the controlled variable was the motor speed, the characterization of the system was completed and then used to design a PID controller for the system. In the future two more of the ultrasonic sensors will be added to the system so that it can eventually navigate better. Also an amplifier circuit will be designed to amplify the voltage coming from the PWM so that higher power motors can be used. Finally a PCB will be designed to take the system off a breadboard.

Bibliography Arduino - HomePage. Web. 07 Dec. 2010. <http://www.arduino.cc/>. Fadali, M. Sami., and Antonio Visioli. Digital Control Engineering: Analysis and Design. Amsterdam [u.a.: Elsevier, Academic, 2009. Print. "PID Controller." Wikipedia, the Free Encyclopedia. Web. 07 Dec. 2010. <http://en.wikipedia.org/wiki/pid_controller>.

Appendix 1: Code int delta=0; int prev=0; #define del_t 10 #define tau -5.5 #define zeta.3105 #define w_n (1.0/(tau*zeta)) #define k_d w_n*w_n #define k_p (k_d*2.0*zeta*w_n) #define k_i (w_n*w_n*k_d) #define t_i (k_p/k_i) #define t_d (k_d/k_p) //Defines constants to be used in the controller float e=0; float e_1=0; float e_2=0; float u=0; float u_1=0; int ref=625; void setup(){ Serial.begin(9600); pinmode(3, OUTPUT); pinmode(9, INPUT); pinmode(6, OUTPUT); //Sets the distance //Sets baud rate for serial communication //Sets up pins to be used } void loop(){ digitalwrite(6,high); delay(.01); digitalwrite(6,low); //int val = digitalread(9); //Sends a 10us pulse //Serial.println(val); delta = pulsein(9,high); Serial.println(delta); delay(del_t); //Input capture function //prints to serial communicator int e=ref-delta; //Controller u=(int)(u_1+(e*(1.0 + del_t/t_i+t_d/del_t)+e_1*(-1.0-2.0*t_d/del_t)+e_2*(t_d/del_t))*k_p); u_1=u; e_2=e_1; e_1=e;

//Serial.println(u); if (delta < 0 delta > 10000){ //analogwrite(3,255); } else{ analogwrite(3,((25*(delta+u))/1000)); } // Serial.print("Sensor 1 = "); // Serial.print(sensor1); // Serial.print(" Sensor 2 = "); // analogwrite(3, 8*sensor1); // analogwrite(5, 8*sensor2); //PWM function }