tisdag 6 mars 2012

Multiwii Airplane

How to setup a Multiwii Airplane and FlyingWing
                     updated 2014-10-18

Airplane uses same Hardware as a MultiWii copter.
Arduino PRO MINI. 5V 16MHz, ProMicro or Arduino  Mega.
- Gyro
- Accelerometer
- Mag (Optional)
- Baro (Optional)

Start with a trimmed suitable plane.
Dynam EZ-Hawk was my choice but any airplane will work.

Connect servos to the Arduino.
To use D7 on Mega boards you need to use MWii V2.4

And in Config.h comment
Otherwise Servos will be on different pins look in config.h for pinnout info.

My Installation
Sensors work best if mounted as close to CG as possible.
I use multiple layers of double-sided foam tape.

This picture is old and need  to be Updated.

Setup Transmitter
Set TX channels to full rates it should reach between 1000-2000µs in the Gui.
Failsafe function will recognize it as abnormal input if Rates reach below 1000µs .

 If you push both sticks in upper right corner all channels should show 2000 in gui.
Correct the servo directions in the TX.
Results is the same in both Mode1 & Mode2

Setup Servos
Gyro or Acc assisted Mode.
Check if Gyro move servos in right directions.
Lift a wingtip and Aileron goes up.
Lift the tail and Elevator goes up.
Rudder moves in same direction as the tail.

 Use the Servo Tab in Gui to Change Servo directions.

The Servo Tab looks a little different for FlyingWings.
Servos connect to same Wing Servo pins as the Airplanes
Adjust Midpoint and the endpoints.
The elevons can be reversed for each function.

Setup in PassThru Mode.
Set all TX trims to zero and check the value when the sticks centers.
If it's not 1500 change #MIDRC to your Midrc in the code.
* Use the Servo Tab in Gui to adjust  Servo Offset to center the Control Surfaces.
   Adjust mechanically on the linkages to keep offsets as small as possible.
* Set the Servo Rates to maximum recommended for the model.

Remember to press Save button before exit!..

It's also possible to export the servo settings.
Press the Save to file button to save Servos.txt in
same folder as MultiWiiconfig.exe

This settings can be pasted in Config.h and you will not loose
the settings if you reset PID's.


Issues With Rudder

If you experience weird function on the rudder.
And the rudder "Drifts" and becomes offset in gyro and Level modes.

Rudder have a tendency to try to hold the heading during Aileron/Elevator turns.
It can make the plane fly Sideways and other strange phenomena.
The cure is to Set YAW_I = Zero.


The settings is done  in  Config.h .

#define MAXTHROTTLE 2000 
Because you  want Full Power sometimes!

Mwii uses 1850 for MultiCopters.

Flaps Settings
Conventional Flaps
Using servo[2]  (A2 on ProMini )
//#define FLAPS                         // Enable Flaps .

Select channel to control flaps
with the AUX buttons to the left.

Set endpoints and direction.

//#define FLAPPERONS          AUX4              // Use Aileroins as Flaps .
#define FLAPPERON_EP   { 1500, 1700 } // Endpooints for flaps on a 2 way switch
#define FLAPPERON_INVERT             { 1, -1 }       // Change flap direction

Make flaps move slow Higher value is Higher Speed. Effects Both types of flaps.
//#define FLAPSPEED     3            

Flaps (Flaperons)*
Select a channel to control your flaps with.
Endpoints is the preprogrammed positions for the flaperons 

Endpoints for flaps can also be programmed in the TX .
Then set FLAP_EP  { 1020, 2000} in the code.

Totally 8 servos is available.
Default mix uses.
2 Wing servos
1 Elevator
1 Rudder
1 Throttle servo or esc.

A0 & A1 can be used for a gimbal.
A2 Is used for conventional Flaps or Camera trigger.

Acc Calibration

Place the plane on a stable surface.
Vings Level with nose in expected Attack angle for level flight.
Normally a few degrees up.
Memorize the planes  attitude in flight this should be Level for Acc.

Sends Rc commands direct to servos.
No influence from sensors.

Gyro Mode (Acro)
This is "Normal" mode when nothing else is selected.
The plane should compensate for movements. (Wind Gusts etc)
The plane feels stable and locked in but still able to loop & roll.
Stall speed is lower and it can be necessary to "Push" it down in landings.

Stable Modes
  With the sticks centered the plane will self stabilize.
  Returning to level flight from almost any situation.
  Provided there's enough Altitude for recovery.

Horizon Mode Allows rolls and loops. Levels with centered sticks
 This is a comfortable flight mode for FPV.

Angle Mode also limits how much the plane can tilt.
 Gives a Stiff feeling and is only recommended for beginners.

Preflight setup
After you have changed the servo Rates
you can set Dual rates and Expos in the Transmitter.
Engine must be Armed to prevent motorstart by accident..
It can be Armed from AXU-channel if it's setup in the gui . (recommended)
Or with stick combination min throttle & max rudder.

First Flight.
Take of in Passthru.
Switch mode on safe height.
Activate Assisted modes and feel the difference.

Level-P value will Reduce the maximum throw in Level-Mode.

If the gyros feels very sensitive (Hysteric).
Activate LPF filtering for the gyro. 42 Hz or lower is a enough for planes.

In bad cases use GYRO_SMOOTHING 
#define GYRO_SMOOTHING {20, 20, 3} // separate averaging ranges for roll, pitch, yaw.
Values must never be below 1.

A mix where ailerons also works as flaps  for simpler models without separate flaps.