5iMX宗旨:分享遥控模型兴趣爱好

5iMX.com 我爱模型 玩家论坛 ——专业遥控模型和无人机玩家论坛(玩模型就上我爱模型,创始于2003年)
查看: 2090|回复: 9
打印 上一主题 下一主题

[求助]MWC飞控,开启GPS后传感器各种抽风

[复制链接]
跳转到指定楼层
楼主
发表于 2014-6-14 00:03 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
如图,在配置文件中开启GPS支持后在GUI里面调试,传感器各种抽风



GPS部分配置代码如下

  1. /**************************************************************************************/
  2.   /***********************                  GPS                **************************/
  3.   /**************************************************************************************/

  4.     /* GPS using a SERIAL port
  5.        if enabled, define here the Arduino Serial port number a n d the UART speed
  6.        note: only the RX PIN is used in case of NMEA mode, the GPS is not configured by multiwii
  7.        in NMEA mode the GPS must be configured to output GGA a n d RMC NMEA sentences (which is generally the default conf for most GPS devices)
  8.        at least 5Hz update rate. uncomment the first line to select the GPS serial port of the arduino */
  9.       
  10.     //#define GPS_SERIAL 2         // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
  11.     //#define GPS_PROMINI_SERIAL   // Will Autosense if GPS is connected when ardu boots.

  12.     // avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
  13.     #define GPS_BAUD   57600

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

  19.    
  20.     //#define NMEA
  21.     #define UBLOX
  22.     //#define MTK_BINARY16
  23.     //#define MTK_BINARY19
  24.     //#define INIT_MTK_GPS        // initialize MTK GPS for using selected speed, 5Hz update rate a n d GGA & RMC sentence or binary settings

  25.    
  26.     /* I2C GPS device made with an independant arduino + GPS device
  27.        including some navigation functions
  28.        contribution from EOSBa n di   http://code.google.com/p/i2c-gps-nav/
  29.        You have to use at least I2CGpsNav code r33 */
  30.     #define I2C_GPS
  31.     // If your I2C GPS board has Sonar support enabled
  32.     //#define I2C_GPS_SONAR

  33.     /* GPS data readed from Misio-OSD - GPS module connected to OSD, a n d MultiWii read GPS data from OSD - tested a n d working OK ! */
  34.     //#define GPS_FROM_OSD

  35.     /* 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
  36.       - No GPS FIX -> LED blink at speed of incoming GPS frames
  37.       - Fix a n d sat no. bellow 5 -> LED off
  38.       - Fix a n d sat no. >= 5 -> LED blinks, one blink for 5 sat, two blinks for 6 sat, three for 7 ... */
  39.     #define GPS_LED_INDICATOR

  40.     //#define USE_MSP_WP                        //Enables the MSP_WP comma n d, which is used by WinGUI to display a n d log Home a n d Poshold positions

  41.     //#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)

  42.     /* GPS navigation can control the heading */
  43.    
  44.     #define NAV_CONTROLS_HEADING       true      // copter faces toward the navigation point, maghold must be enabled for it
  45.     #define NAV_TAIL_FIRST             false     // true - copter comes in with tail first
  46.     #define NAV_SET_TAKEOFF_HEADING    true      // true - when copter arrives to home position it rotates it's head to takeoff direction
  47.    
  48.    
  49.     /* Get your magnetic declination from here : http://magnetic-declination.com/
  50.        Convert the degree+minutes into decimal degree by ==> degree+minutes*(1/60)
  51.        Note the sign on declination it could be negative or positive (WEST or EAST) */
  52.     //#define MAG_DECLINATION  3.96f              //For Budapest Hungary.
  53.     #define MAG_DECLINATION  1.61f   //(**)

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

请问是怎么回事啊,调了一晚上了都。没开启之前正常

欢迎继续阅读楼主其他信息

沙发
发表于 2014-6-14 10:44 | 只看该作者
全是I2C的错误
3
发表于 2014-6-14 13:45 | 只看该作者
GPS用了I2C就得用专门的I2C Nav Board(导航板),你这样估计是直接把GPS接到串口了。串口冲突当然会抽风。
4
发表于 2014-6-14 13:46 | 只看该作者
要不就是串口输出的GPS你接到了I2C,然后就是I2C总线冲突。
5
 楼主| 发表于 2014-6-14 14:01 | 只看该作者
中间连了I2C-GPS-NAV转换板的
6
发表于 2014-6-14 15:23 | 只看该作者
tony1157 发表于 2014-6-14 14:01
中间连了I2C-GPS-NAV转换板的


看看板子有没有接错,有条件多上点图
7
 楼主| 发表于 2014-6-14 16:50 | 只看该作者
GPS调试搜星正常
如图

接线按照http://www.multiwii.com/forum/viewtopic.php?f=15&t=4163的模式进行

MWC se v2.5  --> Arduino pro mini --> Ubox gps

中转板到GPS
Arduino TX0 --> GPS RX
Arduino RX1 <-- GPS TX

Arduino (VCC) --> GPS VCC
Arduino GND --> GPS GND


中转板到飞控
Arduino A4 --> FC SDA
Arduino A5 --> FC SCL
Arduino RAW --> FC +5v
Arduino GND --> FC GNC


Arduino 已刷I2C_GPS_NAV 2.2

8
发表于 2014-6-14 17:40 | 只看该作者
不懂 路过  帮顶
9
发表于 2014-9-27 20:45 | 只看该作者
我摸了一二個月 gps也弄不出來
10
发表于 2014-9-28 11:10 | 只看该作者



一是线没接对,二是地磁没校正

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

关闭

【站内推荐】上一条 /1 下一条

快速回复 返回顶部 返回列表