Fixed Wing Tuning Guide for INAV and Ardupilot
It is not a hard thing to make a fixed-wing airplane or a flying wing fly. Get the center of gravity forward enough, make sure all the control surfaces move in the correct direction and that the motor generates enough thrust. With enough pilot skills or luck, it will fly. Somehow, barely fly but fly. If you think that putting a flight controller will make it fly better then no, this is not the case. It might help, but also might make it worse. In this article, let's go through the airplane with a flight controller tuning process. It will be mostly about INAV, but it's valid for Ardupilot as well.
The main difference between multirotors and fixed-wing airplanes is that multirotors are aerodynamically not stable and can not fly without active stabilization. Contrary to that, planes are (or at least should be) aerodynamically stable. They are designed and built to be stable in the air without the aid of active stabilization.
Those differences cause that fixed-wing tuning is a little different than multirotor tuning even when both use the same flight controller. In the case of multirotors, it's all in the software. In the case of the fixed-wings, 75% is in the airplane itself, and only the remaining 25% is the software.
In other words, before you try to tune INAV or Ardupilot for a smooth flight on your new flying wing, you have to ensure the design is aerodynamically stable. It means that:
- The center of gravity is set up correctly. When the center of gravity is too far to the front, an airplane flies poorly, when it's too far back, it flies once. Flight controller software can not change that, and correctly placed center of gravity is a single most important item when tuning an airplane. Always triple check the CG, refer to the instruction manual, and when in doubt, move CG forward. Also, move it slightly forward during maiden and the first few flights.
- All control surfaces have to move in the right direction and right deflection! The direction is simple to check. The deflection can be tricky, but the general rule of the thumb is that deflection should never exceed 25-30 degrees. Anything above that is just extra drag.
- Wings should be straight, not twisted, rigid. Tail if exists (flying wing have no tail) should be in parallel to the main wing. The linkage should not be loose, servos should move smoothly, and there should be no other mechanical problems
When the hardware part is done correctly, we can concentrate on parts when INAV and Ardupilot can assist.
The airplane has to be trimmed! That means that all the control surfaces should be set to a neutral position by default. Bear in mind that neutral position does not mean: in line with the wing or long axis. Neutral means that the airplane will fly straight and level with control sticks in a neutral position. This can be done manually, but relying on a flight controller is a much more convenient idea. Both Ardupilot and INAV functions that do that. In INAV it's called Autotrim and for Ardupilot it's called Automatic Trim
The rotation rate is the maximum angular velocity airplane can achieve on a given axis
Most of the airplanes not only is limited with the relatively low maximum rotation rate they can achieve, but the rates on the different axis can be completely different. Usually, the roll is the fastest axis, the pitch is second, and yaw is third, if any. Look at flying wings. They can not make a yaw turn at all. It all depends on the airplane itself, but for the most popular builds between 0.5 and 1.5m (20-60") wing-span, here are some ground rules:
- Roll rate that the airplanes can reach in flight is somewhere between 200 and 300 degrees-per-second. Some super-agile flying wing and acrobatic airplanes can go higher, but reaching rates of multirotors is impossible. Even most agile airplanes top up at 400 degrees per second,
- For flying wings, the pitch rate never exceeds 200 dps, and the practical value is between 100 and 150 dps. For traditional airplanes with a tail and elevator, it's better. Values between 200 and 300 degrees per second are reachable, but it should be tested case by case,
- Like I mentioned before, flying wings have no yaw/rudder authority at all. Airplanes with a tail and rudder have it (of course they have), but maximum achievable rates are very low. For most R/C builds, they will seldom exceed 90 degrees per second. Usually even less
After your airplane is set up on a hardware level and rates are set to a desirable level, it's time to tune the PID controllers. You are lucky! Both INAV and ArduPilot / ArduPlane have integrated tuning. All you have to do is to run in during flight, and magic will happen! Yes, I'm not kidding. Most airplanes can fly fine on default values, but Autotune can improve the performance dramatically. The shaky or drunken airplane can be converted into a super stable platform at ease.
Final tweaks for INAV
This section is designed only for INAV, although a similar approach can be reused with Aurpilot / ArduPlane.
Airplanes have a much slower response than multirotors. Also, their ability for active stabilization is greatly limited. This is why gyro filtering can be very simple and done only with one setting: gyro_lpf_hz. Most airplanes will fly the best with super low gyro low pass filter cutoff. You can safely go down to 30Hz and even 20Hz without any negative consequences. Remember, the airplane is not a multirotor FPV drone! Do not multirotor replicate tuning on planes.
Another airplane PID tuning aspect that might be a shock for drone pilots: correctly set up airplane does need anty P-gains. Yes, P can be set to 0, and it will still fly. Usually way better than with too much P-gains. Remember that airplanes have built-in stability, and usually, they do not need any direct response to the error. The hardware (center of gravity, the center of drag and center of lift) will take over and fix everything. All my airplanes fly with P-gains at ZERO and they fly great!
The only negative outcome of a disabled P-term on an airplane might be slightly less precise AutoLaunch. But only if the hardware setup part is not done right!