Home » How To » Program a Mini APM v3.1 with GPS

Program a Mini APM v3.1 with GPS

This article was originally published in April/May 2016 issue.
By Andrew Ocejo
036-3

The APM Mini Version 3.1 is the latest in flight controllers of the APM class. Its board is only 35mm x 35mm, making it comparable in size to the Naze32 and The CC3D. The impressive part of this board is if you flip it over on its back you will find the Atmel Atmegea2560, which is one of Atmel’s more powerful 8-bit AVR class controllers. This opens up opportunities for added sensory like Ultrasonic, Optical Flow and GPS modes support, RTL (Return To Launch) and waypoint flying as well as much more. The controller also supports up to eight motor outputs, meaning all the mini quads and hexcopters, might want to make some room for new classes of mini racers. So while my airframe of choice finishes 3D printing lets tackle the basic the configuration process.

WHAT YOU WILL NEED

• Mini APM v3.1 with GPS Module
• APM Power Module
• APM MavLink OSD OR APM Telemetry Radio Module
• Computer Running Windows
• Mission Planner latest Version By Michael Oborne
• Traditional PWM Receiver for your specific Transmitter
• AirFrame of your choice (In this tutorial I will be setting up an X-8 Octa Quad)
• Knowledge in operating Windows, and Basic Program Installation
• Knowledge in soldering and access to soldering equipment
• Hot Glue gun
• USB Micro

First off we are going to head over to http://ardupilot.com/downloads/. Here you will find some safety information and at the bottom of the page a list of downloads which includes some helpful tutorials, developer tools, APM Planner and other advanced tools. We are going to focus on Mission Planner. We are going to look for the “Mission Planner Installer – Permanent Link to Latest” at the bottom of the page. This will open up another page and here you will see an orange download button. This will prompt you to save your software. Save it in a location you can easily access like your desktop. Then proceed to install the software and follow the installation procedure.

036-4Now we move on to the basic wiring phase. Figure A shows the wiring diagram for the topside of the board. Figure B was my wiring diagram and Figure B1 shows my solution to the wiring harness that is provided with the controller for the motor outputs. I simply took some breadboard and some header pins, I cut eight 4-pin headers and one 2-pin header. I soldered the BEC output in paral- lel and used the 2 pin-header in the middle to evenly access BEC power from eight ESC’s. Then I jumped the signal pin one pin over to be accessed by the APM on each of the eight headers. I then placed a layer of hot glue over the solders to avoid shorts as shown in figure B2. Hot glue can also be used to ensure the connectors stay plugged into the headers.

038-3A couple of things to note: 5v ion the motor outputs is disabled unless you solder short js2 pad. Doing so will cause you to be unable to flash new firmware on to the board, so I recommend you rely on power to be supplied by the APM’s Power Module input. APM power module usually has a six pin connector that is slightly larger than the connector on the APM mini, but you will need fabricate your own cable as seen in Figure C. Also the diagram is different, reference Figure B3. If you wish NOT to use an APM power module, you can use the supplied cable to steal power off the ESC BEC output rails on the custom breadboard. The GPS should be plugged in to the I2C port if the APM and Telemetry or OSD is plugged into the telemetry port on the bottom of the board. Plugging these modules in should be straight-forward as the small connectors used would require excessive forces to plug them in backwards. Another thing to note before we supply power to the unit is to check solder connections.

Remove all plastic housings and check for bad soldering jobs. I have seen some terrifying sol- dering work done on a GPS Module I purchased online so be sure your source is reliable. Lastly, we wire in our receiver. This board does the job of labeling everything quite nicely and the tradi- tional PWM channel layout should be straightforward.

Now it is time to move into the software phase. Once you have triple checked all the wiring, make sure that all the props are removed. Plug the APM into USB using a USB micro to USB-A and your computer should automatically install drivers for Arduino Mega 2560 or Atmega2560. If drivers fail to install automatically, head over to your Device Manager, under Port (COM & LPT), right click over selected COM device, and click “update driver”, then click “Browse”. Now we navigate to the installa- tion folder of Mission Planner and within the directory you should find a folder labeled “Drivers”. Select it and continue on to install the drivers from the specified directory. Once the APM drivers are installed, open up Mission Planner. Keep in mind that Mission Planner does require internet to load up the latest firmware versions. You should see a COM port dropdown as well as setting for baud rates.

In the drop-down select your device and set the baud rate to 115200. Do NOT click “Connect” just yet. Head over to the “Initial Setup” tab of Mission Planner. Click Install Firmware if the wizard pops up close. Select the firmware that best suits your frame. I will be using the latest Octa Quad firmware. Mission Planner will search for your board, identify the exact model and version and Flash the new firmware. When the progress bar reaches 100% the board will reboot and Mission Planner will report done. Your board now has the latest firmware.

Now it is time to connect Mission Planner to your board. In the upper right hand corner of Mission Planner, click “CONNECT”. If you selected the correct baud rate and COM port, Mission Planner should connect and begin loading the board parameters. Once parameters are loaded, in the Initial Setup tab you should see Mandatory Hardware drop-down.

Here we will calibrate the sensors and trans- mitter, as well as set flight modes and failsafe settings. Be sure to calibrate your accelerometer and your compass. In compass tab there should be a button labeled “Live Calibration” next to a YouTube link with a how-to video to assist you if needed. Now power on your transmitter and move into the Radio Calibration tab. Click the button labeled “Calibrate Radio” and follow the instructions. Moving into “Flight Mode” tab, with your transmitter on, while switching your flight mode switch, observe how the switch position alters which drop down box is highlighted in green. If you are using a three position switch, make sure to set flight modes to those specific drop-downs only, then click save. I usually set Loiter to first position, stabilize to second position, and Acro to third. If you’re a beginner stick with Loiter (GPS Lock), AltHold, and cau- tion when using stabilize. I prefer to stay away from Acro. It’s a good mode to loose or tooth- pick your machine if you’re not an experienced pilot. Lastly is our Failsafe. I usually leave this at default, but it’s relatively straightforward. You choose how you want your machine to behave when a specific failure occurs.

Now that we have all this done, we need to calibrate our ESC’s. The APM has an easy, all-at-once mode you can enter by following a few simple steps. First we disconnect Mission Planner from the controller and unplug the USB cable. Make sure no props are on and turn on your transmitter and set throttle to full. Plug in your main flight pack, the controller should enter a cycle, blinking red, yellow, blue in a loop. Once in the cycle, unplug the battery pack, with throttle still at full, plug in the battery again. The ESC’s will now enter calibration mode, wait for the melody to end and the ESC’s will begin to beep in a loop indicating the high endpoint is set. Now we lower the throttle to zero and the ESC’s should start to beep in a new pattern indicating low end- points are being calibrated. When this succeeds the melody will begin to loop again, this indicates low endpoints are set. If you throttle up you should be able to test  out the calibration and then unplug your battery. We then plug in the battery, plug in the APM to USB and lastly, connect to Mission Planner. Open up Initial Setup and under optional hardware, select Motor Test. Here you can test motors sequentially, to verify your setup. Make sure all motors are rotating in the correct directions. Once everything is checked, make sure your APM is not reporting any errors. It helps to have a telemetry capable radio or OSD over a live video feedback to check the system for errors, as well as monitor GPS count and other valuable information used in flight.

After all this is complete and you have checked your work, throw on some props and head out to the field. If you’re new to flying I suggest your search for a good pre- flight checklist for APM flight controllers this will ensure your first flights are safe and enjoyable. Once you get a little time under your belt with the Mini APM v3.1, programming it will become second nature and you’ll likely find yourself wanting to install one in all of your airframes.

CONTACTS

BANGGOOD banggood.com

Leave a Reply

Your email address will not be published. Required fields are marked *