Introduction: Intel Aero Drone - Altitude and Position Hold Using PX4Flow

For the latest information and support for Aero, please visit our wiki.

What is optical flow? Just the future. I mean, being able to sit in one position or cruise at a fixed altitude outdoors or indoors without having to worry about anything is the drone dream right?

These steps are going to be a little long and complicated, but well worth it.

This process could take 1-2 hours.

Step 1: Collect Materials

Here's everything you will need

Step 2: Print the Part

Download this work of art here

Send it into your 3D printer and print for about 30 minutes. The PX4Flow weighs about 18 grams, and this part weighs about 5 grams in ABS, so the total weight added will be 23 grams. The shape seems a bit familiar...

Step 3: Copy Files Onto Aero

While that part is baking in the oven, let's do something else.

Download the two attached files, 'aero-rtf_i2c.jam' and 'aerofc-v1_px4flow.px4'. Copy the files onto your Aero board. Start by connecting to it as a wifi device, then do the following for your OS.

Linux/Mac:

In a terminal, just scp the files onto your board, which has IP 192.168.8.1 when connected over wifi. For example

> scp Downloads/aero-rtf_i2c.jam root@192.168.8.1

> scp Downloads/aerofc-v1_px4flow.px4 root@192.168.8.1

Windows:

Use WinSCP

Connect to IP 192.168.8.1 with username 'root' as shown in the image. Then simply drag both files over.

Step 4: Flash the FPGA and Flight Controller

Start by SSH-ing into your Aero board. Follow the steps for your own OS.

Linux/Mac:

In a terminal, just run ssh on IP 192.168.8.1 with username 'root', like so

> ssh root@192.168.8.1

Windows:

Once again life is a little harder on Windows, so get yourself PuTTY.

Enter the IP 192.168.8.1 and username 'root' as shown in the first image and click Open.

- - -

Once you're in, make sure you are in the directory with your copied files and run the following commands

> jam -aprogram aero-rtf_i2c.jam

> aerofc-update.sh aerofc-v1_px4flow.px4

You should see outputs such as in the last two images. Basically what we are doing is first updating the FPGA so that it can use the telemetry port as an I2C connection. Then we are updating the flight controller so that it will recognize the PX4Flow.

Step 5: Setup the PX4Flow

Follow the steps here, only in the 'Image Quality and Output Section'.

This will take you through connecting to QGroundControl, updating the firmware, and calibrating the camera.

Step 6: Modify the Wires

And now for the most interesting part.

Take the 4 pin I2C connector that comes with your PX4Flow and solder it to your own 6 pin DF13 connector like so. Follow the second image; 1 goes to 1 and so on.

Step 7: Mount the PX4Flow

First, use your own screws to screw the PX4Flow onto the printed part.

Then undo the four screws on the bottom of the frame.

Screw those four screws back in over the mount. Make sure the sonar is facing the front of the drone and the camera is facing the rear.

And finally, plug in the connector to the telemetry port.

Step 8: Sanity Check

Reboot for good luck. Then connect the wifi, open up QGroundControl, and connect it to your drone. Open Widgets > MAVLink Inspector and verify that you can see 'OPTICAL_FLOW_RAD' under your vehicle.

If not, someone messed up. Time to go home.

Step 9: Set Flight Parameters

With the remoter controller connected, toggle the switch in the top left corner. Make sure that the three positions have the correct modes assigned to them in the 'Flight Modes' page.

Then go into Parameters > EKF2.

For the parameter 'EKF2_AID_MASK', check the box that says 'use optical flow' (bitmask is 3).

Note: if you are planning to use this indoors, you should also turn the GPS off. Uncheck the box that says 'use GPS' (bitmask is 2).

For the parameter 'EKF2_HGT_MODE', change this to 'Range sensor'.

Reboot once more for necessity.

Step 10: Set PX4Flow Parameters

If you are flying outdoors, you should be good to go.

If you are indoors, you may want to adjust the PX4Flow parameters for better performance. The performance will vary depending on what kind of surface you are flying over, but we've found the following parameters work pretty well.

Connect to your PX4Flow in QGroundControl directly just as in Step 5. Open up the parameters, set 'BFLOW_F_THLD' to 10, and set 'BFLOW_V_THLD' to 7000.

These parameter changes won't remain after reboot. You can read more about the parameters here.

Step 11: Fly Like a Pro

And there you have it. Living proof that even the worst pilots can hope to fly one day.

Comments

About This Instructable

701views

16favorites

License:

More by intel-aero:Intel Aero Drone - Altitude and Position Hold Using PX4FlowIntel Aero Drone - Extending Wifi RangeIntel Aero Drone - Mounting a CGO3+ Gimbal Camera
Add instructable to: