|
最近準備玩四軸的定點,於是入手一隻Ulbox的GPS模組及arduino pro mini作為I2C-GPS導航板,燒錄了I2C_GPS_NAV_v2.2Beta1-r62固件。
昨晚測試的情況是,GPS信號燈正常,I2C導航板上的指示燈也保持每秒3下的閃動頻率,證明GPS連線正常,但到了GUI裏面GPS_fix雖然是綠色連線狀態,但各項值都是-1的狀態。有說是導航板跟主控的通訊有問題。
請教各位大大
這個是GUI的截圖
這段是I2C导航板的config- //////////////////////////////////////////////////////////////////////////////
- // i2C comm definitions
- //
- #define I2C_ADDRESS 0x20 //7 bit address 0x40 write, 0x41 read
- /* GPS Lead filter - predicts gps position based on the x/y speed. helps overcome the gps lag. */
- #define GPS_LEAD_FILTER
- /* Serial speed of the GPS */
- #define GPS_SERIAL_SPEED 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 - MTK binary protocol (DIYDrones v1.6)
- * MTK_BINARY19 - MTK binary protocol (DIYDrones v1.9)
- * MTK_INIT - Initialize MTK GPS (if MTK_BINARY16 or 19 is not defined then it goes to NMEA, otherwise it goes for binary)
- * With MTK and UBLOX 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
- //////////////////////////////////////////////////////////////////////////////
- // Sonar support. Based on code mods from Crazy Al
- // Connect Sonar trigger to PC3 (arduino pin A3) and echo output to PC2 (arduino pin A2)
- // Supported sonars :
- // Ping/Pong type sonar modules such as HC-SR04, SRF-04, DYP-ME007 and many others...
- // PWM output continous sonars such as the MAXBOTIX series (connect pin2(PWM out) of the sonar to PC2
- //#define SONAR // USE Sonar
- //Sonar type uncomment only one at a time
- //#define PINGPONG
- //#define MAXBOTIX_PWM // PWM output mode sonar
- // Default PID variables
- //////////////////////////////////////////////////////////////////////////////
- // POSHOLD control gains
- //
- #define POSHOLD_P .11
- #define POSHOLD_I 0.0
- #define POSHOLD_IMAX 20 // degrees
- #define POSHOLD_RATE_P 1.4 //
- #define POSHOLD_RATE_I 0.2 // Wind control
- #define POSHOLD_RATE_D 0.010 // try 2 or 3 for POSHOLD_RATE 1
- #define POSHOLD_RATE_IMAX 20 // degrees
- //////////////////////////////////////////////////////////////////////////////
- // Navigation PID gains
- //
- #define NAV_P 1.4 //
- #define NAV_I 0.20 // Wind control
- #define NAV_D 0.006 //
- #define NAV_IMAX 20 // degrees
- ////////////////////////////////////////////////////////////////////////////////////
- // Navigational parameters and limiters initial values
- //
- #define CROSSTRACK_GAIN 1 // Weighting the cross track error
- #define NAV_SPEED_MIN 100 // cm/sec minimum navigational speed when NAV_SLOW_NAV id false
- #define NAV_SPEED_MAX 300 // cm/sec maximum navigational speed
- #define NAV_BANK_MAX 2500 // 20deg max banking when navigating (just for security and testing)
- ////////////////////////////////////////////////////////////////////////////////////
- // GPS data filtering - moving average filter vector length
- //
- #define GPS_FILTER_VECTOR_LENGTH 5
複製代碼 主控GPS部分的設定- /**************************************************************************************/
- /*********************** 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_PROMINI_SERIAL // Will Autosense if GPS is connected when ardu boots.
- // 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 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 */
- #define I2C_GPS
- // If your I2C GPS board has Sonar support enabled
- //#define I2C_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 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) */
- //#define MAG_DECLINATION 3.96f //For Budapest Hungary.
- #define MAG_DECLINATION 1.16f //(**)
- #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
複製代碼 各位大大麻煩看看,請問問題出在哪裡
|
上一篇:四軸無法啟動,請求各位專業的大大幫幫忙下一篇:phantom 2 可以挂 FC40的相机吗?
|