Crius I2C Nav and Ublox Neo6m Dilemma

Post Reply
sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

Ive set up my SE V2 board and it works fine but when I plug in the nav module/gps receiver and opened GUI the copter on the screen was just twirling all over. The nav module blinks red three times then pauses. I tried flashing it with the latest firmware with still no luck. I tried using the v2 ucenter/blox method but ucenter wont even recognize there is a unit attached. The gps receiver holds solid led for 1.5s then blinks.

AndrejLV
Posts: 23
Joined: Wed Mar 14, 2012 9:37 pm

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by AndrejLV »

Your config? Connection? GPS ?

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

Tricopter. I have the gps plugged into the end of the nav board labeled gps and to nav board plugged into the port labeled I2C (4pin yellow)

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

Oh and gps is a ublox 6m

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

Ok got ucenter to read it. and this is what it looked like. Its way off on long/lat. Not really sure what to do with it from here
Image

AndrejLV
Posts: 23
Joined: Wed Mar 14, 2012 9:37 pm

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by AndrejLV »

Navboard?? Something new ...
Which flight controller do you use?
Could you post your config.ino (part of gps definitions) and pictures of your setup?

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

its the I2C nav board. Multiwii SE V2.0 flight controller. Ublox 6m gos receiver.
Heres the gps section I have setup under config.h is that what you are referring to?

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

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

I have #defineI2C_gps commented and it didnt work so I commented #defineUblox also and still nothing. Im new to all this as you can tell

AndrejLV
Posts: 23
Joined: Wed Mar 14, 2012 9:37 pm

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by AndrejLV »

baud rate have to be 57600, but before please show your setup?

Mainboard and how you connect gps.

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

i was told if using the Ic2 nav bard youre not supposed to comment in the baud rate. COuld I run the gps off of the board and eliminate the nav board?
heres another persons setup. I have all of my wires linked up same as he does. I just discovered a newer firmware for the nav board that supports ublox so ill try that when i get home
http://www.youtube.com/watch?v=6b1bEvgtOBU

Imen
Posts: 20
Joined: Thu Sep 27, 2012 5:11 pm

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by Imen »

sixshooterstang wrote:Ok got ucenter to read it. and this is what it looked like. Its way off on long/lat. Not really sure what to do with it from here
Image


Hi can you check the result of the test ?, I mean you can use google earth along with u-Center, just to verify
you get the right position.

I use the latest code, you can find here
https://code.google.com/p/i2c-gps-nav/s ... S_NAV_v2_2

Code: Select all

void GPS_SerialInit() {
 
  Serial.begin(GPS_SERIAL_SPEED); 
  delay(1000);
 
#if defined(UBLOX)
   //Set speed
      for(uint8_t i=0;i<5;i++){
        Serial.begin(init_speed[i]);          // switch UART speed for sending SET BAUDRATE command (NMEA mode)
        #if (GPS_SERIAL_SPEED==19200)
          Serial.write(PSTR("$PUBX,41,1,0003,0001,19200,0*23\r\n"));     // 19200 baud - minimal speed for 5Hz update rate
        #endif 
        #if (GPS_SERIAL_SPEED==38400)
          Serial.write(PSTR("$PUBX,41,1,0003,0001,38400,0*26\r\n"));     // 38400 baud
        #endif 
        #if (GPS_SERIAL_SPEED==57600)
          Serial.write(PSTR("$PUBX,41,1,0003,0001,57600,0*2D\r\n"));     // 57600 baud
        #endif 
        #if (GPS_SERIAL_SPEED==115200)
          Serial.write(PSTR("$PUBX,41,1,0003,0001,115200,0*1E\r\n"));    // 115200 baud   >> don't know this can't work, so change with this
          Serial.write("$PUBX,41,1,0003,0001,115200,0*1E\r\n");    // 115200 baud
        #endif 
        delay(300);      //Wait for init
      }
      delay(200);
      Serial.begin(GPS_SERIAL_SPEED); 
      for(uint8_t i=0; i<sizeof(UBLOX_INIT); i++) {                        // send configuration data in UBX protocol
        Serial.write(pgm_read_byte(UBLOX_INIT+i));
        //delay(5); //simulating a 38400baud pace (or less), otherwise commands are not accepted by the device.     >> uncomment this


I would attach the code later as now I'm on office

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

I plug the FTDI to the I2C Nav and then go into ucenter, select the correct port and set autobauding on and nothing happens. Reads nothing unless I open u-blox5_UBX.ubx
AM i supposed to make a ubx file or something?

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

update: the gps i have is actually one of these:
http://www.aliexpress.com/store/product ... 34337.html

Nicksdesign
Posts: 63
Joined: Sat Jan 26, 2013 6:49 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by Nicksdesign »

Is this a new Nav board? Never worked? If so, check the cable from the NAV to the FC I2C header. Mine had the cable built wrong and the Data &Clk pins were reversed at the FC end. Until I corrected it, it would cause all sensors connected via the I2C bus to go grazy when pluged in. Sensors were fine without it.

Nick

Nicksdesign
Posts: 63
Joined: Sat Jan 26, 2013 6:49 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by Nicksdesign »

When connecting the GPS module to computer to use Uconnect program to check the UBLOX, do not use the NAV board. Connect the FTDI directly to the GPS module. The NAV board is only used to interface the GPS to the Mulitwii FC.

Nick

sixshooterstang
Posts: 41
Joined: Tue Apr 02, 2013 8:25 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by sixshooterstang »

Well the flight controller isnt working now so I suppose it doesnt matter :P Im just going to buy a Multiwii Pro and sell off the nav board and OLED

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by QuadBow »

Imen wrote:I use the latest code, you can find here
https://code.google.com/p/i2c-gps-nav/s ... S_NAV_v2_2


The code implementation didn't work for my Crius CN-06 gps and Crius nav-board, neither. It fell always back to 9600 baud, 1Hz.
That means, switching to other baud rates via NMEA commands didn't work.
My solution was to use Ublox binary commands in i2c_gps_nav.ino as follows in order to set it to GPS_SERIAL_SPEED=57600 baud and 2 hz:
(other variations can be observed by the relevant message of the ublox u-center software)

uint32_t init_speed[5] = {9600,19200,38400,57600,115200};

#if defined(UBLOX)
prog_char UBLOX_INIT[] PROGMEM = { // PROGMEM array must be outside any function !!!
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x05,0x00,0xFF,0x19, //disable all default NMEA messages
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x03,0x00,0xFD,0x15,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x01,0x00,0xFB,0x11,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x00,0x00,0xFA,0x0F,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x02,0x00,0xFC,0x13,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x04,0x00,0xFE,0x17,
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x02,0x01,0x0E,0x47, //set POSLLH MSG rate
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x03,0x01,0x0F,0x49, //set STATUS MSG rate
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x06,0x01,0x12,0x4F, //set SOL MSG rate
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x12,0x01,0x1E,0x67, //set VELNED MSG rate
0xB5,0x62,0x06,0x16,0x08,0x00,0x03,0x07,0x03,0x00,0x51,0x08,0x00,0x00,0x8A,0x41, //set WAAS to EGNOS
0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xF4, 0x01, 0x01, 0x00, 0x01, 0x00, 0x0B, 0x77 //set rate to 2Hz
};
prog_char UBLOX_SPEED[] PROGMEM = {
0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01,
0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00,
0x00, 0xE1, 0x00, 0x00, 0x07, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0xBD, //set speed to 57600
};
#endif

void GPS_SerialInit() {

#if not defined(UBLOX) && not defined(INIT_MTK_GPS) // start directly with the supposed baud rate
Serial.begin(GPS_SERIAL_SPEED);
delay(1000);
#endif

#if defined(UBLOX) // try to start with 9600 baud
//Set speed to 9600
Serial.begin(9600);
delay(1000);
for(uint8_t i=0; i<sizeof(UBLOX_SPEED); i++) { // send baud rate configuration data as UBX protocol
Serial.write(pgm_read_byte(UBLOX_SPEED+i));
delay(5); //simulating a 38400baud pace (or less), otherwise commands are not accepted by the device.
}
Serial.end();
delay(1000);
Serial.begin(GPS_SERIAL_SPEED);
delay(1000);
for(uint8_t i=0; i<sizeof(UBLOX_INIT); i++) { // send Ublox messages configuration data as UBX protocol
Serial.write(pgm_read_byte(UBLOX_INIT+i));
delay(5); //simulating a 38400baud pace (or less), otherwise commands are not accepted by the device.
}
#elif defined(INIT_MTK_GPS) // MTK GPS setup
...

FlyinGizm0
Posts: 9
Joined: Fri Aug 03, 2012 7:13 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by FlyinGizm0 »

I have got the same Problem here. old RCTIMER cn06 v1 (the one which forgets everything) and an I2C nav board. I tried your patch here but I still dont get a lock. Doesn't work with a CN06 V1 nor V2.. Could you maybe post your whole sketch?
thank you
Gerald

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by QuadBow »

FlyinGizm0 wrote:Could you maybe post your whole sketch?


I changed the original sketch as follows:

- internal Pull-Ups to 5V have been deactivated in twiMW.c in order to avoid conflicts with 3,3V line

- UBLOX change of baudrate via Ublox-command instead of NMEA-command

The current configuration is as follows:

- 5Hz

- 57000 baud
Attachments
I2C_GPS.zip
(29.07 KiB) Downloaded 412 times

chris_kmn
Posts: 31
Joined: Sun Jun 09, 2013 11:11 am

Re: Crius I2C Nav and Ublox Neo6m Dilemma

Post by chris_kmn »

Check out this thread:

http://www.multiwii.com/forum/viewtopic.php?f=18&t=3721

I think it's the same configurationnas u have.

If u are using the I2C nav board u just have to uncomment the define for i2C on the flightcontroller. No baudrate and no ublox or nmea protocol.

The configuration hasbto be done in the config.h from the I2C nav board.

AND check tx and rx connections between controller, I2C and GPS module. The differe.

Post Reply