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.
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.
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.
Position 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.
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.
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.
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.)