Monday, 1 July 2019

Collection of Fixed Wing iNAV tips

This page will record any clever Fixed Wing iNAV tips I pick up over time.

Most of these tips come from
Facebook iNav Fixed Wing Group
Pawel Spychalski's YouTube Channel
and some very helpful YouTube subscribers.

1. Transmitter Trims (Pawel)
Trims should not be used with iNav flight control boards, don't touch them.
In fact you can disable them totally
In the Taranis Flight Modes screen change all the trim values on the default flight mode FM0 from (: 0) to (- -)
The trims will disappear from the transmitter screen and no longer be active  The trim switches now can be setup as normal switches for other uses. Which is quite useful because it's easy to run out of normal mode switches on transmitters like the QX7.

2. Only need one model setup (Stewie - UAVFutures)
Programming setup in your transmitter is identical for all iNav models. Wings, planes and even quads need the same 4 channels and mode switches. So you only actually need one iNav Model in your transmitter. Using the D16 protocol (not ACCESS) you can bind as many receivers as you need to this one OpenTX model if you set the receiver number to 00.
You can have all the extra functions like flaps and pan/tilt programmed in and just not use them on models that don't require them.

3. Forget about Angle and Horizon Modes (Pawel)
Well, maybe don't forget about them, but I never use Angle as an actual flight mode, because you have to hold the stick at the angle you want the plane to maintain. The board has to be perfectly aligned to maintain altitude in these modes. It's a self-level mode, which might appeal to beginners, but to me it feels like you have to fight the board to make the plane fly where you want.
However Angle Mode is necessary to initially setup the board alignment (mainly pitch degrees) and is automatically activated with the GPS modes. That's why when you select one of the GPS modes, before satellites are acquired, Angle Mode will be activated.
Angle is also useful on the bench to check that the control surfaces move in the correct direction for stabilisation.

If you want your plane to fly level without stick input use Altitude Hold. That mode uses GPS to maintain level flight and Angle Mode for stabilisation. Or even Acro mode will hold the current attitude.

I usually launch in Acro or Manual mode, fly around the field in Acro, go for an FPV cruise in Alt Hold, then use RTH to come back from a long way out.

I do still have Angle available as a mode for board alignment.

4. PIFF (PID) Tuning (Wiki, Pawel)
Increase FF (D) until control surface movement in Acro (or Angle) is 90% of Manual Mode
This will give you all the control surface movement you need while saving some for stabilisation.
One of the biggest problems in a new iNav build is that you start with much less pitch and roll control  in Acro and Angle compared to Manual. I have been caught a few times with insufficient pitch control to get over trees while testing stabilised modes. This is because the Airplane preset (in the Presets page) puts the FF at 15, which is usually way too low. The default PIDS are are a better starting point in my opinion.

My FF ends up at 50 to 100 depending on the model. D and I terms are less important for fixed wing. Mine seem to end up around D=7 and I=10 but I'll do some further PIFF testing to confirm.

Autotune attempts to do these adjustments for you, but doesn't always get it right. I prefer to set them in the field using the  iNAV OSD Menu. Access the OSD Menu by using the Enter OSD Menu Stick Command. You can make all the adjustments using your transmitter sticks.

UPDATE 10 Sept 2019: Pawel's latest tuning tips from this video.

1. Work out your roll pitch and yaw rates (degrees per second) by doing full stick rolls, loops and rudder turns, in manual mode. 
Example - If a full stick loop takes 2 seconds then the pitch rate is 180dps
Enter these rates into the Rates section of the PID Tuning page
Average rates are Roll - 250, Pitch - 150, Yaw - 90 (Ignore yaw when you don't have rudder)

2. PIFF Values
Change P to ZERO (Actually I think about 5 feels better)
Change I to 7 (around 6 to 8 and never more than 10)
Use AutoTune to set FF value (or increase FF to get 90% throws in ACRO)
Change Gyro LPF Cutoff to 20

3. CLI
Try set fw_iterm_limit_stick_position = 0.25 (Stick position where Acro changes to Manual. Default is 0.50) for a more natural and in control feeling, with stabilisation when sticks are near the centre.

5. Check List before your first flight

On the bench and hooked up to your computer

1. iNav Configurator Receiver screen - Ail, Ele, Thr and Rud values must increase when you move the transmitter sticks up and to the right. This means the stabilisation will work in the correct direction. If a channel value decreases instead of increasing, reverse the weight in your transmitter mixing.

2. Check that values range from 1000 to 2000 when you give full movement to the sticks. Adjust end points in your transmitter mixing if the range is out. I have to use -97 to +97 on my Taranis channel end points.

3. Check control surface movement using the transmitter sticks. If a servo is moving in the wrong direction go to the Servo screen in iNav Configurator and click Reverse for that servo.

4. Check that your Modes switches are working as expected and have one combination of switches that has no modes selected. For me it's all switches up. With nothing selected the plane will be in RATE / ACRO Mode

Outside or at the flying field

5. Check that the GPS is working and acquires more than 6 satellites. You will not be able to arm the board otherwise. Motor will not be active until the board is armed.

If all the above checks out you will be good to go. Time to be brave and throw that plane in the air.

Start in Manual Mode and fly up to a safe height, switch Manual off when you're flying calmly to see how ACRO mode performs. Be prepared to switch back to Manual if something unexpected happens.

Check other modes as your confidence builds.

6. Save your FPV OSD layout
Rather than having to setup the OSD again for every new iNav build you can copy the relevant CLI entries from a previous build, and save them as a text file. Then you can paste them into the CLI for the new build.

Type "Diff" into the CLI then hit Return
Copy all the lines starting with "# osd_layout" and save them in another text file.

osd_layout 0 lines refer to the Default layout
osd_layout 1 lines refer to Alternative layout 1
osd_layout 2 lines refer to Alternative layout 2
osd_layout 3 lines refer to Alternative layout 3

I have a text file with Default and Alt layout 1 saved and available to paste into each new setup.

Here are my OSD layouts at the moment. 
Default layout has Distance to Home and Trip distance included, but not in Alternative Layout 1 

7. Trim the Board Alignment in the field using Stick Functions
To get the plane flying level in Angle Mode you usually need to adjust the Pitch Degrees in the iNav configurator Configuration Screen. Rather than connecting to a computer you can do this using your transmitter sticks.

Have a look at the Mode 2 Stick Functions picture above.
If your plane descends when you switch to Angle Mode you need to add Pitch Degrees to the board alignment. Trim Acc Backwards is the stick function you will need.

With the board disarmed, push the throttle to full up and elevator to full down.
Watch the fast flashing LED on the board (Matek F405 Wing) and notice that it will start flashing slowly. One flash equals about 1/3rd of a degree of Pitch Degrees, so 10 flashes will trim by 3 degrees.

Fly again and adjust as required.
If the plane pitches up in Angle Mode try a few degrees of Trim Acc Forwards. Same for left and right.

My planes seem to need about +3.0 to 4.0 Pitch Degrees.

8. Default Mode is ACRO or RATE
If you have no modes selected you are actually in ACRO Mode (also called RATE), not MANUAL.
I use ACRO Mode 90% of the time for general flying around. ACRO is stabilised but not self levelling.

From the iNav fixed wing WIKI:

Default flight mode (No mode selected) 
The default flight mode does not self level the aircraft around the roll and the pitch axes. That is, the aircraft does not level on its own if you center the pitch and roll sticks on the radio. Rather, they work just like the yaw axis: the rate of rotation of each axis is controlled directly by the related stick on the radio, and by leaving them centered the flight controller will just try to keep the aircraft in whatever orientation it's in. This default mode is called "Rate" mode, also sometime called "Acro" (from "acrobatic") and is active whenever no auto-leveled mode is enabled. 

9. AIR MODE for fixed wing

Air Mode is useful for multi rotors to keep the PID loop (or stabilisation) active when throttle is very low. But it's not as essential for planes. 
If you disable AIR mode on a plane you will only notice slightly reduced stabilisation at zero throttle. No big deal really.
The annoying thing about AIR mode is that it shows in the FPV OSD replacing ACRO the actual mode. This will be corrected in iNav 2.6 so then we can leave AIR mode on.

10. ACRO actually does mean ACROBATIC

On planes with rudder, ACRO mode is designed for Assisted ACROBATIC flying, and not normal cruising around like we all expect. This means that you must use rudder for turns. If you try to turn without rudder input (bank and yank) iNav assumes you are trying to roll into a knife edge and keep flying straight. The rudder will act to resist the natural yaw of the turn.

To overcome this unexpected behaviour, Yaw P and I gains should set at zero. Then you can turn using bank and yank or do coordinated turns with rudder input. There will be no yaw stabilisation, but I would prefer that to unexpected knife edges.

V-Tail planes have less effective rudders so this behaviour may not be so obvious. Same with flying wings.

11. Turn Assist and Overactive Rudder can cause tip stalls in RTH and POS Hold

With Turn Assist activated iNav uses rudder, elevator and ailerons to turn in all the Nav modes. If you have noticed aggressive yawing, overshooting and maybe even tip stalls when you select RTH it's probably due to excessive rudder throws.

Reduce Rudder throws mechanically or reduce Yaw FF for safer and smoother GPS mode turns.

Or you can reduce the amount of rudder in the mix by reducing Turn Assist Gain via the CLI.
Turn Assist is ON by default even though it may not be activated in the Modes Page.
Gain is set at 1.0 with allowed range 0.0 to 2.0

Try gain values less than 1.0 to reduce the effect or turn it off with gain of 0.0.

Set fw_turn_assist_yaw_gain = 0.0

12. Prevent disarming in mid air (Marc Hoffmann)

I have often disarmed in the air by accidentally knocking the arming switch, requiring a glide back to earth with no power. I believe it is possible to re-arm in the air, as long as throttle is at zero and no modes are selected.

But there is a setting that will prevent disarming unless throttle stick is at zero.

set disarm_kill_switch=OFF