MultiWii pro

Post Reply
JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

MultiWii pro

Post by JFRouh »

I bought at Hobbyking store the MultiWii pro board with ATMega 2560 and MTK GPS module.
Now,I try to program it with MultiWii 2.2, but I d'nt find the correct line in "config h" to select it.
Could you help me?
Best Regards
JFRouh

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: MultiWii pro

Post by Kbev5709 »

//#define FFIMUv2 // second version of 9DOF+baro board from Jussi, with HMC5883 <- confirmed by Alex

uncomment that line

Almost everything you need to know about that board can be found here:
http://www.rcgroups.com/forums/showthread.php?t=1726790

If you can't find that line in 2.2 just upgrade to 2.4. Why do you want to run obsolete firmware?

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

Hello Kbev5709,

Thanks a lot!

I'll try this immédiatly.

I thought, it is necessary to use same version of MultiWii and WinGui

JFRouh

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: MultiWii pro

Post by Kbev5709 »

JFRouh wrote:
I thought, it is necessary to use same version of MultiWii and WinGui

JFRouh


Ok, now I see why you were running 2.2 still. Yes,the MW version and the wingui need to match.
If you upgrade to 2.4 you will need to upgrade the gui to 2.3 and then go into your arduino multiwii.h file and change version number to 230. This will allow version 2.4 to run on win gui 2.3. Until EOSBandi comes up with version 2.4 wingui that is how folks have been doing it.
Remember to save your changes before uploading to the FC.
Pretty sure that this thread is in the wrong place seeing as how this FC is I think 8 bit.

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

I succed to upload miltiwii to 2.4.
I 'll now try with wingui 2.3 and changing version to 230!

Thanks a lot

JFRouh

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

I do everythings you tell me.
It seems to be good for Wingui, but the GPS (MTK3329) d'nt work.
It is not selected either in Wingui or in MW.
I have an other problem : My transmiter (FRSkY Taranis) is programmed in PPM ;For the FC , I select " PPM on Trottle" in Config.h.
But,only the Throttle stick is OK, others are not connected.
Could you help me?
Thanks a lot;

JFRouh

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: MultiWii pro

Post by Kbev5709 »

To get your GPS to work EVERYTHING relating to it must be done correctly or you will be pulling out your hair trying to get it.
First, you want to make sure that it is hooked up to serial two. RX wire must go to TX and TX wire must go to RX, from GPS to FC. If you don't have the wires on correctly it will never work. You must have everything set correctly in your config.h sketch as well. Start with your SECTION 5 - ALTERNATE SETUP. Make sure that you have your serial port 2 set to either 57600 or 115200. Take your pick. It has to be one of those two (your GPS speed setting will determine the final speed.) Then in your GPS section enable the port (#define GPS_SERIAL 2) and set your GPS baud speed (#define GPS_BAUD 57600.) Make sure you use that speed and not 115200. Now comes the tricky part. You need to enable a setting, then overwrite that setting in a new upload by disabling that setting and enabling another setting. First set your initialize (#define INIT_MTK_GPS.) Then, upload that sketch. Now go disable that command (//#define INIT_MTK_GPS) and enable this one (#define NMEA.) Now re-upload the new sketch. Your GPS is initialized and ready to work (provided you complete these following steps.) In your GPS section further down you must set the correct magnetic declination for your location (or where you will fly.) You must also make sure that #define USE_MSP_WP is enabled. Now, go and do an ACC calibration. Make sure that the FC is ABSOLUTELY LEVEL before hitting calibrate. Now, calibrate your mag. If you have followed ALL of these steps IN THE RIGHT ORDER,you GPS should function.
Unfortunately, I can not help you with your TX problem, but I'm sure someone here probably can.

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

I understand I have to choose between 57600 and 115200?
Then, I d'nt see where is The GPS section? Is it in Conf.h or somewhere else?
May be, I have to write " #define GPS_serial 2‘‘ and others, somewhere?
For the end of the procedure , it seems to me very difficult to understand.
I am sorry to make you so much work, but I d'nt understand English very well!
Thank you,

JFRouh

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: MultiWii pro

Post by Kbev5709 »

JFRouh wrote:I understand I have to choose between 57600 and 115200?

That is your serial port speed. If you choose 115200 it will use your GPS speed instead which you will be setting at 57600. It does not matter if your serial speed is at 115200 or 57600 because it will only use what you set as the GPS speed.
JFRouh wrote:Then, I d'nt see where is The GPS section? Is it in Conf.h or somewhere else?
May be, I have to write " #define GPS_serial 2‘‘ and others, somewhere?

Yes it is in your config.h. It is about 2/3 of the way to the bottom. Here is what you will be looking for:

Code: Select all

 /**************************************************************************************/
  /***********************                  GPS                **************************/
  /**************************************************************************************/

    /* ENable this for using GPS simulator (NMEA only)*/
    //#define GPS_SIMULATOR

    /* GPS using a SERIAL port
       if enabled, define here the Arduino Serial port number and the UART speed
       note: only the RX PIN is used in case of NMEA mode, the GPS is not configured by multiwii
       in NMEA mode the GPS must be configured to output GGA and RMC NMEA sentences (which is generally the default conf for most GPS devices)
       at least 5Hz update rate. uncomment the first line to select the GPS serial port of the arduino */
       
    #define GPS_SERIAL 2         // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
                                   // must be 0 for PRO_MINI (ex GPS_PRO_MINI)
                                   // note: Now a GPS can share MSP on the same port. The only constrain is to not use it simultaneously, and use the same port speed.

    // avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
    #define GPS_BAUD   57600       // GPS_BAUD will override SERIALx_COM_SPEED for the selected port

   /* GPS protocol
       NMEA  - Standard NMEA protocol GGA, GSA and RMC  sentences are needed
       UBLOX - U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
       MTK_BINARY16 and MTK_BINARY19 - MTK3329 chipset based GPS with DIYDrones binary firmware (v1.6 or v1.9)
       With UBLOX and MTK_BINARY you don't have to use GPS_FILTERING in multiwii code !!! */

   
    //#define NMEA
    //#define UBLOX
    //#define MTK_BINARY16
    //#define MTK_BINARY19
    #define INIT_MTK_GPS        // initialize MTK GPS for using selected speed, 5Hz update rate and GGA & RMC sentence or binary settings


    /* I2C GPS device made with an independant arduino + GPS device
       including some navigation functions
       contribution from EOSBandi   http://code.google.com/p/i2c-gps-nav/
       You have to use at least I2CGpsNav code r33 */
    /* all functionnalities allowed by SERIAL_GPS are now available for I2C_GPS: all relevant navigation computations are gathered in the main FC */

    //#define I2C_GPS

    // If your I2C GPS board has Sonar support enabled
    //#define I2C_GPS_SONAR

    /* indicate a valid GPS fix with at least 5 satellites by flashing the LED  - Modified by MIS - Using stable LED (YELLOW on CRIUS AIO) led work as sat number indicator
      - No GPS FIX -> LED blink at speed of incoming GPS frames
      - Fix and sat no. bellow 5 -> LED off
      - Fix and sat no. >= 5 -> LED blinks, one blink for 5 sat, two blinks for 6 sat, three for 7 ... */
    #define GPS_LED_INDICATOR

   //Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
   #define USE_MSP_WP

   // HOME position is reset at every arm, uncomment it to prohibit it (you can set home position with GyroCalibration)   
   //#define DONT_RESET_HOME_AT_ARM

/* GPS navigation can control the heading */

// copter faces toward the navigation point, maghold must be enabled for it
#define NAV_CONTROLS_HEADING       1    //(**)
// true - copter comes in with tail first
#define NAV_TAIL_FIRST             0    //(**)
// true - when copter arrives to home position it rotates it's head to takeoff direction
#define NAV_SET_TAKEOFF_HEADING    1    //(**)

/* Get your magnetic declination from here : http://magnetic-declination.com/
Convert the degree+minutes into decimal degree by ==> degree+minutes*(1/60)
Note the sign on declination it could be negative or positive (WEST or EAST)
Also note, that maqgnetic declination changes with time, so recheck your value every 3-6 months */
#define MAG_DECLINATION -5.1f   //(**)<<<<<<<put YOUR magnetic declination here!!!

// Adds a forward predictive filterig to compensate gps lag. Code based on Jason Short's lead filter implementation
#define GPS_LEAD_FILTER               //(**)

// add a 5 element moving average filter to GPS coordinates, helps eliminate gps noise but adds latency comment out to disable
// use it with NMEA gps only
//#define GPS_FILTERING                 //(**)

// if we are within this distance to a waypoint then we consider it reached (distance is in cm)
#define GPS_WP_RADIUS              100      //(**)

// Safe WP distance, do not start mission if the first wp distance is larger than this number (in meters)
// Also aborts mission if the next waypoint distance is more than this number
#define SAFE_WP_DISTANCE           200      //(**)

//Maximu allowable navigation altitude (in meters) automatic altitude control will not go above this height
#define MAX_NAV_ALTITUDE           80     //(**)

// minimum speed when approach waypoint
#define NAV_SPEED_MIN              100    // cm/sec //(**)
// maximum speed to reach between waypoints
#define NAV_SPEED_MAX              500    // cm/sec //(**)
// Slow down to zero when reaching waypoint (same as NAV_SPEED_MIN = 0)
#define NAV_SLOW_NAV               0      //(**)
// Weight factor of the crosstrack error in navigation calculations (do not touch)
#define CROSSTRACK_GAIN            .4     //(**)
// Maximum allowable banking than navigation outputs
#define NAV_BANK_MAX 3000                 //(**)

//Defines the RTH altitude. 0 means keep current alt during RTH (in meters)
#define RTH_ALTITUDE               15        //(**)
//Wait to reach RTH alt before start moving to home (0-no, 1-yes)
#define WAIT_FOR_RTH_ALT           1         //(**)

//Navigation engine will takeover BARO mode control
#define NAV_TAKEOVER_BARO          1         //(**)

//Throttle stick input will be ignored  (only in BARO)
#define IGNORE_THROTTLE            1         //(**)

//If FENCE DISTANCE is larger than 0 then copter will switch to RTH when it farther from home
//than the defined number in meters
#define FENCE_DISTANCE      600

//This governs the descent speed during landing. 100 is equals approc 50cm/sec
#define LAND_SPEED          100

Copy those settings. Pay attention to the // in front of things. Removing the // makes that function enabled. Make your config.h look like that. Upload it. Now go back and change your: GPS protocol to look like this:
 
/* GPS protocol
       NMEA  - Standard NMEA protocol GGA, GSA and RMC  sentences are needed
       UBLOX - U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
       MTK_BINARY16 and MTK_BINARY19 - MTK3329 chipset based GPS with DIYDrones binary firmware (v1.6 or v1.9)
       With UBLOX and MTK_BINARY you don't have to use GPS_FILTERING in multiwii code !!! */

   
    #define NMEA
    //#define UBLOX
    //#define MTK_BINARY16
    //#define MTK_BINARY19
    //#define INIT_MTK_GPS        // initialize MTK GPS for using selected speed, 5Hz update rate and GGA & RMC sentence or binary settings


Notice that I have changed from #define INIT_MTK_GPS to //#define INIT_MTK_GPS and from //#define NMEA to #define NMEA?
That is what you want to change after your first upload. Now go upload the changes and you will be done with your config.h
You must also make sure that #define USE_MSP_WP is enabled. Now, go and do an ACC calibration. Make sure that the FC is ABSOLUTELY LEVEL before hitting calibrate. Now, calibrate your mag. If you have followed ALL of these steps IN THE RIGHT ORDER,you GPS should function.
Last edited by Kbev5709 on Sat Nov 21, 2015 2:55 pm, edited 1 time in total.

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

I thank you very much for all your so complite anwser.
I do the first part, but I have an error with the compilation:
collect2.exe: error: ld returned 1 exit status

exit status 1
Erreur lors de la compilation.
What can I do?

Sorry for all my messages

JFRouh

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

I 'nt find what is wrong in my sketch!
The compilation return this:
C:\Users\JEAN-F~1\AppData\Local\Temp\buildeba40c17aefdb7bd54c55b3a974a48be.tmp\sketch\MultiWii.cpp.o: In function `setup':

C:\Users\JEAN-F~1\AppData\Local\Temp\buildeba40c17aefdb7bd54c55b3a974a48be.tmp\sketch/MultiWii.cpp:712: undefined reference to `GPS_SerialInit()'

C:\Users\JEAN-F~1\AppData\Local\Temp\buildeba40c17aefdb7bd54c55b3a974a48be.tmp\sketch\Protocol.cpp.o: In function `serialCom()':

C:\Users\JEAN-F~1\AppData\Local\Temp\buildeba40c17aefdb7bd54c55b3a974a48be.tmp\sketch/Protocol.cpp:241: undefined reference to `GPS_newFrame(unsigned char)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Erreur lors de la compilation.
I d'nt understand!
Could you help me?

Thanks a lot

JFRouh

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: MultiWii pro

Post by Kbev5709 »

You are doing something wrong in the initialization process for the GPS. I have no way of knowing what you are doing wrong. It looks to me like you are not re-commenting the init statement and trying to upload both the init and the nmea. You can't do that. I never had any of the problems that you are experiencing with the exact same board and GPS. Perhaps some of your hardware is toast???

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

How can I reinitiased the board for upload the new sketch??

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

The compilation is wrong when I selecte 'define INIT_MTK _GPS', but it is OK when I selecte directly 'define NMEA'
When I upload this , the GPS is identified in MultiWiiConf, bud is not working.
It is not identified in WinGui.
Something is wrong in the softwear with 'INIT_MTK-GPS',but I d'ont see what do to.
Could you have a solution?
Thank you.

JFROUH

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: MultiWii pro

Post by Kbev5709 »

Sorry man, I've done all I can. You must be messing something up or your hardware is toast.

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

OK! I tank you for all!
I am trying to have anwsers in 'software' section!

JFRouh

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

I come back!

After to have uploaded the sketch with succesfull on my board, I cannot yet use the GPS!
I think , when the boad is connected to the power,the GPS might be in work.
In fact ,the GPS is connected because there is a red led stay lightened,but nothing else.
What is the solution?

JFRouh

JFRouh
Posts: 17
Joined: Thu Nov 05, 2015 7:01 pm

Re: MultiWii pro

Post by JFRouh »

Good news, my GPS is OK.

In fact, it is necessary to uncommed INIT_MTK_GPS and NMEA both.

Thanks for all, one more time.

JFRouh

jack-1948
Posts: 8
Joined: Thu Jun 19, 2014 9:35 pm

Re: MultiWii pro

Post by jack-1948 »

I seen in a video here the link to it. https://www.youtube.com/watch?v=9TIUif3PE9U

Code: Select all

// avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
    #define GPS_BAUD   57600       // GPS_BAUD will override SERIALx_COM_SPEED for the selected port

And change it to this and go to 31:40 in the video and it will show you.

Code: Select all

// avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
    #define GPS_BAUD   115200       // GPS_BAUD will override SERIALx_COM_SPEED for the selected port

Hope this helps someone out.

Post Reply