Difference between revisions of "User:Earthpatrol"

From PaparazziUAV
Jump to navigation Jump to search
m
Line 510: Line 510:
  </nowiki>
  </nowiki>


Copy and paste the resulting displayed values into the magnetometer current calibration section of the aircraft configuration file
Copy and paste the resulting displayed MAG_*_CURRENT_COEF values into the IMU section of the aircraft configuration file
     {{Box Code|conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml|
     {{Box Code|conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml|
<source lang="xml">
<source lang="xml">

Revision as of 23:12, 11 March 2015

Overview

Developing autonomous capabilities for HooperFly using the Lisa MX autopilot from 1BitSquared in tandem with PaparazziUAV.


Frames & Components

The collection of HooperFly frames configured to fly with Paparazzi.

HooperFly RacerPEX : Azul

HooperFly RacerPEX : Verde

HooperFly TeensyFly Quad

HooperFly TeensyFly Hexa

Frame/Component Test Bench : MultiWii FC & DSM2 Receiver

Each frame and associated components(motors/escs/wiring harness) are tested for functionality using a MultiWii FC and DSM2 receiver prior to the Lisa/MX autopilot integration.

Multiwii dsm2 testfc.JPG


Flight Preparation

Airframes: HooperFly TeensyFly and RacerPEX

Attempting to use PaparazziUAV to fly four HooperFly frames in a synchronized autonomous fashion.

Hooperfly racerpex azulverde.jpg

Hooperfly teensyflyquadhexa lisamx.jpg

Airframe Configuration

Motor Layout Diagrams: Quad, Hexa, Octo

Motor position and rotation diagrams for "x" and "+" configurations of HooperFly quads, hexa, and octocopters. The top row consists of the "x" configuration frames and the bottom row contains the "+" configurations. Odd numbered motors(1, 3, 5, 7), blue in color, rotate clockwise. Even numbered motors(2, 4, 6, 8), green in color, rotate counter-clockwise.

Motor layout diagrams.png

All HooperFly airframe configuration files are located in the directory:

$PAPARAZZI_HOME/conf/airframes/HooperFly
Table of Airframe Config Files
Airframe File
TeensyFly Quad teensyfly_quad_lisa_mx_20.xml
TeensyFly Hexa teensyfly_hexa_lisa_mx_20.xml
RacerPEX Quad racerpex_quad_lisa_mx_20.xml
RacerPEX Hexa racerpex_hexa_lisa_mx_20.xml
RacerPEX Octo racerpex_octo_lisa_mx_20.xml

JSBSim Aircraft Configuration

Jsbsim coordinates.gif

JSBSim defines a "BODY" frame with the following cartesian coordinate system to quantify propulsion forces:

  • Top Left Quadrant (e.g.: NW, FL) -, -
  • Top Right Quadrant (e.g.: NE, FR) -, +
  • Bottom Right Quadrant (e.g.: SE, BR) +, +
  • Bottom Left Quadrant (e.g.: SW, BL) +, -

Reference the JSBSim Documentation for a discussion about the STRUCTURAL vs. BODY frame as well as details related to each section of a jsbsim configuration file.

All HooperFly JSBSim aircraft configuration files are located in the directory:

$PAPARAZZI_HOME/conf/simulator/jsbsim/aircraft/HooperFly
Table of JSBSim Aircraft Config Files
Airframe File
TeensyFly Quad teensyfly_quad.xml
TeensyFly Hexa teensyfly_hexa.xml
RacerPEX Quad racerpex_quad.xml
RacerPEX Hexa racerpex_hexa.xml
RacerPEX Octo racerpex_octo.xml

Telemetry - 2.4Ghz Xbee Radios

Radio Setup

Links

Recovering a Bricked Xbee

There are some signal/power dynamics associated with Xbee radios that can sometimes result in a non-operational radio. The following links are useful when looking to un-brick an Xbee radio:

Transmitter - 2.4Ghz DSM2/DSMX Compatible

For this project, a Spektrum DX6i transmitter is used for the RC link.

Airframe Radio Section

Define the roles of the "flap" and "gear" switch for the transmitter. In this example, the "flap" toggle is used for the radio mode and the "gear" toggle as the kill switch.

    <subsystem name="radio_control" type="spektrum">
      <define name="RADIO_MODE" value="RADIO_FLAP"/>
      <define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
       <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
    </subsystem>
 

Deriving 3-State Behavior with Two Toggle Switches

The Spektrum DX6i does not have a 3-state toggle switch. A little bit of "mixing magic" between two toggle switches is needed to express 3-state toggle switch behavior. Use the following setup for "Mix 1" to emulate a 3-state toggle switch using ELEV D/R & FLAP switches.

FLAP-> FLAP ACT
RATE D -100% U  0%
SW ELE D/R TRIM INH
 

DX6i Toggle Switch Flight Mode Verification

Given the following autopilot flight mode settings:

File: conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml
 <section name="AUTOPILOT">
    <define name="MODE_STARTUP" value="AP_MODE_NAV"/>
    <define name="MODE_MANUAL"  value="AP_MODE_ATTITUDE_DIRECT"/>
    <define name="MODE_AUTO1"   value="AP_MODE_HOVER_Z_HOLD"/>
    <define name="MODE_AUTO2"   value="AP_MODE_NAV"/>
 </section>
  1. Power up the autopilot outfitted with a GPS module as well as a working telemetry connection.
  2. Turn on your TX configured to the aircraft under test.
  3. Start Paparazzi and open the appropriate session for your given telemetry link along with the GCS.
  4. Wait for the GPS to get lock and verify the TX is connected as well.

Now that you have your GPS enabled autopilot connect to the GCS, verify the following toggle switch/autopilot states:

Autopilot Flight Mode Toggle Switch States
ELEV D/R FLAPS MODE VALUE
0 1 MODE_MANUAL ATT -- AP_MODE_ATTITUDE_DIRECT
1 1 MODE_AUTO1 H_ZH -- AP_MODE_HOVER_Z_HOLD
1 0 MODE_AUTO2 NAV -- AP_MODE_NAV

Receiver - 2.4Ghz DSM2/DSMX Satellite

Wiring/Binding

The transmitter must bind using the DSM2 protocol only. Note: The DSMX protocol is not currently support in Paparazzi.

Links

Verify TX/RX Connection

  • Lisa MX led 4 light on: red
  • Select the PPM settings and display the TX/RX related messages using the message tool.

Autopilot - Lisa/MX

Lisa MX Mounting Orientation

The default "front" of the Lisa MX controller is dependent on the placement of the IMU on the autopilot pcb board. This can differ between revisions of the autopilot. The PHI/THETA/PSI parameters, in the IMU section of the airframe definition file, are used to normalize the body to IMU placement.


File: conf/airframes/HooperFly/teensyfly_quad_lisa_mx_20.xml
 <section name="IMU" prefix="IMU_">
    <define name="ACCEL_X_NEUTRAL" value="11"/>
    <define name="ACCEL_Y_NEUTRAL" value="11"/>
    <define name="ACCEL_Z_NEUTRAL" value="-25"/>

    <!-- replace this with your own calibration -->
    <define name="MAG_X_NEUTRAL" value="-179"/>
    <define name="MAG_Y_NEUTRAL" value="-21"/>
    <define name="MAG_Z_NEUTRAL" value="79"/>
    <define name="MAG_X_SENS" value="4.17334785618" integer="16"/>
    <define name="MAG_Y_SENS" value="3.98885954135" integer="16"/>
    <define name="MAG_Z_SENS" value="4.40442339014" integer="16"/>

    <define name="BODY_TO_IMU_PHI"   value="0." unit="deg"/>
    <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
    <define name="BODY_TO_IMU_PSI"   value="0." unit="deg"/>
  </section>

Command Line Loader Using Black Magic Probe(BMP)

The following command will upload firmware to the autopilot using the JTAG connected Black Magic Probe:

 Syntax:
 make AIRCRAFT=<aircraft_name> ap.upload BMP_PORT=<bmp_device_id>

 Examples:
 make AIRCRAFT=Teensy_Fly_Quad ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1
 make AIRCRAFT=Teensy_Fly_Hexa ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1

Add the clean_ac target prior to the ap.upload target to force a clean build and load:

 Syntax:
 make AIRCRAFT=<aircraft_name> clean_ac  ap.upload BMP_PORT=<bmp_device_id>

 Examples:
 make AIRCRAFT=Teensy_Fly_Quad clean_ac ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1
 make AIRCRAFT=Teensy_Fly_Hexa clean_ac ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1
 

GPS - UBLOX LEA-6H

Links

Verify GPS Connection

  • Lisa MX led 3 light on: green
  • GPS unit leds active


Flight Testing

RC Transmitter Verification

With the propellers removed from the multirotor, verify throttle, roll, pitch and yaw functionality prior to initial flight tests as well as expected motor spin directions. The autopilot should be in manual flight mode during this verification process.

TX/Motor Verification
Airframe Throttle Yaw Pitch Roll M1 M2 M3 M4 M5 M6
TeensyFly Quad + + + + CW CCW CW CCW
TeensyFly Hexa + + + + CW CCW CW CCW CW CCW

IMU Calibration

It is best to have a fully populated airframe with a working telemetry radio running on battery power for IMU calibration purposes. Be sure to remove the propellers from the motors before proceeding with IMU calibration. For a general overview reference: Calibration of an IMU.

Accelerometer

  1. Power up the flight controller/IMU circuitry on your aircraft with a functioning telemetry radio
  2. Start paparazzi
  3. Run the session that connects the ground station telemetry to the aircraft
  4. In the "Settings" tab for the aircraft select the "raw sensors" and commit
  5. Viewing sensor data in real-time (optional step)
    1. Open the "Messages" tool and select the "IMU_ACCEL_RAW"
    2. Open the "Real-Time Plotter" tool and reduce the "Update time" slider to the far left (smaller the value, the faster the update)
    3. Drag and drop the IMU_ACCEL_RAW fields "ax", "ay", and "az", from the Message window to the Real-Time Plotter window
  6. Stop the "server" process and restart to begin the capture of calibration related information
  7. Begin aircraft manipulations - "Flat/Flip/Edge Stepping Rotation"
    1. Place on a flat surface in the "normal" position, wait 10 seconds
    2. Flip aircraft top down on the flat surface, wait 10 seconds
    3. Hold aircraft on edge, perpendicular to the flat surface, wait 10 seconds
    4. Rotate craft 90 degrees on edge, still perpendicular to the flat surface, wait 10 seconds
    5. Rotate craft another 90 degrees on edge, still perpendicular to the flat surface, wait 10 seconds
    6. Rotate craft the final 90 degrees on edge, still perpendicular to the flat surface, wait 10 seconds
  8. Stop the "server" process to finish the data capture

From the command line, run the "calibrate.py" tool over the collected accelerometer sensor data

python ./sw/tools/calibration/calibrate.py -s ACCEL -p ./var/logs/15_02_18__18_19_04.data

Copy and paste the resulting displayed ACCEL values into the IMU section of the aircraft configuration file

File: conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml
  <section name="IMU" prefix="IMU_">
    ...
    <define name="ACCEL_X_NEUTRAL" value="36"/>
    <define name="ACCEL_Y_NEUTRAL" value="15"/>
    <define name="ACCEL_Z_NEUTRAL" value="-108"/>
    <define name="ACCEL_X_SENS" value="4.86727226621" integer="16"/>
    <define name="ACCEL_Y_SENS" value="4.87315360311" integer="16"/>
    <define name="ACCEL_Z_SENS" value="4.85264051322" integer="16"/>
    ...
  </section>

Save the aircraft configuration file and upload the new firmware

make AIRCRAFT=Teensy_Fly_Quad clean_ac ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1

Magnetometer

  1. Power up the flight controller/IMU circuitry on your aircraft with a functioning telemetry radio
  2. Start paparazzi
  3. Run the session that connects the ground station telemetry to the aircraft
  4. In the "Settings" tab for the aircraft select the "raw sensors" and commit
  5. Viewing sensor data in real-time (optional step)
    1. Open the "Messages" tool and select the "IMU_MAG_RAW"
    2. Open the "Real-Time Plotter" tool and reduce the "Update time" slider to the far left (smaller the value, the faster the update)
    3. Drag and drop the IMU_MAG_RAW fields "mx", "my", and "mz", from the Message window to the Real-Time Plotter window
  6. Stop the "server" process and restart to begin the capture of calibration related information
  7. Begin aircraft manipulation "Global Bee Dance"
    1. Hold craft out from body and rotate frame about axis parallel to the ground while rotating your body slower than the craft is spinning
    2. Continue this motion until your body has completed 360 degrees of rotation
    3. Turn the craft 90 degrees on edge and repeat the process
    4. Hold craft out from body and rotate frame about axis parallel to the ground while rotating your body slower than the craft is spinning
    5. Continue this motion until your body has completed 360 degrees of rotation
  8. Stop the "server" process to finish the data capture

From the command line, run the "calibrate.py" tool over the collected magnetometer sensor data

python ./sw/tools/calibration/calibrate.py -s MAG -p ./var/logs/15_02_18__18_26_49.data

Copy and paste the resulting displayed MAG values into the IMU section of the aircraft configuration file

File: conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml
  <section name="IMU" prefix="IMU_">
    ...
    <define name="MAG_X_NEUTRAL" value="262"/>
    <define name="MAG_Y_NEUTRAL" value="-108"/>
    <define name="MAG_Z_NEUTRAL" value="43"/>
    <define name="MAG_X_SENS" value="3.26330433172" integer="16"/>
    <define name="MAG_Y_SENS" value="3.22600231318" integer="16"/>
    <define name="MAG_Z_SENS" value="3.76287398848" integer="16"/>
    ...
  </section>

Save the aircraft configuration file and upload the new firmware

make AIRCRAFT=Teensy_Fly_Quad ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1

Current Calibration

References

Add send_imu_mag_current module to airframe file:

File: conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml
  <modules>
    <load name="send_imu_mag_current.xml"/>
    ...
  </modules>

Add MILLIAMP_AT_FULL_THROTTLE to battery section in airframe file:

File: conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml
  <section name="BAT">
    <define name="MILLIAMP_AT_FULL_THROTTLE" value="58800"/>
    ...
  </section>

Make sure the telemetry configuration file contains the following:

File: conf/telemetry/default_rotorcraft.xml
    <mode name="mag_current_calibration">
      <message name="ROTORCRAFT_STATUS"             period="1.2"/>
      <message name="DL_VALUE"                      period="0.5"/>
      <message name="ALIVE"                         period="2.1"/>
      <message name="IMU_MAG_CURRENT_CALIBRATION"   period="0.05"/>
    </mode>

Process

  • Startup the paparazzi control center
  • Start a session for the aircraft under test with propellers. Be sure that the craft is secured and safe to operate under full throttle.
  • On the Telemetry tab in Settings, select 'mag_current_calibration' and commit

Mag current calib telemetry.png

  • On the Modules tab in Settings, select 'Start' button for the send_imu_mag line and commit

Mag current calib module.png

  • On the TX, enable motors and slowly sweep the throttle up to maximum.
  • On the Modules tab in Settings, select 'Stop' button for the IMU_MAG_CURRENT_CALIBRATION messages and commit
  • Kill the motors

Contents of the IMU_MAG_CURRENT_CALIBRATION message as displayed in the Messages tool: Mag current calib messages.png

From the command line, run the "calibrate_mag_current.py" tool over the collected magnetometer sensor data

$ python ./sw/tools/calibration/calibrate_mag_current.py var/logs/mag_current_tune_15_03_11__16_50_58.data

<define name= "MAG_X_CURRENT_COEF" value="-0.0140313409241"/>
<define name= "MAG_Y_CURRENT_COEF" value="-0.00949491888244"/>
<define name= "MAG_Z_CURRENT_COEF" value="-0.0151296129399"/>
 

Copy and paste the resulting displayed MAG_*_CURRENT_COEF values into the IMU section of the aircraft configuration file

File: conf/airframes/HooperFly/teensyfly_hexa_lisa_mx_20.xml
 <section name="IMU" prefix="IMU_">
    ...
    <define name= "MAG_X_CURRENT_COEF" value="-0.0140313409241"/>
    <define name= "MAG_Y_CURRENT_COEF" value="-0.00949491888244"/>
    <define name= "MAG_Z_CURRENT_COEF" value="-0.0151296129399"/>
    ...
  </section>

Save the aircraft configuration file and upload the new firmware

make AIRCRAFT=Teensy_Fly_Hexa clean_ac ap.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1

Hover - In Flight Tuning

Reference

ESC/Actuator Setup

IMPORTANT: Remove propellers before proceeding with ESC/Actuator setup. Once the actuators are calibrated, re-flash the autopilot with the appropriate firmware prior to mounting the propellers. Do some live testing of the motors with the newly calibrated actuators in combination with your transmitter before you add propellers.

Flash Lisa/MX with Setup Firmware

  • Start the Paparazzi Center and choose "setup_lisamx_20" as the aircraft
  • Compile the "setup_actuators" target
  • Connect the BMP including the serial line to UART3
  • On the command line, flash the firmware using the following command:
make AIRCRAFT=setup_lisamx_20 setup_actuators.upload BMP_PORT=/dev/cu.usbmodemE2B9BDC1
 

Setup - Unified Power System

For autopilots and ESCs that are powered from a unified/single connection use the following steps:

In the Paparazzi Center, execute the "Setup Actuators Lisa/MX V2.0" session

  1. Unplug power
  2. Plug in power (the pwm outputs are not active until you commit a setting through the settings app)
  3. Set the first actuator output to 2000
  4. Submit with green check mark (you should hear all the esc beep)
  5. Set the first actuator output to 1000
  6. Submit with the green check mark (you will hear the first esc beep)
  7. Return to step 1 and repeat this procedure for each of the remaining actuators

Setup - Dual Power System

For autopilots and ESCs that are powered from separate connections use the following steps:

In the Paparazzi Center, execute the "Setup Actuators Lisa/MX V2.0" session

  1. Unplug all power
  2. Plugin autopilot power
  3. Set all actuators in the settings app to 2000
  4. Submit all actuators settings using the green check mark
  5. Plugin ESC power (all esc should beep)
  6. Set all actuators in the settings app to 1000
  7. Submit all actuators settings using the green check mark (for each submitted value the corresponding esc should beep)
  8. Setup of the actuators is complete

PWM Parameters in Airframe File

After doing this the 0 value for the esc is 1000 and max is 2000. The motor should not turn on before you give it less than 1065 making the 1100 setting in the airframe file is a good value to use for neutral (motors running at idle), 1000 for minimum (motors off) and 1900 for maximum throttle.


File: conf/airframes/HooperFly/teensyfly_quad_lisa_mx_20.xml
 <servos driver="Pwm">
    <servo name="FRONT_LEFT"  no="0" min="1000" neutral="1100" max="1900"/>
    <servo name="FRONT_RIGHT" no="1" min="1000" neutral="1100" max="1900"/>
    <servo name="BACK_RIGHT"  no="2" min="1000" neutral="1100" max="1900"/>
    <servo name="BACK_LEFT"   no="3" min="1000" neutral="1100" max="1900"/>
 </servos>

IMPORTANT: Once the actuators are calibrated, re-flash the autopilot with the appropriate firmware prior to mounting the propellers. Do some live testing of the motors with the newly calibrated actuators in combination with your transmitter before you add propellers.

PID Tuning

Attitude Control Section

Real-Time Tuning with Attitude Stabilization Sliders

Teensyfly quad pid.png

Update and Save Changes to Airframe File

File: conf/airframes/HooperFly/teensyfly_quad_lisa_mx_20.xml
  <section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_">
    <!-- setpoints -->
    <define name="SP_MAX_PHI"     value="45." unit="deg"/>
    <define name="SP_MAX_THETA"   value="45." unit="deg"/>
    <define name="SP_MAX_R"       value="90." unit="deg/s"/>
    <define name="DEADBAND_A"     value="0"/>
    <define name="DEADBAND_E"     value="0"/>
    <define name="DEADBAND_R"     value="250"/>

    <!-- reference -->
    <define name="REF_OMEGA_P"  value="400" unit="deg/s"/>
    <define name="REF_ZETA_P"   value="0.85"/>
    <define name="REF_MAX_P"    value="400." unit="deg/s"/>
    <define name="REF_MAX_PDOT" value="RadOfDeg(8000.)"/>

    <define name="REF_OMEGA_Q"  value="400" unit="deg/s"/>
    <define name="REF_ZETA_Q"   value="0.85"/>
    <define name="REF_MAX_Q"    value="400." unit="deg/s"/>
    <define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/>

    <define name="REF_OMEGA_R"  value="250" unit="deg/s"/>
    <define name="REF_ZETA_R"   value="0.85"/>
    <define name="REF_MAX_R"    value="180." unit="deg/s"/>
    <define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/>

    <!-- feedback -->
    <define name="PHI_PGAIN"  value="500"/>
    <define name="PHI_DGAIN"  value="200"/>
    <define name="PHI_IGAIN"  value="200"/>

    <define name="THETA_PGAIN"  value="500"/>
    <define name="THETA_DGAIN"  value="200"/>
    <define name="THETA_IGAIN"  value="200"/>

    <define name="PSI_PGAIN"  value="1350"/>
    <define name="PSI_DGAIN"  value="500"/>
    <define name="PSI_IGAIN"  value="10"/>

    <!-- feedforward -->
    <define name="PHI_DDGAIN"   value="300"/>
    <define name="THETA_DDGAIN" value="300"/>
    <define name="PSI_DDGAIN"   value="300"/>
  </section>

NOTE: Compile and re-flash firmware to persist PID modifications

Manual Flight (ATT)

First flights are conducted using RC control only. Any issues related to normal/manual flight should be addressed before attempting more autonomous forms of flight.

  • Program Lisa MX manual flight mode: ATT -- AP_MODE_ATTITUDE_DIRECT
  • GPS and Xbee Telemetry not required but are useful if mounted for monitoring flight characteristics with Paparazzi
    • Note telemetry and GPS data while running manual test flights as a correlation exercise with respect to expected vs. observed data
  • Verify all flight systems are stable, reliable and behaving as expected before attempting more advanced flight modes

Test Plan

  • Prior to flight:
    • Verify TX correctly enters ATT flight mode when the FLAP switch is toggled from 0 --> 1 and the ELEV D/R switch is 0
  • Verify the idle arming of the motors using the throttle/yaw stick
  • Verify the KILL mode assigned to the GEAR toggle switch. Toggling the GEAR switch from 1 (live) --> 0 (kill)
  • Verify responsive throttle, pitch, roll and yaw behavior

Flight Log

  • Saturday, 2015-02-21 : (Sunny/Calm) Flew both the LisaMX TeensyFly Quad and Hexa at the test field. Both aircraft are stable and responsive in manual flight mode.
  • Monday, 2015-02-23 : (Sunny/Calm) Flew both the LisaMX TeensyFly Quad and Hexa at the test field. Once again, both aircraft flew stable and responsive in manual flight mode.

Hybrid Flight (HOVER)

  • Program Lisa MX auto1 flight mode: H_ZH -- AP_MODE_HOVER_Z_HOLD
  • Mount GPS and Xbee Telemetry for monitoring flight characteristics with Paparazzi
  • Verify all flight systems are stable, reliable and behaving as expected before attempting fully autonomous flight modes

Test Plan

Reference Rotorcraft Control Loops

  • Prior to flight:
    • Verify TX correctly enters ATT flight mode when the FLAP switch is toggled from 0 --> 1 and the ELEV D/R switch is 0
    • Verify TX correctly enters H_ZH flight mode when the FLAP switch is 1 and the ELEV D/R switch is toggled from 0 --> 1
  • Wait for GEO_INIT to complete
  • Switch to ATT mode, take off
  • Establish a hover position about 5 meters above deck
  • Switch from ATT mode to H_ZH mode (hover)
  • Move throttle to 100% while in H_ZH mode
  • Aircraft should now be in a 3D locked hover
  • Verify flight characteristics based on the hover mode. Evaluate roll, yaw and pitch RC inputs.

Flight Log

  • Saturday, 2015-02-28 : (Sunny/Wind 10mph) Flew the LisaMX TeensyFly Hexa at the test field and tried the above test plan. Test went as planned but the H_ZH behavior was not as expected. When switching from ATT to H_ZH, I had the throttle set to approx. 60%. The craft would stay stable for about 2-3 seconds and then deviate off axis and begin to accelerate in the direction of deviation. I could quickly recover the craft by switching back to ATT mode and to a more predictable response from the craft.
    • Log/Data File: $PAPARAZZI_HOME/var/logs/zhz_t1_15_02_28__17_02_29
    • Cover barometer sensor with foam/tape being sure not to plug either of the two holes
    • Review flight log files (See Log Replay tool)
    • Verify the hover throttle level and update the vertical guidance value in the airframe to reflect that value in decimal form. (i.e. 50% throttle = .5)
      • NOTE: The CLIMB rate specified in the flight plan should also be reviewed to verify an appropriate throttle level
    • Move HOME point more north in the field to allow for more flight buffer along the south side of the flight perimeter
    • Move waypoints: CAM and 2 a little closer to HOME
    • Re-flash LisaMX with updates
  • Sunday, 2015-03-01 : (Sunny-Overcast/Calm) Flew the LisaMX TeensyFly Hexa at the test field. Successfully managed to fly in 3D Hover(H_ZH) for an extended period of time. Flew three batteries for an average of about 7 minutes each for a total in air time of about 21 minutes. Also attempted to switch into NAV mode from H_ZH to see how the aircraft would react. It looks like the vertical guidance parameter related to throttle still needs to be increased a bit. New target is .61 = 61% throttle for a nominal hover value; today's mission was at .58 = 58% throttle. The xbee telemetry module on the aircraft stopped functioning after the third flight putting an end to the days flight tests.
    • Log/Data File: $PAPARAZZI_HOME/var/logs/zhz_t2_15_03_01__15_57_36
    • Review flight log files (See Log Replay tool)
    • Update nominal throttle value from .58 to .61 in the airframe file.
    • Check xbee telemetry radio on the aircraft to understand why it is non-functioning.
    • Elevate the GPS RX off of the aircraft deck to see if that improves the 3D lock characteristics of the flights.
    • Review the vertical and horizontal guidance loops and the various inputs/behaviors.
      • Investigate using real-time loop tuning of the vertical and horizontal guidance values from the Settings tool
    • Re-flash LisaMX with updates
  • Tuesday, 2015-03-03 : (Sunny/Calm) Measured IMU data for the purposes of vibration analysis. Monitor scaled_sensors using the Settings tool.
    • Flight 1:
      • Procedure: TeensyFly Hexa in ATT and H_ZH
      • Log/Data File: $PAPARAZZI_HOME/var/logs/vibe_t1__15_03_03__13_13_42
    • Flight 2:
      • Procedure: Removed propellers from TeensyFly Hexa and suspended it in a stable string harness.
      • Log/Data File: $PAPARAZZI_HOME/var/logs/vibe_t2_15_03_03__15_39_00
    • Profile frame vibrations using the IMU scaled_sensor parameters in the log and real-time plotter tools: plot & plotter
      • Look at the full spectrum of flight modes: takeoff, hover, climb, descend, pitch variants, roll variants, yaw variants
      • Anything greater than 9.9m/s on the accelerometer is over the limit
    • Balance props
    • Re-flash LisaMX with updates
  • Wed/Thur, 2015-03-04/05 : (Sunny/Calm) Two days devoted to understanding how the aircraft/TX/GCS interact when transitioning from Z_HZ to NAV mode.
    • Observe how the aircraft behaves during the start engine/takeoff/standby NAV sequence
    • Attempt multiple NAV takeoffs to become familiar with TX/GCS interaction
    • Need to increase the climb rate on takeoff in NAV mode( change from .65 to .75). A little too slow/minimal based on observations.
    • Increase the initial ground_alt from 45m to 46m
    • Compile and Re-flash LisaMX with updates
    • Work on fine tuning the hover in Z_HZ by capturing the tune_hover telemetry during the next set of flights
  • Saturday, 2015-03-07 : (Sunny/Calm) Two flights to capture tune_hover telemetry. First flight in ATT and the second in H_ZH.
    • Analyzed data based on pitch, yaw and roll for the respective RC/Command/Body parameters
    • As expected, the H_ZH mode is less stable and requires more RC stick to maintain hover.
      • Log/Data File: $PAPARAZZI_HOME/var/logs/hover_tune_15_03_07__10_55_42
      • Plot: Hover Tune Data 2015-03-07 at 1.07.32 PM
  • Sunday, 2015-03-08 : (Sunny/Calm) One flight with Piotr to get his thoughts on how well the craft is flying in ATT and H_ZH mode.
    • In H_ZH, the copter is "toilet bowling" a bit probably due to magnetometer interference related to DC currents/motors on craft.
      • Profile current using the mag_current_calibration process. Update the firmware and see if it performs better.


Autonomous Flight (NAV)

  • Define a thoughtful flight plan with the appropriate safety features for limiting flyaway risk
  • Identify and take GPS measurements of the area to be used for testing. Also see Maps
  • Incorporate GPS measurements/data into a flight plan and simulate until satisfied with behaviors
  • Program Lisa MX to include a full navigation flight mode: AP_MODE_NAV (a.k.a. NAV)
  • TBD: Establish a set of pre-flight system checks

Test Plan

  • Prior to flight:
    • Verify TX correctly enters ATT flight mode when the FLAP switch is toggled from 0 --> 1 and the ELEV D/R switch is 0
    • Verify TX correctly enters H_ZH flight mode when the FLAP switch is 1 and the ELEV D/R switch is toggled from 0 --> 1
    • Verify TX correctly enters NAV flight mode when the FLAP switch is toggled from 1 --> 0 and the ELEV D/R switch is 1
  • Take off in ATT mode
  • Switch from ATT mode to H_ZH mode (hover)
  • Switch to NAV (position hold)
  • Stay_s1 (stay and hold position at point S1)
  • Fly a line S1 -> S2 -> S1 and hold
  • Switch over to ATT mode again and land

The flight plan only needs to have the geo init part, hold position S1 and the line blocks for this test.

Once comfortable, expand this test to include autonomous takeoff and landing and start to improve the flight plan.

Flight Log

TBD

Future Goals

  • Autonomous takeoff and landing
  • Fully autonomous execution and verification of the rotorcraft_basic flight plan
  • Aerial survey flights
  • Leader/follower flights
  • Multiple aircraft flights

Technical Explorations

  • BBB Paparazzi Ground Station
  • BBB OpenCV + Lisa/MX
  • Potential Blender/Bullet Integrations

Paparazzi UAV Project Development and Compilation

Project Related

Environment

OPAM

$ opam list
Installed packages for 4.01.0:
base-bigarray    base  Bigarray library distributed with the OCaml compiler
base-threads     base  Threads library distributed with the OCaml compiler
base-unix        base  Unix library distributed with the OCaml compiler
camlp4         4.01.0  Camlp4 is a system for writing extensible parsers for programming language
ivy             1.2.2  This OCaml-library interfaces the Ivy software bus C-library.
lablgtk        2.18.2  OCaml interface to GTK+
ocamlfind       1.5.3  A library manager for OCaml
ocamlnet        3.7.6  Internet protocols (http, cgi, email etc.) and helper data structures (mai
xml-light         2.4  Xml-Light is a minimal XML parser & printer for OCaml 

$ opam switch
system  I system  System compiler (4.02.0)
4.02.0  I 4.02.0  Official 4.02.0 release
4.01.0  C 4.01.0  Official 4.01.0 release
--     -- 3.11.2  Official 3.11.2 release
--     -- 3.12.1  Official 3.12.1 release
--     -- 4.00.0  Official 4.00.0 release
--     -- 4.00.1  Official 4.00.1 release

$ opam switch 4.01.0
# To complete the configuration of OPAM, you need to run:
eval `opam config env`

$ eval `opam config env`
 


Command Line Tools

Ivyprobe

With the command line tool ivyprobe, you can see what is being sent over the IVY bus.

$ ivyprobe -help
ivyprobe: illegal option -- h
usage: ivyprobe [options] [regexps]
	-b bus	defines the Ivy bus to which to connect to, defaults to 127:2010
	-t	triggers the timer test
	-n name	changes the name of the agent, defaults to IVYPROBE
	-v	prints the ivy relase number

regexp is a Perl5 compatible regular expression (see ivyprobe(1) and pcrepattern(3) for more info
use .help within ivyprobe
	-s bindcall	active the interception of regexp's subscribing or unscribing
	-f regexfile	read list of regexp's from file one by line
	-c msg1,msg2,msg3,...	filter the regexp's not beginning with words
 

The following command will display all packages with all their content:

ivyprobe "(.*)"

You can constrain what ivyprobe displays by extending the regular expression for example, the following command will display raw accelerometer data that is being sent over the IVY bus

ivyprobe “[\d]+ IMU_ACCEL_RAW (.*)”

ivyprobe takes that regular expression and prints the match inside the (), by default it is only showing telemetry:*

Note: The packages/class names returned by ivyprobe can be used as input to the messages tool.

Messages

$ ./messages -help
Usage: 
  -b <ivy bus> Default is 224.255.255.255:2010
  -c class name
  -help  Display this list of options
  --help  Display this list of options
 

GCS

$ ./gcs -help
Usage: 
  -auto_ortho IGN tiles path
  -b <ivy bus> Default is 224.255.255.255:2010
  -center Initial map center (e.g. 'WGS84 43.605 1.443')
  -center_ac Centers the map on any new A/C
  -edit Flight plan editor
  -fullscreen Fullscreen window
  -maps_fill Automatically start loading background maps
  -maps_zoom Background maps zoomlevel (default: 20, min: 18, max: 22)
  -ign IGN tiles path
  -lambertIIe Switch to LambertIIe projection
  -layout <XML layout specification> GUI layout. Default: horizontal.xml
  -m Map XML description file
  -maximize Maximize window
  -mercator Switch to Mercator projection, default
  -mplayer Launch mplayer with the given argument as X plugin
  -no_alarm Disables alarm page
  -maps_no_http Switch off downloading of maps, always use cached maps
  -ortho IGN tiles path
  -osm Use OpenStreetMap database (default is Google)
  -ms Use Microsoft maps database (default is Google)
  -particules Display particules
  -plugin External X application (launched with the id of the plugin window as argument)
  -ref Geographic ref (e.g. 'WGS84 43.605 1.443')
  -speech Enable vocal messages
  -srtm Enable SRTM elevation display
  -track_size Default track length (500)
  -utm Switch to UTM local projection
  -wid <window id> Id of an existing window to be attached to
  -zoom Initial zoom
  -auto_hide_fp Automatically hide flight plans of unselected aircraft
  -help  Display this list of options
  --help  Display this list of options
 

Link

$ ./link --help
Usage: 
  -aerocomm Set serial Aerocomm data mode
  -audio Listen a modulated audio signal on <port>. Sets <port> to /dev/dsp (the -d option must used after this one if needed)
  -b <ivy bus> Default is 224.255.255.255:2010
  -d <port> Default is /dev/ttyUSB0
  -dtr Set serial DTR to false (deprecated)
  -fg Enable trafic statistics on standard output
  -noac_info Disables AC traffic info (uplink).
  -nouplink Disables the uplink (from the ground to the aircraft).
  -s <baudrate>  Default is 9600
  -hfc Enable UART hardware flow control (CTS/RTS)
  -local_timestamp Add local timestamp to messages sent over ivy
  -transport <transport> Available protocols are modem,pprz,pprz2 and xbee. Default is pprz
  -udp Listen a UDP connection on <udp_port>
  -udp_port <UDP port> Default is 4242
  -udp_uplink_port <UDP uplink port> Default is 4243
  -udp_port <UDP port> Default is 4242
  -uplink Deprecated (now default)
  -xbee_addr <my_addr> (256)
  -xbee_retries <nb retries> (10)
  -xbee_868 Enables the 868 protocol
  -redlink Sets whether the link is a redundant link. Set this flag and the id flag to use multiple links
  -id Sets the link id. If multiple links are used, each must have a unique id. Default is 0
  -help  Display this list of options
  --help  Display this list of options
 

Server

$ ./server --help
Usage: 
  -b Bus	Default is 224.255.255.255:2010
  -hostname <hostname> Set the address for the http server
  -http Send http: URLs (default is file:)
  -kml Enable KML file updating
  -kml_no_http KML without web server (local files only)
  -kml_port Port for KML files (default is 8889)
  -n Disable log
  -no_md5_check Disable safety matching of live and current configurations
  -replay_old_log Enable aircraft registering on PPRZ_MODE messages
  -help  Display this list of options
  --help  Display this list of options
 

Settings

$ ./settings --help
Usage: 
  -b <ivy bus> Default is 224.255.255.255:2010
  -ac A/C name
  -help  Display this list of options
  --help  Display this list of options
 

Calibrate

$ python ./sw/tools/calibration/calibrate.py -help
Usage: calibrate.py [options] log_filename.data
Run calibrate.py --help to list the options.

Options:
  -h, --help            show this help message and exit
  -i AC_ID, --id=AC_ID  aircraft id to use
  -s SENSOR, --sensor=SENSOR
                        sensor to calibrate (ACCEL, MAG)
  -p, --plot            Show resulting plots
  -a, --auto_threshold  Try to automatically determine noise threshold
  -v, --verbose         
 

Magnetometer Current Calibration

$ python ./sw/tools/calibration/calibrate_mag_current.py -help
Usage: calibrate_mag_current.py [options] log_filename.data
Run calibrate_mag_current.py --help to list the options.

Options:
  -h, --help            show this help message and exit
  -i AC_ID, --id=AC_ID  aircraft id to use
  -p, --plot            Show resulting plots
  -v, --verbose         

 

Play

$ python ./sw/logalizer/play -help
Usage: 
  -b <ivy bus> Default is 224.255.255.255:2010
  -d <port> Default is /dev/ttyUSB0
  -o Output binary messages on serial port
  -s <baudrate>  Default is 9600
  -shfc Enable UART hardware flow control (CTS/RTS)
  -help  Display this list of options
  --help  Display this list of options