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

The wizard

After connecting the Pixhawk to our computer, start up the Mission Planner software. You'll be confronted with this requestor:

Obviously, you'll want to select Rover. This wizard will do the initial setup of your Pixhawk and calibrate it for use.

Next you simply select how the computer connects to the Pixhawk (as shown in the following screenshot):

At this point, you must provide which port the Pixhawk is attached to. The Pixhawk essentially emulates a serial port via USB (a COM port). The way to know which port is associated with your Pixhawk (on Windows) is to look at the Device Manager (as shown in the following screenshot):

Under Ports, just look for PX4 FMU. In this case, you can see that it's COM9.

Now that it's found the Pixhawk, it will verify its version of firmware and update it. If this fails, just repeat the steps until it succeeds. You may need to change which plug you have the USB jacked into. Sometimes USB hubs and other devices can interfere. Again, just keep trying with different combinations until it works. It will eventually. In most cases, it works the first time.

The next step is compass calibration. Wherever the device is in the world, the compass needs to be calibrated. Additionally, every time the drone is used, you should recalibrate the compass. Solar flares, electric lines, and buildings can create variances in the Earth's magnetic field at your location. It's extremely important to have an accurate compass reading.

For this stage, you'll see this screen:

While this is onscreen (with the cable still connected), take the rover and spin it on all 6 axes a full 360 degrees. This lets the rover sense the magnetic field in all directions and know which way it is facing.

Next, the wizard will move into configuring the power monitor module (as shown in the following screenshot):

We need to make sure the communication protocols are accurate with the device. If you're not sure which power module you have, a safe bet is to select the 3DR Power Module option.

As for the size of batteries, this is in reference to the mAh (milliamp hours) rating. 1000 mAh means that for one hour, it can supply a constant current of 1 Amp (1000 milliamps). The mAh rating is stamped on all batteries. If it is in Amp-hours (Ah) instead of milliamp hours (mAh), just multiply the number by 1000 to fill in this field.

After clicking on Next, the wizard will have you set up any sonar devices (as shown in the following screenshot):

We're not using sonar for this rover. However, we may use it in a much later chapter. So we just left the Sonar Model field at None.

On to the control configuration. Here is where we can bind the receiver to our control transmitter (a Spektrum DX8 in this case) and calibrate the controls to work properly.

The following screenshot shows the screens associated with this process:

In the panel on the left, you'll see a Continue button (not the Next button). That will bring you to the panel on the right. At the lower-right, you'll notice a section called Spektrum Bind. Activating the proper binding button by selecting the appropriate type of Spektrum Satellite will set the receiver into bind mode. Then, just follow the instructions in the Spektrum manual for binding whichever Spektrum transmitter you are using. For the DX8, the following are the instructions:

  1. Select a fresh model
  2. Turn the transmitter off
  3. Hold down the Bind button
  4. Turn on the transmitter while holding the Bind button
  5. Wait for the transmitter to confirm it is bound

After binding the transmitter, just click on the Calibrate Radio button and follow the instructions. (It will have you move various controls in different directions.)

Next is the Flight Modes setting, as shown in the following screenshot:

Up to seven flight modes can be associated with a switch or dial on your remote. If you have a three-position switch on the remote, modes 1, 3, and 5 are the most likely ones that would be assigned to these positions. The flight modes are as follows:

  • Manual: This mode involves full manual control of the vehicle. The Pixhawk simply forwards all commands directly to the servos and ESCs it is controlling.
  • LEARNING: This mode has the same controls as the manual mode, but it lets you toggle a switch on your controller to teach GPS waypoints to the software for use in the Auto mode. Essentially, the rover will repeat your movements.
  • STEERING: This mode is the same as the Learning mode, but turns on obstacle avoidance (if sonar is used), and will steer the rover around obstacles for you. This is great for tuning your obstacle avoidance (which we may use in a later chapter).
  • HOLD: This mode stops the rover with all wheels stopped and pointed straight ahead.
  • Auto: This mode involves fully autonomous driving from waypoint to waypoint. This waypoint list will be looped and repeated infinitely. If reception is lost, the rover will go in to the HOLD mode.
  • RTL: This stands for Return to Launch and will directly return the rover to the spot it was launched from. Upon reaching the launch point, it will go into the HOLD mode. If sonar-equipped, it will avoid obstacles along the way.
  • Guided: This mode utilizes the radio telemetry unit. You can use advanced controls (such as telling the throttle to let up if the rover pulls a wheelie), use joysticks on the computer, or specify waypoints on the fly. Think of this as the Mars Rover setting.

On the final screen of the wizard, you should see that everything is green except for trying to arm your rover (as shown in the following screenshot):

Do not try to arm your rover at this point. First, perform the following procedure:

  1. Make sure all four wheels are off the ground. We used an RC car stand (the orange platform in all of the pictures of the rover in this chapter).
  2. Make sure your transmitter is on.
  3. Connect the power sensor module to the ESC.
  4. Connect the battery to the power sensor module.
  5. Hold down the ARM button (the now flashing red button attached to the GPS cable) for 3 seconds.

If the red button light stops flashing and goes solid red... congratulations. It has successfully armed. If not, or if the button's light never turned on, you may have connected up the wrong wires on the GPS cabling. Check them again.

The red box will not turn green, but you have registered successful arming in every significant way.

The rest of the screens do not actually allow you to configure anything. They simply advise you of what Failsafe options are and give you some links for some reading material. Read them. They are very helpful.