apr justice

Upload: joaopaulolaudares

Post on 05-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Apr Justice

    1/4

    Indian Journal of Science and Technology Vol.2 No 4 (Mar. 2009) ISSN: 0974- 6846

    Research article Unmanned flight He Bin & JusticeIndian Society for Education and Environment (iSee) http://www.indjst.org Indian J.Sci.Technol

    12

    HeBinandAmahahJusticeBeijingUniversityofChemicalTechnology,Beijing,China-100029.

    [email protected] paper focuses on the design, modeling,

    implementationandtestingofanautonomousunmannedaerial vehicle. The controller is based on an Ardupilotboard which is a custom PCB with an embeddedprocessor(ATMega168)combinedwithcircuitrytoswitchcontrolbetweentheRCcontroland theautopilotcontrol.It controls navigation (following GPS waypoints) andaltitudebycontrollingtherudderandthrottle.Itusesflightstabilization system (co-pilot), a sensor pack, GlobalPositioning System (GPS) and an RF transceiver tomonitor and report crucial parameters such as altitude,speed, pitch, roll, and position. An embedded softwarealgorithmhasbeendevelopedtoenabletheaerialvehicleaccomplish the required autonomy and maintainsatisfactory flight operation. The autopilot features an

    advanced, highly autonomous flight control system withanauto-launchandautolandingalgorithms.Keywords:Autopilot,GPS,MUX,UAV,FMACopilot

    Agrowingarea inaerospaceengineeringistheuseanddevelopment of unmanned aerial vehicles (UAV) formilitaryandcivilianapplications .Therearedifficulties in

    thedesignofthesevehiclesdueto the variedandnon-intuitive nature of the configurations and missions that

    can beperformed (Krus& Andersson, 2003). CurrentlytherehasbeenahugedemandforUAVsandservicesforrealtimeandremotesensing.Unmannedaerialvehiclescanbedeployedtosolveanumberofciviliantasks.Itcanbeusedasaneffectivemeansof search, detection and identifying ofobjectsorsubjectsofinterestaswellastheirprecise coordinates (Paul G. Fahlstrom &Thomas J. Gleason: Introduction to UAVSystems). UAVs are also very useful in

    disastermanagement.Intheoccurrenceofaforestfire,forinstance,itisverydifficulttohaveaprecisedataonthedevelopmentofthesituation.ButwiththedeploymenofaUAVwhichiscapableof flyingatlowaltitudesandabletonavigatewithGPSwaypointsandmachinevisionthesituationcanbecontrolledveryefficiently.

    ArduPilot is a full-featured autopilot based on theopen-source Arduino platform (DIY Droneshttp://www.diydrones.com). The Ardupilot is a customPCB with an embedded processor (ATMega 168combinedwithcircuitrytoswitchbetweenRCcontrolandthe autopilot control (i.e., the multiplexer/failsafeotherwise known as a MUX). This controls navigation(followingGPSwaypoints)andaltitudebycontrollingthe

    rudder and throttle. These components are all opensource.Thisautopilotisfullyprogrammableandcanhaveany number of GPS waypoints (including altitude) andtriggercameraorothersensors.

    Itcanbeusedforanautonomousaircraft.Thebuilt-inhardware failsafe uses a separate circuit to transfecontrol from the RC system to the autopilot and backagain.Itincludestheabilitytorebootthemainprocessoinmid-flight. Itmakes provision for the use ofmultiplewaypoints.Italsoprovidesa6-pinGPSconnectorforthe1hzEM406GPSmodule.

    The Autopilot system comprises of the ArduinocompatibleArdupilotboard,1HzEM406GPSmoduleandan Infrared Flight Stabilization System (FMA co-pilot)TheEM-406AGPSmodulefromGlobalSatisbasedonthespectacularSiRF.Thiscompletemoduleisbuiltuponthe same technology asET-301, but includeson-boardRAM, and a built-in patch antenna. The Infrared FlighStabilization System is used to sense the difference ininfraredtemperaturebetweentheEarthandthesky.Thesky is alwaysata relatively lower infrared temperaturewhile the infrared signature of the earth is alwaysrelatively warmer. Co-pilot uses two pairs of infraredsensors:onepairpointsforeandaftandtheotherpointsleftandright.Whenonepairofsensorsseesachangein

    the aircrafts orientation relative to the earths infraredhorizon,co-pilot issues signals to the controlsystem tobringtheaircraftbackintolevelflight.

  • 7/31/2019 Apr Justice

    2/4

    Indian Journal of Science and Technology Vol.2 No 4 (Mar. 2009) ISSN: 0974- 6846

    Research article Unmanned flight He Bin & JusticeIndian Society for Education and Environment (iSee) http://www.indjst.org Indian J.Sci.Technol

    13

    PlaneDecidingon the platform touseisveryparamountinthebuildingofaUAV.Weused the Hobbico Superstar EP

    asmyplatform.ThespecificationoftheplatformchosenisprovideinTable1.Center of gravity: 2.5 (63.5mm) -2-7/8 (73mm) backfrom the leading edge of the wingat the fuselagesideControlThrows:

    LowRateHighRateElevator,UpandDown:6.35mm11mmRudder,RightandLeft:9.5mm15.9mmAilerons,UpandDown:6.35mm6.35mm

    Fig.3.ScreenshotoftheArduinoEnvironment

    SoftwareArduinoSoftware:Theopen-sourceArduinoenvironmentmakesiteasytowritecodeanduploadittotheI/Oboard.It runs on Windows, Mac OS X, and Linux. The

    environment is written in Java that serves as a codeeditorandcompiler,andbasedonProcessingandotheropensourcesoftware.TheArduinoenvironmenthasthefollowing functions: Verify/Compile, Check for errors inthe codeand uploads the alreadycompiledcode totheboard.

    1) Cross-Platform-The Arduino software runs onWindows,MacintoshOSXandLinuxoperatingsystems,2) Simple, clear programming environment, 3) Opensourceandextensiblesoftware,4)Thelanguagecanbe

    expanded through C++ libraries,andAVR-CcodecanbeaddeddirectlyintoArduinoprograms.

    The ground station/monitoconsists simply of a laptop

    computer that isusedto displaythe video stream sent by theUAV. The Aerial video system

    (AVS) used is AVS-KX171 Camera. The AVS is acomplete wireless video kit with 900MHz frequency500mWRFoutputpower,12Vcamera.

    Fig.5.ScreenShotoftheSimulationinXPlan

    Screen shot ofsimulation in GoogleEarth is provided inFig. 6. This method

    of simulation wasdeveloped by Jordi(DIYDRONES).Required hardwareArduPilot,FTDIcableandcomputer.Required softwareModified ArduPilotcode, X-Planesimulator,GoogleEarthandArduSimulator.

    Thesimulation runs inX-plane simulator, while theArduPilotwhichisconnectedviatheFTDIcabletothepcreceives simulated GPS data over serial and it returns

    backproposedservopositionsbackoverserialaspartoftelemetryinformation.Variablesthatarerecordedincludelongitude,latitude,altitude,waypointsanddistance.

    1) Connects to ArduPilot over serial for sending andreceiving data, 2)Connects toX-plane on localhost, 3Reads data from X-plane (lat/lon/alt/ course), sendingthesetoArduPilotasGPSsentences,4)SimulatingFMAcopilot stabilization on ailerons/elevator, 5) Reads andDisplaystelemetryandservopositionsfromArduPIlot,6)Sendsservopositions toX-plane tocontrol throttleand

    Table1.thespecificationsoftheHobbicoSuperstar

    Wingspan 48.5in

    Wingarea 400sqin

    Wingloading 16.1oz/sqft

    Length 36.1in

    Weight 3.11bs

    Radio 4-channelwiththreeservos

    MotorBattery 8.4volt1700mAh-3000mAh

  • 7/31/2019 Apr Justice

    3/4

    Indian Journal of Science and Technology Vol.2 No 4 (Mar. 2009) ISSN: 0974- 6846

    Research article Unmanned flight He Bin & JusticeIndian Society for Education and Environment (iSee) http://www.indjst.org Indian J.Sci.Technol

    14

    rudder and 7) Records fly path and sends it to GoogleEarthtodisplay.

    //Definingrangesoftheservos(andESC),mustbe+-90degrees.#definemax16_throttle2100//ESCmaxposition,givenin

    useconds, inmyunglyservos2100 isfine, you can try2000..#definemin16_throttle1000//ESCposition#definemax16_yaw2100//Servomaxposition#definemin16_yaw1000//Servominposition#definereverse_yaw1//normal=0andreverse=1//PIDmaxandmins#defineheading_max15#defineheading_min-15#definealtitude_max40#definealtitude_min-45//Numberofwaypointsdefined#definewaypoints6

    #define distance_limit4000 //Themaxdistanceallowedtotravelfromhome./*****************************************************************RTL,ifitsetastruebytheuser,theautopilotwillalways

    ****************************************************************/#defineRTL 1 //0 = waypoint mode, 1 = Return homemode//PIDgains//Atthebeginningtrytouseonlyproportional.//Theoriginalconfigurationworksfineinmysimulator.#defineKp_heading10#defineKi_heading.01#defineKd_heading0.001#defineKp_altitude4

    #defineKi_altitude0.001#defineKd_altitude2/*******************************///Definingwaypointsvariablesfloatwp_lat[waypoints+1];floatwp_lon[waypoints+1];intwp_alt[waypoints+1];byte current_wp=1; //This variables stores the actualwaypointwearetryingtoreach..byte jumplock_wp=0; //When switching waypoints thislockwillallowonlyonetransition..bytewp_home_lock=0;//int wp_bearing=0; //Stores the bearing from the current

    waypointunsignedintwp_distance=0;//Stores thedistancesfromthecurrentwaypoint/*******************************///PIDloopvariablesunsignedintheading_PID_timer;//TimertocalculatethedtofthePIDintheading_previous_error;floatheading_I;//Storestheresultoftheintegratorfloatheading_D;//Storestheresultofthederivatorintheading_output;//StorestheresultofthePIDloop

    unsignedintaltitude_PID_timer;//TimertocalculatethedofthePIDintaltitude_previous_error;floataltitude_I;//Storestheresultoftheintegratorfloataltitude_D;//Storestheresultofthederivatorintaltitude_output;//StorestheresultofthePIDloop

    //PIDKconstants,definedatthebeginingofthecodefloatkp[]={Kp_heading,Kp_altitude}; floatki[]={Ki_heading,Ki_altitude}; floatkd[]={Kd_heading,Kd_altitude};/*******************************/charbuffer[90];//SerialbuffertocatchGPSdatacharhead_rmc[]="GPRMC";//GPSNMEAheadertolookforcharhead_gga[]="GPGGA";//GPSNMEAheadertolookforbyteunlock=1;//somekindofeventflagbytechecksum=0;//thechecksumgeneratedbytechecksum_received=0;//Checksumreceivedbytecounter=0;//generalcounter/*GPSPointers*/

    char*token;char*search=",";char*brkb,*pEnd;//Temporary variables for some tasks, speciallyused intheGPSparsingpart(LookattheNMEA_Parsertab)unsignedlongtemp=0;unsignedlongtemp2=0;unsignedlongtemp3=0;//GPSobtainedinformationbytefix_position=0;//Validgpspositionfloatlat=0;//CurrentLatitudefloatlon=0;//CurrentLongitudebyte ground_speed=0; //Ground speed? yes GroundSpeed.

    intcourse=0;//Courseoverground...intalt=0;//Altitude,//ACMEvariablesbytegps_new_data_flag=0;//Asimpleflagtoknowwhenwe'vegotnewgpsdata.unsignedintlaunch_altitude=0;//launchaltitude,altitudeinwaypointsisrelativetostartingaltitude.intmiddle_thr=90;//Thecentralpositionintmiddle_yaw=90;//Thecnetralpositionofyawbytemiddle_measurement_lock=0;//Anotherlocktovoidresettingthemiddlemeasurement../*******************************/inttest=0;

    The results of the simulation werent exactly ideabecause of certain problems such as the cumbersomenature of specifying individual waypoints manuallyAnother problem that arose was the altitude control bythrottle with the use of the FMA copilot stabilizationsystem which didn't work properly. Apart from this thesimulationwassuccessful.Theplaneflewsmoothlyandaccordingtopredeterminedwaypoints.

  • 7/31/2019 Apr Justice

    4/4

    Indian Journal of Science and Technology Vol.2 No 4 (Mar. 2009) ISSN: 0974- 6846

    Research article Unmanned flight He Bin & JusticeIndian Society for Education and Environment (iSee) http://www.indjst.org Indian J.Sci.Technol

    15

    TheArdupilotoperatesintwomodes,firstofallitcanbeprogrammedwith desiredwaypoints (any number ofwaypoints),andalsocanbeprogrammedtoRTL(return-to-launch).

    Programming the Ardupilot board for desiredwaypointsinvolvingfirstobtainingtheGPSLongitudeandLatitudecoordinatesof thewaypointsand thenenteringthe GPS Longitude and Latitude coordinates into thecodeintheArduinoenvironmentanduploadingittotheboard. The coordinates can be obtained from GoogleMaps, undersatelliteview. Thewaypoints (wp-lat andwp-lon) declaration obtained would be pasted on theMissionSetuptaboftheArduino.

    The altitude is relative to the initial launch positionandnotabovesealevel.Foranexampleiftheairfieldis500metersabovesealevel,then500wouldbeenteredasthewaypointaltitude.Hencetheplanewillflyat1,000

    meters abovesea levelbut itwouldbejust500metersabove.

    voidsetup_waypoints(void){/*Declaringwaypoints*/wp_lat[1]=34.982613;wp_lon[1]=-118.443357;wp_alt[1]=50;//meterswp_lat[2]=34.025136;wp_lon[2]=-118.445254;wp_alt[2]=100;//meterswp_lat[3]=34.018287;wp_lon[3]=-118.456048;

    wp_alt[3]=100;//meterswp_lat[4]=34.009332;wp_lon[4]=-118.467672;wp_alt[4]=50;//meterswp_lat[5]=34.006476;wp_lon[5]=-118.465413;wp_alt[5]=50;//meterswp_lat[6]=34.009927;wp_lon[6]=-118.458320;wp_alt[6]=20;//meters

    For the UAV to return-to-launch, then the code stillhastobemodified.Thecode#defineRTL0,thisisthe

    RTLflaganditshouldbesetto1orjustsettozeroiftheUAVistofollowthewaypointsintheMissionSetuptab.

    For the first test flight of the UAV, we setup thesystem as described above i.e., connecting all thecomponents to the board, modifying the code anduploading it to the board. Components include the EM-406AGPS,FMACopilotStabilizationunit,Servos,Towerhobbies72MHz8channelRXandTowerHobbies6XMTXandtheAVS.

    TheUAV was launchedmanually and when itwasabout150 feet it was switched into autopilot by flippingthe control switch whichcorresponds to our channel 5The UAV successfully started navigating to thepredetermined first waypoint that we uploaded into theboard. We then uploaded the RTL code (return to

    launch),thethrottlebehavedasexpectedandmaintainedsteadyaltitude.Itreturnedtolaunchpoint.

    In this paper, we have discussed the design andimplementationandsimulationofanArdupilotbasedUAVautopilotsystem.

    The simple UAV has the ability to implemenautonomous flight (automatic take and landing). Thedeveloped UAV has been tested successfully in bothmanualandautomaticflightoperations.Usefuldatahasalsobeenobtainedbytheuseofcomputervision,i.e.theAVS and valuable data has also been obtained by theuseoftelemetry.

    Presently waypoints can only be entered pre-flighandmanually,thislimittheautonomouspropertiesoftheUAV .It would be very useful to develop a method toreprogram the waypoints on the controller board midflight. Power consumption is another issue worthy oconsidering, presently the power rating of the UAV willastonlyforseveralminuteswithoutrecharging,itwouldbe great if the power rating of the UAV could bereasonably increased. Two methods worthy oconsiderationis1)theuseofsolarpanelsforrechargingmid-flight,2)theuseofautomaticrecharging,i.e.havingthe UAV taxiing into predetermined destination andrechargingonitsownthentakingoff.Thiswouldrequire

    theadditionofextra electroniccomponentswhich coulddrasticallyaffecttheweightoftheaircraftandcouldalsogiverisetomagneticinterference.

    KrusP andAnderssonJ (2003)Optimizing optimizationfordesignoptimization.In:ProceedingsofASMEDesignAutomationConference,Chicago,USA,September2-6.

    Fig. 6.ScreenshotofsimulationinGoogleEarth