17 January 2014

Receiver to Flight Controller

The flight controller is the brains of the quadcopter. It has sensors that determine the pitch, roll, yaw, altitude, and acceleration of the quadcopter. Mechanically fix the flight controller to the frame, tell the flight controller what level looks like based on how you mounted it to the frame, and tell it how your motors are arranged. (We will cover these things a bit later.) The flight controller senses if the quadcopter tips, and controls the motors to correct it and level out the quadcopter. Quite frankly, this is amazing. It takes a lot of the complication of flying out, and makes it stable and easy to fly.

In order to do this, the flight controller has to be hooked up to the receiver appropriately. There are six lines that matter for this:
1) Yaw
2) Throttle
3) Pitch
4) Roll
5) +5V
6) Ground

On the flight controller I bought, there is silk screen showing what to connect to where, but the silkscreen is wrong. The wrong labels are repeated on the hard case I bought. Pitch, Roll, and Throttle are wrong. Here is the wrong silkscreen on the flight controller board:


Here is the wrong silkscreen on the hard case.



It took me a long time to figure out that the silkscreen was wrong, as I completely trusted it. In the end, I was able to figure it out because when I tipped the quadcopter while it was turning the rotors on very low throttle, the wrong motors would cut out. The idea here is if you have it in a stabilize mode and you tip it so one rotor is up, that rotor should slow or stop because the unit is trying to level out. So experimentally, I determined the layout. Here's the actual layout for the board I have:

Remember, the silkscreen is wrong, so it should read, starting with the yellow wire:

Yaw
Throttle
Pitch
Roll
+5V
Ground




As you can see above (spelled out for the colorblind), wire colors I chose are:
Yaw--Yellow
Throttle--White
Pitch--Blue
Roll--Red
+5V--Orange
Ground--Brown





These wires plug in to the receiver. Based on the color scheme I chose, and the channels I have selected on the transmitter, here is how I have wired up the receiver-flight controller connection at the receiver side:













Bat Orange and Brown (Inside has nothing, Middle is Orange, Outside is Brown)
   6  White -- Throttle
   5  Nothing
   4  Yellow -- Yaw
   3  Nothing
   2  Blue -- Pitch
   1  Red -- Roll
Remember that the signal pins are the inside ones (the pins nearest the channel number label).

As I spent so much time debugging the Receiver to Flight controller, and thinking I had something wrong, I'm documenting the full interconnect. The sticks on my transmitter are set up like this:

  • Pitch (Blue), Channel 2, left stick forward and back
  • Yaw (Yellow), Channel 4, left stick left and right
  • Throttle (White), Channel 6, right stick forward and back
  • Roll (Red), Channel 1, right stick left and right

The next thing to hook up is the ESC's to the motor controls on the Flight Controller. There are four of them, and you have to get the right one in the right place (you could modify the firmware to change which one plugs in where, but it's a lot easier in my mind to simply plug the right one in to the right place). Again, you have to experimentally determine which one is which. I chose the "+" configuration, so here is what it turned out to be for me:

Note that as odd as it seems, according to the silkscreen there is no "4" slot.
Front 6
Back  2
Right 5
Left  3

Looking back at this blog post, it doesn't seem nearly as hard as it was in real life. The hardest part was that I kept thinking I did something wrong on the receiver end because of the problem with the silkscreen. Now that I know how it should go, wiring this up could be really fast and painless. :-)