3m pilot multiwii megapirateng mwc flight controller

Tony_Ba

Кто настраивал его или заливал новую прошивку ?? Поделитесь опытом .
У меня после заливки MultiWii2.4 - Идет постоянные ошибки I2C в multiWiiConf.exe от -32000 до 32000 и гироскопы сума сходят . В прошивке выбираю #define CRIUS_AIO_PRO - так как очень похожи.

Tony_Ba

Сам нашел - как прошить мега пиратом - помогло - хотелось с мультиви конечно

3M Pilot Flight Controller
The “order” (or lack of” of this document is related to a random manner in which I approached this
project and often simply which piece I chose to try to connect and get working first. Apologies. Gems
throughout but you may have to read through it all to get something you need right from the start.
I ordered a 3M Pilot flight controller from www.goodluckbuy.com
Specifically I ordered the full setup with ultrasonic and gps sensors.
goodluckbuy.com/3m-pilot-multiwii-mwc-flight-contr…
I received the 3M Pilot board, the GPS board (which says lea-5h on the module, not 5h), the GPS
antenna board and the ultrasonic sensor along with 3 pin cables to connect the 3m Pilot flight controller
board to the RC receiver and a 4 conductor micro mini JST connecter cable to connect the GPS to the 3M
Pilot board. Also included was a USB to micro USB cable.
No documentation. No instructions. You are on your own.
What have I gotten myself into…
So this is my saga with documentation along the way that hopefully save someone else a little effort.
Lets start with why I bought this. I have an X525 quadcopter that came with a KK Multicopter board. I
have had some success flying it but have consumed MANY props and really want something more stable
to fly, especially with cameras onboard. Tired of crashing and destroying things.
So the first question I have about my new board is what firmware is it running and how is it configured.
Specifically the board claims to be capable of running MegaPirateNG or Multiwii software… so what
does it come with.
Fortunately I have spent some time around Arduino boards and knew this was a form of Arduino board.
So to answer my question I hooked the board up to my Windows 7 PC with the USB cable. That supplies
power to the board and drivers install automatically. Wait for it to install the drivers. It looks like a COM
port, in my case COM5. I ran the Arduino 1.01 environment and under Tools>>Serial Port I selected
COM5. That lets the Arduino software talk to the board. Then I wanted to see what the board was saying
so I selected Tools>>Serial Monitor in the Arduino software. I saw junk and realized the baud rate was
probably wrong so I selected 115200 baud at the bottom left of the serial monitor window. I also
unchecked Auto Scroll so I could watch things go by at leisure. Then I hit the reset button on the 3m
Pilot board. Here is what I saw (with a few junk characters edited out)
Init MegaPirateNG V2.6 R6
Free RAM: 2742
FW Ver: 118
----------------------------------------
load_all took 756us
Press ENTER 3 times for CLI
GROUND START
----------------------------------------
G_off: 0.03, -0.01, 0.00
A_off: 0.00, 0.00, 0.00
update:35: gps read timeout 5920 0
GPS
----------------------------------------
disabled
Ready to FLY
So, first mystery solved, the board came with MegaPirateNG V2.6 R6 it seems. One step forward. The
only other blog I have read about the 3M Pilot indicated they had MegaPirateNG V2.7 R4. At the time of
writing, the “featured” downloads on the MegaPirate site at code.google.com/p/megapirateng/
are 2.8 R3, 2.7 R4, and a couple of 2.5 versions… I may want to upgrade to the 2.8 R3 along the way but
plan on getting this one working before I tackle an upgrade of the firmware.
So then I researched MegaPirateNG and found it is a spin off from Arducopter and you can use the
Ardupilot Mission Planner to talk to the device. I downloaded and installed Mission Planner which I
found at the Ardupilot Mega site at code.google.com/p/ardupilot-mega/downloads/list. I
downloaded and installed version 1.2.51 and on initial launch it told me there was an update which I let
it install and I am now running 1.2.52 apparently. It installed under the Start Menu APM Planner which I
presume is Ardu Pilot Mission Planner. Mission Planner required Java and .NET 4 installed on Windows.
Running mission planner with the 3M Pilot board still connected via the USB to micro USB cable I
selected COM5 as my port and set the baud to 115200 and clicked Connect.
It works. I could move the board around and watch the artificial horizon move as well.
I clicked on Configuration and then on ArduCopter Level and it indicated it was in Frame Setup X which is
what I wanted so no change required.
It indicated NO GPS so that led me to connecting the GPS. Back to hardware hookup.
GPS Hookup
The GPS board has an antenna that plugs into a tiny connector on the u-blox lea-6H GPS board.
Then there is a 4 conductor cable that plugs into the GPS board and connects it to the 3M Pilot board.
The trick here is that the 4 pin plug plugs into the middle 4 pins of the 6 pin GPS connector on the 3M
Pilot board. WARNING: You can miss and plug it off to one side and that may fry things on either the 3M
Pilot or the GPS board. Get it right. Make sure power is off when you plug it in. The cable won’t plug in
upside down but it will plug in offset either way. I believe that other GPS modules like the MTK use an 8
pin connector that matches this one, it just happens this matches the middle 4 pins. ````
Once connected I plugged back into the USB cable and launched Mission Planner and clicked Connect.
Port and baud rate were remembered and worked. Mission planner now says… NO GPS… crud. So I went
into the Terminal Window on Mission Planner and poked around in there. There is a test command. Lets
start there. I typed test then at the test prompt typed ? and return to see what tests were available.
Started with rawgps
I saw a screen that was receiving something every second and it looked similar to this eventually. This
strikes me as a baud rate mismatch in the GPS module and what looks like NMEA strings from the GPS at
the wrong baud rate. I was very brave and unplugged the GPS board and the stream stopped. I plugged
it back in and it started. I was on the right port on the board for GPS but the 3M Board did just not
understand the GPS board. As far as I can tell there are two solutions to this. Talk to the u-blox lea-6H
GPS board and set a new baud rate or download new MegaPirateNG code to the 3M Pilot board which
involves many code adjustments and many settings that I may not understand or have correct. I wasn’t
ready for that so I opted for modifying the GPS board baud rate as I have had some experience with that
from previous projects.
Getting the u-blox GPS set correctly for the 3M Pilot was a bugger. Not for the faint of heart. Extra
hardware and software required. Again, because I had experience with Arduino before I got into
quadcopters, I had some bits around that let me press through this. I needed the u-blox u-centre utility
to talk to the lea-6h module and I needed what is known as an ftdi or ft232 cable. This is a usb to rs232
converter and this provides power to the module, installs a virtual COM port (this is essentially what is
built into the 3M Pilot board but we need it alone to hook to the GPS module). Cabling the GPS to the
FTDI turned out to be pretty easy. I cut my cable in the middle, stripped the twisted and soldered the
wires back together then soldered them onto a 4 pin molex header in the right order to plug right onto
the FTDI adapter. WARNING: do not plug both the 3m Pilot board and the FTDI adapter at the same
time. One or the other. Not both. You can see the wiring from the GPS to the FTDI adapter in the
picture: Black to Gnd; Yellow to Rxd; Green to Txd; Red to Vbus; Note I am using the middle 4 pins of the
FTDI and polarity is VERY important. Revers it and it fries probably. Note in the picture the 3m Pilot
board is NOT connected at the same time as the FTDI is plugged into the GPS module. Also note that my
instructions mate wire colours but if your wire colours are not in the same order you have to adjust.
What is important is the order of the wires in the GPS connector.
Plug the FTDI into your USB port and the green light on the GPS should come on. If not unplug
immediately and check your wiring. If you get a green light let it sit for a couple of minutes on first
plugin to let Windows install the COM port driver before launching the u-center program.
Run the u-center program, select the COM port (mine was COM6, it will be different than the 3M Pilot
board, don’t get mixed up), select the baud rate (default is 9600) it should connect to the gps module
and execute the following u-center commands:
Go to Message view (View->messages view):
MAKE SURE TO CLICK SEND IN THE LOWER LEFT CORNER AFTER EACH CHANGE!!

  1. Right Click on the NMEA Text on top of the tree and choose disable child messages SEND
  2. Choose UBX=>CFG=>NAV - set the Dynamic Platform Model to use Pedestrian. SEND
  3. Choose UBX=>CFG=>NAV2- set the Dynamic Platform Model to use Pedestrian. SEND
  4. Choose UBX=>CFG=>NAV5- set the Dynamic Model to use Pedestrian. SEND
  5. UBX=>CFG=>PRT - set USART1 to 38400bps and make sure ALL the protocol settings are on
    UBX+NMEA!! SEND
  6. Change the baudrate of U-Center to 38400bps if the connection is lost at this point SEND
  7. UBX=>CFG=>RATE(Rates) - change the Measurement Period to 200ms This gives a 5 Hz position
    update since 5 x 200ms is one second. SEND
  8. UBX=>CFG=>SBAS : Disable (SBAS appears to cause occasional severe altitude calcuation errors) SEND
  9. UBX=>NAV (not UBX=>CFG=>NAV): double click on POSLLH, STATUS, VELNED. They should change
    from grey to black. SEND
  10. UBX=>CFG=>CFG : save current config, click “send” in the lower left corner to permanently save
    these settings to the receiver.
  11. go to Receiver=> Action=> then click Save Config. Otherwise, every time you unplug your gps, it
    will revert back to the original configuration.
    Success… and failure… sort of… Mission Planner came up and showed me where I was located this time
    and indicated a GPS with 3D lock. Wuhoo…
    The joy was short lived. Then it stopped recognizing the GPS on startup. I have looked at the MegaPirate
    code and there are options to tell it what sort of GPS you have and one option is AUTO which I suspect
    tries to determine if it is an NMEA stream or a ublox GPS data stream. I am guessing this auto is not
    working great.
    Sonar board hookup:
    So it came with a sonar board labeled HC-SR04 which appears to be a pretty standard looking board as
    far as I can tell. The board has 4 molex pins labeled on the board as Vcc Trig Echo Gnd. The Sonar
    connects to the 3m Pilot board to a small 4 pin connector on the underside of the board (below the USB
    connector) with pins labeled Gnd 5v 9 10 and the mapping from Sonar board to 3M Pilot connector is:
    Gnd to Gnd; Vcc to 5v; Trig to 9; Echo to 10
    You will need a 4 pin molex connector on one end and a micro mini 4 pin JST or ZH connector on the 3M
    Pilot board end. I had a cable that had the required connectors on each end, but the micor mini jst end
    was not in the right order. The answer is to swap the red and the green wires.
    In Mission Planner you would enable the Sonar in the Hardware Configuration screen and set it to XLEZ0
    I decided I was wasting resources on the MegaPirateNG V2.6 So…. I am putting the latest MegaPirateNG
    code on it and explicitly setting the options. First task is to identify what the 3M Pilot has on board so
    we know what to “define” in the code.
    Here is what GoodLuckBuy indicates is on the 3m Pilot board:
  • MCU: ATMEGA 2560
  • IMU: MPU-6050
  • MS5611 pressure sensor
  • 5883L COMPASS
    Looking at the MegaPiratesNG code the FreeIMU 0.4.1 board has:
    MPU6050
    MS5611
    5883L
    Looking at the Crius AllInOne (AIO) v2 board specs for comparison:
    ·ATMega 2560-16AU Microcontroller
    ·MPU6050 6-axis gyro/accel with Motion Processing Unit
    ·HMC5883L3-axis digital magnetometer
    ·MS5611-01BA03 highprecision altimeter with metal cap
    And to confuse matters, the CRIUS V1.x board specs:
    ATMega 2560 Microcontroller
    MPU6050 6 axis gyro/accel with Motion Processing Unit
    HMC5883L 3-axis digital magnetometer
    MS5611-01BA01 high precision altimeter
    So we have 3 choices but the post on the rcgroups.com forum site titled 3M Pilot and MegaPirateNG
    indicates some success was had by others using the FreeIMU board type so I am starting with that.
    I just bit the bullet and upgraded to MegaPirateNG V2.91 R300 beta… and now things seem to be
    working better. I tried the “released” V2.8 R3 and that wa virtually un flyable I am afraid.
    The first step is getting the beta code down to work on. That was not as easy as the released code which
    is in a nice zip file. I installed TortoiseSVN which is a software revision control and is a Windows
    extension that adds extra Right Click menu options to Windows Explorer. You install TortoiseSVN, create
    a new folder, right click on the folder and select TortoiseSVN >> Export to grab your own copy (i.e. you
    are not working on the code as part of the project you are just using it as is)
    It prompts for a URL of the repository, I used
    megapirateng.googlecode.com/svn/beta/2.9.1
    Here is what my dialog box looked like:
    In order to compile and download the code (after the mods below) you need the Arduino environment.
    Download the Arduino 1.01 program environment and extract it all and copy it into this folder so you
    end up with a folder that looks like:
    Now copy the libraries folder and paste it into the Arduino folder saying yes to merge and yes to replace
    all existing (there is a check box to do this for all) each time you are prompted.
    You are now ready to modify the beta code in the ArduCopter folder to work with your 3M Pilot board.
    Edit APM_config.h
    Set the board type by making the line read:
    #define PIRATES_SENSOR_BOARD PIRATES_FREEIMU_4
    My radio (FlySky CT6B cheapie that works just fine) required a couple of changes:
    #define SERIAL_PPM SERIAL_PPM_DISABLED
    #define TX_CHANNEL_SET TX_mwi
    My u-blox lea-6h GPS module required the following change:
    #define GPS_PROTOCOL GPS_PROTOCOL_UBLOX
    Because of a physical board installation error on my quad, I ended up with the board pointing in a +
    (Plus) configuration rather than my normal X config. That meant I had to edit the line to read:
    #define FRAME_ORIENTATION PLUS_FRAME
    I also made a change (gleened from the forum posting) in config.h to make the 3M Pilot status LEDs
    A,B,C work:
    #elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
    # define A_LED_PIN 27 // for 3M Pilot
    //# define A_LED_PIN 13 // for Pirates
    # define B_LED_PIN 26 // for 3M Pilot
    //# define B_LED_PIN 31 // for Pirates
    # define C_LED_PIN 25 // for 3M Pilot
    //# define C_LED_PIN 30 // for Pirates
    If you do not make this change then you do not have indicators LED B and LED C and LED A is the white
    LED on the board. More on LED’s later.
    Once you have the code changes made you need to hook your 3M Pilot board to your PC via the micro
    USB cable connector, run the Arduino 1.01 program, select the COM port with Tools>>Serial Port (COM5
    for mine) and set the board type Tools>>Board Type (use Arduino Mega 2560 Mega ADK). (Failure to set
    the board type will result in a lot of undefined errors on upload.) Use File>>Open to open the
    ArduCopter.pde file in the Arducopter folder then click Upload button. This compiles the code and
    uploads it to the 3M Pilot board.
    GPS seems to work. Things seem stable.
    So the next trick was installing the RC radio and the Motor ESC’s on the board.
    The radio is not a simple 1,2,3,4 mapping so watch out. Here are the connections from the receiver to
    the 3M Pilot board:
    ch1 -> A9
    ch2 -> A8
    ch3 -> A10
    ch4 -> A11
    The ESC hookup is dependent on the configuration you are using. Easiest way is following the
    readme from the MegaPirateNG source in image and text format as the image format lines up
    nicely and text permits searching:
    *** Motor mapping ***
    motor mapping (maximize your text viewer or disable word wrapping to avoid
    line breaks)
    ---------------------------------------------------------------
    Pin D2 D3 D5 D6 D7 D8 D11 D12 - Arduino pins
    CH 3 4 1 2 7 8 10 11 - MegaPirate output channel
    ---------------------------------------------------------------
    TRI S BC RC LC - - - -
    QuadX LFW RBW RFC LBC - - - -
    Quad+ FW BW RC LC - - - -
    Hexa+ BLW FRC FW BC FLC BRW - -
    HexaX FLW BRC RW LC FRC BLW - -
    Y6 LDW BDW RDW LUC RUC BUC - -
    Octo+ FRC BRC FW BW FLC BLC LW LW - Map changed since v2.0.39
    OctoX RRFC BBRC FFRW BBLW FFLC LLBC LLFW RRBW - Map changed since v2.0.39
    Quad8X BLUC BLDW BRUC BRDW FLUC FLDW FRUC FRDW - Support added in v2.0.36
    Quad8+ BUC BDW RUC RDW LUC LDW FUC FDW - Support added in v2.0.36
    -----------------------------------------------------------------
    Motors description:
    B- back
    R- right
    L- left
    F- front
    U- upper
    D- lower
    W- clockwise rotation
    C- counter clockwise rotation (normal propeller)
    S- servo (for tri)
    Example: FLDW - front-left lower motor with clockwise rotation (Y6 or Y4)
    Status LED’s
    There are a number of LED’s on the 3M board and here is what I have figured out so far. The
    actions below assume you made the change to config.h as described elsewhere in this note. If
    not, then the White LED near reset is the same as the red LED A and you do not have LED B
    and LED C.
    Power LED: Blue near USB connector. Comes on when the board has power. There are 2
    White LED: Beside reset button. Flashes a couple of times on power up.
    Tx LED: Blue; Flashes when data transmitted from 3M Pilot to USB connected device
    Rx LED: Yellow; Flashes when the 3m Pilot board receives data
    LED A: Red; Flashes on reboot, goes out, Slow Flashing Disarmed, On armed
    LED B: Yellow; Don’t know what it does…
    LED C: Blue; GPS Status, Off NO GPS, Flashing GPS no fix, Solid GPS 3D Fix
    Now that you have the code installed on the board time to close the Arduino program and go
    into Mission Planner and do some calibration and setup before flying.
    In Mission Planner set the COM port (COM5 in my case) and Baud 115200 and then click the
    terminal button. You should see text from the board as it boots up and tells you its version
    number etc. Once it is done type setup to put you in the setup mode.
    Type erase to clear the board storage area so you are not using old firmware values. That takes
    a minute or so.
    Type level to set the level reference point (make sure the board is level when you do this)
    Type accel to calibrate the accellerometers and follow the prompts to put the board level, on its
    nose, sides, back and upside down.
    Done with the terminal mode setup.
    Click on Flight Data and Click Connect. After the connect process click on the Configuration. In
    there you need to do a Radio Calibrate to make sure it knows your signal levels (hint: when
    doing the calibrate I was seeing nothing… that’s when I realized I had the SERIAL_PPM
    APM_config.h value wrong…well, that was after I remembered to turn on my radio)
    Also do some hardware config and make sure the GPS is enabled, auto declination is enabled,
    and the Sonar is enabled and set to XL-EZ0
    I also set flight modes… I set them all to Stabilize and checked the Simple option and I
    recommend this until you get flying and then you can experiment with loiter and Pos Hold
    modes.
    You are ready to fly. This is not an indoor toy. Wide open space and soft ground recommended
    for first flights.
    Power on your radio, throttle to zero, plug the battery into your quadcopter, arm and fly!
    Arming and disarming
    When the board first turns on it boots, then it is disarmed for safety. Once it has finished the
    boot sequence you move the throttle to the bottom right for 3 seconds. The armed LED A (and
    LED B as it initializes first time) will flash then come on solid.
    To disarm, hold the throttle stick to the bottom left for 3 seconds. The armed LED will go from
    solid to flashing.
    GPS indicator (LED C) is flashing until it gets a 3D fix… even when it has a 3D fix it takes a
    while to settle down and get an accurate location… don’t be in a rush to go to GPS mode. I
    have no idea what happens if you go to GPS mode without a fix… as soon as it gets a fix it
    probably tries to go where it thought it was at launch and takes off cross country…
    The board will also disarm if it sits idle for 10 seconds.
    Start slowly… a valuable lesson I learned the hard way is do NOT watch AWESOME pilots
    flying their quadcopters on YouTube before you go out to fly… that leads to broken parts…
    props at least, frames and motor mounts often, whole quadcopters sometimes… Oh and they
    are wicked dangerous, I have scars from learning that some boards arm during calibrate
    procedures…