torsdag 26 april 2012

Multiwii Helicopter

How to setup a Multiwii Helicopter
                     updated 2012-05-14
            (New way to setup the Swash mixer)

This Guide is not fully uptodate to V2.3.
In general it is correct but most servosettings can be configured from Gui now.

Same Hardware as a MultiWii copter.
Arduino PRO MINI. 5V 16MHz or Arduino  Mega.
- Gyro Ex Nintendo Wii motion plus.
- Accelerometer.
Acc only needed forAutoleveling.

The code can handle 120 & 90 degree heads.

Connect servos to the Arduino.

 If you use a Mega Board you need to comment
Otherwise Servos will be different pins

Connection diagram 120°

Connection diagram 90°

Setup Transmitter
Set TX channels to full rates it shoud reach between 1000-2000us in the Gui.
Correct the servo directions in the TX.

In config.h
     // Servo mixing for heli 120  Use 1/10 fractions (ex.5 = 5/10 = 1/2)
    //                                        {Coll,Nick,Roll}
    #define SERVO_NICK    { +10, -10,  -0 }
    #define SERVO_LEFT    { +10, +5, +10 } 
    #define SERVO_RIGHT { +10, +5,  -10 }  
    Invert each function by change from + to -.
    The parts of the mixer is. ( Collective , Nick , Roll  )
    Adjust the Nick mixing so swash don't move up or down when tilting.

   // Servo mixing for heli 90 
   //                                                     {Coll,Nick,Roll}
   #define SERVO_DIRECTIONS {   +1,   -1,   -1   }          // -1 will invert servo

!! Important Note !!
In versions after dev-06-04 there's been a change.
It's effecting GyroSmoothening and Servo_offset.
If you change any of the values in the ConfigFile The RESET button in the Gui
must be pressed before the changes will be applyed!.

 Swash Angels
    Adjust the midpoint offset to trim the swash level.
    #define SERVO_OFFSET     {  0,   0,   0,  0,   0,   0,  0,   0 }
Helicopters is known to create lots of different vibrations.
If the gyros feels oversensitive (Hysteric) Try smoothing.
#define GYRO_SMOOTHING {20, 20, 3} // separate averaging ranges for roll, pitch, yaw.
Values must never be below 1.
Increase the values untill it feels right.

The most settings is done  in  Config.h .

// Channel to controll CollectivePitch
#define CollectivePitch AUX1   // Selectable channels: ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4

// Set Maximum available movement for the servos. Depending on modell.

#define SERVO_ENDPOINT_HIGH {2000,2000,2000,2000,2000,2000,2000,2000};
#define SERVO_ENDPOINT_LOW  {1020,1020,1020,1020,1020,1020,1020,1020};

// Limit the range of Collective Pitch. 100% is Full Range each way and position for Zero Pitch
#define CollectiveRange { 80, 1500, 80 }    // {Min%, ZeroPitch, Max%}.
#define YAWCenter             1500       // Use servo[5] SERVO_ENDPOINT_HIGH/LOW for the endpoits.

#define YAWMOTOR                0       // If a motor is use as YAW Set to 1 else set to 0.

// Proportional throw for Roll & Nick  in 0-100%  or more.
#define ControllRange   { 100, 100 }      //  { ROLL,PITCH }

All changes made to settings to servos in config.h...
Require that you press reset button in gui to accept from config.h
Will limit the absolute maximum servotravel.
Should be set to stop servos to travel to far.
You dont want to stall the servos.

Totally 8 servos is available.
Default mix uses.
3 Swashservos
1 YawServo (alt. esc for Yawmotor)
1 Trottelservo or esc.
There's 3 free servos to use. A0,A1 & A2
For use of a gimbal or other functions.
The mixes in outputfile can be modified for more advanced setups.

Sends Rc commands direct to servos.
Not recomended on a FBL!...

The model should feel stable but can still be flown advanced.

Levels the model when sticks is in center.
LevelMode also limits how much the model can tilt.

Preflight setup
After you have changed the servoRates in the code
you can set Dualrates, Expos and curves in the Transmitter.
Engine must be Armed to prevent motorstart by accident..
Should be Armed from AXU-channel if it's setup in the gui (KillSwitch)
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.
Initial settings for my first testflight.

Level-P value will Reduce the maximum throw in Level-Mode.
P=9 Will give similar throws as Gyro-Mode.