These notes are for a common Pixhawk 2.4.8 F450 frame drone kit you can buy on AliExpress. Example: https://www.aliexpress.com/item/1005008272355887.html
If the link no longer works, search "PIXHAWK2.4.8 Flight Control F450 Drone Kit" for some identical listings. These notes are for the "Full Kit" option.
- See https://ardupilot.org/copter/docs/connect-escs-and-motors.html
- Make sure you place your motors correctly on the frame
- From the front left arm of the drone going clockwise, motors should be ordered SILVER, BLACK, SILVER, BLACK
- SILVER = motor spinning clockwise
- BLACK = motor spinning counter-clockwise
- The colour corresponds with each propeller blade's middle section colour, and also the cap the comes on the motor
- From the front left arm of the drone going clockwise, motors should be ordered SILVER, BLACK, SILVER, BLACK
- You'll need to solder the 3 male connector pieces to the 3 black wires
- You can connect the 3 black wires between the motors and ESC's in any way
- The black and red wires from the ESC's must be soldered to your Power Distribution Board (PDB)
- Red is positive
- Black is negative
- The brown, red, yellow connectors will plug into the pin header on the back of the Pixhawk
- They should be plugged into MAIN columns 1 through 4 (any order can be configured to work, but if you follow the order shown in https://ardupilot.org/copter/docs/connect-escs-and-motors.html then things will work right away).
- The brown wire should be on top
- The radio should have a plug that fits into the TELEM 1 port of the Pixhawk
- Plug the M8N GPS into the GPS and I2C ports of the Pixhawk
- So far the GPS hasn't worked for me. Running
gps statusin a MAVLink shell (In QGC, open the Analyze Tools menu -> MAVLink Shell) outputs that no GPS is found.
- So far the GPS hasn't worked for me. Running
- The battery should plug into the Power Brick / Power Monitor
- The power brick in my kit did not output a high enoug voltage for the Pixhawk!
- It was causing a preflight check failure
- My power brick was outputting ~5.2V. However, the internal voltage of the Pixhawk was being measured around 4.8V - 4.9V, which is a preflight check fail (needs to be 5V). The drop is due to a diode (to prevent backpower when multiple sources are used) with a drop of ~0.2V and evidently some other components causing a drop of another 0.1V - 0.2V.
- I used a spare Power Brick Mini to fix this issue which outputs 5.3V
- The power brick in my kit did not output a high enoug voltage for the Pixhawk!
Connect the Pixhawk to your computer using a USB cable and open QGroundControl (QGC). You will need to power the drone using a battery for some of the setup below.
Before you can configure the drone, you need to flash the PX4 firmware onto it
- In QGC, go to Vehicle Setup
- Click on the Firmware tab
- You should see red text reading something like "Please unplug your Pixhawk..."
- If you don't see this then you need to troubleshoot why QGC can't detect the autopilot. There may be an issue with its bootloader or QGC's permissions to access devices on your computer.
- Remove power from your device, then plug it back in.
- Install the most recent Stable PX4 firmware (this should be default)
- I ran into issues with an error happening during the end. Retrying several times seemed to work.
- QGC should now connect to the device and reveal a lot of new vehicle setup tabs
Do these configurations in the given order for best results
- Make sure "Generic Quadcopter" is selected
-
Geometry
- Set the geometry of the airframe in meters
- Note that the center is the center of gravity, not the autopilot
-
Power
- See https://docs.px4.io/main/en/config/battery.html
- Set Battery options according to your battery e.g. for a 4S LiPo battery
- The voltage divider value will vary from setup to setup. Use a voltmeter to measure your battery while it is powering your drone, then click the "calculate" button and enter the measured voltage. This will give you an accurate voltage divider value which also means an accurate battery percentage.
-
Assign motors
- See https://docs.px4.io/main/en/config/actuators.html#multicopter-pwm-motor-assignment
- In the Actuator Outputs menu, open the PWM Main tab
- Be prepared to spin the motors. Make sure propellers are removed. Battery power is needed.
- Click "Identify & Assign Motors"
- Note which motor spins and click it in the diagram.
- If the motor is spinning the wrong way based on the diagram, remove power and swap any two of the black wires connecting the ESC to the motor. This will change the direction of spin
- Alternatively, if something isn't working, see https://docs.px4.io/main/en/config/actuators.html#output-assignment-manual
- See https://docs.px4.io/main/en/config/actuators.html#multicopter-pwm-motor-assignment
-
Calibrate ESC's
- See https://docs.px4.io/main/en/advanced_config/esc_calibration.html
- Unplug the battery from your drone, but leave the USB plugged in.
- Back in the Power tab, in the "ESC PWM Minimum and Maximum Calibration" section, click the calibrate button.
- Plug the battery back in. You should see a calibration in progress popup for a few seconds and hear the ESC's beeping.
- I had to attempt this several times before it worked (I kept getting timeout errors).
- See https://docs.px4.io/main/en/advanced_config/esc_calibration.html
-
PWM Minimums and Maximums
- See step 7 from https://docs.px4.io/main/en/advanced_config/esc_calibration.html#steps
- Back in the Actuators tab, set PWM min and max values accordingly
- It's a good idea to read the above doc page and make sure the values in the image are appropriate.
- Back in the Actuators tab, set PWM min and max values accordingly
- See step 7 from https://docs.px4.io/main/en/advanced_config/esc_calibration.html#steps
- TODO when I get an RC
You can control the drone through your laptop / any device running QGC with a radio attached to it.
- You can use virtual joysticks (enabled in Application Settings -> General -> Fly View)
- Or you can plug in a Gamepad / controller
In either case, if you are NOT using an RC:
- In Vehicle Setup, go to the Parameters tab
- Search "Joy"
- Change COM_RC_IN_MODE to "Joystick Only"
After plugging in a controller, you should see a joystick tab appear. Use this tab to configure buttons to different actions.
- Make sure to enable the joystick using the checkbox
- I highly recommend binding the "Emergency Stop" action to a button you will not forget and can press at any time. This action will stop the motors from spinning instantly, even if flying (very useful in a crash since the autopilot can take valuable time to realize something is wrong)
- Other useful bindings are "Toggle Arm", "Hold", and "Return"
- You can calibrate the Gyroscope and Accelerometer at your bench
- Wait to do compass calibration until you're outside in the area where you'll be flying
- The compass is sensitive to magnetic interference, and calibrating it in a building will likely cause it to be incorrectly calibrated when you leave the building.
- To fix a preflight check failure about missing power redundancy, set the parameter
com_power_countto 0
TODO

