Home
Technical documentation v.1.0 - ISY
Contents
1. JOJOW JOJOW JOJOW f eyeg tsrt10 tricopterQgmail com E mail Control Project Course name o9 a a E 4a a o SS mz 39 SE i He xS E O 2 N u Om ges EE d Ho E e a d O e om c AL gs EE 2E RM Aa B od Eh O US i 28 25 2 2 40 Technical documentation tricopter pdf Document name Tricopter Project Tricopter 27 B Surveillance unit code In arduimu pde Gimbal code if include lt Wire h gt 12C library include lt Waypoints h gt Used for location struct include lt Servo h gt Servo library Macros if define ToRad x x 0 01745329252 define ToDeg x x 57 2957795131 12C define CURRENT LOCATION Package ID 1 define TARGET LOCATION 2 define TRICOPTERHEADING 3 f define GIMBALSERVO ANGLES 4 define I2C MAX MESSAGE LENGTH 32 Max message length in bytes Gimbal define OFFSET TILT 215 0f Tilt offset to level gimbal degrees define OFFSET PAN 80 0f Pan offset to level gimbal degrees define OFFSET THETA 24 0f Theta offset to level tilt de
2. Functionality Description Waypoints via XBee Send waypoints of the flight route over the XBee Target point via XBee Send the position of the target over the XBee Tricopter position and orienta Receive data about the tricopter s position and ori tion via XBee entation over the XBee Playback of video Display the video feed in VLC player on computer Size of the box Set the size of the Virtual Box offline Table 3 Optional functionality Functionality Description Size of the Box wireless Send and receive parameters that determine the size of the Virtual Box via XBee Flight mode Display or change the mode of the tricopter Au tonomous or manual mode Virtual Box Easy control fea Display or change which features are active tures The attributes required functionality presented above were first implemented as func tions in an application that can be executed from a terminal window When all the functionality worked the next step was to modify the APM MISSION PLANNER to han dle the functions which removed the need for the external application 8 4 2 Console program The purpose of the console program is to have a simple software that fulfils the priority 1 requirements for the ground station The console program has the following functions e connect Connect the laptop to the tricopter with XBee or USB cable e get orientation Receive the orientation
3. Tricopter 59 References 1 v a arducopter Arduino based autopilot for mulitrotor craft from quadcopters to traditional helis http code google com p arducopter 2011 09 02 2 v a ardupilot mega Official ArduPilot Mega repository http code google com p ardupilot mega wiki Mission 2011 09 05 3 v a FlightGear sophisticated professional open source flight simulation http www flightgear org 2011 09 09 4 Atmel 8 bit Atmel Microcontroller with 64K 128K 256K Bytes In System Pro grammable Flash http www atmel com dyn resources prod_documents doc2549 pdf may 2011 5 Barsk Karl Johan Requirement specification Tricopter with stabilized camera version 1 1 oct 2011 6 Barsk Karl Johan User manual Tricopter with stabilized camera version 1 0 7 v a Quad Telemetry XBee http code google com p arducopter wiki Quad_TelemetryPage 2011 11 14 8 v a Knowledge Base Article X CTU XCTU software Support Digi Interna tional http www digi com support kbase kbaseresultdetl jsp kb 125 2011 11 17 9 v a NOAA National Geophysical Data Center http www ngdc noaa gov geomagmodels Declination jsp 2011 12 06 Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documenta
4. Line added for drawing the target marker on the map addpolygonmarker Target double targetloc lng 10000000 double targetloc lat 10000000 0 true In FlightData cs at line 401 in function MainLoop Draw target marker on the map addpolygonmarker Target double Clng double Clat int Calt 100 true F 5 Video functionality In FlightData cs Booleans to show if recording is active and if recording video window or attitude window static bool recording false static bool recordcam false Video window public static hud HUD mycam null Signal that it is the attitude window we are starting to record private void hud_mouseover object sender EventArgs e if recording recordcam false Signal that it is the video window we are starting to record private void cam_mouseover object sender EventArgs e if recording recordcam true In function FlightData hud2 is video window object in the graphic design mycam hud2 Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 57 At line 262 in function Mainloop code added x x Condition added to decide if to record
5. Modified function to support drawing target marker Last parameter isred added to notify if the marker added should be red instead of green private void addpolygonmarker string tag double lng double lat int alt bool isred false try PointLatLng point new PointLatLng lat lng added codex Red marker for the target GMapMarkerGoogleRed m2 new GMapMarkerGoogleRed point m2 ToolTipMode MarkerTooltipMode Always m2 ToolTipText tag m2 Tag tag added code endx xx GMapMarkerGoogleGreen m new GMapMarkerGoogleGreen point m ToolTipMode MarkerTooltipMode Always m ToolTipText tag m Tag tag XrdupilotMega GMapMarkerRectWPRad mBorders new ArdupilotMega GMapMarkerRectWPRad point int float Parse TXT WPRad Text MainMap GMapMarkerRect mBorders new GMapMarkerRect point mBorders InnerMarker m mBorders wprad int float Parse TXT WPRad Text mBorders MainMap MainMap Check if adding a green or red target marker added codex if isred objects Markers Add m2 else added code end x objects Markers Add m objects Markers Add mBorders y added bracket xs catch Exception In FlightPlanner cs Added booleans static bool addtarget false True if adding target and not WP static bool onTargetMarker false True if mouse over the target marker and not WP marker Course
6. ifdef VIRTUAL BOX PRINT Serial println boundary_west BROKEN endif return true 2D box in longitude and latitude ifndef IGNORE HIGHT else if current loc alt boundary bottom ifdef VIRTUAL_BOX_PRINT Serial println boundary_bottom BROKEN endif return true else if current_loc alt gt boundary_top ifdef VIRTUAL_BOX_PRINT Serial println boundary_top BROKEN endif return true Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 41 endif else ifdef VIRTUAL_BOX_PRINT Serial println boundary NOT BROKEN Serial print current_box_size Serial println current_box_size endif return false Controls if the tricopter is back in the middle box either in 2D or 3D Static bool in middle ifndef IGNORE_HEIGHT return current loc lat middle boundary north current loc lat gt middle boundary south current loc lng lt middle_boundary_east current loc lng gt middle boundary west current loc alt middle boundary top current loc alt gt middle boundary bottom BRERE telse return current loc lat lt middle_boundary_north current_loc lat gt middle_boundary_south current loc lng lt
7. sei I2 receive event void receiveEvent int howMany At least two bytes sent int8 t payload Wire receive int8 t flag Wire receive Get all data while Wire available int i payload Wire available byte data byte Wire receive received data i data byte Interpret message Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 30 switch flag New tricopter location case CURRENT LOCATION tricopter pos lat long convertToint32 t received data tricopter pos lng long convertToint32 t received data 4 tricopter pos alt long convertToint32 t received data c 8 break New target location case TARGET_LOCATION target lat target lng 4 target alt 8 break New tricopter heading case TRICOPTER_HEADING tricopter_roll long convertToint32 t received data c long convertToint32 t received data c long convertToint32 t received data c long convertToint32 t received data c tricopter pitch long convertToint32 t received data 4 tricopter_yaw long convertToint32 t received data 8 new_orientation true break New requested gimbal angl
8. 999 30 19 rasjo160 Johan Larsson Tests 070 747 87 78 johla342 Mattis Lorentzon Information 070 592 32 66 matlo622 Bjorn Rodseth Designer 070 274 52 20 bjoro826 Document History Version Date Changes made Sign Reviewer 0 1 111130 First draft KJB Karl Johan Barsk 1 0 111208 Second draft KJB Karl Johan Barsk Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Contents D 4 omplicationg bo Interlacd B4 Howard w oO 0 Oc c BB A O O O O o 10 12 13 13 14 14 15 15 15 15 15 16 16 17 17 17 19 X W e diag B Surveillance unit code ode 22 22 22 26 27 35 I irmware modifications to support sending receiving virtual box size and target po E Box size functionality 4 2l ll lll esas eos as AT E arget funCctionallty o woe x3 a a ad a a ee 49 IF Box and target shared functionality leere 51 F 4 Modified map functionality ers 52 F Video functionality amp oe d aa je dE Ga a Ben den de f r van ode S r ao v r a de s r e ae an rs 56 Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Course code TSRT10 Project Tricopter
9. Technical documentation Tricopter with stabilized camera Version 1 0 Author Karl Johan Barsk Date December 12 2011 triforce Status Reviewed Karl Johan Barsk 111206 Approved Fredrik Lindsten 111208 Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Project Identity Group E mail Homepage Orderer Customer Course Responsible Project Manager Advisors Group Members tsrt10 tricopterQgmail com http www isy liu se edu projekt tsrt10 2011 trikopter Fredrik Lindsten Link ping University Phone 46 13 28 13 65 E mail lindsten isy liu se David T rnqvist Link ping University Phone 46 13 28 18 82 E mail tornqvist isy liu se David T rnqvist Link ping University Phone 46 13 28 18 82 E mail tornqvistQisy liu se Josefin Kemppainen Manon Kok Link ping University Phone 46 13 28 40 43 E mail manon kokQisy liu se Name Responsibility Phone E mail Gstudent liu se Josefin Kemppainen Project Manager 070 866 56 75 joske208 Karl Johan Barsk Documents 070 788 95 48 karba878 Joakim Hallqvist Firmware 070 571 37 64 joaha738 Patrik Johansson Hardware 070 299 47 48 patjo855 Rasmus J nsson Software 070
10. guided WP guided WP middle box set_mode GUIDED Return to middle if loiter counter lt LOITER COUNTER RATE loiter_counter endif The boundaries been broken and we arrive to the middle then the control is given back to the user and the box mode is turned on if boundaries PREVIOUSLY BROKEN amp amp in middle ifdef VIRTUAL_BOX_PRINT Serial println NOTE In middle endif boundaries PREVIOUSLY UN BROKEN guided WP old guided WP set mode BOX Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 40 if virtual_box_counter lt VIRTUAL_BOX_UPDATE_RATE virtual_box_counter Functions that controls if the boundaries breaks static bool boundaries breaks if current_loc lat gt boundary_north ifdef VIRTUAL BOX PRINT Serial println boundary_north BROKEN endif return true else if current_loc lat lt boundary_south ifdef VIRTUAL BOX PRINT Serial println boundary south BROKEN endif return true else if current loc lng gt boundary east ifdef VIRTUAL_BOX_PRINT Serial println boundary_east BROKEN endif return true else if current loc lng lt boundary west
11. loop static int busy bus 0 static const int send rate offset 200 static int update current location send_rate_offset 3 static int update_camera_target_location send rate offset 2 static int update tricopter heading send rate offset static int update gimbal servo angles 0 static int32 t angle pan 0 static int32 t angle tilt 0 7 In 1oopO in ArduCopter pde Sending tricopter location over I2C bus if CURRENT LOCATION SEND RATE 0 if busy bus 0 amp amp update current location gt CURRENT LOCATION SEND RATE update_current_location 0 busy_bus send_rate_offset Wire beginTransmission IMU_CAMERA_ADRESS Wire send CURRENT LOCATION PACKET SIZE Wire send CURRENT LOCATION FLAG Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 36 Wire send uint8_tx makeCurrentLocationSendVector CURRENT_LOCATION_PACKET_SIZE Wire endTransmission if update current location lt CURRENT_LOCATION_SEND_RATE update current location endif Sending camera target location over I 2C bus if CAMERA TARGET LOCATION SEND RATE 0 if busy bus 0 amp amp new camera target amp amp c update camera target location
12. Place target on map if left click while shift is held down if Control ModifierKeys Keys Shift added code endx x x if currentMarker IsVisible addtarget true currentMarker Position MainMap FromLocalToLatLng e X e Y move current marker with left holding void MainMap_MouseMove object sender MouseEventArgs e draging if e Button MouseButtons Left amp amp isMouseDown isMouseDraging true code added x x Moving the target marker if onTargetMarker targetloc lat int currentMarker Position Lat 10000000 targetloc lng int currentMarker Position Lng 10000000 FlightData tar lat currentMarker Position Lat ToString lt OS FlightData tar lng currentMarker Position Lng ToString lt Os writeKML else added code endx x x if CurentRectMarker null left click pan Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 56 At line 394 in function FlightPlanner Target initial position on map targetloc lat int 58 39845 10000000 targetloc lng int 15 57792 10000000 targetloc alt int 1 100 At line 865 in function WriteKML
13. Serial print angle_tilt Serial print Theta Serial print ToDeg theta Serial print Serial print theta Serial print Serial print Alpha Serial print ToDeg alpha Serial print Serial print alpha Serial print Serial print Tilt out Serial print tilt out Get distance in ground plane between to locations long get_distance Waypoints WP loci Waypoints WP loc2 Valid input if loci lat 0 loci gt 1ng 0 return 1 if loc2 gt lat 0 loc2 gt 1ng 0 return 1 Latitude of loc2 in radians float rads abs loc2 gt lat 10000000 0 0174532925 Get longitude scalings from latitude float _scaleLongDown cos rads float _scaleLongUp 1 0f cos rads Get angle differences float dlat float loc2 lat loci lat float dlong float loc2 gt lng loci gt 1ng _scaleLongDown Get distance from angle difference return sqrt sq dlat sq dlong 01113195 Get bearing from locl to loc2 long get bearing Waypoints WP loci Waypoints WP loc2 Valid input if loci lat 0 loci gt 1ng 0 return 1 if loc2 gt lat 0 loc2 gt 1ng 0 Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student
14. that the sides are parallel to the longitude and latitude lines To calculate the boundaries B the following equations have been used The longitude and latitude are in degrees x107 and sizebon altituderricopter sa f eH eight and rearth in meters Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 8 iZebox 180 107 1 By latitude 4 ae 2 T Tearth iZepox 180 107 1 Bg latitude PR 2 T Tearth izego 180 107 1 Bw longitude p 1 2 T Tearth izepox 180 10 1 By longitude P 2 T Tearth Br altituderricopter stes if altitudeiricopter gt safeHeight Mus safeHeight sizepox else SiZEhor altitudetricopter 2 if altitudetricopter gt safeHeight Mie Bg i safeHeight else The subscripts i B refers to North South West East Top and Bottom respec tively When a boundary is broken the tricopter will fly back autonomously to the middle in a proximity of 5 x 5 x 5 m The control of the tricopter will be given back to the user when it is back in the middle To calculate the boundaries of the middle of the box the equations M above will be used but the sizepor is replaced by the wanted sizemidale Which is 5 meters by default This mode is activated by switching A
15. CAMERA TARGET LOCATION SEND RATE update camera target location 0 busy bus send rate offset Wire beginTransmission IMU CAMERA ADRESS Wire send CAMERA TARGET LOCATION PACKET SIZE Wire send CAMERA TARGET LOCATION FLAG Wire send uint8_tx makeCameraTargetLocationSendVector CAMERA_TARGET_LOCATION_PACKET_SIZE Wire endTransmission if update_camera_target_location L e CAMERA_TARGET_LOCATION_SEND_RATE update camera target location endif Sending tricopter heading over I2C bus if TRICOPTER HEADING SEND RATE 0 if busy bus 0 amp amp update tricopter heading TRICOPTER HEADING SEND RATE update_tricopter_heading 0 busy_bus send_rate_offset Wire beginTransmission IMU_CAMERA_ADRESS Wire send TRICOPTER HEADING PACKET SIZE Wire send TRICOPTER HEADING FLAG Wire send uint8_tx makeTricopterO0rientationSendVector TRICOPTER HEADING PACKET SIZE Wire endTransmission if update tricopter heading lt TRICOPTER HEADING SEND RATE update tricopter heading endif Sending gimbal servo angles over 12C bus if GIMBAL_SERVO_ANGLES_SEND_RATE 0 if busy_bus 0 amp amp update_gimbal_servo_angles GIMBAL_SERVO_ANGLES_SEND_RATE Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878Gstudent liu se Project Tric
16. Document responsible Author s E mail Document name Karl Johan Barsk karba878 student liu se Technical documentation tricopter pdf Tricopter 1 1 Introduction During the course of the project the group has constructed a surveillance system made up of a UAV Unmanned Aerial Vehicle with a mounted camera The user is able to specify a flying route along with a specific point of interest for surveillance and the UAV will then perform the surveillance mission This will be referred to as the autonomous flight mode During the flight a video stream from the camera will be broadcasted to a ground station with the optional addition to record it Additional to the autonomous flight mode there will be a manual flight mode The manual mode is for manual control of the tricopter with two optional safety features to prevent accidents This will allow for unexperienced pilots to try out the equipment without risking damage to it These are 1 A virtual box with pre specified boundaries If this feature is enabled and the user breaches the boundaries an auto pilot will take control of the tricopter and fly it back to the center of the virtual box 2 Easy control which when enabled translates the user control signals to direction commands in a fixed coordinate system instead of directly forwarding the signals to the rotors For more information on the safety features see section J 2 Definitions APM ArduPilot Mega ArduCopter Open
17. J 30 I I 1 1 1 I I 30 20 10 0 10 20 30 40 50 Servo angle degrees Figure 9 Gimbal transfer function The red line represents the servo angle and the blue line the gimbal angle For the implementation of the gimbal transfer function see appendix H 5 4 Complications Before the work on the tricopter started the plan was to use the sensors on the IMUcamera to control and correct for eventual reference errors e g drift errors But after some testing it was concluded that the readings from the IMUcamera were so inaccurate that it was impossible to use them for the project s purpose On the other hand the gimbal servos were accurate enough for the IMUcamera s sensors not to be needed 6 Sensor unit To be able to fulfill the requirements specified by the project additional sensors needed to be placed on the tricopter These sensors will be described in this section See figure IU for the outline of the unit Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 14 Serial link Flight unit Flight unit Serial link Flight unit r F Barometer onar Flight unit I Sensor unit i Lana a es eee E Figure 10 Block diagram for the Sensor unit with ingoing and outgoin
18. boundary west Boundaries for the middle box Static int32 t middle boundary east static int32 t middle boundary north static int32 t middle boundary south static int32 t middle boundary top static int32 t middle boundary bottom static int current box size BOX SIZE Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 39 Determines the size of the box In loop in ArduCopter pde if box_created amp amp virtual box counter VIRTUAL BOX UPDATE RATE virtual box counter 0 ifndef GO TO LOITER BEFORE GUIDED If the boundaries not been broken but it breaks now the we will go to guided and fly back to the middle of the box if boundaries PREVIOUSLY UN BROKEN amp amp gt boundaries breaks boundaries PREVIOUSLY BROKEN Set the param to previously broken old guided WP guided WP guided WP middle box Set the waypoint to the middle of the box set mode GUIDED Return to middle telse if boundaries PREVIOUSLY UN BROKEN amp amp gt boundaries_breaks control_mode LOITER set_mode LOITER if loiter_counter LOITER_COUNTER_RATE loiter counter 0 boundaries PREVIOUSLY BROKEN old guided WP
19. comPort BaseStream IsOpen int templat int 10000000 float Parse tar_lat int templng int 10000000 float Parse tar 1ng int tempalt int 100 float Parse TarAlt Text if tempalt 0 MessageBox Show Bad altitude else if templat 0 templat gt 1800000000 templat lt gt 1800000000 MessageBox Show Bad latitude else if templng 0 templat gt 900000000 templat lt gt 900000000 MessageBox Show Bad longitude else if MainV2 comPort BaseStream IsOpen try MainV2 comPort setParam CAMERA_LAT templat MainV2 comPort setParam CAMERA_LNG templng MainV2 comPort setParam CAMERA ALT tempalt catch Exception ex Console WriteLine ex try MainV2 comPort param MainV2 comPort getParamList UpdateCurrentTarget float MainV2 comPort param CAMERA LAT 10000000 float MainV2 comPort param lt CAMERA_LNG 10000000 float MainV2 comPort param lt CAMERA_ALT 100 float tempmsgi float MainV2 comPort param gt Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter CAMERA_LAT 10000000 float tempmsg2 float MainV2 comPort param lt gt CAMERA_LNG 10000000 float tempmsg3
20. longitude latitude altitude via XBee USB PI parameters via XBee USB e Size of the virtual box via XBee USB Flight modes via XBee USB 8 4 Software For the required functionality of the project there was a need to create software for handling transmission of data and parameters playback of video and also for logging of the data There already existed an open source program with a graphic interface for simulation and programming of already existed an open source program with a graphi cal interface for simulation and programming of the ArduCopter chipset This program is called APM MISSION PLANNER 2 and was modified to fit our specific goals and purposes while it maintained a user friendly environment The software is executed on Laptop 2 Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 22 8 4 1 Functionality The functionality of the software can be divided into and listed in two parts one with required functionality and one with optional The required functionalities are linked to the contents of the requirement specification B representing priority 1 requirements of the ground station The optional functionalities correspond to priority 2 requirements Table 2 Required functionality
21. middle_boundary_east current loc lng gt middle boundary west SER endif In system pde This function creates the virtual box and the middle box boundaries static void create virtual box if current box size 0 current box size BOX SIZE middle box current loc The middle in the box will be thew current position start_loc current loc The start loc will be the current position boundary_west get_boundary boundary_east get_boundary boundary_north get_boundary boundary_south get_boundary WEST BOX_BOUNDARIES EAST BOX_BOUNDARIES NORTH BOX_BOUNDARIES SOUTH BOX BOUNDARIES a ao if start_loc alt lt current box size 24BOX HEIGHT ABOVE GROUND lt 100 Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 42 boundary top current box sizex100 2 boundary bottom current box size 24BOX HEIGHT ABOVE GROUND lt 100 current box sizex100 2 middle box alt boundary top boundary bottom 2 else boundary_top boundary_bottom start_loc alt current_box_sizex 100 2 start_loc alt current_box_sizex 100 2 get_boundary WEST MIDDLE_BOUNDARIES get_boundary EAST MIDDLE_BOUNDARIE
22. name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 17 7 Communication unit This section covers the wireless communication between the tricopter and the ground station Figure A below is an overview of the communication unit Wireless serial link Ground station Radio signals Ground station n 1 I I l Serial link Flight unit Serial links Receiver Flight unit Figure 12 Block diagram for the Communication unit with ingoing and outgoing signals 7 1 Hardware The Communication unit consists of XBee Pro 900 Wire Ant XBee Pro 900 RP SMA Ant Multiplex Royal 9 evo AR7000 DSM2 7 Channel Receiver 7 1 1 XBee The XBee will be connected to the ArduPilot and communicate while airborne with the XBee on the ground connected to Laptop 2 which is part of the Ground station It will be used for updating parameters tracking sensor outputs setting flight paths and target coordinates The first thing to do to get the XBee to work is to load the latest firmware using a DIGI software called X CTU 8 and set the correct baud rate APM planner will connect to the XBee on the baud rate 57600 This is done with the unit installed on the product Course name Contro
23. name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 53 void MainMap_OnMarkerLeave GMapMarker item if isMouseDown code added x x Test if targetmarker if item Tag ToString Target else added code endsss onTargetMarker false if item is GMapMarkerRect CurentRectMarker null GMapMarkerRect rc item as GMapMarkerRect rc Pen Color Color Blue MainMap Invalidate false void MainMap_OnMarkerEnter GMapMarker item if isMouseDown code added x x Test if target marker if item Tag ToString Target else added code endx x x if item is GMapMarkerRect onTargetMarker true GMapMarkerRect rc item as GMapMarkerRect rc Pen Color Color Red MainMap Invalidate false CurentRectMarker rc void MainMap_MouseUp object sender MouseEventArgs e Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 54 if isMouseDown mouse down on some other object and dragg
24. source control system for multicopters ArduPilot The autopilot of the tricopter ArduPilot board The ArduPilot and IMUcopter together as one unit AV Audio video EEPROM Electrically Erasable Programmable Read Only Memory ESC Electronic Speed Controller GPS Global Positioning System GUI Graphical User Interface IMU Inertial Measurement Unit IMUcamera IMU module with an IMU and a processor mounted on the Gimbal IMUcopter An IMU shield connected to the ArduPilot IMU shield Sensor module with accelerometers gyroscopes magneto meters and a barometer TC Inter Integrated Circuit RC Radio Control UAV Unmanned Aerial Vehicle XBee Wireless modem 2 1 Signal definitions Tricopter heading The heading of the tricoper in degrees from the magnetometer to compensate for the drift in the raw gyro on the GPS and the IMUcopter Tricopter orientation The roll pitch and yaw of the tricopter in degrees Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 2 Target location The latitude and longitude of the target in degrees and the altitude in dm GPS data The tricopter s position specified in latitude and longitude degrees the altitude in dm and the speed of the tricopter in cm s 2 2 Orientation If
25. 10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 6 4 3 Firmware The firmware on the flight unit is run on the ArduPilot board which is responsible for e Processing all sensor data from IMUcopter e Processing the flight commands e Sending control signals to the tricopter s rotors and servo e Sending data to IMUcamera 4 3 1 ArduPilot The ArduPilot is a complete control system running on an Arduino base It receives commands from the ground station and uses the information from the IMUcopter to stabilize the tricopter while performing these commands It is also responsible for the autonomous flight mode Its output signals are control signals for the rotors tail pan servo and flight information to the ground station The board is delivered with open source firmware that fuses sensor information from the IMUcopter to get estimates of the tricopter s position velocity and orientation Most of the ArduPilot s functionality already exists in the firmware but some things have been added e Functionality to send target coordinates to the IMUcamera over 12C bus e Functionality to send position and orientation estimates to the IMUcamera over I C bus e Functionality for virtual box feature in manual mode Autonomous mode Performing autonomou
26. Angles Clamp angles to valid interval clampServoAngles Compensate for non linearity in tilt angle output See technical documentation for more details H Parameters define GIMBAL A 12 mm define GIMBAL_B 12 define GIMBAL_C 27 define GIMBAL_D 22 define GIMBAL_F 6 define GIMBAL_G 11 define GIMBAL PHI 0 49934672 atan F G ifndef PI define PI 3 1415927 endif Calculate theta and add offset for leveling tilt float theta ToRad angle_tilt OFFSET THETA Calculate alpha from theta and parameters float psi PI GIMBAL_PHI theta float i sqrt GIMBAL_B GIMBAL_B GIMBAL_D GIMBAL_D 2 GIMBAL_B GIMBAL_D cos psi float alpha 1 acos isi GIMBAL_A GIMBAL_A GIMBAL Cx lt GIMBAL_C 2 GIMBAL_Axi float alpha_2 acos ixi GIMBAL_B GIMBAL_B GIMBAL Dx4 lt Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 32 GIMBAL_D 2 GIMBAL_Bxi float alpha alpha 1 alpha_2 Get servo angle from alpha float tilt out OFFSET TILT ToDeg alpha Write servo angle servo tilt writef tilt out Set pan angle no non linearity servo pan writef FFSET PAN angle pan Debug Serial print Tilt in
27. Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 11 Tricopter P ofS e Target North dist N I g NI Figure 6 A graphical interpretation of the transformation from the tricopter s coordinate system to the earth s To compensate for the tricopter s heading a three dimensional rotation matrix with the pitch p roll r and yaw y angles is used see equation UU to transfer the target to the tricopter s coordinate system see figure 7D TT cos r sin r 0 1 0 0 cos y 0 sin y ug yr sin r cos r 0 10 cos p sin p 0 1 0 2T 0 0 1 10 sin p cos p sin y O cos y zz 10 The desired gimbal angles relative to the tricopter are then given by equations ILT I2 2T angle arctan 11 9gt tilt ise TT anglepan arctan 12 YT Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 12 a Earth coordinate sys b Tricopter coordinate sys c Gimbal coordinate sys tem E tem T tem G Figure 7 Coordinate systems The implementation of this can be seen in appendix Bl 5 3 2 Servo input The servos used
28. Flight Data tab is used for displaying real time data from the tricopter see figure LS Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 24 In the off the shelf software there were some functionalities that had to be implemented to fulfil the requirements of the software These functionalities were displaying the location of the target and setting the virtual box size Sending the target coordinates was implemented in Flight data instead of Flight planner because of problems with editing the layout That and setting the box size functionality were implemented in the tab Set Box amp Target which was included in the parameter box see figure T3 When there was some time over the video feed box was implemented in Flight data The user can use this box to display the video feedback from the tricopter if there is a video receiver connected to the laptop and the set up has been done according to the User manual 6 In the non modified version of APM MISSION PLANNER it is possible to display the video broadcast in the attitude window but because the camera is not fixed in the tricopter it was decided to split up the attitude and video into two separate windows It was also done due to
29. NER V1 0 66 is described in the User manual 6 The modifications that were made to APM MISSION PLANNER can be found in appendix El except graphical modification which were made with MICROSOFT VISUAL STUDIO S de signer The designer automatically generates code so it is hard to track the exact changes The generated code is located in the designer files e g FlightData Designer cs Among these changes were the exchange of the map representation of the multicopter from a quadcopter to a tricopter see figure Modifications in Flight Planner tab The Flight Planner tab see figure MA is used for defining an intended flight route by using waypoints and for defining the target that the camera should lock on The off the shelf software was only able to define the route as waypoints and the project also required a waypoint for the target that the camera should look at The target waypoint was implemented in Flight planner as a red marker so the user can differ the target from route waypoint which is green see figure TG The coordinates for the target can not be written with Flight planner because there were some problems with the change of layout so the reading and writing functionality to the tricopter is implemented in Flight data ArduCopter2 Delete WP Loiter Jump Measure Distance Rotate Map Grid Clear Mission Figure 16 The modified Flight Planner tab Modifications in Flight Data tab The
30. S To determine the position of the tricopter and enable waypoint navigation a GPS mod ule is mounted on the tricopter This GPS module is connected to the ArduPilot board through the GPS port 6 1 3 Magnetometer Since the tricopter is able to hover no heading from GPS to compensate for IMU yaw drift To compensate for this a magnetometer is used the magnetic field to provide a heading of the tricopter for the Flight unit and the Surveillance unit Since the magnetic field s declination varies depending on location this has to be accounted for in the ArduPilot This declination which can easily be obtained online at 9 can then be set in the APM Planner see the User manual 6 The magnetometer is mounted on IMUcopter via an I C cable 6 1 4 Barometer The barometer is used to determine the altitude of the tricopter which is done by mea suring the air pressure When the tricopter gets armed the ArduPilot saves its current barometer reading then uses that as a reference value during flight to estimate the tri copter s current altitude The barometer is physically mounted on IMUcopter 6 2 Interface This section describes the communication of the Sensor unit Signals in This unit has no signals in Signals out e GPS data serially see definition in section LI to the Flight unit via the serial port on the ArduPilot board e Magnetometer acquired signals to the Flight unit via an 12C bus with address Ox1E on th
31. S get_boundary NORTH MIDDLE_BOUNDARIES get_boundary SOUTH MIDDLE_BOUNDARIES middle_box alt MIDDLE_SIZE 2x100 middle_box alt MIDDLE_SIZE 2x100 middle_boundary_west middle_boundary_east middle_boundary_north middle_boundary_south middle_boundary_top middle_boundary_bottom E ww current box size 2 BO0X HEIGHT ABOVE GROUND 100 Calculates the boundaries with aid of the start location static int32 t get boundary byte compass direction byte boundary type if start_loc lat 0 start loc lng 0 return l int32 t boundary 0 int boundary size 0 int32_t start_loc_lat_abs start loc lat if start loc lat abs lt 0 start loc lat abs start loc lat abs float rads temp 0 0174532925 float scaleLongDown temp float scaleLongUp temp float awesome constant float super awesome constant cos rads temp 1 0f cos rads temp 01113195 1 0 awesome_constant if boundary_type BOX_BOUNDARIES else boundary_size current_box_size boundary_size MIDDLE_SIZE switch compass_direction i case NORTH boundary start_loc lat awesome_constant boundary_size lt 0 5 super_awesome_constant start loc lat abs 10000000 0 Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tri
32. Technical documentation tricopter pdf Tricopter 44 E Firmware modifications to support sending receiv ing virtual box size and target position E 1 Target position In Parameters h k param camera target alt 230 k param camera target lat k param camera target lng AP Int32 camera target alt AP Int32 camera target lat AP Int32 camera target lng camera target alt 0 k param camera target alt PSTR CAMERA ALT camera target lat 0 k param camera target lat PSTR CAMERA LAT camera target lng 0 k param camera target lng PSTR CAMERA_LNG In ArduCopter pde static struct Location camera target camera target waypoint static bool new camera target Flag to tell us if a new camera target is received If new target has been sent to tricopter save it to eeprom and print to console that new target position has been received void update camera target if g camera_target_alt camera_target alt g camera_target_lat camera_target lat g camera target lng camera_target 1ng amp amp Inew camera target g camera target alt save camera target alt g camera target alt g camera target lat save camera target lat g camera target lat g camera target lng save camera target lng g camera target lng new camera target true else if new_camera_target Course name Control Project E mail tsr
33. UX1 on the RC controller to the lower level see section EZ The code for the implementation can be seen in appendix D Easy control feature When this feature is activated a fixed coordinate system is used 5 which was created and aligned to the tricopter s orientation when it was armed As long as this feature is active all control commands are interpreted as desired flight directions in this coordinate system and will be converted to rotor commands to follow them This mode is activated by switching AUX2 on the RC controller to the lower level see section Z Surveillance unit The function of the Surveillance unit is to calculate the orientation of the Gimbal and then control the camera The purpose of the camera and the Gimbal is covered in the introduction see section Il Course name Control Project E mail Project group Triforce Course code TSRT10 Project Tricopter Document responsible Author s E mail Document name tsrt10 tricopter gmail com Karl Johan Barsk karba878Gstudent liu se Technical documentation tricopter pdf Tricopter 9 Wireless video link Ground station PC Flight unit Pan servo IMUcamera Tilt servo Surveillance unit Figure 5 Block diagram for the Surveillande unit 5 1 Hardware The Surveillance unit consists of e Camera e Gimbal e Ardulmu V2 IMUcamera 5 1 1 Gimbal The Gimbal is the device on which the camera is mounted It con
34. a cs Box size variables public static float BoxSize 20 public static float CurrentBoxSize 20 Run when typing in the virtual box size text box private void textBox1_TextChanged object sender EventArgs e try if sizeBox Text if int Parse sizeBox Text gt 0 else BoxSize float Parse sizeBox Text MessageBox Show Box size can not be zero sizeBox Text catch MessageBox Show Invalid box size sizeBox Text Update local virtual box size and display it public void UpdateBoxSize float size CurrentBoxSize size label2 Text Size CurrentBoxSize Run when clicking the send button for the virtual box size Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 49 private void SendBoxSize object sender EventArgs e if comPort BaseStream IsOpen if BoxSize lt 0 BoxSize gt 255 Console WriteLine Invalid size else if MainV2 comPort BaseStream IsOpen try MainV2 comPort setParam BOX_SIZE BoxSize MessageBox Show New box size set catch Exception ex Console WriteLine ex try MainV2 comPort param MainV2 comPort getParamL
35. arometer magnetometer sonar and GPS which are part of the sensor unit The IMUcopter consists of the regular functionality of an IMU which has a triple axis accelerometer and a triple axis gyro The ArduPilot Mega and IMUcopter will be considered as one device as described in section E21 4 2 Interface This section describes the communication of the Flight unit Signals in e GPS data see definition in section BJ from the Sensor unit via the serial port on the ArduPilot e Tricopter heading see definition in section ZJ from the magnetometer in Sensor unit via the 12C bus and serial ports e Altitude from the sonar sensor see section ECT in the Sensor unit via the port marked pitot tube on IMUcopter e Altitude from the barometer see section ELA in the Sensor unit via the I C bus and serial ports e Control signals from the Communication unit e Route target coordinates from the Communication unit Signals out e Updated UAV flight data i e tricopter orientation and GPS data according to section LT to the Communication unit e The Flight unit provides the Surveillance unit with heading and GPS position data via an 12C bus 4 2 1 Internal communication The communication between IMUcopter and ArduPilot is serial and has not been modified further Henceforth IMUcopter and ArduPilot will be considered as one device in terms of communication with other components Course name Control Project E mail tsrt
36. at x dist cos bearing float y dist sin bearing float z target alt tricopter pos alt 100 0f cm to m Rotate relative coordinates according to tricopter orientation float y p x cos pitch cos yaw y cos_pitch sin_yaw z Sin pitch float x p x cos_yaw sin_pitch sin_roll cos_roll sin_yaw ye cos_roll cos_yaw sin_pitch sin_roll sin_yaw z cos_pitch Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 34 sin roll float z_p x sin_roll sin_yaw cos_roll cos_yaw sin_pitch y cos_yaw sin_roll cos_roll sin_pitch sin_yaw zs cos pitch cos roll Get resulting angles angle tilt ToDeg atan2 z p abs dist angle pan ToDeg atan2 x p y p Target in sight if angle tilt MAX TILT angle tilt lt MIN TILT angle pan gt MAX PAN angle pan lt MIN PAN target in sight fa lse else target in sight true x Debug Serial print Serial print Serial print Serial print D dup doy Tilt Serial print angle tilt Pan Serial print angle pan Dist Serial print dist Serial print Bearing Serial print bearing Serial print Tri lng Serial print tricopter pos l1n
37. attitude window or video window if recordcam hud2 streamjpgenable true aviwriter avi add hud2 streamjpg ToArray uint hud2 streamjpg Length aviwriter avi end hud2 Width hud2 Height 10 else added else cond contains the original code though xxx Original code hudi streamjpgenable true add a frame aviwriter avi add hudi streamjpg ToArray uint hud1 streamjpg lt Length write header so even partial files will play aviwriter avi end hudi Width hudi Height 10 added code endx x x At line 859 in function cam camimage Display video in the appropriate window hud2 bgimage camimage modified x x At line 1229 in function recordHudToAVIToo1StripMenultem_Click Line added to show that recording is on recording true At line 1248 in function stopRecordToolStripMenultem Click Line added to show that recording is off recording false In Configuration cs Boolean to show if camera window is active public static bool is camera on false At line 75 in function Configuration Load This line was changed so that the configuration setting for hud overlay is applied to the video window and not the attitude window CHK_hudshow Checked GCSViews FlightData mycam hudon At line 629 in function BUT_videostart_Click Course name Control Proje
38. copter Document name Technical documentation tricopter pdf Tricopter 43 break case SOUTH boundary start_loc lat awesome_constant boundary_size lt 0 5 super_awesome_constant break case WEST boundary start loc lng int32_t boundary_size 0 5 lt super_awesome_constant scaleLongUp_temp break case EAST boundary start loc lng int32_t boundary_sizex 0 5 2 super_awesome_constant scaleLongUp_temp break return boundary In set_mode in system pde A mode that creates a virtual box if the box mode is turned on When the tricopter is inside the box the streering functionality is like stabilize case BOX if box_created ifdef VIRTUAL_BOX_PRINT Serial println NOTE BOX CREATED like a boss endif create_virtual_box box_created true yaw_mode YAW_HOLD roll_pitch_mode ROLL_PITCH_STABLE throttle_mode THROTTLE_MANUAL reset hold I break The following code has been added in every mode i set modein system pde to remove the box when box mode is deactivated If virtual box has been created un make the box if box created box_created false boundaries PREVIOUSLY UN BROKEN Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name
39. ct E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 58 Line added to signal that the camera window is active is_camera_on true At line 646 in function BUT_videostop_Click Line added to signal that the camera window is not active is camera on false At line 665 in function CHK_hudshow_CheckedChanged This line was changed so that the configuration setting for hud overlay is applied to the video window and not the attitude window GCSViews FlightData mycam hudon CHK_hudshow Checked In HUD cs At line 624 in doPaint O Original code has been commented inactivated if hudon false return pa Added condition to only draw attitude hud overlay if it is activated in Configuration tab if hudon Else draw an image else if ArdupilotMega GCSViews Configuration is_camera_on _bgimage global ArdupilotMega Properties Resources lt camera image Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf
40. cument responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 38 D Virtual box code In defines h Virual box parameters if define BOX SIZE 20 A box that is BOX SIZE x BOX SIZE x BOX SIZE m default size define BOX HEIGHT ABOVEGROUND 3 The box height above the ground in m define MIDDLE SIZE 5 The resolution of the middle in the box in m define WEST 1 define EAST 2 define NORTH 3 define SOUTH 4 define PREVIOUSLY BROKEN 1 define PREVIOUSLY UN BROKEN 0 define VIRTUAL BOX UPDATE RATE 10000 define LOITER COUNTER RATE 4 define BOX BOUNDARIES 10 define MIDDLE BOUNDARIES 11 In ArduCopter pde Virtual box parameters static struct Location middle box static struct Location start loc static int virtual box counter 0 Counter that controls how often we check if the boundaries are broken static byte boundaries PREVIOUSLY UN BROKEN A variable that says if the boundaries previously been broken or unbroken static bool box created false A bool that check if the box been created or not static int32 t boundary west Boundaries for the box static int32 t boundary_east Static int32 t boundary north static int32 t boundary south static int32 t boundary top Static int32 t boundary bottom static int32 t middle
41. e ArduPilot board e Sonar sensor acquired signals to the Flight unit via the port marked pitot tube on the ArduPilot board e Barometer acquired signals to the Flight unit via the 12C bus with address 0x77 on the ArduPilot board 6 3 Complications During the course of the project a few critical issues arose These will be listed below Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 16 6 3 1 Magnetometer While performing tests on the magnetometer large offsets were measured regarding the orientation along all axis of the tricopter Initially it was suspected that the electronics mounted on the tricopter were the cause of the bad compass readings However after further tests and investigations it was conclusive that the offset calibration performed by the Arducopter was not well suited for a location with a relatively large vertical component of the earth s magnetic field which Sweden is affected by A few data collection sessions revealed that the offsets in the magnetometer reading were stationary and therefore could be compensated for with stationary offset values To find these offsets the collected magnetometer readings were plotted up in MATLAB The earths magnetic field is measured as three orth
42. e name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878Gstudent liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 7 waypoint 1 and then further to waypoint 2 The third waypoint is not an actual waypoint because the command has been changed to a landing command Therefore the next thing to do is to land at the location of waypoint 2 and the simulated tricopter will not fly to the third waypoint as seen in the figure The location of waypoint 3 the landing command can be chosen arbitrarily Figure 4 Exampel of a route with autonomous landing Manual mode In manual mode the user controls the tricopter using an RC controller How the control signals are interpreted depends on the feature that has been enabled Virtual box feature The virtual box feature is used to confine the flight space for the tricopter The box default size is 20 x 20 x 20 m but can be altered The box cannot be too small due to inaccuracy in the GPS thus a box size of the default one 1 or 2 meters is recommended The center point of the box is determined by the tricopter s position when the feature is activated To prevent the tricopter from crashing because the box is placed too close to the ground the box is automatically elevated to a safe height This height is by default 3 meters The box is oriented so
43. ed to here if e Button MouseButtons Left isMouseDown false code added x x Test if target marker if onTargetMarker onTargetMarker false added code endx x x if lisMouseDraging if CurentRectMarker null code addedx x x Place target on the map if left click while shift is held down else if addtarget amp amp Control ModifierKeys Keys Shift cant add WP in existing rect targetloc lat int currentMarker Position Lat 10000000 targetloc ing int currentMarker Position Lng 10000000 writeKML FlightData tar lat currentMarker Position Lat lt ToString FlightData tar_lng currentMarker Position Lng lt ToString addtarget false I xadded code endx x x else callMe currentMarker Position Lat currentMarker Position Lng 0 else void MainMap_MouseDown object sender MouseEventArgs e start MainMap FromLocalToLatLng e X e Y Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 55 if e Button MouseButtons Left amp amp Control ModifierKeys Keys Alt isMouseDown true isMouseDraging false code added x x
44. es case GIMBAL_SERVO_ANGLES angle_pan float int8 t received data 0 angle tilt float int8 t received data l1 setServoAngles break 12C request event void requestEvent Only one type of request Target in sight if target in sight Wire send 1 else Wire send 0 Convert 4 bytes to int32 it Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 31 int32_t convertToint32 t bytex data return int32 t uint32 t data 3 lt lt 4 6 uint32_t data 2 lt lt 4 4 uint32 t data 1 lt lt 4 2 uint32_t data 0 Clamp servo angles to 180 180 void clampServoAngles Get right angle interval while angle_pan lt 180 0f angle pan 360 0f while angle_pan gt 180 0f angle pan 360 0f while angle tilt lt 180 0f angle tilt 360 0f while angle tilt gt 180 0f angle tilt 360 0 Clamp servo angles if angle pan lt MIN PAN angle pan MIN PAN if angle pan gt MAX PAN angle pan MAX PAN if angle tilt lt MIN TILT angle tilt MIN TILT if angle tilt gt MAX TILT angle tilt MAX TILT Set out desired angles to servos 7 void setServo
45. float MainV2 comPort param CAMERA ALT 100 string tempfinalmsg Lat tempmsgi ToString gt long tempmsg2 ToString alt tempmsg3 lt ToString MessageBox Show tempfinalmsg catch Exception ex Console WriteLine ex else MessageBox Show Tricopter is not connected At line 383 in MainLoopO Updating lat long displayed text TarLat Text Lat tar_lat TarLng Text Long tar lng F 3 Box and target shared functionality In FlightData cs Run when clicking the button to get current values for target position and virtual box size from the tricopter private void click_getBoxTar object sender EventArgs e if MainV2 comPort BaseStream IsOpen try UpdateBoxSize float MainV2 comPort param BOX SIZE UpdateCurrentTarget float MainV2 comPort param CAMERA LAT 10000000 float MainV2 comPort param lt CAMERA_LNG 10000000 float MainV2 comPort param lt CAMERA_ALT 100 I catch Exception ex Console WriteLine ex I I Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 52 F 4 Modified map functionality In FlightData cs and FlightPlanner cs
46. for this project are pulse width modulated and the servo control code available in Arduino is used to generate the pulses given a specific angle The servo code takes a value between 0 and 180 and generates a pulse between 0 5 and 2 5 ms It is important to disable interrupts from the bus code during the pulse generation otherwise the pulse may stay high for too long An offset was added so if both calculated angles are zero the camera will be pointing straight ahead To prevent the servos from taking damage some limitations on the servo output were implemented to correspond to the restrictions of the gimbal If you look at figure Bl you can suspect that the transfer from the tilt servo angle to the actual tilt of the camera is not linear because of the joints shaded in the figure Because of this a non linear transfer function had to be calculated Figure 8 Gimbal sketch To see the relationship between the servo and gimbal angle see figure B As seen by the transfer function the maximum difference between the two angles is around 5 Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 13 60 T T T T T T T Gimbal angle 50r Servo angle P d J 0 2 D O 5
47. g Serial print Tri lat Serial print tricopter pos lat Serial print Tar Ing Serial print target Ing Serial print Tar lat Serial print target lat Serial print Serial print Serial print x Serial print x y Serial print y z Serial print z Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 35 C EC code In defines h 12 parameters define IMU CAMERA ADRESS 0x02 define CURRENT LOCATION PACKET SIZE 12 define CURRENT LOCATION FLAG 1 define CAMERA TARGET LOCATION PACKET SIZE 12 define CAMERA TARGET LOCATION FLAG 2 define TRICOPTER HEADING PACKET SIZE 12 define TRICOPTER HEADING FLAG 3 define GIMBAL SERVO ANGLES PACKET SIZE 2 define GIMBAL SERVO ANGLES FLAG 4 A send rate of 0 equals no sending over the bus The send rate is sends per runs through loop define CURRENT LOCATION SEND RATE 4000 define CAMERA TARGET LOCATION SEND RATE 6000 define TRICOPTER_HEADING SEND RATE 1000 define GIMBAL SERVO ANGLES SEND RATE 0 In ArduCopter pde 12 variables The offset of the sent packages are send rate offset runs through
48. g signals 6 1 Hardware The Sensor unit consists of e MB1200 XL MaxSonar EZ0 High Performance Ultrasonic Range Finder e GS407 U Blox5 GPS 4Hz New Antenna amp Free uBlox Adapter Basic e HMC5883L Triple Axis Magnetometer e A built in barometer 6 1 1 Sonar Since autonomous landing was a secondary requirement in this project a sonar sensor was mounted on the tricopter for accurate altitude determination when the tricopter is close to ground level If the built in barometer section ELA gets a height reading below eight meters the ArduPilot will start using a combined height measurement from both the sonar and the barometer The AutoPilot uses the sonar data to create a scale variable varying between 0 and 1 which decreases the closer the tricopter gets to the ground Based on this it calculates its current height as presented in equation L3 current height scale variablexbarometer readings 1 scale variable sonar readings 13 This sensor is placed on the main frame of the tricopter facing the ground with at least a distance of eight centimetres from the body to prevent the sonar sensor from picking up electrical disturbances Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 15 6 1 2 GP
49. grees define MAX TILT 30 Maximum tilt servo output e degrees w o offset define MIN TILT 65 Minimum tilt servo output degrees w o offset define MAX PAN 90 Maximum pan servo output e degrees w o offset define MINPAN 90 Minimum pan servo output e degrees w o offset Current angles id static float angle_tilt 0 0f Gimbal tilt angle w o offset static float angle_pan 0 0f Gimbal pan angle w o offset Servo Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 28 Servo servo_tilt Tilt servo object Servo servo_pan Pan servo object if Locations and orientation Waypoints WP target Target location in ng lat alt Waypoints WP tricopter pos Tricopter location in lng lat alt long tricopter roll 0 Tricopter roll angle degrees 100 long tricopter pitch 0 Tricopter pitch angle degrees 100 long tricopter yaw 0 Tricopter yaw angle e degrees 100 static bool new orientation false New orientation data has been received static bool target_in_sight false Target is in sight 12C received data if byte received data I2C MAX MESSAGE LENGTH Set
50. hanged Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 46 current box size g box size box size changed true else if box size changed Serial print NOTE Box size changed New size Serial println current box size Serial3 print NOTE Box size changed New size Serial3 println current box size box size changed false At line 1240 in function slow loopO Check if new box size has been received and update the virtual box size if that is the case update current box size if box size changed update virtual box size box size changed false Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 47 F APM Mission Planner code F 1 Box size functionality In Common cs Modified to be consistent with changes made in the arducopter code simple is no longer a mode Also Box mode is added public enum ac2modes STABILIZE 0 hold level positio
51. is used to make sure that the bus is not overrun with transmissions Each package will be sent Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878Gstudent liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 4 according to its send rate which is equal to number of runs through the loop the main function A constant variable aptly named send rate offset is used to further handle possible conflicts on the bus by offsetting the transmissions a number of runs 4 Flight unit The purpose of the flight unit is to fly the tricopter according to the commands received from the Ground station It manages the sensor data from the Sensor unit see section Bl and controls the Gimbal see section BELLI It consists of three rotors one tail pan servo IMUcopter and the ArduPilot chipset Note that though the GPS is mounted on the ArduPilot chipset it is considered a part of the Sensor unit see section Bl See figure for the outline of the unit Serial link Xbee Communication unit Right rotor Serial links NM UON Receiver x Communication unit Tail rotor Seriallink o Tail pan servo GPS Sensor unit FE IMUcopter Flight unit Barometer 1 Sensor unit I P 4 Serial lin Sonar Sensor unit PC IMUca
52. ist UpdateBoxSize float MainV2 comPort param BOX SIZE catch Exception ex Console WriteLine ex else MessageBox Show Tricopter is not connected F 2 Target functionality In FlightData cs Target Vars static public string tar_lat static public string tar_lng Current target static float Clat 58 39845f static float Clng 15 57792f static float Calt 1f un when typing in the target altitude text box R I typing in the target alti le t ls private void TarAlt_TextChanged object sender EventArgs e try if TarAlt Text catch if int Parse TarAlt Text gt 0 MessageBox Show Invalid altitude TarAlt Text Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 50 Update local target position and display it public void UpdateCurrentTarget float lat float lng float alt Clat lat Cling lng Calt alt Ctar lat Text Lat Clat ToString Ctar long Text Long Clng ToString Ctar alt Text Alt Calt ToString Run when clicking the send button for the target position private void SendTarget object sender EventArgs e if
53. l Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 18 The XBee is a very sensitive unit and must be used carefully The XBee must be connected to the ArduPilot board after the board is supplied with power from the battery Then it must be disconnected before the battery power is broken It is very important to follow these steps otherwise the XBee will be reset and the unbricking procedure described on the ArduCopter web page 1 must be performed Hence the recommended starting procedure is 1 Supply the tricopter with power from the battery 2 Wait for the initialization to finish after the status LEDs on the ArduCopter stop fashing rapidly 3 Supply the XBee module on the tricopter with power i e the outer of the two switches see figure T3 4 Wait two seconds 5 Turn on the RX TX switch i e the inner one see figure IA 6 You are good to go i e connect through APM PLANNER and the corresponding shutdown procedure is 1 Turn of the RX TX switch see figure 3 2 Turn of the XBee power see figure L3 3 Shut down the tricopter aio 994 g a 7D n Fil 3 i F gt I j a io EN AU a o HER YT TTT ny NN E Power supply p Pa P ROSADA Figure 13 The three switche
54. liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 33 return l Latitude of loc2 in radians float rads abs loc2 gt lat 10000000 0 0174532925 Get longitude scalings from latitude float _scaleLongDown cos rads float _scaleLongUp 1 0f cos rads Get longitude difference long off x loc2 gt lng loc1 gt lng Get latitude difference long off_y loc2 gt lat loci gt lat _scaleLongUp Get bearing from differences long bearing 9000 atan2 off y off x 5729 57795 Wrap bearing if necessary if bearing lt 0 bearing 36000 return bearing Calculate gimbal angles void calculateAngles Get tricopter orientation in radians float roll rad ToRad tricopter roll 100 0f float pitch rad ToRad tricopter_pitch 100 0f float yaw rad ToRad tricopter yaw 100 0f Calculate cos and sin values float cos roll cos roll_rad float sin roll sin roll_rad float cos pitch cos pitch_rad float sin pitch sin pitch_rad float cos yaw cos yaw rad float sin yaw sin yaw_rad Calculate distance and bearing from tricopter to target float dist float get distance amp tricopter pos amp target float bearing float ToRad get bearing amp tricopter pos amp target lt 100 0 Get relative coordinates in world system flo
55. lot and to calculate the gimbal servo angles 5 3 1 Angle calculation The first thing IMUcamera does in order to calculate the desired camera angles is to calculate the distance between the tricopter and the target in the ground plane and the bearing relative to north see equations Q The longitudes and latitudes received from ArduPilot are given in degrees x10 and the altitudes are given in cm The calculated bearing is given in degrees x102 The cartesian coordinates for the target in a coordinate system with its center at the tricopter s position see figure ZA are given by equations m These are in m Aat tricoptertat targetiat 2 target Aing cos a7 tricopteriong targetiong 3 Aa tricopter a target att 4 2 2 T Tearth dist V Nat A un 180 107 5 Aong y 18000 bearing 9000 arctan A lat The factor 9000 in B is to turn the bearing 90 towards north rp dist cos bearing 7 oo YE dist sin bearing ZE Aat 100 e These equations are a good approximation for coordinates close to each other but are not completely accurate In the equations for Along we assume that both the target and the tricopter have the same latitude A more graphical explanation of the equations m Q can be seen i figure Hi Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan
56. mera Surveillance unit PC Maanetometer Sensor unit Figure 3 Block diagram for the Flight unit with ingoing and outgoing signals 4 1 Hardware The Flight unit consists of e ArduPilot Mega Arduino Compatible UAV Controller w ATMega2560 e Three rotors and a tail pan servo e EM 406 uBlox MTK Adapter Cable 5 cm e ArduPilot Mega IMU Shield OilPan Rev H With Pins IMUcopter Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 5 The ArduPilot Mega which is an IMU based open source autopilot is used to control the tricopter by sending signals to both the servo on the tail and to the three ESCs which control the three rotors The main board which is designed with an ATMega2560 micro controller is placed as close as possible to the tricopter s center of mass The IMUCopter is mounted on the ArduPilot and with help of the Sensor unit see section Bl the ArduPilot Mega is a fully functional autopilot for a UAV The ArduPilot IMU on the Flight unit called IMUcopter is used to take measurements of the acceleration and the angular velocity of the tricopter for the ArduPilot Mega The processor on ArduPilot Mega is used to process the measurements from IMUcopter as well as measurements from the b
57. ms see section El for the Ground station section A for the Flight unit section Bl for the Surveillance unit section 4 for the Sensor unit and section A for the Communication unit 3 1 PC In the interface sections of the Flight unit the Surveillance unit and the Sensor unit sec tions J and respectively the I C bus is mentioned On this bus the ArduPilot will be acting as master It is written in C using the ARDUINO Wire library I C uses two bidirectional lines named Serial Data Line SDA and Serial Clock SCL with pull up resistors As the name suggests the former is used for sending the data and the latter for the clock Since the bus is the same as the one used by the barometer section ELA the given barometer code on the ArduPilot initializes the bus and sets the ArduPilot to master This is done in the file APM BMPO85 cpp The protocol on the bus namely the communication between the ArduPilot and the IMUcamera can be seen in table Il below Table 1 I C protocol for communication between ArduPilot and IMUcamera Type byte 1 packet byte 2 byte 3 to end packet size flag Current location 12 1 Lat Ing alt Camera target 12 2 Lat Ing alt Tricopter heading 12 3 Roll pitch yaw Gimbal servo angles 2 4 Pan tilt The fourth package servo angles to the gimbal is for testing purposes only The implementation can be seen in appendix Q There the variable busy bus
58. n ACRO 1 rate control SIMPLE 2 ALT_HOLD 2 AUTO control changed xx AUTO 3 AUTO control changed x GUIDED 4 AUTO control changed x x LOITER 5 Hold a single location changed x x RTL 6 AUTO control changed x CIRCLE 7 changed x x POSITION 8 added x BOX 9 addedss In CurrentState cs at line 270 in function UpdateCurrentSettings Modified to be consistent with changes made in the arducopter code simple is no longer a mode Also Box mode is added switch sysstatus mode case byte 102 mode Simple break case byte 102 changed x mode Alt Hold break case byte 103 changed s mode Auto break case byte 104 changed x mode Guided break case byte 105 changed x mode Loiter break case byte 106 changed x mode RTL break case byte 107 changed x mode Circle break Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 48 case byte 108 added x x mode Position break case byte 109 added x x mode Box break In FlightDat
59. o firmware related to APM MISSION PLANNER To be able to send and receive target position and virtual box size between the tricopter and APM MISSION PLANNER and also for the sent values to be saved to the EEPROM on the ArduPilot some modifications hade to be made to the firmware These can be found in appendix H Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf 26 Tricopter A Wiring diagram en Jo eDeg LLOZ zz saquiaydag Or olio 7 Hold JJLLOHHL 191ISJaAIUN Buldoxun ASI AWA v ezis abed weep yoo Jeydoou YIMASIPON LXV Gdoyzxnv ONSD2IHOUL YWAATLLOYMH e osa do 3 DRE e Av OAFHIS ATIF ONS ppna UlIA3TLLOSH L ea Lxny CXV Jona OM Maroma T INS S Qaia suid mamo suid indu NYD LWAAd Lal XL AS XH wewegna IND AND AS UNO AS IND AS a a OWAAd uy HOdulajar q ANO Age 19S VQS ANO SAND Sud OZI Ag PAS ToS Induj1euog 24M 10lld Hod OZI yas i zi pe 1gsvgs cds AS aNd Jeu0s 1 un ein WEN gin en ENJ znj en Wen enj ern dfts AO di di pg rfe au put y Enz Sd9 MC ones wold 2s3 yer osa xoeg os3 vas AS ALL AS ALL AS AL AS AND gt
60. of the tricopter e get location Receive the position of the tricopter e set box size Send the size of the virtual box to the tricopter e set target Send the target coordinates to the tricopter e get target Receive the target coordinates of the tricopter e set waypoint Send the coordinate of a specific waypoint to the tricopter e add waypoint Send the coordinate of a new waypoint to the tricopter 8 4 8 APM MISSION PLANNER The APM MISSION PLANNER V1 0 66 is an off the shelf software with much of the func tionality required for the project already at hand such as updating the firmware setting controller parameters and as the name suggests planning waypoints for a flight route Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 23 The software was modified to fit the requirements such as setting and displaying the tar get location set the box size and display the video feed The interesting parts of the off the shelf software are the Flight Data and Flight Planner tab If there is a need to move a waypoint left click on the waypoint and drag it to the desired location while holding down the left mouse button More about how to use the modified version of the APM MISSION PLAN
61. ogonal vector components which correspond to the three axis in the plotted figures The length of these components combined should be constant since the measured field is approximately stationary Therefore the plotted values should resemble a sphere centered around the origin Raw magnetometer data revealed a sphere that was centered around an offset point from the origin The location of this point is the offset needed to fix the incorrect magnetometer readings The plotted magnetometer readings can be seen in figure TI 400 400 200 200 200 200 400 400 400 400 200 200 200 Y 400 400 x Y 400 400 200 x a Raw magnetometer data b Corrected magnetometer data plotted with a fit ted sphere Figure 11 Magnetometer calibration 6 3 2 GPS At the end of the project a rather unexpected error occured that caused the ArduPilot to not get GPS lock Given the shortage of time to further inverstigate this issue a conclusion could not be made However suspicions pointed to that this issue was due to the communication between the ArduPilot and IMUcamera over the I C bus which interrupted the communication between the ArduPilot and the GPS device Although this error has not been resolved it can easily be worked around by first disconnecting the camera starting the tricopter and waiting for the ArduPilot to get GPS lock After this is done reconnect the camera and reset the ArduPilot Course
62. opter Document name Technical documentation tricopter pdf Tricopter 37 update gimbal servo angles 0 busy bus send rate offset Wire beginTransmission IMU CAMERA ADRESS Wire send GIMBAL SERVO ANGLES PACKET SIZE Wire send GIMBAL SERVO ANGLES FLAG Wire send angle pan Wire send angle tilt Wire endTransmission I if update gimbal servo angles lt GIMBAL_SERVO_ANGLES_SEND_RATE update_gimbal_servo_angles endif if busy_bus gt 0 busy bus Making a vector with the current location to send over the I2C bus static long makeCurrentLocationSendVector long send_vector 3 send_vector 0 current loc lat send vector 1 current loc lng send vector 2 current loc alt return send vector Making a vector with the target location to send over the I2C bus static long makeCameraTargetLocationSendVector long send_vector 3 send vector 0 camera_target lat send vector 1 camera_target 1ng send vector 2 camera_target alt return send_vector Making a vector with the tricopter orientation to send over the 12C bus static long makeTricopter rientationSendVector long send_vector 3 send_vector 0 dem roll sensor send_vector 1 dcm pitch sensor send_vector 2 dem yaw sensor return send vector Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Do
63. s flight is a matter of translating route information to control signals for the rotors and tail pan servo The route information consists of predefined waypoints that the tricopter should pass through Using sensor information to estimate position velocity and orientation it is possible to adjust the control signals to steer the tricopter in the desired direction The sensor information is hardware filtered on the IMUcopter and then fused on the ArduPilot to get the estimates The autonomous flight mode will be performed using already existing functionality in the ArduPilot firmware Autonomous landing In the given code there is an implemented command for au tonomous landing By setting a land command in the APM MISSION PLANNER the tricopter will perform landing At three meter altitude the tricopter will hold the current GPS position in longitudinal and lateral direction and then descend When the tricopter is either 40 cm above the ground or has the speed 0 m s the engines will be turned off and the tricopter will fall freely from this point This command has been tested in a simulation environment and it works but it does not perform a very smooth landing Therefore this command has not been implemented in the final product because of the risk of damaging the components Figure Al shows an example of how a route specification looks like when the landing command land in the simulation Primarily the tricopter will fly autonomously to Cours
64. s related to the XBee module on the tricopter The switch on the XBee module should be in master mode at all time see figure Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 19 7 2 Interface The interface between the Communication unit and the other units Ground station and Flight unit will be presented below Signals in e Control signals from the RC control in the Ground station e Updated route target coordinates over XBee from the Ground station Signals out e Control signals to the ArduPilot in the Flight unit from the RC e Updated route target coordinates to the ArduPilot in the Flight unit over XBee 8 Ground station The Ground station consists of two computers and one Radio Controller RC The Ground station is primarily used to control the tricopter from the ground either with the RC in manual mode or the autonomous mode It will also receive the orientation of the tricopter from the Communication unit see section M One of the computers is dedicated to receiving the analogue video signal from the camera named Laptop 1 The other is equipped with the software APM MISSION PLANNER and communicates with the tricopter via XBee see section LLI This computer is named Laptop 2 See fig
65. sists of two servos one to perform a panning movement and one to perform a tilting movement This makes it possible to rotate the camera relative to the UAV so that it focuses on the target coordinates 5 1 2 IMUCamera IMUcamera is connected to ArduPilot via the 12C bus section ELT from which it receives the target s location and the tricopter s position and orientation With this information IMUcamera calculates the desired angles for the gimbal servos see section EZZ Note that this unit is used as s processor only since the sensor are not used See section EA 5 2 Interface The interface between the surveillance unit and the other units the Ground station and Flight unit will be presented below Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 10 Signals in e Tricopter orientation and target location see definition in section ZJ from the ArduPilot in the Flight unit The signals are transmitted via the I C bus The IMUcamera will have address 2 on the bus Signals out e Video to Laptop 1 in the Ground station via the Video link e Reference signal from IMUcamera to the gimbal servos 5 3 Firmware The firmware for the unit is run on IMUcamera and is used to communicate with ArduPi
66. t10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 45 Serial print NEW TARGET latitude float camera_target lat 10000000 longitude float camera target 1ng 10000000 Serial print altitude Serial println float camera target alt 100 Serial3 print NEW TARGET latitude Serial3 print float camera target 1at 10000000 Serial3 print longitude Serial3 print float camera target 1ng 10000000 Serial3 print altitude Serial3 println float camera target alt 100 new camera target false Serial print za Serial print Serial print At line 1248 in function slow loopO If target is not hardcoded check if new has been received ifndef HARD CODED CAMERA TARGET update camera target endif E 2 Virtual box size In Parameters h k_param_box_size AP_Int16 box_size box_size 20 k param box size PSTR BOX_SIZE In ArduCopter pde static bool box size changed false Flag if new box size has been received If new box size has been sent to tricopter save it to eeprom and print to console that new size has been changed void update_current_box_size if g box_size current_box_size amp amp box_size_c
67. the desire to be able to record the video feedback and the attitude indicator separately Because of the implementation of the window for the video broadcast the parameter box was moved to the left The intended flight trajectory and the position of the tricopter are presented on a map Representation of a target was implemented in the same way as in Flight planner A red marker shows the coordinates of the target The real time position indicator for the multicopter in Flight data was changed from a quad copter to a tricopter The difference between the modified and the non modified APM MISSION PLANNER can be seen in figures IS IA respectively lo APM Planner 1 0 74 Build By Michael Obome O Ms EE ANV E o 22 ArduPlane PH SS SHO EH dO S99 NN 9 15 amp OMM EE EE AE Dir 0 OVA 00 00 00 AS O00 GS 0 0 a 0570 Bat0 00v 0 GPS No GP TA Figure 17 The non modified Flight Data tab Course name Control Project E mail tsrt10 tricopterQgmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 25 ArduCopter2 M 2 Figure 18 The modified Flight Data tab The numbering in the figures above 1 2 3 4 5 6 Menu bar Connection bar Parameter box Video window Map window Attitude window Modifications t
68. the tricopter is seen from above and the arm with the tail pan servo is pointing south then the arm pointing north east will be called right and the one pointing north west will be called left see figure M North 3 2 Left LS Right PT gt Figure 1 Right Left orientation for the system 3 System overview The UAV consists of a tricopter with an ArduCopter platform ArduCopter is based on the open source autopilot ArduPilot and is one of the most sophisticated IMU based autopilots on the market It provides among other things full UAV functionality with scripted waypoints and manual RC control The tricopter consists of a Ground Station a Flight unit a Surveillance unit a Sensor unit and a Communication unit The relation of these subsystems can be seen in figure B For more information about the ArduPilot see I 1Due to the fact that a barometer and sonar sensor will be used to decide the altitude this information will be redundant Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 3 Right rotor Left rotor ArduPilot Tail rotor Tail pan servo IMUcopter Flight unit Pan servo Tilt servo Figure 2 Block diagram for the system For further descriptions of the subsyste
69. tion tricopter pdf
70. up Run once at startup void setup Gimbal servo setup servo_tilt attach 10 servo_tilt setMaximumPulse 2450 servo_tilt setMinimumPulse 450 servo_pan attach 9 servo_pan setMaximumPulse 2450 servo_pan setMinimumPulse 450 i Set angles to zero at start angle_tilt 0 angle_pan 0 setServoAngles 0 fF Reset locations soccer VS target lat 583982430 target lng 155789512 target alt O analog pin O field outside analog pin 1 B house Course name Control Project E mail Project group Triforce Document responsible Course code TSRT10 Author s E mail Project Tricopter Document name tsrt10 tricopter gmail com Karl Johan Barsk karba878Gstudent liu se Technical documentation tricopter pdf Tricopter 29 7 tricopter pos lat 583979029 tricopter pos l1ng 155789512 tricopter pos alt O it Initialize I2C for uint8_t i 0 i lt I2C MAX MESSAGE LENGTH i received data i O Wire begin 0x02 Address 2 on the bus Wire onReceive receiveEvent Wire onRequest requestEvent Main loop void loop i Update angles when new orientation has been received ji if new_orientation cli calculateAngles setServoAngles new orientation false sei Refresh servos every 20 ms disable interrupts cli Servo refresh
71. ure A for the outline of the unit L Radio signals Wireless serial link Communication unit Communication unit Wireless video link Surveillance unit Figure 14 Block diagram for the Ground station with ingoing and outgoing signals 8 1 Hardware The Ground station consists of e iTheater glasses Wireless AV receiver Two laptops e RC e XBee module Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 20 e Dazzle Tv video converter The wireless AV receiver will receive analogue video signals from the wireless video link at the tricopter To watch this video iTheater glasses or a video converter connected to a laptop can be used By using the video converter and a composite video cable Laptop 2 can play back the video signal from Laptop 1 For laptop to tricopter communication the Xbee module will be used connected to Laptop 2 through an USB port It will send and receive signals to and from the Xbee on the tricopter For more information on the XBee see section LLI 8 2 Radio controller The RC controller that was used during the project was a Royal 9 Evo as seen in figure 14 It is communicating with a AR7000 DSM2 7 Channel RC receiver on the back arm on the tricopter It uses a 2 4 GH
72. z band frequency and a DSM2 modulation Figure 14 shows which stick is controlling which command note that some flight modes may change the function of the stick or disable it Figure 15 Radio controller and its different control sticks AUX1 controls e Upper level Autonomous mode e Middle level Manual mode e Lower level Virtual box AUX2 controls e Upper level Not specified Course name Control Project E mail tsrt10 tricopter gmail com Project group Triforce Document responsible Karl Johan Barsk Course code TSRT10 Author s E mail karba878 student liu se Project Tricopter Document name Technical documentation tricopter pdf Tricopter 21 e Middle level Not specified e Lower level Easy control 8 3 Interface The interface between the Ground station and the other units namely the Communication unit and the Surveillance unit is described here Signals in e Analogue video signal from the video link in the Surveillance unit e Tricopter heading orientation and position via XBee USB e Waypoint coordinates longitude latitude altitude via XBee USB e Target coordinates longitude latitude altitude via XBee USB e PI parameters via XBee USB e Size of the virtual box via XBee USB e Other parameters e g flight modes via XBee USB Signals out e Control signals to the Communication unit via the RC e Waypoint coordinates longitude latitude altitude via XBee USB Target coordinates
Download Pdf Manuals
Related Search
Related Contents
LAC2900RN - Droit Activités : mode d`emploi Powerware 9125 Two-in-One UPS 2500/3000 VA User`s SONAR X3 Benutzerhandbuch Suma Multipurpose Cleaner 1 - DHP Furniture Hanns.G HW191DP User Guide Manual 取扱説明書 - GENTOS 5/ 1 - 武蔵村山市 Copyright © All rights reserved.
Failed to retrieve file