This commit is contained in:
Stavros Korokithakis 2021-09-07 15:09:31 +03:00
parent a37ab9d597
commit 9cd0048686
No known key found for this signature in database
GPG Key ID: 26EA345ECD4C2A63
20 changed files with 100 additions and 74 deletions

View File

@ -0,0 +1,13 @@
+++
title = "ArduPilot"
weight = 2
sort_by = "weight"
insert_anchor_links = "right"
+++
## Contents
Click on a link in the list below to go to that page:
1. [ArduPilot setup checklist](../../ardupilot/ardupilot-setup-checklist)
1. [Building ArduPilot](../../ardupilot/building-ardupilot)
1. [TECS tuning calculator](../../ardupilot/tecs-tuning-calculator)

View File

@ -1,6 +1,6 @@
+++
title = "ArduPilot setup checklist"
weight = 2
weight = 1
sort_by = "weight"
insert_anchor_links = "right"
+++
@ -10,8 +10,6 @@ You should keep the [full list of ArduPilot parameters](https://ardupilot.org/pl
## Helper utility
I have created a utility that lets you easily get/set/backup/restore parameters from the command line.
It's called Parachute, and you can download it here:
@ -19,43 +17,10 @@ It's called Parachute, and you can download it here:
## Building ArduPilot
Because building ArduPilot is a bit complicated, I've written a short script that uses Docker to build AP in a controlled environment.
Copy it from here, save it to a file called `docker_build.sh` in the root of the ArduPilot repo, and run it with `docker_build.sh <your board>`. Output files will be stored in `build/<yourboard>/bin/`, and you can flash them with the [INAV configurator](https://github.com/iNavFlight/inav-configurator/releases) by putting your board in DFU mode and uploading the `arduplane_with_bl.hex` file:
```bash
#!/usr/bin/env bash
set -euo pipefail
if [ $# -ne 1 ]
then
echo "No board supplied, run as ./docker_build.sh <board name> or ./docker_build.sh list"
exit 1
fi
BOARD=$1
cd "$(git rev-parse --show-toplevel)"
git submodule update --init --recursive
git checkout Dockerfile
echo "RUN pip install intelhex" >> Dockerfile
echo 'ENV PATH="/home/ardupilot/.local/bin:/usr/lib/ccache:/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:/ardupilot/Tools/autotest:${PATH}"' >> Dockerfile
cat Dockerfile
docker build . -t ardupilot
git checkout Dockerfile
docker run --rm -it -v "$(pwd)":/ardupilot ardupilot ./waf configure --board="$BOARD"
docker run --rm -it -v "$(pwd)":/ardupilot ardupilot ./waf build
```
See [Building ArduPilot](../../ardupilot/building-ardupilot) for instructions on how to build the latest version.
## Hardware setup
The values in this section are specific to the Omnibus F4, but the settings aren't, so you'll usually need to adjust your outputs to your specific configuration but you probably won't need to skip many of the steps here.
@ -104,7 +69,6 @@ The values in this section are specific to the Omnibus F4, but the settings aren
## Radio-related
- [ ] Set your radio channels to AETR and run the radio calibration in the calibration section of ArduPilot.
- [ ] Add a killswitch to the radio that overrides the mode to manual and the throttle to 0.
This way it's really easy to kill the motor right away, but you still need to go through the arming procedure to get the motor running (thanks to Michel Pastor for this great idea).
@ -116,7 +80,6 @@ The values in this section are specific to the Omnibus F4, but the settings aren
## Auto modes
- [ ] Set `SERVO_AUTO_TRIM=1` so the aircraft trims itself while flying.
- [ ] Set `FS_SHORT_ACTN`/`FS_SHORT_TIMEOUT`/`FS_LONG_ACTN`/`FS_LONG_TIMEOUT`. I tend to disable the short action and set long to RTL.
- [ ] Set `RTL_CLIMB_MIN=30` so the aircraft climbs first before starting to return to home.
@ -129,7 +92,6 @@ The values in this section are specific to the Omnibus F4, but the settings aren
## Auto takeoff
- [ ] Change `TKOFF_THR_MAX` to the desired max takeoff throttle.
- [ ] Change `TKOFF_ALT` to the altitude you want takeoff to reach.
- [ ] Set `THR_SUPP_MAN=1` so you can manually set the autolaunch "idle" throttle (before the throw).
@ -140,13 +102,11 @@ The values in this section are specific to the Omnibus F4, but the settings aren
## In the field
- [ ] Run an autotune.
- [ ] Fly in FBWA and see if you're gaining/losing altitude. Pitch up/down to fly level, check the pitch on the OSD, and use the formula `old_value+pitch*π/180` to get the new value for `AHRS_TRIM_Y` (in radians).
## Tuning the TECS
To tune the TECS, a helpful resource is the [TECS tuning guide](https://ardupilot.org/plane/docs/tecs-total-energy-control-system-for-speed-height-tuning-guide.html).
Make sure you have run an autotune beforehand, and continue with the tuning below.
@ -157,7 +117,6 @@ In tuning, there are three stages:
- Set parameters on the bench, based on your measurements.
### Preparation
- [ ] Set `LIM_PITCH_MAX=4500` (centidegrees), or something similarly high.
This is the maximum pitch you'll be achieving in FBWA, and you don't want to be limited by this while trying to tune.
- [ ] Set `LIM_PITCH_MIN=-4500` (centidegrees) or something similarly low.
@ -165,11 +124,9 @@ In tuning, there are three stages:
### In the field
You should perform the measurements in four stages, all in the FBWA mode:
#### Fly straight
Fly straight and note down:
- [ ] The maximum speed you want to be flying at (in km/h).
@ -181,7 +138,6 @@ Fly straight and note down:
Note the minimum amount of down-pitch required to keep you from stalling (this should only be in the 1-3 degree ballpark).
#### Fly up
Set the throttle to the maximum throttle percentage from the previous step and start slowly pitching up until your airspeed equals your trim speed from the previous step.
If you're higher than that speed and need to climb more, change `LIM_PITCH_MAX` to something higher and try again.
Note down:
@ -190,14 +146,12 @@ Note down:
- [ ] The vertical speed from the variometer (in m/s).
#### Fly down
Set the throttle to 0 and start pitching down until your airspeed equals your trim speed from the previous step.
Note down:
- [ ] The vertical speed from the variometer (in m/s).
#### Fly down more
Keep the throttle at 0 and pitch down until you reach your desired maximum speed from step 1.
If you're lower than that speed and need to pitch down more, change `LIM_PITCH_MIN` to something lower and try again.
Note down:
@ -209,10 +163,9 @@ You're done with this step.
### On the bench
After you have the above measurements, you're ready to tune things. You can use the automatic calculator:
### [TECS tuning calculator](../../drone-stuff/tecs-tuning-calculator)
### [TECS tuning calculator](../../ardupilot/tecs-tuning-calculator)
Otherwise, you can do things manually, following the steps below, but you should really use the calculator instead.
@ -243,7 +196,6 @@ That's it!
## Reverse thrust
To set up reverse thrust (for higher braking when landing, for example), follow the steps below:
- [ ] Set your BLHeli-compatible ESC to "Reversible soft" and make sure you're using DShot.
@ -259,7 +211,6 @@ Be careful not to stall or otherwise hurt your craft, I don't recommend going ov
## Parachute parameters
This is the regex I use with Parachute to transfer between planes only the parameters that are transferrable (ie non-plane-specific):
`^(ACRO_LOCKING|OSD.*|RC[\d_]+.*|FLTMODE.*|FLIGHT_OPTIONS|FS_.*|RTL_CLIMB_MIN|RTL_RADIUS|THR_PASS_STAB|THR_SLEWRATE|THR_SUPP_MAN|TKOFF_ACCEL_CNT|TKOFF_ALT|TKOFF_DIST|TKOFF_THR_DELAY|HOME_RESET_ALT|ALT_HOLD_RTL)$`
@ -272,6 +223,6 @@ _(Many thanks to Michel Pastor for his help with everything in this note.)_
* * *
<p style="font-size:80%; font-style: italic">
Last updated on August 28, 2021. For any questions/feedback,
Last updated on September 07, 2021. For any questions/feedback,
email me at <a href="mailto:hi@stavros.io">hi@stavros.io</a>.
</p>

View File

@ -0,0 +1,64 @@
+++
title = "Building ArduPilot"
weight = 2
sort_by = "weight"
insert_anchor_links = "right"
+++
Because building ArduPilot is a bit complicated, I've written a short script that uses Docker to build AP in a controlled environment.
Copy it from here, save it to a file called `docker_build.sh` in the root of the ArduPilot repo, and run it with `docker_build.sh <your board>`. Output files will be stored in `build/<yourboard>/bin/`, and you can flash them with the [INAV configurator](https://github.com/iNavFlight/inav-configurator/releases) by putting your board in DFU mode and uploading the `arduplane_with_bl.hex` file.
Here's the script:
```bash
#!/usr/bin/env bash
set -euox pipefail
if [ $# -ne 1 ]
then
echo "No board supplied, run as ./docker_build.sh <board name> or ./docker_build.sh list"
exit 1
fi
BOARD=$1
cd "$(git rev-parse --show-toplevel)"
git submodule update --init --recursive
git checkout Dockerfile
echo "RUN pip install intelhex" >> Dockerfile
echo 'ENV PATH="/home/ardupilot/.local/bin:/usr/lib/ccache:/ardupilot/Tools/autotest:${PATH}"' >> Dockerfile
cat Dockerfile
docker build . -t ardupilot
git checkout Dockerfile
# We need to update the PATH with the location of the ARM EABI inside the Docker
# container, so we write a script that handles this and the actual building.
cat <<EOF > undocker_build_temp.sh
#!/usr/bin/env bash
set -euox pipefail
export ARM_EABI=/opt/\$(ls -1 /opt/ | grep gcc-arm-none-eabi)/bin/
export PATH=\$ARM_EABI:\$PATH
./waf configure --board="\$1"
./waf build
EOF
chmod +x ./undocker_build_temp.sh
docker run --rm -it -v "$(pwd)":/ardupilot ardupilot ./undocker_build_temp.sh "$BOARD"
rm undocker_build_temp.sh
```
* * *
<p style="font-size:80%; font-style: italic">
Last updated on September 07, 2021. For any questions/feedback,
email me at <a href="mailto:hi@stavros.io">hi@stavros.io</a>.
</p>

View File

@ -1,10 +1,10 @@
+++
title = "TECS tuning calculator"
weight = 13
weight = 3
sort_by = "weight"
insert_anchor_links = "right"
+++
To use this calculator, first follow the steps in the [TECS tuning section](../../drone-stuff/ardupilot-setup-checklist#tuning-the-tecs) of the ArduPilot setup checklist.
To use this calculator, first follow the steps in the [TECS tuning section](../../ardupilot/ardupilot-setup-checklist#tuning-the-tecs) of the ArduPilot setup checklist.
<script>
function kmhToMs(kmh) { return Math.round(kmh / 3.6); }
@ -85,6 +85,6 @@ Run this command in a terminal, making sure you have <a href="https://gitlab.com
* * *
<p style="font-size:80%; font-style: italic">
Last updated on August 21, 2021. For any questions/feedback,
Last updated on September 07, 2021. For any questions/feedback,
email me at <a href="mailto:hi@stavros.io">hi@stavros.io</a>.
</p>

View File

@ -1,6 +1,6 @@
+++
title = "Drone stuff"
weight = 2
weight = 3
sort_by = "weight"
insert_anchor_links = "right"
+++
@ -9,7 +9,6 @@ insert_anchor_links = "right"
Click on a link in the list below to go to that page:
1. [A simple guide to PID control](../../drone-stuff/a-simple-guide-to-pid-control)
1. [ArduPilot setup checklist](../../drone-stuff/ardupilot-setup-checklist)
1. [E6000 hinges](../../drone-stuff/e6000-hinges)
1. [FPV frequency chart](../../drone-stuff/fpv-frequency-chart)
1. [General RC tips](../../drone-stuff/general-rc-tips)
@ -20,6 +19,5 @@ Click on a link in the list below to go to that page:
1. [Omnibus F4 V3 pinout](../../drone-stuff/omnibus-f4-v3-pinout)
1. [Omnibus F4 pro servo diode](../../drone-stuff/omnibus-f4-pro-servo-diode)
1. [QGroundControl to Mission Planner conversion script](../../drone-stuff/qgroundcontrol-to-mission-planner-conversion-script)
1. [TECS tuning calculator](../../drone-stuff/tecs-tuning-calculator)
1. [Transmitter external module pinout](../../drone-stuff/transmitter-external-module-pinout)
1. [Transportable C1 Chaser](../../drone-stuff/transportable-c1-chaser)

View File

@ -1,6 +1,6 @@
+++
title = "E6000 hinges"
weight = 3
weight = 2
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "FPV frequency chart"
weight = 4
weight = 3
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "General RC tips"
weight = 5
weight = 4
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Getting uninverted SBUS on a no-name FrSky-compatible receiver"
weight = 6
weight = 5
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Getting uninverted SBUS/SmartPort on the FrSky XSR receiver"
weight = 7
weight = 6
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "INAV tuning tips"
weight = 8
weight = 7
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Miscellaneous"
weight = 9
weight = 8
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Omnibus F4 pro servo diode"
weight = 11
weight = 10
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Omnibus F4 V3 pinout"
weight = 10
weight = 9
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "QGroundControl to Mission Planner conversion script"
weight = 12
weight = 11
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Transmitter external module pinout"
weight = 14
weight = 12
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Transportable C1 Chaser"
weight = 15
weight = 13
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Maker things"
weight = 3
weight = 4
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Model build notes"
weight = 4
weight = 5
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Software"
weight = 5
weight = 6
sort_by = "weight"
insert_anchor_links = "right"
+++