Tuesday, April 2, 2019

Mobile Robotic Arm Motivation Computer Science Essay

nomadic automatonic outgrowth want Computer Science EssayRobotics is technology that deals with the name, construction and subroutine of zombiesthat ar utilize in numerous applications is called robotics. It has become an unstoppcapable force in the submit dancement of modern autory as they fuddle life easier. It is an interesting yield to dwell in as it is the future of mankind. Although we know them as modern inventions, the idea of automated or admitled railroad cars has fascinated homophiles. With this fascination it motivated me to manoeuvre on this ejection, building and programming a mobile robotic offshoot. It is my hunger to require and attain knowledge that drives me towards this knit stitch of study for my ejection.CUsersDanDesktopImages21042010(002).jpg double 1.1.1 Mobile Robotic Arm1.2 Introduction to RoboticsRobotics is an interesting topic of research. Basically it is an engineering field that is concerned with research and creation of robots f or various applications. Robots atomic number 18 machines that consist of electronic and mechanical parts much(prenominal)(prenominal) as gears and cogs put together for do tasks in place of compassionateitys. They stinkpot be programmed to run a hale range of tasks with ease. They be more or less desired for certain functions because they never tire, they th under(a) mug endure harsh physical conditions that is possibly life threatening and they never get bored or distracted from repetitious work. The number of robots has begun to annex in numbers e trulywhere as they study human compass almost non-existent with their efficiency and throughput.They discharge work with the simplest of materials to the most dangerous such as radioactive materials. They fundament be found more commonly in industrial use from production lines of factories to harvesting of fruits in orchards. In domestic use, from vacuum cleaning to lawn mowing where these domestic tasks have become dull for a human to undertake and would rather leave it to robots. In the more modern military use, robots play an important role to reduce human casualties from dangerous jobs such as bomb defusal and not forgetting space exploration where it might not be possible for humans to explore and for pile up terrain sample from foreign planets. For exploring enemy territories unmanned aerial vehicles are utilize from which these pilotless dr sensations can search terrains for hostiles and fire on targets.Robots are meant to eke out tasks that it is programmed to do. course of studys can al ports be altered to suit the task at hand. As robots become more innovative they gain more features such as sensors and artificial intelligence as they become more human ilk. Examples of sensors include motion sensors, temperature sensors, crystallize and many more various types. For example, in pathfinder robots we usually find a motion sensor which assist a robot in avoiding obstacles.In other applications for example in a water tank when the water has reached a certain direct the sensor modifys the robot to stop the flow of water. It can be utilize in industrial applications such as grip personal identification number downg objects from conveyor belts or it can be utilise in a more advanced role such as bomb defusal, where it would be dangerous for a human to interact. With camera adjuncts, humans can cook these machines from a serious distance charm completing the task at hand in a safe and efficient manner. In the medical field where a more delicate touch is required, a robotic arm can perform tiny incisions for a less invasive method. With a robotic arm jobs can be d whizz with ease and efficiency and thus eliminate human errors and the costs that come with those errors.http//www.engr.colostate.edu/dga/mech324/handouts/ referage_stuff/Mars_rover.png go into 1.2.1 Mars Rover1.3 ObjectivesThe aim of this project is to build a robotic arm for the purpose of li fting and moving small objects. It is that like a human arm with joints to facilitate apparent motionment. The end attachment features a gripper which is able to grab and hold objects and also a try out light in order to work in low light scenarios. The arm is correspondled via pumped-up(a) remote. It is rested on a mobile rack which is fitted with 2 rear wheels and 2 robot castors at the front. This drop outs the robot to move to the desired location where the object is.The objectives of this project areTo understand and develop core knowledge in robotics.To apply the knowledge of robotics and design a prototype.To implement the designs and build an actual prototype. variety 1.3.1 Project LayoutEnd chisel in Instruction Codes into PICTest PrototypeEvaluate label in relation to hardware designWrite CodesDiscuss conveyment notionPropose Objectives1.4 Design Stage body-build 1.4.1 Design Flow chartThis simple flowchart can explain the overall process touch in this projec t. after(prenominal) the objectives have been proposed the robot movement and motion opinion is plowed and after that the autographs are indite. It is downloaded into the micro ascendancy for testing. If testing fails we return to the code stage and evaluate the coding. The process reaches the end after testing passes.Chapter 2 Robot Overview2.1 ironware DesignThis aim of this project is to design a mobile robotic arm. The arm part consists of dickens joints which enable 2 degree of movement and at the end of the top joint is a gripper which enables objects to be gripped by the attachment. The tie-up has two wheels at the back and at the front two robot castors which has ball bearings underneath. This project involves two parts which is hardware and parcel. However some(prenominal) parts are intricately connected and it is hard to actually split them hitly. This report leave alone focus more on the software smell. on that point testament be some minor hardware intro duction as understanding of the hardware is required to work with the software. Here is the component appoint for the hardwareComponentAmountMicro encounterler PIC18F45201 ride number one wood SN75441014.7k Ohm Resistor11uF electrical condenser40.33uF Capacitor10.1uF Capacitor1L7805 quintupletage Regulator120MHz Oscillator19 Volt Battery1C40R servomechanicalmechanicalsystemmechanical force back3C55R servomechanism beat back1Servo Holder4Servo U hold up2SPG10 Geared drive242mm Wheels2Robot Castors2Table 2.1.1 hardware ComponentsTo write the software one must be familiar with the hardware functionality, configuration and settings. The hardware of significant importance would be the micro hold upler as the program is stored there. It sends the signal to the pins where other twists are connected. One of those devices is the servosystemmechanical move. It is what stops the arm and junior-grade. Actual gibe of the servos is by press releases. Those clits are connecte d to the microcontroller and is able to control the servo thru programming of the microcontroller. It is done by generating and manipulating PWM signals which will be discussed later.PROJECT BOARD20.0 cm24.0 cm10.0 cm25.6 cmTOP PROFILE.jpg figure out 2.1.1 Robot Layout2.2 Software DesignAfter the purpose and specifications are determined it is date to plan and design the software. Most modern robots are controlled by innovative software. Creation and modification of the software is crucial to make machines work the way we want it to. thither are many ways a machine can be programmed. The software is usually stored in the heart of the machine which is either a microprocessor or a microcontroller depending on what the machine does and how it works. That device is the brains of the robot as all the instructions are stored there. The software is the link for the user to the hardware as the program relays the instructions to the robot in machine code.The user writes the program in co mputing machine language which will then be converted into machine code by the compiler. There are many computer languages available to write programs such host, C, Pascal, staple and FORTH. For this project the microcontroller that is used is Microchips PIC18F4520. The language used to program the microcontroller is C. C is a simple and procedural language and it has influenced many later languages such Java. It is mainly variable and function based. Values are stored in variables for easy feeler and it is structured by defining and calling functions to perform tasks. C resigns exact control of the input and production. The input and product can be easy directed to the microcontroller terminals.The IDE (integrated development environment) that is used for this project is MPLAB which is a 32bit program used for the software development of this project along with the MPLAB C18 compiler add-on to allow the codes to be written in C .This is the screenshot of the development env ironmentCUsersDanDesktopFYP ReportimagesUntitled.jpg normal 2.2.1 MPLAB IDEThe general idea of writing the program is to control the pins of the microcontroller. The robot arm mechanism and the base mechanism will be isolated for easier explanation. The arm is made up of the 1st stage, 2nd stage, the left gripper and the near gripper. check over of the servos is by generating PWM signals which will be discussed in detail in chapter 4. By manipulation of these PWM signals we can control the servo movement to a certain angle with outstanding precision. For the DC motors in the base, it is controlled via motor controller. By manipulating logic combinations we will be able to control the movement and caution of the base.Infinite loop to check for loss pressA button is pressedNecessary routine or function is called to move servo/ DC motorEnd solve 2.2.2 General Software flow chartThis is a general flowchart to represent the program flow. A slice loop with an infinite condition is used to continuously check if a button has been pressed. If a button is pressed it will call the necessary function to run the specific device whether it is the servo or the DC motor.Chapter 3 Hardware Information3.1 MicrocontrollerThis project makes use of Microchip Technologys PIC18F4520 microcontroller. Lets discuss in detail what is a microcontroller and how it makes this project work. Notice that a microcontroller is chosen instead of a microprocessor for this project for a number of reasons. To make the choice, one must know the difference between a microcontroller and a microprocessor in terms of functionality and application. Both are typicly a small computer in the form of an integrated hitch which contains things like registers, storage, I/O, dissipates and timers. They pull up stakes in terms of number of I/O, registers, clock speed and reminiscence size.Microcontrollers are usually for cases that involve a lot of input output devices in contrast to a microproc essor which is usually used for heavy entropy applications. So that means microcontrollers dominate the robotics and automation industry. Lets examine closely what it looks like and the detailed features for this particular microcontroller, the PIC18F4520. Its versatility, robust nature and features contributed to the choosing of this IC. The detailed features along with its surgical procedure can be found in the datasheet for the microcontroller.CUsersDanDesktopFYP ReportimagesPIC18F4520IP.jpgFigure 3.1.1 PIC18F4250 parametric quantity NameValueProgram Memory TypeFlashProgram Memory (KB)32 mainframe travel (MIPS)10RAM Bytes1,536selective information EEPROM (bytes)256Digital Communication Peripherals1-A/E/USART, 1-MSSP(SPI/I2C) secure/Compare/PWM Peripherals1 CCP, 1 ECCPTimers1 x 8-bit, 3 x 16-bitADC13 ch, 10-bitComparators2Temperature simulacrum (C)-40 to 125Operating Voltage Range (V)2 to 5.5 personal identification number wait40Table 3.1.1 PIC18F4250 SpecificationsPeripher al Highlights High- circulating(prenominal) sink/ ancestry 25 mA/25 mA Three programmable external severs Four input commute interrupts Up to 2 Capture/Compare/PWM (CCP) modules,one with Auto-Shutdown (28-pin devices) Enhanced Capture/Compare/PWM (ECCP)module (40/44-pin devices only) One, two or four PWM outputs Selectable polarity Programmable loose time Auto-Shutdown and Auto-Restart Master Synchronous Serial Port (MSSP) module reinforcement 3-wire SPI (all 4 modes) and I2CMaster and Slave Modes Enhanced Addressable USART module Supports RS-485, RS-232 and LIN 1.2 RS-232 operation using native oscillatorblock (no external crystal required) Auto-Wake-up on vary bit Auto-Baud Detect 10-bit, up to 13-channel Analog-to-DigitalConverter module (A/D) Auto-acquisition capability variety available during catnap Dual analog comparators with input multiplexing)Power Managed Modes egest CPU on, peripheral devices on Idle CPU off, peripherals on Sleep CPU off, peripherals off Idle mo de currents down to 5.8 A typical Sleep mode current down to 0.1 A typical Timer1 Oscillator 1.8 A, 32 kHz, 2V watchdog Timer 2.1 A Two-Speed Oscillator Start-upFlexible Oscillator Structure Four Crystal modes, up to 40 MHz 4X Phase Lock Loop (available for crystal andinternal oscillators) Two extraneous RC modes, up to 4 MHz Two international Clock modes, up to 40 MHz Internal oscillator block 8 user selectable frequencies, from 31 kHz to 8 MHz Provides a complete range of clock speedsfrom 31 kHz to 32 MHz when used with PLL User tuneable to compensate for frequency drift routineary oscillator using Timer1 32 kHz Fail-Safe Clock Monitor Allows for safe shutdown if peripheral clock stopsSpecial Microcontroller Features C compiler optimized architecture elective extended instruction set designed tooptimize re-entrant code 100,000 erase/write cycle Enhanced Flashprogram memory typical 1,000,000 erase/write cycle Data EEPROMmemory typical Flash/Data EEPROM Retention 100 years typi cal Self-programmable under software control Priority take aims for interrupts 8 x 8 Single-Cycle Hardware Multiplier Extended Watchdog Timer (WDT) Programmable period from 4 ms to 131s Single-supply 5V In-Circuit SerialProgramming (ICSP) via two pins In-Circuit Debug (ICD) via two pins Wide in operation(p) voltage range 2.0V to 5.5V Programmable 16-level High/Low-VoltageDetection (HLVD) module Supports interrupt on High/Low-VoltageDetection Programmable Brown-out Reset (BOR With software enable optionHere is a list of pins and how they are connected in the circuit. tumble Name stick Number (PDIP)FunctionsMCLR1ResetRA13Servo PWM InputRA24Servo PWM InputRA35Servo PWM InputRA46Servo PWM InputVDD11+5VVSS12GroundedOSC113Oscillator Crystal/External Clock InputOSC214Oscillator Crystal/External Clock InputRC015IN2 of push back DriverRC116IN1 of ride DriverRC318IN4 of Motor DriverRD019IN3 of Motor DriverVSS31GroundedVDD32+5VRB033Motor Push passingRB134Motor Push ventRB235Motor Push ex pirationRB336Motor Push ButtonRB437Servo Arm Push ButtonRB538Servo Arm Push ButtonRB639Servo Arm Push ButtonRB740Servo Arm Push ButtonTable 3.1.2 Pin ConnectionsCUsersDanialDesktopFull Schem.JPGFigure 3.1.2 Full Schematics3.2 Motor DriverFigure 3.2.1 SN754410 Motor DriverThe SN754410NE is a quadruple half-H device driver. The SN754410 can operate a pair of DC motors at the same time. It gives the robot bi bootal movements. It carries the peak output currents up to 1 ampere at a voltage range of 4.5 to 36V. The SN754410 has a minimal logic voltage of 4.5V and a maximum logic voltage of 5.5V. This driver is made to operate from a -400C to 850C. Drivers are enabled in pairs. Driver 1 and driver 2 are enabled by 1,2EN. Driver 3 and driver 4 are enabled by 3,4EN. When the input is low, the drivers are disabled and the outputs are off. If the input is high, the drivers are enabled and the outputs are on.Figure 3.2.2 SN754410 Motor Driver PinoutPin 1 (1,2EN) enables/ disables the mot orPin 2 (1A) is a logic pin for the motorPin 3 (1Y) is for Motor APin 4, 5 are for groundingPin 6 (2Y) is for Motor APin 7 (2A) connected to the motorPin 8 (VCC2) connected to source for motor powerPin 9 (3,4EN) enables/ disables the motorPin 10 (3A) connected to the motorPin 11 (3Y) is for Motor BPin 12, 13 are for groundingPin 14 (4Y) is for Motor BPin 15 (4A) connected to the motorINPUTSOUTPUT YH = High LevelL = Low LevelX = Do Not MatterXX = OFFAENHHHLHLXLXXTable 3.2.1 SN754410 Function TableCUsersDanialDesktopMotor.JPGFigure 3.2.3 Motor Schematics3.3 DC MotorThis project will use the SPG10 Geared Motor that has 1.3 kg/cm torque. This motor is light sufficiency to not fight down the robot and only weighs 10 grams. It runs at 45 rpm.Figure 3.3.1 SPG10 MotorCUsersDanDesktopImages23042010(001).jpgFigure 3.3.2 Motor Wheel3.4 Servo MotorA servo is a mechanism used in robotic control systems. It is a mechanism that the user can set and forget. This is because of its ability to m ake corrections to return to its preset state if any changes occur. This is thanks to feedback operations. A servo is a casing that contains a DC motor, some gears with an output shaft, a variable resister that is connected to the output shaft, and a control board.The sensor mechanism allows the control circuit to monitor the current. The motor, through a series of gears, turns the output. The control circuit calculates the difference from the intended position from the current position the shaft is in. This makes the motor turn to its new position. If the control circuit senses that the position is accurate, it brings to a halt the motor.There are three connections to a servo the power line, the ground line and finally the control signal. The servo needs to be told when to move and wont do so til now if power is forgetd directly. The servo utilizes pulse width modulation (PWM) stream to intimate its position.SpecificationServo Motor ModelAt 5 VoltsSpeed (s/60o)0.19Torque (Kg.cm) 6.00Signal To Control angleTTL PWMPWM At Min fish (ms)0.54PWM At Max Angle (ms)2.40Operating Voltage (VDC)4.8-6.0Operating frequency (Hz)50.0Moving Range(degree)0-180Wiring (Black/Brown Wire)GroundWiring (Red Wire)4.8-6.0 VoltsWiring (Orange/ other Wire)PWM SignalTable 3.4.1 Servo SpecificationsCUsersDanialDesktopUntitled.jpgFigure 3.4.1 Servo MotorCUsersDanialDesktopServo.JPGFigure 3.4.2 Servo SchematicChapter 4 Software Coding4.1 PWM GenerationPWM is simply the short form for pulse-width modulation. It is an efficient way to provide intermediate amounts of electrical power between richly on and fully off. This means PWM signals are digital, because at any strident given instant of time, the full DC supply is either fully on or fully off. PWM is employed in a wide variety of applications, ranging from measuring stick and communications to power control and conversion.Many microcontrollers include on-chip PWM controllers, like the one which is used this project, which makes this easy for controlling the servos for this project. One of the advantages of PWM is that the signal remains digital all the way from the processor to the controlled system and no digital-to-analog conversion is necessary. By keeping the signal digital, noise effects are minimized. Noise can only affect a digital signal if it is strong enough to change logic 1 to logic 0, or vice versa. PWM is the initiation of controlling the servos in this project. Lets examine some basic theory.CUsersDanDesktopFYP Reportimagespwm.gifFigure 4.1.1 PWM Square WaveThe diagram above introduces a PWM signal that changes between 0 and 5 volts which is equivalent as digital logic 0 and 1. Notice that the waves are symmetrical. The uptime and downtime is 10ms when added together we get the period which is 20ms. Now that the fundamentals are out of the way, lets look at how a normal servo signal input looks like.CUsersDanDesktopFYP Reportimagespwm_servo.gifFigure 4.1.2 PWM WaveNote that the servo ru ns at 50Hz frequency and therefore the period is 20ms. The uptime is what determines the angle of which the servo motor moves to. In simple words, we can tell the servo where to move with great precision.These are some examples for 180 servos.t = 0.9msT = 20msAngle = 0t = 1.5msT = 20msAngle = 90t = 2.1msT = 20msAngle = 180The next step is to create these PWM signals using the PIC microcontroller. The PWMs is in this switch rehearsalswitch(count) //Choose which servo to modifycase 1 chess opening = 0x02 // First StageWriteTimer1( servo3 )breakcase 2 PORTA = 0x04 // Left GripperWriteTimer1( servo1 )breakcase 3 PORTA = 0x08 //Right GripperWriteTimer1( servo0 )breakcase 4 PORTA = 0x10 // Second StageWriteTimer1( servo2 )breakFigure 4.1.3 Switch StatementThe operations for the timers are split in to 4 possible cases of how to generate PWM signal to the pins to power the servos.This is what the statement does//INTERRUPT visualizepragma code InterruptVectorHigh=0x08void InterruptVector High (void)_asm//assembly code startsgoto InterruptHandlerHigh//interrupt control_endasm//assembly code endspragma codepragma interrupt InterruptHandlerHigh//end interrupt control compositors case 1 turns PortA1 On and resets the timer1.Case 2 turns PortA1 Off, PortA2 on and resets the timer1. Case 3 turns PortA2 Off, PortA3 on and resets the timer1. Case 4 turns PortA3 Off, PortA4 on and resets the timer1.Figure 4.1.4 Interrupt HandlerThe switch statement is nested in the interrupt handler function. The interrupt handler handles the timer operations. The interrupt control runs assembly code and then calls the go-to function which is InterruptHandlerHigh. The interrupt controller is set at high priority 0x08. Once the interrupt control is correctly implemented interrupts is sent to the interrupt handler where we can do whatever operation necessary depending on the type of interrupt.4.2 Arm Controlvoid move(int one,int two,int three,int four, int five)if(one)servo0 = one // Right Gr ipperif(two)servo1 = two // Left Gripperif(three)servo2 = three // Second Stage Linkif(four)servo3 = four // First Stage LinkA move function is declared to make things easier when linking with buttons. The arguments of the move function are the respective position the servo moves to when it is called upon.Figure 4.2.1 fall upon FunctionAfter the move function is declared it can be called when the specific button is pressed.//Arm Controlif(PORTBbits.RB7==1)move(0xF03B,0xF477,0,0,0) //GRIPif(PORTBbits.RB6==1)move(0,0,(servo2-0x0250),(servo3+0x0100),0) //MOVE AWAYif(PORTBbits.RB5==1)move(0,0,(servo2+0x0250),(servo3-0x0100),0) //MOVE TOWARDSif(PORTBbits.RB4==1)move(0xFA77,0xEE07,0,0,0) //UNGRIPFigure 4.2.2 Arm Button CheckThere are 4 buttons that control the movement of the arm.PortB pin 0 Close the gripperPortB pin 1 Move arm awayPortB pin 2 Move arm towardsPortB pin 3 Open the gripperCUsersVictorDesktopImagesClose Gripper.jpgFigure 4.2.3 Close GripperThis picture depicts a closed gripper state that is triggered by the button. The following figure is how the robotic arm will look when it is triggered to open both grippers.CUsersDanDesktop22042010(007).jpgFigure 4.2.3 Open Gripper4.3 junior-grade ControlThe only thing that needs to be controlled in the base is the 2 DC geared motors. It is linked with the microcontroller through the H-bridge. The motors rotational direction is determined by a combinational logic code as seen in the data sheet of the motor driver. It is the same with the servo, when a button is pressed certain commands will be executed.//Base Controlif(PORTBbits.RB3==1)// send on controlPORTCbits.RC1=1PORTCbits.RC0=0PORTDbits.RD0=1PORTCbits.RC3=0if(PORTBbits.RB2==1)// ferment controlPORTCbits.RC1=0PORTCbits.RC0=1PORTDbits.RD0=0PORTCbits.RC3=1Figure 4.3.1 Base Button Check (Forward/Reverse)if(PORTBbits.RB1==1)//Left controlPORTCbits.RC1=0PORTCbits.RC0=1PORTDbits.RD0=1PORTCbits.RC3=0if(PORTBbits.RB0)//Right ControlPORTCbits.RC1=1PORTCbits.RC0= 0PORTDbits.RD0=0PORTCbits.RC3=1Figure 4.3.2 Base Button Check (Left/Right)There are 4 buttons that control the movement of the base.PortB pin 4 ForwardPortB pin 5 ReversePortB pin 6 Move rightPortB pin 7 Move left4.4 SimulationCUsersDanDesktopUntitled.jpgFigure 4.4.1 Watch SimulationThe MPLAB software allows a minimal amount of simulation to show that the program is written correctly. Due to software limitation on the PIC18F4520 it is unable to correctly show port activities. However it does show variable activity like in the figure by using the watch feature in the MPLAB.This screenshot shows the stepping when make the OpenTimer1 function. A separate window opens to show the function and it will hold out to step through the function until it is done.CUsersDanDesktopUntitled1.jpgFigure 4.4.2 Program SteppingThe stepping continues while opening the necessary functions in a separate window and step though it until it is done. It reaches the while loop and it keeps looping as it waits for a button to be pressed. Figure 4.4.3 shows the final stage of the program stepping.CUsersDanDesktopUntitled3.jpgFigure 4.4.3 Final SteppingChapter 5 Conclusions and Recommendation5.1 SummaryThis project has further spread out my interest and knowledge in the field of robotics. A project that is very hands on like this sustains with the development of certain skills that would certainly help when I go on to become a professional engineer. The most important skill would be planning the stages of the project.To conclude, this project involved two phases which is the hardware design and software design. This report covered the software aspect in detail. In the early stages of this project different methods was planned for the outcome. At the start, the use of a PLC (programmable logic controller) was planned. However it proved to be unfeasible in terms of cost and size. In the end it was decided that a PIC microcontroller was to be use as it is easier to implement with res pect to the project and provides a great deal of functionality. The programming was made easier with the addition of the C compiler thus enabling the use of a higher level language which is C. With the use of a language of higher level it would be easier to implement features that were not possible using the PLC.5.2 RecommendationsIn this project, certain improvements can be made in order to make things work more efficiently. For example, the quick movements seen in the arm is because of the incrementer seen in the codes and lack true control software. By revising the software and introducing more control oriented design it is possible to fine tune the speed. Instead of the 2 robot castors that make up the front motion it could be replaced with wheels and a servo in between them to make the movement and control similar to remote controlled cars. The wired controller could be replaced with a wireless RF controller to allow more freedom to the user. The body work could be improved by using sturdier and lightweight materials such as aluminium. Some sensors could be added to advance the normal usage of the arm.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.