블로그 이미지
SuperMjs

calendar

1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

Notice

'NMEA protocol'에 해당되는 글 3

  1. 2009.12.02 NMEA & UBX Protocol(1)
  2. 2009.12.01 U-Blox GPS Module 테스트 (NMEA프로토콜을 UBX로 변경하기)
  3. 2009.11.26 NMEA Library
2009. 12. 2. 21:00 NOVA Project(Hovering Robot)
※ 이 포스트의 도표 및 테이블은 U-Blox사의 Protocol Specifications을 참조하였습니다.

NMEA Protocol

 
 NMEA-0183은 NMEA라고 불리기도 하며 미국의 The National Marine Electronis Association에서 정의해 놓은 시간, 위치, 방위 등의 정보를 전송하기 위한 규격입니다.  이 규격은 Gyrocompass, GPS, Anemometer, echo sounder, Autopolot등 많은 측정장비에서 사용되고 있습니다.
 NMEA-0183 Standard는 ASCII코드와 Serial communications방식의 Protocol을 사용하여 데이터를 sentence형식으로 전송을 하게 됩니다.

 기본적인 NMEA Protocol의 Frame은 다음과 같습니다. 

 위 Frame에서 보시다시피 첫 문자는 항상 "$"로 시작을 하며 마지막에는 Carriage return 과 Line Feed로 이루어져있습니다.
 Address에서는 앞의 두 캐릭터는 Identifier이며 다른 세 캐릭터는 Message의 Format을 나타내는 field입니다.  Address의 경우 GPS에서는 항상 GP라는 문자가 붙어서 나오게 됩니다.  이는 해당 Device가 GPS라는 것을 뜻하는 문자입니다.  그리고 나머지 뒤에 3개의 Character는 GGA, GSA, GAV, RMC, VTG, ZDA등이 있으며 각각 GPS 수신기의 위치 정보, 위성 상태정보, 속도, 시간 및 날짜 등등을 알려주는 데이터의 기본 형태를 표시해 줍니다.


  • Latitude and Longitude Format
    
      NMEA Standard에 따르면 Latitude와 Longitude는 출력되는 Format의 형태가 도(Degree), 분(MInutes) 그리고 초(Fractions of Minutes)로 출력이 됩니다.    ddmm.mmmm형태로 출력이 되는데 Second같은 경우에는 0.mmmm에 60을 곱해주어 초로 환산하여 사용하시면 됩니다.

     다음 화면은 실제 수신기를 통해 윈도우 하이퍼터미널을 통하여 GPS로부터 수신된 정보를 확인한 화면을 캡쳐한 것입니다.


     아래에서 다시 설명을 드리겠지만 GGA로 시작하여 들어오는 Sentence안에는 Latitude와 Longitude 데이터가 포함되어있습니다.

     
     $GPGGA,100138.000,3729.6463,N,12701.6470,E,1,07,1.1,217.7,M,19.6,M,,0000*55

     위 문장 하나를 보면 3729.6463, N이라는 Latitude와 12701.6470,E라는 Longitude를 보실 수 있습니다.  실제 좌표로 환산하기 위하여 Latitude의 0.6463과 0.6470의 Longitude를 초단위로 환산하게 되면 38.76초와 38.82초가 나오게 됩니다.

     이 좌표가 실제 맞는 좌표인지 확인하기 위하여 Google Earth등 다음과 같은 맵프로그램을 통하여 확인할 수 있습니다.



    ㆍGGA Message
     
           GGA는 Global positioning system fix data를 나타내며 시간, 위도, 경도 및 고도 등에 대한 정보를 담고 있습니다.



    ㆍGSA Message

           GSA는 현재 위치를 확인하는데 사용된 위성의 수와 정확도를 나타내주는 메세지 입니다.



    ㆍGSV Message

          GSV는 현재 측정하는 위치에서 보이는 전체 위성에 대한 정보를 측정하는데 사용이 됩니다.  이 메세지 안에는 메세지의 숫자, 수신기와 연결된 위성의 수, 위성의 번호, 고도, 방위각 등이 포함되어있습니다.



    ㆍRMC Message

           RMC는 Recommended Minimum data로 시간, 위도, 경도, 고도, 속도, 날짜 등이 확인 됨을 알 수 있습니다.




      이 밖에도 GLL, GSV, GRS, GST, ZDA, GBS, DTM, GPQ, TXT등이 있으며 다음 참고 사이트에서도 확인 하실 수 있습니다.


    ※ 참조 사이트
      National Marine Electronic Association :   http://www.nmea.org
      U-Blox :  http://www.u-blox.com
      Wikipedia :  http://en.wikipedia.org/wiki/NMEA













posted by SuperMjs
2009. 12. 1. 00:51 NOVA Project(Hovering Robot)

 이번에 새로 구매한 UIGOODS에서 판매하는 GPS모듈입니다.  
  가로세로 48mm x 25mm정도의 상당히 작은 모듈이며 U-Blox사의 LEA-5S칩셋이 장착되어있습니다. 
  U-Blox사의 gps칩을 탑재한 모듈은 국내에서는 쉽게 구하기 어려운 모델입니다.  스위스에서 제조된 칩셋으로 상당히 우수한 수신률을 가지고 있으며 50개까지의 위성을 잡을 수 있습니다.  현재 국내에서는 아이나비 네비게이션 모델에 탑재되어 나오고 있습니다.  UIGoods에서 판매하고 이 모듈은 LEA-5S칩셋을 사용하고 있는데 전원이 일정시간 공급이 되지 않으면 임의로 설정한 설정값이 날아가게되는 단점이 있습니다.


  판매하고 있는 GPS칩은 U-Blox사 홈페이지(http://www.u-blox.com)에서 다음과 같이 확인하실 수 있습니다.
 
  UIGoods에서 판매하는 모듈은 default setting으로 NMEA-0183방식으로 되어있습니다.  따라서 출력되는 방식 또한 NMEA표준 프로토콜로 출력이 됩니다.  필자는 UBX Protocol방식의 데이터가 필요하기 때문에 이를 변경하기 위해서 별도의 셋팅이 필요하여 이를 설명하고자 합니다.  이를 변경하기 위해서는 U-Blox사에서 제공하는 U-Center라는 Application이 필요합니다.  이 프로그램은 아래 링크를 통해서 설치하실 수 있습니다.







  NMEA Protocol을 UBX Protocol로 바꾸는 방법은 Paparazzi Free Autopilot에 올려진 내용과 같이 다음 몇번의 설정으로 쉽게 바꾸실 수 있습니다.

 1. Right Click on the NMEA Text on top of the tree and choose disable child messages
2. Choose UBX->CFG->NAV5(Navigation 5) - set it to use Airborne 8 <4G. This tells the Kalman filter to expect significant changes in direction.
   Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better
3. UBX->CFG->PRT - set USART1 to 38400bps (must match the value in your
Airframe file)
4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point
5. UBX->CFG->RATE(Rates) - change the Measurement Period to 250ms This gives a 4 Hz position update since 4 x 250ms is one second.
6. UBX->CFG->SBAS : Disable (SBAS appears to cause occasional severe altitude calcuation errors)
7. UBX->NAV (not UBX->CFG->NAV): double click on POSLLH, SOL, STATUS, SVINFO, VELNED. They should change from grey to black
(add the flag -DGPS_USE_LATLONG in your
Airframe file) also make sure you set tiny_2_1_1.h if you have the latest boards Tiny/TinyWOG)
8. UBX->CFG->CFG : save current config, click "send" in the lower left corner to permanently save these settings to the receiver

 






1. 우선 Message박스를 열어서 NMEA Protocol출력 부분을 모두 Disable시켜줍니다.






2. 또는 UBX-CFG-MSG에서 개별적으로 원하는 Port로 해당 프로토콜에 대한 정보를 출력 또는 삭제할 수 있습니다.  또한 NMEA Protocol과 UBX Protocol을 동시에 출력해줄 수 있으며 UART1으로는 NMEA, UART2로는 UBX Protocol등으로 임의지정해서 사용할 수도 있습니다(단, 포트가 모두 외부로 나와있다는 가정하에...)










3.  다음은 UBX-CFG-NAV5로 가셔서 모델 선택을 해주셔야 합니다.  이 부분은 해주셔도 되는 부분이고 안해주셔도 굳이 상관은 없는 부분입니다.  이 부분을 수정해주시면 GPS가 Kalman Filter적용 시 참조하는 부분입니다.  모드에 따라서 Portable인지 Fixed인지 또는 Pedestrian등등 GPS장착 모델과 기본적인 이동 속도 등을 고려하여 Kalman Filter를 적용하게 끔 합니다.
  저의 경우에는 움직임 속도가 빠르지 않은 Hovering Robot에 적용을 하기 때문에 Pedestrian을 선택하였습니다.







4. NMEA Protocol방식의 GPS는 기본적으로 1Hz의 주기로 GPS로부터 수신을 받습니다.  이 부분을 4Hz로 변경하여 주기 위해서 UBX-CFG-RATE부분으로 가시면 주기를 변경해 주실수 있습니다.   Measurement Period가 기본적으로 1000ms로 되어있을 겁니다.  이 부분을 250ms로 바꾸어주게되면 Measurement Frequency가 4Hz로 바뀌게 됩니다.













5.  마지막으로 이렇게 변경된 설정에 대해서 저장을 시켜줍니다.  LEA-5H칩이 탑재된 모델 같은 경우에는 이 부분이 지속적으로 메모리에 저장되어 향후에도 변경된 내용이 저장이 되지만 저같은 경우에는 LEA-5S모델이 탑재되어있는 관계로 백업배터리가 있지만 설정 값이 전원이 들어오지 않은지 한참 후에는 설정 값들이 다시 Default상태로 돌아가더군요.






  참고로 직접 GPS어플리케이션을 작성하여 UBX Protocol로 GPS를 사용하실 분들은 해당 스크린 캡쳐사진을 보시면 오른쪽 하단부에 Hex값들을 보실 수 있으실 겁니다.  이 Hex값들을 통신을 통해서 GPS로 보내주시게되면 U-Centre에서에서 사용하신 설정방법과 동일한 설정이 적용되는 것을 확신 하실 수 있습니다.

'NOVA Project(Hovering Robot)' 카테고리의 다른 글

NMEA & UBX Protocol(1)  (0) 2009.12.02
Nova Auto Flight Controller Prototype based on GPS  (3) 2009.12.02
Attitude Control  (0) 2009.11.30
Quad Copter H/W Platform  (0) 2009.11.30
Project Notes  (0) 2009.11.12
posted by SuperMjs
2009. 11. 26. 21:29 Embedded System/Software

Disclaimer

The National Marine Electronics Association (NMEA) has developed a specification that defines the interface between various pieces of marine electronic equipment. The standard permits marine electronics to send information to computers and to other marine equipment. Most computer programs that provide real time position information understand and expect data to be in NMEA format. This data includes the complete PVT (position, velocity, time) solution computed by the GPS receiver. The idea of NMEA is to send a line of data called a sentence that is totally self contained and independent from other sentences. All NMEA sentences is sequences of ACSII symbols begins with a '$' and ends with a carriage return/line feed sequence and can be no longer than 80 characters of visible text (plus the line terminators).

Introduction

We present open source and free library in 'C' programming language for work with NMEA protocol. Small and easy to use. The library build on different compilers under different platforms (see below). The code was tested in real projects. Just download and try...

Features

  • Analysis NMEA sentences and granting GPS data in C structures
  • Generate NMEA sentences
  • Supported sentences: GPGGA, GPGSA, GPGSV, GPRMC, GPVTG
  • Multilevel architecture of algorithms
  • Additional functions of geographical mathematics and work with navigation data

Supported (tested) platforms

  • Microsoft Windows (MS Visual Studio 8.0, GCC)
  • Windows Mobile, Windows CE (MS Visual Studio 8.0)
  • UNIX (GCC)

VirtualGPSJet (addition)

We also provide virtual COM port driver for generating a stream of NMEA protocol. It is developed for testing applications working with GPS. Now this driver made only for Windows CE platform.

Downloads


Source : http://nmea.sourceforge.net/

'Embedded System > Software' 카테고리의 다른 글

Setting up my machine to build Android source code(for ODROID)  (0) 2011.02.12
Kalman Filter  (0) 2009.11.15
Ziegler–Nichols method  (0) 2009.11.08
커널 부팅 로고 이미지 바꾸기(출처 : FALinux)  (0) 2009.08.13
__attribute__  (0) 2009.07.24
posted by SuperMjs
prev 1 next