MegaPirateNG 3.0.1 R2 – Public Release

MegaPirateNG 3.0.1 R2 is now available for all. You can download zip file or get sources at GitHub.

Please post all bugs and feature requests in GitHub issue tracker.

Who want to contribute some code, you can done it via GitHub Pull request.

Current bugfixes in upcoming R3:

  • Added ability to use Serial1 in UserCode.pde
  • Added ability to disable internal compass (to use external) in AP_IntertialSensor_MPU6000_I2C.cpp
  • Added ability to select MPNG compatible boards in APM_Config.h
  • Added ability to change Serial2 port speed in APM_Config.h
  • Fixed Serial2 initialization (RXD pullup enable)
  • Fixed GPS driver selecting in APM_Config.h (from AC 3.1)
  • Main loop rate lowered to 100Hz (from AC 3.1)
  • Fixed pin mapping for Copter LEDs and Voltage&Current sensor

54 thoughts on “MegaPirateNG 3.0.1 R2 – Public Release

  1. Yesterday, maiden flight with MegaPirateNG 3.0.1R2. Despite some vibration problems the first flight went very well. I started with the PID values ​​of version 2.9.1 that have been proven correct even on 3.0.1.
    Stable and correct flight, after adjusting the drift on the axes.
    The loiter is very accurate and stable even continuously turning the quadcopter with the rudder, both clockwise and counterclockwise.
    RTL effective, even if vibrations, that I will fix, have caused an instability of the vehicle during the rotation, without creating, luckily, flight problems.
    I discharged two batteries of pure enjoyment in flight.
    Congratulations for the great work on porting MPNG under HAL and thanks for the time dedicated to the project.

  2. Thank for all who support project!
    And can you add an option to the “LPF”, like MWC as to allow the sensor to filter out vibrations

    1. The option to change the low pass filter is already present and editable in parameter INS_MPU6K_FILTER through Mission Planner. The default value is 20Hz (INS_MPU6K_FILTER = 0) but can be changed by entering the value in Hz from those available.

  3. Great! Can’t wait for R3 so I can try it on my copter. Although I should probably upgrade to the newer multiwii board for the better sensors anyway. The barometer accuracy is much better from what I heard.

  4. Just tested 3.0.1 R2.

    Tested almost all manual and automatic functions: STAB, LOITER, AUTO, GUIDED, RTL, LAND, ecc. without any problem….and without noting any difference with Arducopter.

    You’ve done a good job! Compliments to the team!

    Luciano

  5. What is the current problem with pin outs? i got with R2 rssi on 0 working, current on 1 working and voltage on 13 working, i want to add a buzzer and led and wonder if the pin outs will work as well.

    1. Hi ,

      I did the chnges in the in the config.h and what happens is the leads do their function but the yaw stick doenst work anymore ..any ideias please ?

      Best regards

  6. Trying to get “copter leds” working for external indication , just like it was in 2.9 , but no luck. Is it supported (or planned for future ) on Crius AIOP2 ?
    Thanks.

    1. read my post in RCG, i chaneg config.h for led an buzzer on an5 an6 an an7, tbe arm and gps leds work but the buzzee doesn’t. how do i make buzzer work with leds? i put 127 on led_mode, should i put something else?

  7. Downloaded yesterday, flashed into my CRIUS AIO Pro v2 board. Flew today and within 5 mins it crashed. Must admit that only after switching from Stabilize to AltHold and later even to Loiter. Even stabilize was really amazing compared to older FW. All motors stopped in the air and my hexa fell down from 8 meters. Luckily just one arm broken and notjhing else. On the ground red and green LEDs were solid on, board wasn’t responding to radio at all. After turning off and back on again everything just worked fine. After reading discussions around bugs in MPNG it is clear that this is a bug and it will happen again. My strong suggestion for everyone with Crius boards is to wait for new release of MPNG, probably 3.0.1 R3. Or to go back to 2.9.1b R8 from “paku” (https://code.google.com/p/megapirateng-add-ons/downloads/detail?name=MegaPirateNG%20Add-Ons%20V2.9.1b%20R8.158%2020130701.zip&can=2&q=). And it’d be worth marking 3.0.1 R2 here as ‘beta’ or ‘experimental’.

    1. Yes a lot of people encountered this bug. Looks like it Magnetometer problem or related to Compass Learn or CompassMot features.
      You must do all things to decrease magnetic interference by motors wires. Also you must lower vibrations. All who made this never seen this bug again.

      But I’m still working on it in order to find where the problem in code. The main problem – I’m cannot reproduce this bug on my all three boards (Crius v1, v2, BlackVortex). I’m will not publish R3 while this bug not fixed.

      1. Maybe you should increase magnetic interference and vibrations manually to reproduce this bug?
        I have HK Multiwii and Megapirate AIO Flight Controller V2.0, have no problem with MPNG 3.0.1 R2 and can not reproduce this bug too.

      2. My quad runs fine with the new 3.xx. Never had a problem with the compass nor vibrations with MPNG 2.8R3. I don’t understand why people with the APM even have this “compassmot” monkey business. Note my Crius board is mounted on an 50g alum plate to dampen vibrations and then it is bolted through rubber isolators to the chassis. In addition, all of my motors are on vibration isolators. The APM has been out for a couple of years and the users of it are STILL fumbling with common sense requirements like dampening and the isolation of vibrations.

        1. Just need to add. Got lots of flying in today. Problems. In loiter, quad started to progressively wobble out of control. Quad had been airborne for about 4 minutes. Landed before almost flipping. Next flight quad was airborne about three minutes,about 30 meters away and control got sluggish. Crashed with severe damage…Oh well! Crius v1.1 FC.

  8. Had 4 crashes today.

    1. Copter on loiter flew first like a charm. then i tried return to home it looked great as well. until the copter took off on maximum throttle, i quickly switched off the return to home and took back control. the copter then disarmed in middle air. on touch down i regained the copter but the board hung. no flashing lights anymore it was only be able to get the board going with powercycling again.
    2. When the copter was on pos hold it took off again and crashed directly after. Board hung again.
    3. one of the motors was not running at full speed even i have my ESC’s calibrated. this resulted in the quad flip over on take off.
    4. Copter crashed in middle air when i hovered and want to lower the throttle to bring it back to the ground. the copter didnt survive this crash from 20 metres.

    This 3.0.1 R2 is NO GOOD ! please others dont try this.

  9. Hi,

    This firmware work very fine On aiop pro v2 !! I had no problem , loiter is great, alt hold and RTL too.

    3.01 r2 work better than 2.8 , 2.9 firmware (r7 and r8 version is very dangerous!)

    Note : my ECS is close to motor , not board .

    1. Hi zips,

      I Tried it on Crius AIOP V2 – But all i could get is the red light flashing twice after board boot.

      When flashed multiwii 2.2 it worked great and the quad flies perfect.

      I really didn’t understand the part on APM_config.h:
      “If you used to define your CONFIG_APM_HARDWARE setting here, it is no longer
      // valid! You should switch to using a HAL_BOARD flag in your local config.mk.”

      So when i tried to disable the GPS or Change setting on APM_config.h i got compilation erros.

      What is the config,mk file and what is the new way to change hardware settings.

      Thanks for the help,
      NitBeat

    1. @lion13ch: the “bug” is a common one – but its not really a bug its a timing/ processor workload problem.
      But things should be getting better again with the upcoming releases as there were made some code optimizations

      So if you have the crius: get the R3!

  10. Sir Alex, Excellent! Runs great. Compass, yaw control, GPS; no problem. Will exercise loiter, etc when my new 4s battery arrives. I’ve been waiting all year for this version utilizing the 3.x ArduCopter code and HAL.

    A few glitches in the compile; just config settings. Resolved after reading the install notes. I did discover a problem with the copter LEDs though, and I see there is a fix in the works for R3.

    LEDS; for my Crius board I modifed my 2.8 code to use pin 35 (this was before I learned about the “Motor LEDs”) .

    Additionally, I don’t understand what all the fuss is about with the compass. I’m running a Crius v1.1 board and my compass is rock solid; yaw is rock solid. I think the APM has EMF issues.

    Unfortunately, a crash destroyed a cell in my battery so I had to modify the battery to a 3s. Doesn’t have quite the horsepower with 3s (will get a new 4s battery ASAP), but the v3.0.1-R2 did just as well as v2.8-R3 (actually better) with no PID changes which I’ve been running for months.

    Great job!

    1. Hi tomb!
      Can you please share your harware config details a bit more?
      I am struggling with Crius AIOP V2 with MegaPirateNG 2.8.r3 compass issues. You say you have rock solid compass and that’s what I really want to achieve, but no luck for 3 multis built so far.
      My setups are:
      2 medium size hexas with HK F30A ESCs under the base plate and one small sized quad with 4in1 20A ESC combo also under the base plate.
      All 3 multis have CRIUS AIOP v2 fastened to the base plate with HK double sided sticky 4mm foam tape.
      All 3 have perfect hovering and whatsoever, but I cannot use modes like Loiter and WP navigation due to “current heading” is all over the place in Mission Planner. I have even tried to disable compass completely (with a crash following ofcourse :) )
      Tried all ways to calibrate the compass, but still: until I arm a copter – heading reading is standing still, after arming it drifts, when motors spin – it jumps randomly.
      So my question is: HOW does your setup look: what ESCs, where you put them, how do you dampen your board, do you have any EMC absorbing case or whatever?

      I really hate the idea of an external compass sitting on a mast and what to make my setup neat, so PLEASE share :)

      Thanks in Advance!

      1. Just went flying today. Runs great.
        lluf, my quad has the Crius v1.1 All-In-One board, RCTimer 40A ESCs. 4s 5000mAh battery. Tiger MS2814-770 motors. XBee pro for telemetry. Crius CN-06 GPS. Separate linear 2amp BEC supplies power to the FC and electronics (provides a clean stable 5v power). And as of yesterday, new style APC 12×4.5MR and MRP props. ESCs are mounted about four inches from the FC on each arm. The FC is hard mounted on 1/2 inch plastic standoffs to a 1/8 inch x 50mm x 80 mm alum plate to provide increased mass and dampening. This is mounted using vibration grommets (made by Keystone and sold by Digikey) to a 3 x 6 x 1/8 plate to provide isolation. All of my motors are mounted using same vibration grommets for isolation. I suppose the aluminum helps shield EMI/RFI. Any magnetic interference is probably self cancelling since the ESCs and motors on my quad are equidistant form the FC. I don’t understand why people using the APM and megapirate are having problems with their compass.

        I am now running v3 of megapirate, but prior I was running v2.8r3 and never had a problem with the compass or yaw control. Be sure to calibrate the compass by rotating it 360 degrees through the X,Y and Z axis in MissionPlanner config. Set declination (http://www.ngdc.noaa.gov/geomag-web/#declination). For me in Illinois, I enter -2 and 41 minutes.

        Good luck!

      2. Additionally, finished flying today. Not so good results. Position hold was good but had problems when using loiter. I have my channel 6 to go from stabilize to position hold at 1500ms to loiter at 1700ms
        1.Four minutes into a flight the quad started to gyrate until it eventually flipped. This was repeatable. Got it to the ground before any damage, but 2.Last flight was up to about 40 feet when the quad’s response became sluggish and started to fly away. Had to crash it to bring it down.

        Fortunately, my quad is built to take a crash, but this crash from 40 feet onto concrete damaged the main strut. Will have to make a new one. Amazingly, the FC and electronics which were in a tough enclosure were still running when I recovered the quad.

        Should also add I am now using ROAR hardcase LiPos; no damage to the battery at all. The battery is a Vant 5000mAh hardcase 4s 40C from dirtcheaprc.

  11. Red Led on Crius V2 (A) flashing twice.

    I Tried it on Crius AIOP V2 – But all i could get is the red light flashing twice after board boot.

    When flashed multiwii 2.2 it worked great and the quad flies perfect.

    I really didn’t understand the part on APM_config.h:
    “If you used to define your CONFIG_APM_HARDWARE setting here, it is no longer
    // valid! You should switch to using a HAL_BOARD flag in your local config.mk.”

    So when i tried to disable the GPS or Change setting on APM_config.h i got compilation erros.

    What is the config,mk file and what is the new way to change hardware settings.

    Please help me understand what i’m doing wrong or what i’m missing.

    Thanks.

  12. HI, sometimes i get “bad compass health” error message on mission planner 1.2.83. Board in use: Crius V2. Megapirate version: 3.1-rc4 inplane Mode. Thanks for porting latest version of ardupilot . thanks

  13. Guys, just to add my input here..
    It clearly says in the documentation of AC 3 that you must keep the compass away from all EMF.

    So it may not have been an issue for those of you who were running 2.x before, but when you move to 3.x, you must use compassmot to check for the level of interference.

  14. Good afternoon.
    Please tell me when the release will come out MegaPirateNG 3.0.1 R3 – R4
    Where can I download it? Test the software?

  15. Hi,
    A few days ago I tried several times my Quadcopter with APM 2.5.2 board and MPNG 3.0.1.R2 software on RTL mode .
    Work great !!!
    First two times Quad execute RTL on 20 m above us.
    And after that I change RTL_ALT_FINAL on Mission planer to 0 meters and Quad land on the same place that take off !!!

  16. Hi folks! Just wanted to update on my quad re-build after crashing onto concrete from ten meters up. All of the electronics survived (Crius v1.1 AIO), but the frame was busted beyond repair. Should have a new machine up and running for testing MPNG in about two weeks.

    Regarding problems with MPNG v3.xxx, it’s possible my RC receiver was getting interference from the WiFi hubs in my neighborhood, and there might not be any problem with MPNG.

    While testing the electronics in my lab I’ve found the 2.4ghz RC transmitter causes interference with my WiFi. In addition, I have a Crius Bluetooth (which is on the ISM band at 2.452ghz) connected to S0 which links up with Mission Planner; I’m running in “status” display. The Bluetooth works great and I am able to use it short range with my Sytek X52 joystick. When I transmit any commands from my RC transmitter I can see inteference from the RC transmitter in the status display of MissionPlanner (v1.2.86). I know Blutooth uses channel 9 of the WiFi band (ISM). My WiFi is locked on channel 1. In addition, my WiFi inspector program on my PC is showing about half dozen WiFi hubs in my neighborhood.

    One additional note, I’m testing my electronics in a static setup; i.e, all tied down to a piece of plywood with no props on the motors. I’ve found the yaw PWM doesn’t return to center after a yaw command is sent from the joystock (the values can be seen in Mission Planner “flight data”->”status”). The pitch and roll return to center. I’ll investigate this further when my machine is up and running in a few weeks.

    I hope this information is useful!

    In other words, I don’t want to denegrate MPNG v3.xxx just yet, the problem I had with MPNG v3.xxx might be due to interference from the nearby WiFi hubs…more to come…empirical data is much better than anecdotes!

  17. Hi guys

    I have a plane running megapirate 3(latest) on a AIOP v2 board.

    I want to run a buzzer from the channel 5 on the fc board (which I believe would be digital pin 7). I understand I could do this by setting RC5_Function to Manual in Mission Planner’s Standard Params screen.

    However, I’m not getting any signal past channel 4 (d6) on the servo output rail. My 4 flight channels are fine (throttle,elevon,ailerons,yaw) but past that channel 5-7 (d7-9) isn’t working.

    I’ve set RC5-RC7′s functions to Manual on Mission Planner->Standard Params. I can see the radio channels (5-7) moving on the calibration screen. I’ve calibrated with all channels operational. The voltage line is working and it’s getting power but the signal pin is saying nada.

    I’ve even connected only the signal pin to my rx and then it works, but that isn’t ideal. This is probably just a ArduPilot thing and not AIOP v2 specifically but I’m asking here to be sure.

    Any ideas?

  18. hi. I have a problem with the Bluetooth connection. The board is Crius AIOP V2 of RCTIMER bluetooth is from HK. In multiwii the bluetooth works, but MPNG 3.1 is a problem, communication does not work. Someone help me with the configuration?

    1. Hi there. The issue is not with MPNG V 3.xxx but with mission planner it’s self. I read someone and have tested it as well. A older version of Mission Planner, Version 1.2.27 works fine with bluetooh. So the issue is not with the bluetooh or MPNG V3.xxx but with something within the newer versions of Mission Planner.

  19. Hello All,

    On mission planer, on the PIDs setting, for the Stabilize mode, I have only the P who is displayed ( For Roll, Pich, Yaw, and also for the Loiter mode), How can I do for to display the D and I.
    I don’t found it.

    Have some one an idea ?

    Thanks

    Fred

  20. Hi guys!

    I would so love to see the sonar function working on the next release.
    Just a little christmas wish from me.
    Happy New Year guys!

    /Peter

  21. Hey all. Been running V3.0.1R3 for about just over a week. Taking my time tuning it and getting it setup just right. Can’t really say much about it as this is my first venture into Megapirate or anything like this. My other quad has a KK2.0 board on it. Must say I really love the RTL and Loiter options. Run a few simple missions with 5 waypoints nothing fancy and well I gotta say it flys great. Anyway that’s my two cents worth can’t wait to see what happens in the next version. I’m also building a hexacopter, oh I’m using the HobbyKing Crius clone.

    Well Cheers

  22. Hello Alex,
    is there a way to change the baud rate of port S0 on CRIUS AIOP V2 with the new firmware MPNG 3.01 Rx? In older versions of MPNG I used port S0 to connect the radio thus getting it separated form GPS port (S1-S3).This was possible by changing the baud rate of port S0 in the firmware before flashing it. Now, on 3.01 Rx, I cannot find the way to do this. Thanks.
    Marco

  23. Hi,

    Has anyone had any luck or issues with the new RCTimer U-blox CN-06 v3.0 GPS. I’ve hooked it up to the Crius AIO Pro V2 board. Everything seems to be working fine. I see 3D fix on mission planner showing the correct lat/long and heading. I’ve also checked that the flight controller is configuring the GPS to the 38400 BAUD and 5Hz refresh rate. The problem is that when I go to loiter or auto mission, the quad goes in any direction but the waypoint or the loiter zone. When I go into loiter mode, the quad decides to fly away randomly. Same thing happens when I go into auto mode. The quad just goes to a random location. I’ve noticed a couple of times that the quad actually stays hovering on a pretty good zone in loiter and goes to the correct waypoint in mission mode. These “good” events seem to be random.

    I would appreciate any help you guys could provide.

    Thanks!

  24. Hi folks! Finally got my rebuilt quadcopter (actually all new frame since the last one was destroyed) up and running with MPNG 3.0.1R2. Went outdoors today (17degrees). Switched on the quad inside the house; too cold to start electronics outside (ESCs can’t take a very cold start). Carried quad outdoors while ESC and FC were running and warm.

    Anyway, flew great! Before I went outside to fly, I spent about four hours tuning the PIDs with the quad tied down. Did a final tune in free flight indoors. If you don’t know how to tune the PIDs using channel 6, find out! There is no better way than tuning on-the-fly; tethered first.

    Last time I flew MPNG in October using 3.0.1R2 I had a catastrophic crash from 15 meters up. I built a new machine from scratch.

    I did have two glitches while tuning indoors.
    1) It appears to be the same bug reported by others. Starting up, the quad took off about 20cm and flipped over backwards; nose up. I see that SirAlex has fixed this bug in 3.0.1R3, but I don’t see the bug ticket on it. Anyone know what issue it is/was?
    2) Switching to “simple mode” didn’t work. After enabling simple mode, all the stick movements were backwards!

    Additionally, I have no problem with my compass. I don’t understand why APM users have magnetic interference problems! The quad locks yaw on the compass like it’s on railroad tracks.

    Looking forward for the release of R3 or R4! The flip issue is disconcerting, and I would really like to see what the fix was!

    Equipment:
    Tiger MSMS-2814-10 770kv motors (350watts and plenty of power)
    RCTimer 40amp ESC (generic RC plane/helio ESCs bought in 2012 [note these are at least two years old and they are not SimonK firmware ESCs, so I don't know why there is so much raving about SimonK firmware ESCs])
    Crius v1.1 All-In-One flight controller
    dual 5000mAh 4s 40C 80C burst LiPO
    Digital voltage display/alarm module (everyone should use one[shows voltage of batt and each cell])
    Crius Bluetooth (this is the way to tune and get telemetry in the lab)
    Crius GPS
    HK 2.4ghz transmitter & receiver
    2amp 5v BEC
    3300uF-16v capacitor on 5volt supply

    On my PC I have a Kensington Bluetooth module; interfaces transparently with mission planner; makes updating the PIDs and firmware a snap, makes watching the fligt data in real-time easy. Only limitation is the range is about 10 meters. No need for the 433/915mhz telemetry!

    1. I cant seem to disable ACRO TRAINER mode…have commented in config.h and also tried setting it to 0 in MP….the BAL terms are maxed however, but I thought setting to disable in MP would turn autoleveling off in ACRO mode…

      I use ACRO mode to tune the PID on other controllers since the stabilizers arent in the loop confusing things…(overshoot primarily)

  25. Hi guys!

    I am facing little problem as the motors are not starting when connected to board .
    I have a HobbyKing – Multiwii and Megapirates AIO , I have flashed Megapirates onto that , connected four turnigy plush 30A in X config.
    On powering ESC gives me correct tone as per manual , but the motors don’t start even after pushing throttle to high with Turnigy 6x.
    I have set TX_CHANNEL_SET to TX_set2 , also tried rest four parameters except TX_JR.
    Motors work when I hook them to RX individually ( without AIO board ).
    I have connected throttle wire to A8 pin on board.
    MOTOTRS to 2 3 5 6 .

    Thanks

  26. In my last flights with 3.0.1 R2 om my Cruis AIO v2 I notished in stable mode the front sometimes would pitchup until about 15/20 degr. and than come back in stable mode.
    First I thought I was due to the hard wind and I neeeded to play around with my PID’s some more, but later at home I found that my PWD in flightmode-2 was exactly at 1360 and notished that my radio sometimes is a little unstable and the PWD went up sometimes to 1362 and back to 1360 thereby switching to flightmode-3 (RTL) and back real quick.
    After adjusting my PWD for flightmode-2 to 1350 no more strange behavior was notished by me. I think this happened after updating my TX firmware.

    I dont know it this is of any importance to mention but because I read so much about about unwanted movements here I think it is good to mention to check your that you PWD’s for the filghtmode’s are not on the edge of an flightmode setting but nice in the center of the high and lower value’s.

    1. I fly a Discovery clone with Cruis AIO V2 that is mounted with 4 nylos bolds to the bottum plate (no damping materials what soever). The ESC’s are mounted as far as possible on the legs, far away from the FC as possible.
      The quad does well in modes Stable,Acro, RTL and perfect loiter.
      Now that I have mounted some FPV equipment and now in LOITER I experience a little toiletboiling so I need to rewire but thats about it at the moment.

  27. Additionally, I posted this on the APM forum; might be of interest.

    There seems to be a discrepency in how the PID values for IMAX are entered. There are several screen shots on the web which show incorrect entries. By examining the source code I have found that the IMAX value for altitude hold, throttle rate, and throttle acceleration are a fraction of PWM. The stabilize, rate, yaw, and loiter IMAXs are in degrees/second.

    Example values of 5,5,8,and 30 for stabilize, rate, yaw, and loiter. Values of 500, 500, 300 for throttle acceleration, throttle rate, and altitude hold.

    The http://copter.ardupilot.com/wiki/tuning/ screen shot shows values that seem to be incorrect. Another is at http://www.youtube.com/watch?v=7pSsdrS56nE

    Aside from rate D values being too high, could this also be a cause of the copter flipping!?

Leave a Reply