Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
上QQ阅读APP看书,第一时间看更新

Connecting the brain to the body

Now, we need to hook up the Pixhawk to the power, the motor, and the steering. If we open the receiver box, we'll see three servo (white, red, and black) cables. One goes to the ESC to control the motor. The other goes to the steering servo. There are a plethora of servo connections on the rear of the Pixhawk, as shown in the following image:

The steering servo (the servo wire leading to the front of the vehicle) connects to Main Out pin 1 vertically, with the wire at the top being black (ground) and the white wire going to the bottom. The throttle servo wire connects to Main Out pin 3 in the same way.

Finally, connect the power lead to power 1 (as also shown in the following image), and connect the other end to the power module (as shown in the following image):

This power module goes inline (between the battery and speed controller) to provide power to the Pixhawk's computer and give power readings (so the Pixhawk knows when it's running low on power).

This does not provide power to the servos. The servo board must get power from a Battery Eliminator Circuit (BEC), a device that eliminates the need for multiple batteries by distributing power to the servo board. The ESC on this rover has a BEC integrated into it. So, it not only receives signals from the Pixhawk, but supplies power to all the servos. If this ESC didn't have a BEC integrated, one would be needed (connected directly to the main battery), and could be plugged into any port on the servo board (rear of the Pixhawk). Most ESCs have BECs integrated. However, some do not, and it's important to know what a BEC is.

Now that everything is hooked up, let's get started with the software.