The Robot Source parts for building robots and drones
> >

How To Build A Quadcopter
With A Pixhawk Flight Controller

Step 1  Step 2  Step 3  Step 4  Step 5-1  Step 5-2  Step 5-3  Step 6  Step 7  Step 8  Step 9-1  Step 9-2  Step 9-3  Step 9-4  Step 10  Step 11  Step 12  Step 13 Maiden Flight!

Step 1: Connecting the Q-Brain 4-in-1 ESC

Connecting the Q-Brain 4-in-1 ESC

In order to clearly demonstrate how to wire together all of the components for the Pixhawk flight controller, we have put together a simple demo frame to mount the components on. We will use this demo frame throughout the build until we get to the part of the instructions where we will mount everything on our actual quadcopter frame. Please note that this demo frame is by no means suitable for flying and is only intended to be used for the purpose of instruction.

quadcopter demo frame
The demo frame is not suitable for flying and is intended for instruction only!

We have marked the front of the demo frame with yellow tape and arrows so that when we mount the Pixhawk flight controller and the GPS/compass they are both pointing in the same direction. As you can see in the above photo (not sure why the booms look so bowed in the photo) we have already mounted the battery underneath the frame and have also mounted the motors on the booms with plywood mounts.

Q-Brain ESC solder connector
Be very careful to solder the positive wire to the positive terminal on the XT60 connector! It is dangerous to get this wrong!

Solder a female XT60 connector to the power wires of the Q-Brain ESC (electronic speed controller). The sides of the connector have a "+" mark for positive and "-" mark for negative so BE VERY CAREFUL to solder the RED wire to the "+" terminal of the connector and the BLACK wire to the "-" terminal! It is dangerous to get this wrong! To make it easier to connect the Pixhawk later on, add in an additional length of 14 gauge wire.

Q-Brain orientation

Q-Brain CloseupPosition the Q-Brain ESC in the center of the frame making sure that all the wire leads from the Q-Brain ESC can reach the motor wires at the end of the booms. The orientation of the ESC is important because we want the correct wires leading to the proper motors. If you notice on the ESC the motor leads are identified as M1 (ABC), M4 (ABC), M3 (CBA) and M2 (CBA). Mount the Q-Brain ESC so that the M1 and M4 wires will be to the left side of the frame when the front of the frame is facing you.

Q-Brain wiring to motor M1

Connect the wires from the Q-Brain ESC to the appropriate quadcopter motor wires. Looking at the frame from the front, M1 will connect to the front left motor, with the "A" wire from the ESC going to the red wire on the motor, the "B" wire from the ESC going to the yellow wire on the motor and the "C" wire going to the black wire on the motor. This will give us a CCW (counter clockwise) rotation for the M1 motor. Connect the M4 wires from the Q-Brain ESC to the rear left motor as follows; the "A" wire from the ESC to the black wire on the motor, the "B" wire from the ESC to the yellow wire on the motor and the "C" wire from the ESC to the red wire on the motor. This sequence will cause the M4 motor to rotate in a CW (clockwise) direction. The M3 motor will be your rear right motor, this motor needs to rotate in a CCW direction so connect the wires as follows; the "A" wire from the ESC goes to the red wire on the motor, the "B" wire goes to the yellow wire and the "C" wire goes to the black wire. Finally, we want the front right motor (M2) to rotate in a CW direction so we will connect the "A" wire from the ESC to the black wire on the motor, the "B" wire to the yellow wire and the "C" wire to the red wire on the motor.

Q-Brain wiring to motors overview
Q-Brain to Pixhawk Connection

Connect the Q-Brain to the Pixhawk flight controller with the following sequence; the RED wire from the ESC will connect to PORT 1 of MAIN OUT on the Pixhawk, the 3 wire (BLACK-RED-WHITE) from the ESC to PORT 2 (the white signal wire must go on the bottom pin), the ORANGE wire from the Q-Brain to PORT 3 on the Pixhawk and finally the BROWN wire to PORT 4 on the flight controller.

Pixhawk orientation

It is important to position the Pixhawk flight controller with the directional arrow pointing to the FRONT of the frame. Move onto STEP 2 and connect the GPS compass, telemetry radio, buzzer, switch and power module. (We will do the Q-Brain ESC calibrations later on.)