MultiWii Mixing for TBS Discovery

Firstly, I don’t have a TBS Discovery – I’m cheap.  But, I did use the pattern of the Discovery to make my quad out of 1/8″ plywood.  It seems like a popular layout that doesn’t allow props in the video, so I went with it.  Now I just need a mix to accommodate the oddball motor layout.  Here’s how.

Firstly, I owe all the credit to Adam Polak  here:

This procedure is for my Witespy Mega Ez 3 board.  It is a Mega 2560, so some info to note is:

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

Motor layout with relation to Pin is shown here:


I took a picture of my quad and overlayed a grid on the picture.  This made it easy to get some numbers for ratios.


Adam Polak says on his web page:

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

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’+’)’);

Looking at my grid, I can modify the standard QuadX configuration to be:

motor[0] = PIDMIX(-1,+3/4,-1); //REAR_R
motor[1] = PIDMIX(-5/4,-3/4,+1); //FRONT_R
motor[2] = PIDMIX(+1,+3/4,+1); //REAR_L
motor[3] = PIDMIX(+5/4,-3/4,-1); //FRONT_L

Armed with that information, I need to make 4 changes to the MultiWii sketch

  1. In Output.ino, add the following config for QUADXDISCO:
    #ifdef 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
     #ifdef QUADXDISCO
      motor[0] = PIDMIX(-1,+3/4,-1); //REAR_R
      motor[1] = PIDMIX(-5/4,-3/4,+1); //FRONT_R
      motor[2] = PIDMIX(+1,+3/4,+1); //REAR_L
      motor[3] = PIDMIX(+5/4,-3/4,-1); //FRONT_L
     #ifdef Y4
     motor[0] = PIDMIX(+0,+1,-1);   //REAR_1 CW
     motor[1] = PIDMIX(-1,-1, 0); //FRONT_R CCW
     motor[2] = PIDMIX(+0,+1,+1);   //REAR_2 CCW
     motor[3] = PIDMIX(+1,-1, 0); //FRONT_L CW

    This is line 843 in MultiWii 2.2

  2. Add the frame definition to Config.h:
    //#define QUADP
     //#define QUADX
     #define QUADXDISCO
     //#define Y4
     //#define Y6
  3. In def.h in the section labelled “Multitype decleration for the GUI’s”, I changed this line:
    #elif defined(QUADX)
     #define MULTITYPE 3


    #elif defined(QUADX) || defined (QUADXDISCO)
     #define MULTITYPE 3

    This allows the GUI to display the correct craft type.

  4. Also in def.h, find the following line (line 135 in MultiWii 2.2):
    #elif defined(QUADP) || defined(QUADX) || defined(Y4)|| defined(VTAIL4)
     #define NUMBER_MOTOR     4

    Add another condition for your model:

    #elif defined(QUADP) || defined(QUADX) || defined(Y4)|| defined(VTAIL4) || defined(QUADXDISCO) 
     #define NUMBER_MOTOR     4


Once these changes were made, I opened up MultiWii WinGUI to save my settings to file (don’t wanna recreate the wheel), then loaded the EEPROM_CLEAR sketch to ensure a clean upload.  Once cleared, I loaded up the new MultiWii sketch, uploaded my settings via WinGUI and went for a test flight.  So far so good, but unfortunately it started raining right when I got in the air, so more updates to come.

Flashing F-30a ESCs with SimonK

Flashing F-30A or F-20A ESCs is easy with a USBasp adapter.

You’ll need the following:

Reference This Spreadsheet and find your ESC.  In this case, I am flashing F-30A ESCs, so I will use firmware file “bs_nfet.hex”.

Using the following images, I can match up the 6 or 10 pin connector to the necessary points on the ESC.

6Pin ISP ISP 10-pin connection-pinout

This image shows the corresponding points on the ESC.  Rather than removing the entire case, use the razor blade to cut open a window to the solder points we need our wires to contact.


I used two servo extension wires with the male leads pressed into the 6 pin connector of the USBasp programmer.  On the other end, I stripped the wires back a little bit and dabbed a little solder on them to keep them stiff.  I can then hold them in place with my fingers while the programmer does its job.


Open the kkMulticopter Flash Tool and note the settings in the screenshot.


I can choose the file directly by using the disk icon and then flash that file with the arrow next to it, or I can allow the tool to download the firmware file automatically by selecting the firmware shown and then use the arrow next to the firmware section.

My firewall blocked this app, so I manually downloaded the file and flashed it using the file option.  If you want to allow the tool to download the firmware, you can skip downloading from the firmware link above.

Be sure to hold the wires steady and firm onto the ESC during flash.  If it fails the first time, adjust your grip and try again.  I flashed 4 ESCs in about 5 minutes with a couple failures while getting the wires to touch all pads firmly.

Good luck!

FS-TH9x mods

Now that I’m knees deep in this hobby, I need a better transmitter that supports multiple models.  The FlySky TH9x (Same as the Turnigy 9x) is a 9 channel transmitter which has a ton of options for upgrade.  This is a very versatile transmitter when it comes to modification, firmware, and upgradeable parts.  For a $79 price tag, it’s a deal compared to higher priced models.

Changing firmware is my first upgrade.  The popular ER9x code is available from HERE which fully supports any of the FS-TH9x flavors.  Flashing the 9x can be somewhat daunting and usually requires some soldering, engineering a connector into the case somewhere, and programmer such as a USBASP.  I chose the route of the SmartieParts 9x Solderless Programmer Board.  This is a drop-in board that adds a small USB port inside the battery compartment.  All you have to do is open the case, install the board with a few screws, mount the usb port, and you’re done!

While the case is open, you may as well order a back-light for your screen.  This is a great $5 upgrade you can find HERE.  The smartieparts board above even has a port to power this back-light.  It only requires cutting the existing lead that comes with the back-light and soldering the two-wire plug that comes with the programmer board to the existing wires.  After that, it drops in as easy as the programmer board.

Flashing ER9x was a breeze with the exception of one hang-up.  Use the driver and flashing software for the programmer board that SmartieParts provides on their website.  I did not get regular windows drivers to work.  After that, it’s smooth sailing into a powerful firmware.

My next upgrade is a FrSky DJT transmitter module with Telemetry receiver.  Smartieparts also sells a board to easily integrate FrSky telemetry into the 9x display.  I opted for the FrSky add-on display mostly because I forgot about the SmartieParts adapter.  D’oH!  Those parts should arrive in a couple weeks, so I will update this entry at that time.

The Tricopter Saga

After building the first tricopter, I found some things about it that I didn’t like.  The body was small and doesn’t allow for much electronics.  Because of that, the flight controller, camera gimbal, receiver, and battery are all hanging off of it somehow or stuck to it with double sided tape.  I wanted something that would have a place for everything and protect it if possible.

I came across the Simple T-Copter design from which has the flight controller and receiver recessed int he body.  Great idea.  What I wasn’t so much on was the “T” design.  It seems like the center of gravity would be off.  As a compromise, I made a hybrid of the tricopter v2.5 and the T-Copter.  Ideally, two bearings would inset in the platform with a matched shaft drilled into the boom, but – we’ll see if those parts turn up.

This design was pretty nice.  The platform on the front allowed me to add a camera gimbal (I used the “super simple gimbal”).  The copter flew well, but when I finally got a GoPro, the propellers were in view.  *sigh.  This called for something with the camera further forward to get the propellers out of frame.

Version three was based off of the T-Copter design.  One thing the designer claimed is that the props are out of view when the camera sits on the front.  This is true. Video looks good with no propellers in frame.  Design note: keep the GoPro directly between the propeller center.  I failed to take many pictures of version three which is unfortunate because I was proud of how I integrated the gimbal (SSG) into it.  I kept the camera mount on top, but the servos were on the bottom with an extended  fuel line going through the body.  I had to add some wire inside the fuel line to keep it rigid through the body, but it worked!

The T-copter design was great.  As long as you mount the battery to the rear, the center of gravity isn’t too bad.  It was not as stable on high throttle as the original tricopter.  I also experienced some jitters with the gimbal that I think were due to the extended fuel line tubing used to attach the platform to the servos catching on the holes in the body.  I want to build another, but the next one will keep some arm angle, have the gimbal detached from the main platform, have all electronics inline with the FC and receiver recessed, and have a designated place to strap the battery.

My next model will not have the steering mount yaw mechanism.  While this seems like a good idea from RCExplorer, I find that if my motor has any vibration, it can resonate due to the “looseness” of the extended joint.  I think the method of using a bolt or screw through a wooden platform, then attaching a servo to the platform, is going to prove a more stable mounting solution.  This was the first mounting method by RCExplorer and the method still used on the T-Copter.

The body is two similar pieces with the lower piece having an extended platform on the tail to mount the battery.  I guess it could be smaller, but the surface area touching the battery makes me think it’s more snug.  I used 1/2″ spacers/risers to separate the two body plates and attached them with  4×1/2″ screws.  Two openings in the top piece allow for access to the KK2 board and the receiver.  Simple triangular pieces attached to the arms allow for a decent looking landing gear.  The motors are no longer DT750’s.  Instead, I upgraded to SunnySky 2216-12 800kv motors.

What I’ve learned after the fourth copter:

  • The gimbal jitter was not from having extended tubing.  It’s the darn servos! Apparently this is a widespread problem and finding servos that don’t bounce around is difficult.  I tried a torroid ring on my signal line which made no difference.  For now, unhooking the servos gives me great ideo, but I have to deal with the flight movement.
  • You get what you pay for. While the DT750 motor is great and efficient, it takes forever to get balanced properly.  The SunnySky motors bolted on and with about 5 minutes total of dynamic balancing, DONE.  Smooth out of the box.
  • Be careful not to set your “P” too high on Yaw.  If it starts going back and forth, it gets nasty!
  • Don’t integrate a gimbal into the body.  Make it attachable by some means.  On Gen. 4, I used four fuel line pieces on screws to add some more vibration isolation, but the main point of keeping it separate is so you can make changes without modifying your body.

Flashing Turnigy Plush 18A SiLabs ESC with BLHeli Firmware

According to many multirotor flyers, BLHeli firmware for SiLabs based ESCs gives better control, more responsive handling, and better motor control over stock firmware.  This is the process I used to flash the firmware of my Turnigy Plush 18A ESCs.

In case any of my links expire, here is a link to the BLHeli Master Folder

First, you’ll need an SiLabs Toolstick.  I bought mine here: SiLabs Toolstick at Mouser
You’ll need to solder some wires to the toolstick in order to connect it to your ESC.  The connections are covered in this document or see my pictures below.

20130307_202347  20130307_202310 20130307_20293220130307_203026

Next, find your ESC in this document.  Solder connections at the indicated spots.  I used Servo connectors so that I had an easy connector to the Toolstick.  I used a servo extension cable to solder onto the Toolstick.  This way, the toolstick has a male end and the ESC has a female end.

Now that you have connectors on the Toolstick and the ESC, install SiLabs Flash Utility.  Once installed, plug in your toolstick and fire up the Flash Utility.  When open, go to the “Connect/Disconnect” tab and select your USB Debug Adapter.  Power up your ESC and connect the toolstick to it.  Next, click Connect.

You should see your device detected.  If there is a prompt to update your toolstick, go ahead and click OK.

Click on the “Download Hex File/Go/Stop” tab and then browse to the hex file for your ESC.  For this, I used Turnigy Plush 18A version 10 Multi.  If this is for a multirotor, use the Multi version.  Check the box for “Erase all Code Space before download”.

Once the hex file is selected, click on Download.

Click OK and the flash completes.

BLHeli is now on your ESC.  Go back to the “Connect/Disconnect” tab and click Disconnect.  Connect the toolstick to the next ESC and repeat the process for each ESC.

Once all your ESCs are programmed, You’ll need to calibrate the throttle.  I use a KK2 board to control my tricopter, so I power up my copter/KK2 and instantly hold button 1 and 4.  The screen will say “throttle passthrough” if successful.  This will pass the throttle to all the output channels so the ESCs will all calibrate to the same throttle.  Put your transmitter to full throttle until the ESCs make a few low to high tones.  When high throttle is set, you’ll hear a few low to high tones, then it will then do a series of double beeps.  Move the throttle to the lowest position.  Once the ESCs beep high to low a few times, the throttle range is calibrated.  Page 4 of this document covers this procedure or see the following picture.

If you want to adjust any settings manually, you can use BLHeli Setup to adjust settings, save settings, or load settings to your ESCs.

*Note – After flashing my ESCs, all motors spun the wrong way so I had to reverse a couple wires on each motor.  Not sure why this is, and you can reverse the rotation using BLHeli Setup, but swapping the wires was easy enough for me.

So far, I notice that the stability of the tricopter is somewhat improved.  I notice more that the motors are quieter and seem to run smoother.  I’ll have more test data tomorrow once I get it in the air.

The Art of Prop Balancing

If there was one aspect of building a tricopter for video use I thought would be most difficult, removing vibration is not it.  Unfortunately, it is the killer of good video and the most elusive demon to exorcise.  Cheap props make the process more difficult, but who can argue over the price of china-made GWS style props when you’re crashing all the time?  Vibration makes video have “jello”.  Apparently, “jello” is the term people use to describe the wobbly, horizontal lines or generally liquid video you’ll get from too much vibration on your copter frame.  While there are many gimbal designs on the internet to dampen vibration, stopping it at the source is the best solution.

My scenario uses a DT750 brushless outrunner with a 10×4.7 GWS style slow-fly prop.

Step 1: Balance the motor bell housing.  In a previous post, I have links to videos on how to use an iPhone and sound to balance the motor housing.  Use tape on the bell housing to add weight and counteract a heavy portion of the housing.  While these methods use the motor in action to measure vibration and feedback, it is also possible to disassemble the bell housing from the motor and use a prop balancer to find the heavy spots.  This is the long way and what I found is that after balancing using the seismometer iPhone app, the bell housing was almost perfect when I put it on the prop balancer.

Step 2: Balance the prop.  Some people swear they can balance a prop by trial and error.  Those people have a gift.  Get a gift for yourself and buy a prop balancer!!  Seriously, do not make excuses – just buy one.  I bought a DuBro like this and I see others recommending magnetic styles like this. Sand away plastic from the top of the heavy sides of the prop until it rests on the balancer perfectly horizontal.  I use a rough grit until it’s almost perfect and then finish the job with a high grit like 1000 to make the surface smooth again.

Step 3: Dynamically balance.  Mount the prop onto motor, but don’t mount it so tight that you cannot move the prop.  Mount it tight, but not “locked” into place.  While you my have balanced the bell housing and the prop, physics says the combination of the two will inherently have flaws.  The goal here is to find the position of the prop which has the least vibration.  There is an angle of that prop that will vibrate the least and your goal is to find it.  This requires a lot of trial and error, spinning up the prop, twisting it, spinning it up again, etc., etc..  I turn in 30 degree increments and note the positions that have the least vibration. That should result in two positions.  Focus on an angle between those positions to find the sweet spot.  You may think that you’re done since you found that sweet spot, but you’re not.  There may still be unbalance in the system of the prop and motor.  Sometimes a little tape on the prop is necessary to reach perfection.  Measuring vibration at this point can be difficult, so a laser and a mirror can assist.  You can find a laser at Wal-Mart for $3.97.  Look on the cat toy isle.  strap a compact mirror to your copter arm and point the laser at it.  The reflection across the room will show the amount of vibration.  The best explanation of this method is from FliteTest on Youtube.  The video is below.

Step 4: Reduce vibration transfer.  Spinning motors will still have some sort of vibration.  Mediums such as rubber and foam can reduce the transfer of this energy.  Wherever you can get creative to use an insulator of this type between two connections is up to you, but will help reduce vibration transfer.  I mounted my motors to a small round platform insulated bu high density foam.  I also used some old dynamat pieces on my camera gimbal and body to absorb vibration energy.  It’s trial and error so find something that works for you.

CT6B “T6” config for KK2 Tricopter

Configuring the T6 transmitter can be difficult due to lack of documentation or lack of experience with RC transmitters.  Mine was both.  Hopefully the info here and the links will help someone else trying to configure this transmitter.

First link: This site has a ton of links and info related to the CT6B transmitter.
Download the drivers for the SILabs CP210 in order to properly utilize the data cable that came with the transmitter.  The driver will emulate a COM port on your PC.

As the transmitter relates to the KK2 controller, let’s look at a few pictures.  Firstly, the most common control layout for a helicopter is Mode 2.

Within T6Config, this is listed as “Model 2”.  You can see how the sticks translate to channels in this diagram.

Referencing that picture, you can see what channels control Aileron, Elevator, Throttle, and Rutter.  In Mode 2:

  • Channel 1 = Aileron
  • Channel 2 = Elevator
  • Channel 3 = Throttle
  • Channel 4 = Rudder

Knowing that, we can reference the next picture to know what channels to hook where on the KK2 board.KK2PinOut

Channels 1-4 connect in the same order on the KK2 board.

One thing I realized after getting some flight time is I want the ability to switch self-leveling on or off without using a stick in the arming process.  Since there are 6 channels on the T6, I assigned channel 5 to turn self-level on or off.  Below are screenshots of my configurations in T6 Configuration and Digital Radio.

After assigning channel 5 (note the mixer screens above), connect another signal cable to the AUX input on the KK2 board from channel 5 output of the receiver.  VR(A) can be turned either way, but the switch may not work if VR(A) is exactly in the middle.  Now, flipping switch A will toggle self-leveling mode.