Hkpilot Mega 2.7: Flight Controller Usb/Gyro/Acc/Mag/Baro
Hkpilot Mega 2.7: Flight Controller Usb/Gyro/Acc/Mag/Baro
Hkpilot Mega 2.7: Flight Controller Usb/Gyro/Acc/Mag/Baro
1
HKPILOT MEGA 2.7
Features:
• 3.3v issue of “bad Gyro heath” resolved in the 2.7
• Connectors relocated for better wire layout
• Mux Port added for OSD or selectable other outputs
• Dataflash swapped voltage lines fixed in the 2.7
• External compass Jumper added
• Arduino Compatible
• Pre-soldered and tested
• 3-axis gyro, accelerometer, magnetometer and high-performance barometer
• Built in 4 MP Dataflash chip for automatic data logging
• Honeywell HMC5883L-TR Digital compass
• Invensense's 6 DoF Accelerometer/Gyro MPU-6000
• Measurement Specialties MS5611-01BA03 Barometric pressure sensor.
• Atmel ATMEGA2560 and ATMEGA32U-2 (processing and USB function).
• Micro-USB
• External compass support
• GPS input, I2C, Power module input
• Port for telemetry radio, OSD and airspeed sensor ports
2
HK PilotMega 2.7 Improvements:
1) 100uf cap in Vcc and 10uf tantalum capacitor added to stop 3.3v bad gyro health issues
2) Replacement of the (not used/redundant) 1.0mm 6p GPS port with df13-4P I2C external compass port, putting the GPS
and external compass ports next to each other, making for easier connections.
3) Multifunction MUX port added in the old I2C port location, this lets users select an output from the bonding pad (Uart0,
Uart2, I2C, OSD “default is OSD”. This new layout makes data transmission more stable with an isolation resistance.
5) External Compass enable/disable jumper added, verses having to cut a trace wire.
The HKPilot Mega 2.7 is based on the rapidly evolving and refined Ardupilot mega or “HKPILOTMEGA”, an open source
project from 3DR robotics. This amazing flight controller allows the user to turn any fixed wing, rotary wing, or multi-rotor
vehicle (even boats and cars) into a fully autonomous vehicle, capable of performing a wide range of tasks even
programmed GPS missions with waypoints (with the optional GPS module).
Various user interfaces are available for programing, reviewing logs, even some Apps for smart phones and tablets. The
optional telemetry radio allows for two way radio communication giving you full control and provides live data back to your
computer or tablet. The list of what this flight controller is capable of has quickly been surpassed by what it cannot, with
features, flight modes and supported platforms. The HKPILOTMEGA project is supported by thousands of users pushing this
open source flight controller to be one of the best systems available.
Specs:
Dimensions: 44x70x15mm (with case)
Weight: 32g (with case)
Includes:
HKPilot Mega 2.7
Connection leads x 5
Case and 3M double sided tape
*Note: The reference to APM refers to the ArduPilot project, a family of open source autopilots based on the
Arduino open source computing platform, developed by 3DR and the open source community. It consists of a choice
of ArduPilot Mega (APM) electronics and a range of free software versions for different vehicles and is governed by
an open source creative commons license. This product is based on the open source APM Project from 3D Robotics,
the Cad files per the creative commons license is available under the files tab.
*Note: This is not an original Arduino brand product.
3
Using the HK PilotMega 2.7 Enclosure
The HK PilotMega 2.7 board requires assembly, and is ready for firmware. You have a choice of side or top entry pin
configuration, in order to accommodate a variety of installations. You’ll see this option when you order.
If you aren’t using the enclosure, make sure to cover the barometric sensor with some open cell foam, cotton padding or
tissue to protect it from prop wash, wind and turbulence. Also, the barometric sensor is sensitive to light and readings can
change by several meters from direct sunlight to shade. Some type of light shield (on top of the foam) will minimize the
effects of light changes.
4
Powering the HK PilotMega 2.7 Board
Like any computer, the HK PilotMega 2.7 needs a power supply with a steady clean voltage and sufficient current.
The HKPilotMega power module that supplies 2.25A at 5.37V. The module is designed to convert power from the main flight
battery (18 volt maximum). That module will supply sufficient power for your HKPilotMega, and low power radios including
your RC receiver (without servos). Your RC receiver can be powered from any flight controller Input (+5V and ground). This
is normally done by connecting a 2 or 3 wire cable between an HK PilotMega 2.7 Input and one of the output channels on
the RC radio.
If you are using any servos such as are required with a traditional helicopter or a camera gimbal, you will need to provide an
additional dedicated power supply for the servos. The HKPilotMega is intended to control servos, not power them.
In order to design a power supply for your HKPilotMega, or provide additional power, you’ll need a basic understanding of
the power circuit in the HKPilotMega.
There are two “sides” to the positive circuit in the board. Each side has positive-rails available for inputing power or
distributing it to peripheral devices. The center row of pins in the three groups of pins (Outputs, Inputs, Analog) labeled “+”
are referred to as a “positive-rail”. This means that the base of all the + pins are connected so they represent a single
electrical path. The positive-rails of the Input and Analog group are connected together. So we have two separate positive
circuits, one in the Outputs and the other made up of the Input/Analog.
All of the components on the board take power from various points on these rails, so it is necessary for both “sides” to be
receiving +5V (within the specs below) for the board to function.
These positive-rails can be joined together by placing JP1 in it’s position on the board. This connects all the positive-rails
ands provides power to both sides of the board, so that low-level power can be distributed to peripheral sensors and
devices: Radios, sonar, RC Rx, etc. via the power-rails.
From the power module connection the negative wire is connected to a negative-rail shared by the entire board regardless
of JP1.
Positive voltage comes in to a T-junction. to the left is a path through the JP1 to the positive-rail of the Outputs. To the right
it flows through an over-voltage, over-current, reverse-polarity protection(500mA fuse and 6V Zener diode). A side effect of
passing through the Zener diode is a .37V loss, therefore input voltage should be bumped up by .37V to account for this.
From here the positive voltage runs to the positive-rails of the Inputs and Analog. Inputs should not be used to power
anything except your RC receiver.
Higher current loads such as servos should be powered from the power-rails (positive-negative) of the Output side. You
must use an adequate voltage-regulator to provide power directly to the Output power-rails, all servo power leads will attach
to these same rails (the signal wires can connect on the Analog “S” pins in the case of a camera gimbal). Since JP1 is
removed in this scenario, the other “side” of the board will need power provided to it’s power-rails directly.
5
A Non technical Description of the Power Supply Requirements
The description below simply supplements and provides an alternate view of the information above.
1. The HKPilotMega 2.7 board has two separate power circuits which make it very easy to power by a variety of
methods.
a. A fused power circuit provides primary board and general I/O power: (It cannot provide power for
servos).
b. The Other power circuit is for the OUTPUT connector power rail: (it can provide power for servos).
2. The jumper JP 1 determines whether the two power circuits are connected or separate.
a. If JP1 is removed, the power rail on the OUTPUT connector “Floats” and may be used to distribute
power.
b. Although if JP1 is removed the OUTPUT connector cannot be used to supply power to the HKPilotMega
board.
3. It is possible to power the HKPilotMega board from the Power Module connector or the OUTPUT or INPUT
connectors.
4. Normally the HKPilotMega 2.7/2.6 “Power Module” is used to provide primary HKPilotMega 2.6 board and general
I/O power.
5. Alternatively primary board power can be supplied by a BEC either from one of the ESCs or from an external BEC.
6. If servos are used, supplementary power is required.
a. Generally one power supply is provided for the board and one or more additional power supplies for the
servos.
b. But if a sufficiently large external BEC is used it can supply power for both via the OUTPUT connector.
7. Only the OUTPUT connector can provide power for servos as the other circuit is fused.
a. The address connector is sometimes used provide servo signals, but the servos power must come from
elsewhere.
8. How you are powering your HKPILOTMEGA board and or servos determines whether JP1 is installed or not.
a. (Whether the two power circuits are separated or connected).
b. All possible configurations are detailed Below.
9. The type of use will determine which options are available.
a. Copter can power the HKPILOTMEGA from a power module or a UBEC or a BEC from one of the ESCs
and can power servos from a UBEC or from the other ESC’s BECs.
b. Plane can power the HKPILOTMEGA from the power module, the BEC from the flight motors ESC or a
separate UBEC and can power servos from a separate UBEC or the flight motors BEC if it is large
enough.
c. Rover can power the HKPILOTMEGA from the power module, the BEC from the drive motor’s ESC or a
separate UBEC and can power the steering servo from a separate UBEC or the drive motors BEC if it is
large enough.
Warning: Connecting USB when you have input voltages at the high end of the range (near Abs Max) can damage the
board. Disconnect battery before connecting USB or test input voltages so they are within the specified range.
No Power Module and No Servos and Power provided by BEC from ESC
If you do not have a power module and you are not using servos.
Ensure JP1 is installed and provide the necessary power via the BEC from one of your ESC’s.
Connect one ESC’s BEC power and ground wires to one pair of the HKPilotMega OUTPUT connectors power and
ground pins.
Clip the BEC power leads on the remaining 3 wire connectors.
6
Ensure that the ESC’s signal wires are connected to the appropriate HKPilotMega OUTPUT connector signal pins.
You must ensure that your ESC’s BEC has a sufficient power capability (at least 2 amps).
Most 20 amp or higher ESCs have 2 amp BECs.
No Power Module but using Servos and a high power External BEC
If you do not have a power module and are using servos you can use a high power external BEC.
Ensure JP1 is installed and provide the necessary power via a high power external BEC (5 to 10 amps or more).
The BEC power must be provided to one pair of the HKPilotMega OUTPUT connector pins.
Warning! Clip all power leads on the ESC’s BECs (they would conflict with the external BEC).
Your servos will determine the size of the BEC required.
You should allow at least 2 or 3 amps extra to power the HKPILOTMEGA, receiver and to prevent (brown outs).
All of the positive power for driving each servo must come from the OUTPUT connector.
This is true even if the servo(s) signal wires are connected to the ADDRESS connector.
This option requires you to take responsibility for providing sufficient power to prevent brownout.
No Power Module but using Servos and multiple BECs from ESC’s (A BEC for each Servo)
If you do not have a power module and are using servos you can use multiple BECs from your ESC’s.
Ensure JP1 is installed and plug one of your ESC’s signal cables with power leads into the OUTPUT connector.
Remove the power and ground leads from the remaining ESCs signal cable connectors.
Plug the signal wire connector from each ESC onto the appropriate pin on the OUTPUT connector.
You can heat shrink these or plug them into a multi-wire connector appropriate for your copter.
Connect one pair of each of the remaining BEC power and ground lines to the power and ground of each
individual servo.
Clip or heat shrink any remaining excess BEC power and ground leads.
The BEC power from one ESC must be provided to one pair of the HKPILOTMEGA output connector pins.
Plug only the signal input wire from your servos into the appropriate OUTPUT or ADDRESS connector pin.
Your ESC’s BECs should be at least 2 amps.
The ESC’s BEC grounds are in common with battery and internal signal ground so grounding the servos this way is
OK.
7
Provide HKPilotMega board and receiver power via the power module connected to the power module connector.
Connect an external BEC with sufficient power for your servos to one pair of the OUTPUT connector power pins.
When connecting your ESCs to the OUTPUT connector clip the BEC power leads on each ESC’s 3 wire connector.
Or connect only the ESC signal wires to the OUTPUT connector.
Power Module and using Servos with BEC power from one ESC
If you have a power module and you are using servos Remove JP1.
Provide HKPilotMega and receiver power via the power module connected to the HKPilotMega’s power module
connector.
The BEC of a single ESC must provide sufficient power for all your servos.
When connecting your ESCs to the OUTPUT connector clip the BEC power leads on all but one of the ESC’s
connectors.
Or connect only the ESC signal wires to the OUTPUT connector for all except one ESC.
And on that ESC connect all 3 wires to the OUTPUT connector.
No Power Module and using Servos with BEC power from two ESCs
If you do not have a power module and you are using servos remove JP1.
Provide HKPilotMega and receiver power via 1 pair of ESC-BEC power wires connected to the HKPilotMega INPUT
connector power pins.
Also connect another of the ESCs power wire pair to the OUTPUT connector.
The BEC of a single ESC must provide sufficient power for all your servos.
Clip the signal power leads on your remaining ESC’s.
Connect all ESC signal wires to the appropriate OUTPUT connector pins.
On the bench, you’ll probably be powering the board via your USB cable while you set it up and test it. But in your aircraft,
you’ll need to power it with your on board power system, which is usually your LiPo battery going through an ESC or the
Power Module. In the case of a multicopter, this can come through your Power Distribution Board (PDB), which will break
out the 5V output from the one of the electronic speed controls (ESCs) or the Power module which is wored directly to the
battery.
In the picture below, the red and black wires are the 5b m hV power cable coming from a PDB. You can plug them into
any two pins along the 5V and Ground (middle and outer) rows of pins on HKPilotMega 2.7’s Output side. The other cable,
which in this case is a four-wire cable with orange and white wires for a quadcopter, is the signal cable to the PDB, which
are the wires that HKPILOTMEGA 2.7 will use to command each of the ESCs.
The picture below is of HKPILOTMEGA 2; but the concept is applicable to HKPILOTMEGA 2.7.
8
It’s also possible to power HKPILOTMEGA 2.7 from two separate sources, one powering the RC system on the input side,
and the other powering the output side (servos or ESCs). This is determined by a jumper on the JP1 pins (see below). If the
jumper is on, which is the factory default, the board is powered from the OUTPUT rail or the USB. If the jumper is off, the
board is powered from the INPUT rail, but the OUTPUT rail will need its own power source. This configuration is used if you
want to have two separate power sources in your aircraft, one powering the servos and the other powering the electronics.
The ideal input voltage is 5.37v +/-0.0v and may not be provided by a typical ESC.
Warning: Do not exceed Abs MAX input voltages when connecting power supply or you will damage your board.
In some cases it may be a good idea to set the input voltage slightly above the median (but below the maximum) to account
for possible voltage drops during momentary high current events.
The HKPILOTMEGA 2.7 by itself draws relatively little current (200ma range) and a power source capable of providing 300 –
500ma will provide plenty of margin. However, if servos or other power consuming devices are being driven by the same
power source you must consider the power requirements for those devices as well and provide plenty of margin to prevent
disastrous “brown-outs”. For instance, a single digital servo can easily draw 1-5 amps depending on it’s size and
performance. (Note: ESCs do not consume power from the HKPILOTMEGA) If you experience spurious resets or other odd
behavior it is most likely due to noisy or insufficient power to the HKPILOTMEGA. As with all logic boards, electrical noise
from the motors, servos, or other high current devices on the power source can cause unpredictable behavior.
Too short or long power wires, bad or old connectors, or insufficient current capability of the HKPILOTMEGA power source
can result in a “brown-out” situation resulting in unpredictable operation. This is particularly true in traditional helicopters
where the collective servos can draw 3-20 amps in short bursts. The power source must be able to accommodate this
without voltage droop or voltage spikes. A quality switching type BEC.
can be a solution depending on overall current requirements. Many of these type of regulators are programmable so
remember to program them with in the safe operating range of the HKPILOTMEGA 2.7 Linear voltage regulators are not
recommended as they are inefficient and prone to overheating and heat induced failures. HKPILOTMEGA 2.7 should never
be connected directly to a battery of any type.
Power source problems are common and can be insidious and frustrating. Be meticulous. Any autopilot or flight controller is
useless and potentially dangerous without good clean power source.
The picture below is of HKPILOTMEGA 2; but the concept is applicable to HKPILOTMEGA 2.6/2.7.
9
Explanation of solder jumper options on the bottom of the board
10
HKPILOT 2.7 Board Features
11
All these pins can take up to 5V and may be used for any general analog input. They are commonly used for airspeed and
sonar inputs.
Pin 12: power management connector current pin, accepts up to 5V, usually attached to 3DR power brick with 17:1 scaling
Pin 13: power management connector voltage pin, accepts up to 5V, usually attached to 3DR power brick with 10.1:1
scaling
Pin 54 to 62: You need to add 54 to the pin number to convert from an analog pin number to a digital pin number. So pin
54 is digital output pin on the A0 connector. Pin 58 is A4 etc.
These pins are usually used with the RELAY_PIN to RELAY_PIN4 parameters, allowing you to control things like camera
shutter, bottle drop etc. They are also used as sonar “stop” pins allowing you to have multiple sonars and not have them
interfere with each other.
Questions about this page? Comments? Suggestions? Post to HKPILOTMEGA Forum! Use the platform specific to your query,
and make sure to include the name of the page you are referring to.
12
HKPILOT Mega v2.7 DIAGRAM
Radio Telemetry
External Compass
Jumper
GPS
External
Compass(I2C)
13
1hobby.com
Replacement/Repair Centre.
14/F, Kerry Warehouse (Shatin)
3642
Shan Mei Street
Fotan, Hong Kong
Phone: +852 3586 0327
Fax: +852 3586 0704
14