Megapirates APM Vampire Hexicopter on Multiwii PARIS v5 MEGA 2560

Megapirates already supplies a great flashtool for configuring your sketch and uploading to the board, you can find it here.

However, for those of us with more … unique … airframes, such as the Multiwiicopter Vampire (H-Hex) we need to configure a custom motor mix. This is because the middle motors must not be used for yaw, only roll and lift, or else the craft behaves oddly.


Here are the sketch files required for a vampire with custom motor mappings pre-set. Click here to download.

How to upload:

  • Unzip folder to C:\ (must be C:\ because the file names must be less than 255 characters)
  • Run C:\vampireunzip\Ardupilot-aruino1.0-3mpngpatched\arduino.exe
  • Select ArduPilot menu > HAL board > MegapiratesNG
  • Select board: Tools > Board > Ardupilot MEGA 2560 or Mega ADK
  • Select serial port: tools > serial port > (your port)
  • File > preferences > sketchbook location – set this to the source code root folder, eg: C:\vampireunzip\ardupilot-mpng
  • Close and restart Arduino software
  • File > sketchbook > Arducopter
  • click verify – should say ‘done compiling’ – if not you’ve done something wrong.
  • Upload the sketch to the board

If you would like to make your own custom motor mix, you need to change the AP_MotorsHexa.cpp file, here are the settings for the Vampire:

// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
/*
 *       AP_MotorsHexa.cpp - ArduCopter motors library
 *       Code by RandyMackay. DIYDrones.com
 *
 *       This library is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU Lesser General Public
 *   License as published by the Free Software Foundation; either
 *   version 2.1 of the License, or (at your option) any later version.
 */

#include "AP_MotorsHexa.h"

// setup_motors - configures the motors for a hexa
void AP_MotorsHexa::setup_motors()
{
    // call parent
    AP_MotorsMatrix::setup_motors();

    // hard coded config for supported frames
    if( _frame_orientation == AP_MOTORS_PLUS_FRAME ) {
        // plus frame set-up
        add_motor(AP_MOTORS_MOT_1,   0, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  1);
        add_motor(AP_MOTORS_MOT_2, 180, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 4);
        add_motor(AP_MOTORS_MOT_3,-120, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  5);
        add_motor(AP_MOTORS_MOT_4,  60, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 2);
        add_motor(AP_MOTORS_MOT_5, -60, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 6);
        add_motor(AP_MOTORS_MOT_6, 120, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  3);
    }else{
        // X frame set-up
        add_motor(AP_MOTORS_MOT_1,  90, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  2);
        add_motor(AP_MOTORS_MOT_2, -90, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 5);
        add_motor(AP_MOTORS_MOT_3, -30, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  6);
        add_motor(AP_MOTORS_MOT_4, 150, 0, 3);
        add_motor(AP_MOTORS_MOT_5,  30, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 1);
        add_motor(AP_MOTORS_MOT_6,-150, 0,  4);
    }
}

Thanks to Dave for his work setting up the custom motor mixes!

Leave a Reply

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