Custom MultiWii Motor Mixes
Although the standard MultiWii firmware offers an abundance of multirotor mixes, some less common designs remain absent. Modifying the firmware to support custom mixes is rather easy and allows for a wide range of frame options. I will first start by introducing the concept behind the motor mixes and an example mix of a quadcopter with an x orientation.
The way a motor mix works is by specifying the magnitude of the forces that should be applied to each motor. Motors that are placed farther away from the center of gravity will require a greater amount of thrust to travel the same distance as a motor that has been placed near to the center of gravity. Where this can become tricky is when determining the rudder magnitudes of a frame that is not symmetrical diagonally across the center of gravity. However, the easiest rule to follow is to assume that half of the rotors will spin clockwise and the other half will spin counter-clockwise with equal and opposing magnitudes.
First begin with a grid that resembles the one shown below. The green box symbolizes the flight controller at the center of gravity. The origin of the grid is assumed to be at the flight controller with the orange boundary outlining a box that is 1 unit from the flight controller on each side (1/4 unit spaces).

Begin by placing the motors around the flight controller, red represents a clockwise spinning rotor and blue represents a counter-clockwise spinning rotor. Each motor should be placed roughly within the bounds of the orange box such that the x and y coordinates of each motor are about +/- 1 unit from the fight controller.

Using the grid as an aid, determine the magnitude of the pitch, roll and yaw mix by measuring the coordinates of the motor. For example, the mix for this quadx would be:
#if def QUADX
motor[0] = PIDMIX(-1,+1,-1); //REAR_R
motor[1] = PIDMIX(-1,-1,+1); //FRONT_R
motor[2] = PIDMIX(+1,+1,+1); //REAR_L
motor[3] = PIDMIX(+1,-1,-1); //FRONT_L
#endif
The syntax of the mix would be as follows:
*Be aware of the sign change!
“motor['motor number'] = PIDMIX( ‘- X-Coordinate’, ‘- Y-Coordinate’, ‘Rotation (‘clockwise ‘-’, counter-clockwise’+')’);
Here is an example of a custom V6 hexacopter motor mix:

#ifdef HEX6V
motor[0] = PIDMIX(+5/4,-1,+5/4); //FRONT_L
motor[1] = PIDMIX(-1 , 0,+1 ); //MID_R
motor[2] = PIDMIX(+3/4,+1,+3/4); //REAR_L
motor[3] = PIDMIX(+1 , 0,-1 ); //MID_L
motor[4] = PIDMIX(-5/4,-1,-5/4); //FRONT_R
motor[5] = PIDMIX(-3/4,+1,-3/4); //REAR_R
#endif
You may notice that the yaw magnitudes are not equal to + or – 1. This is because the frame is not symmetrical diagonally across the center of gravity. If + or – 1 was used for the rudder mix, then the aircraft would sweep very wide during turns as if the frame was rotating about a point to the rear of the aircraft where the two outer arms would intersect. For this mix, the magnitude of the rudder is equal to that of the roll magnitudes, causing the aircraft to yaw about its center.
Another point worth mentioning is the number assigned to each motor of the mix. MultiWii is capable of handling up to eight motors. These motors must each be wired to a specific pin on the flight controller and their assignments can be completely arbitrary. If the controller is labeled with pins M0-M7, then the motor number of each mix will directly correspond to these pins. However, if the board is only labeled with the digital pin numbers, then the mix must be defined accordingly:
For flight controllers assigned the “PROMINI” designation, such as boards with an ATMEGA328 or ATMEGA 168:
Motor 0 = Digital Pin 9
Motor 1 = Digital Pin 10
Motor 2 = Digital Pin 11
Motor 3 = Digital Pin 3
Motor 4 = Digital Pin 6
Motor 5 = Digital Pin 5
Motor 6 = Analog Pin A2
Motor 7 = Digital Pin 12
For flight controllers assigned the “MEGA” designation, such as boards with an ATMEGA1280 or ATMEGA2560:
Motor 0 = Digital Pin 3
Motor 1 = Digital Pin 5
Motor 2 = Digital Pin 6
Motor 3 = Digital Pin 2
Motor 4 = Digital Pin 7
Motor 5 = Digital Pin 8
Motor 6 = Digital Pin 9
Motor 7 = Digital Pin 10
Here is one final example of a custom frame mix for a U or crescent shaped hexacopter:

#ifdef HEX6U
motor[0] = PIDMIX(+1,-1,+1); //FRONT_L
motor[1] = PIDMIX(-1 , 0,+1); //MID_R
motor[2] = PIDMIX(+1/2,+1,+1/2); //REAR_L
motor[3] = PIDMIX(+1 , 0,-1 ); //MID_L
motor[4] = PIDMIX(-1,-1,-1); //FRONT_R
motor[5] = PIDMIX(-1/2,+1,-1/2); //REAR_R
#endif
There are four modifications that must be made in order to implement the custom mix into the MultiWii code:
1) Each of the mixes written above must be added to the ‘Output‘ tab at about line 750, after the default motor mixes.
2) Add a frame definition to ‘config.h‘ such as “#define HEX6V” or “#define HEXU6“
3) Add an argument to ‘def.h‘ at about line 1000 that allows for the correct model to be displayed in the GUI. You will need to choose from a pre-existing model with the same number of motors.
#elif defined(HEX6X) || defined(HEX6V) || defined(HEX6U)
#define MULTITYPE 10
4) Add an argument to ‘def.h’ at about line 1100 that allows for the correct number of motors to be defined.
#elif defined(Y6) || defined(HEX6) || defined(HEX6X) || defined(HEX6V) || defined(HEX6U)
#define NUMBER_MOTOR 6
Now that all of the code is done, select your new frame type from config.h and upload the code to the board. With irregular shaped frames that aren’t diagonally symmetrical, it is best to reduce the yaw rates on your transmitter before testing the yaw control. Yaw may be slower or result in adverse pitch or roll manipulations if the mix is not properly configured. However, adjusting the yaw magnitudes may not necessarily correct for all of the side effects. Enabling auto-leveling will help to make most of these disappear.
Flashing Arduino Sketches with an ISP Programmer
If you have ever damaged your ftdi programmer or shorted a connection on your Atmel based board, it is quite possible that the only way to program the device is using an ISP programmer. This tutorial will show you how to compile and flash a binary from arduino to your Atmel processor.
First you will need to download WinAVR available from here.
After installing WinAVR, open your arduino sketch and select “verify”.

When compiling has completed navigate to the directory where the compiled binary is located. This can be found within your computer’s temporary files:
Windows XP: C:\Documents and Settings\”username”\Local Settings\Temp
Windows 7: C:\users\”username”\AppData\Local\Temp



Connect your ISP programmer and launch the command prompt. Type the first command followed by [ENTER]:
cd C:\
Type the second command for which the format is:
avrdude.exe -c “programmer” -p “device” -U flash:w:”Firmware.hex”
Example:
avrdude.exe -c usbasp -p m2560 -U flash:w:ArduCopter.cpp.hex

After several minutes avrdude will complete the writing and verification of the binary followed by the message ”avrdude done. Thank you.” At this point you’re done and you can unplug your programmer. Be sure not to disconnect your device in the process of uploading the firmware binary. If the process fails or you receive an error message, be sure to check the syntax of your command and check that you have correctly input the programmer name, device name and firmware file name.
Additional information can be found here.
FPV With GoPro 2.5mm Composite Cable
First you will need to get a composite to four pin 2.5mm cable. This cable is supplied with the original GoPro, however, you can also purchase it from ebay or amazon. Be sure that the cable has a 4-pin 2.5mm jack.

Next you will need to remove the thick plastic plug from the end with the jack. This can be most easily accomplished using a hot knife or heating a hobby knife with a torch. After cutting away the black plastic you may find that the jack is encased in a separate layer of plastic that resembles wax. This can also be cut or melted away, however, if you decide to melt this away be sure not to overheat the jack because the insulation between each of the pins will burn or melt away. After removing all of the plastic, the old wires can be desoldered from the pins just make sure not to apply excessive heat. You will be left with the core of the jack, it should resemble the picture below.

Check the connections between the plug side and the wire side to be sure that they match the connections above. This can be done using a voltmeter and testing for the continuity between each of the rings and solder joints. You want to be sure that you solder the new wires to the solder joints that correspond to the diagram of the rings above.
Finally you can attach whatever plug you would like to the end of your wires, I prefer to use a 3 pin futaba connection with ground, audio and video pins. Wrap the plug in several layers of heat shrink to protect the wiring and solder connections. It can easily be attached to a video transmitter or removed when not in use.

Another option is to make the entire plug into an adapter such as the following.
![IMG_1505[1]](http://polakiumengineering.org/wp-content/uploads/2012/03/IMG_15051-1024x764.jpg)
![IMG_1506[1]](http://polakiumengineering.org/wp-content/uploads/2012/03/IMG_15061-1024x764.jpg)






