Welcome to Multi-Rotor UK. Please login or sign up.

Thursday,April 25, 2024, 20:58:29

Login with username, password and session length

Shoutbox

Gaza07:
23 Apr 2024 08:09:45
The Domain expires for the forum in 60 days, I'm not going to renew it this time unless I see any activity  :beer2:
Gaza07:
20 Apr 2024 18:02:50
Is there anyone who would like to see this forum stay open ? :shrug:
hoverfly:
17 Apr 2024 17:15:13
 :rolleyes:
Bad Raven:
26 Mar 2024 08:41:05
 :(
Andy7:
25 Mar 2024 14:49:21
An excess of work and rain.  :thumbdown:
Bad Raven:
23 Mar 2024 18:12:38
Almost a personal Blog, it would seem. LOTS of members, but NO posts.  :-/   :shrug:
Gaza07:
06 Mar 2024 16:59:49
Anyone still here  :shrug:
ched:
24 Dec 2023 11:48:48
Hope you all have a Great Christmas and a happy New Year.
Bad Raven:
20 Dec 2023 06:17:47
 ~~   :beer2: 
Gaza07:
19 Dec 2023 22:20:27
Merry Christmas All  :beer2:
Members
  • Total Members: 8,195
  • Latest: lokloks
Stats
  • Total Posts: 201,427
  • Total Topics: 20,261
  • Online today: 31
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 21
Total: 21

Theme Changer





3d - Printworx

Multiwii 2.2 GPS tuning

Started by teslahed, Wednesday,March 13, 2013, 18:42:31

Previous topic - Next topic

teslahed

So far i';ve managed to get satellites to pick up on my crius All in one pro v1 board with the ublox GPS but i';ve failed to get my quadcopter holding position or returning to home. These are my settings;

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

    /* 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 3 // should be 2 for flyduino v2. It';s the serial port number on arduino MEGA
    #define GPS_BAUD   57600
    //#define GPS_BAUD   115200


   /* 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

    //#define GPS_PROMINI_SERIAL    57600 // Will Autosense if GPS is connected when ardu boots
   
    /* 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 */
    //#define I2C_GPS

    /* I2C GPS device made with an indeedent ATTiny[24]313 + GPS device and
       optional sonar device.    https://github.com/wertarbyte/tiny-gps/ */
    /* get GPS data from Tiny-GPS */
    //#define TINY_GPS
    /* get sonar data from Tiny-GPS */
    //#define TINY_GPS_SONAR

    /* GPS data readed from Misio-OSD - GPS module connected to OSD, and MultiWii read GPS data from OSD - tested and working OK ! */
    //#define GPS_FROM_OSD

    /* 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

    //#define USE_MSP_WP                        //Enables the MSP_WP command, which is used by WinGUI to display and log Home and Poshold positions

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

    /* GPS navigation can control the heading */
   
    #define NAV_CONTROLS_HEADING       true      // copter faces toward the navigation point, maghold must be enabled for it
    #define NAV_TAIL_FIRST             false     // true - copter comes in with tail first
    #define NAV_SET_TAKEOFF_HEADING    true      // true - when copter arrives to home position it rotates it';s head to takeoff direction
   
   
    /* Get your magnetic decliniation 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) */
    //#define MAG_DECLINIATION  3.96f              //For Budapest Hungary.
    #define MAG_DECLINIATION  0.0f

    #define GPS_LEAD_FILTER                      // Adds a forward predictive filterig to compensate gps lag. Code based on Jason Short';s lead filter implementation
   
    //#define GPS_FILTERING                        // add a 5 element moving average filter to GPS coordinates, helps eliminate gps noise but adds latency comment out to disable
    #define GPS_WP_RADIUS              200       // if we are within this distance to a waypoint then we consider it reached (distance is in cm)
    #define NAV_SLEW_RATE              30        // Adds a rate control to nav output, will smoothen out nav angle spikes

One circlip short of a quadcopter.
 1 lobe short of an antenna.

bunnygirl80

Chris,

I have the following commented out

//#define GPS_SERIAL
//#define GPS_BAUD

You dont need these with the CN-06.

then un comment

#define I2C_GPS

that should be it
Always smile because you never know who could be falling in love with it. :) Drone Operator in North Wales. [url="//www.aerialworx.co.uk"]www.aerialworx.co.uk[/url]

teslahed

#2
I think you are using the i2c adapter stef - it';s different with the mega boards as they use the serial connection. That';s why i have it commented in.

Edit - just moved the UBEC further away from the underside of my Flight controller after Stef suggested i give that a try. Unfortunately i can';t test it until tomorrow now.

The last GPS test was exciting though. It flew the wrong way when i tried return to home until it was off in the distance and i lost orientation (was getting dark, no LEDs as still testing the quadcopter). I had to ditch it in a thicket full of brambles.

I had to go home for a long metal pole and a torch as it was starting to get dark, then return and walk out a search grid. I knew roughly where it was but it still took me a panicked 20 mins to find it.

No damage though - quite relieved!
One circlip short of a quadcopter.
 1 lobe short of an antenna.

bunnygirl80

Hi Chris,

I';ve got my fingers crossed for you! I hope this solves your problem!

Thxx
Always smile because you never know who could be falling in love with it. :) Drone Operator in North Wales. [url="//www.aerialworx.co.uk"]www.aerialworx.co.uk[/url]

teslahed

Calculating Magnetic Declination;

First check here for magnetic declination: http://magnetic-declination.com/

Then use this website to convert to decimal values: http://www.satsig.net/degrees-minutes-seconds-calculator.htm

Leave seconds at 0 as you don';t have that much detail.

For Lancaster i get

-2.65

So i have set my magnetic declination to;

#define MAG_DECLINIATION  -2.65f
One circlip short of a quadcopter.
 1 lobe short of an antenna.

bunnygirl80

How are you getting on with this Chris? I';ve just upgraded to MultiWii 2.2 and it works well. It seems a little more stable and the default PIDs are more suited to my quad. On MW2.1 I have my P for roll and pitch up to 5.8, but it doesn';t seem to like these settings now! So, I';ve reset to default and will determine the best PIDs when the weather is better!

As far as the magnetic declination is concerned, I have three of them in the code based on my most popular flying spots. It is surprising how much of a difference there is between places a 100 miles apart! A lot! I';m not sure how much of a difference this will make though when you arm (it records your position) then you fly somewhere and RTH! I would like to assume that it will return to the same settings that you took off from, so in theory the magnetic declination shouldn';t make any difference! UNLESS, you were using GPS-coords for something like waypoints! What do you think?
Always smile because you never know who could be falling in love with it. :) Drone Operator in North Wales. [url="//www.aerialworx.co.uk"]www.aerialworx.co.uk[/url]

teslahed

I';ve not had much of a chance to test things as the weather has been so bad.

I';ve shortened some wires, relocated the receiver and GPS unit further apart from each other and set the speed back down to 57600 in the multiwii code just in case that will help at all.

I';ll let you know if it';s made a difference next time i get to fly.

I';ve just fitted a bluetooth device to the quadcopter in question as well - hopefully i will be able to tune the PIDs faster using my phone now.

Quote from: bunnygirl80 on Sunday,March 24, 2013, 15:30:06 It seems a little more stable and the default PIDs are more suited to my quad. On MW2.1 I have my P for roll and pitch up to 5.8, but it doesn';t seem to like these settings now! So, I';ve reset to default and will determine the best PIDs when the weather is better!

I notice that the defaults PIDs have altered P from 4.0 down to 3.2 for Pitch and Roll. Therefore it';s possible that if you were using 5.8 before you might want to try 5.0 now.

That';s what i did anyway - i haven';t had to alter anything other than that really.
One circlip short of a quadcopter.
 1 lobe short of an antenna.