GPS n GPS Space Segment Control Segment User
- Slides: 39
GPS의 구성요소 n GPS 는 우주 부문(Space Segment) , 관제 부문 (Control Segment) , 사용자 부문(User Segment) 3가지 영역이 있다. Embedded System Lab. II 4
GPS 원리 Embedded System Lab. II 9
GPS 정확도 Embedded System Lab. II 12
NMEA n GGA - Global Positioning System Fix Data ü ü 시간, 위치 등의 정보 데이터 표현 $GPGGA, hhmmss. dd, xxmm. dddd, <N|S>, yyymm. dddd, <E|W>, v, s s, d. d, h. h, M, g. g, M, a. a, xxxx *hh<CR><LF> Ex) $GPGGA, 092204. 999, 4250. 5589, S, 14718. 5084, E, 1, 04, 24. 4, 19. 7, M, , 0000*1 F Embedded System Lab. II 14
NMEA n GLL - Geographic Position - Latitude/Longitude ü ü 위도 경도 시간 등의 , , UTC 정보 데이터 표현 $GPGLL, xxmm. dddd, <N|S>, yyymm. dddd, <E|W>, hhmmss. dd, S, M *hh<CR><LF> Ex) $GPGLL, 4250. 5589, S, 14718. 5084, E, 092204. 999, A*2 D Embedded System Lab. II 15
NMEA n GSA - DOP and Active Satellites ü ü GPS 수신 모드, 사용되는 위성 표시, 고도 등의 정보 데이터 표현 $GPGSA, a, b, xx, xx, xxx, xx, p. p, h. h, v. v*hh<C R><LF> Ex) $GPGSA, A, 3, 01, 20, 19, 13, , , , , 40. 4, 24. 4, 32. 2*0 A Embedded System Lab. II 16
NMEA n GSV - Satellites in view ü ü 시야에 있는 위성의 개수, 위성 ID Number, SNR 값 등의 정보 데이터 표현 $GPGSV, n, m, ss, xx, ee, aaa, cn, xxxx, ee, aaa, cn*hh<CR><LF> Ex) $GPGSV, 3, 1, 10, 20, 78, 331, 45, 01, 59, 235, 47, 22, 41, 069, , 13, 32, 252, 45*70 Embedded System Lab. II 17
NMEA n RMC - Recommended Minimum Specific GNSS Data ü ü 시간, 날짜, 위치, 경로, 스피드 등의 정보 데이터 표현 $GPRMC, hhmmss. dd, S, xxmm. dddd, <N|S>, yyymm. dddd, <E|W>, s. s, h. h, dd, mmyy, d. d, <E|W>, M*hh<CR><LF> Ex) $GPRMC, 092204. 999, A, 4250. 5589, S, 14718. 5084, E, 0. 00, 89. 68, 21, 1200, , *25 Embedded System Lab. II 18
NMEA n VTG - Course Over Ground and Ground Speed ü ü 경로 및 시간 등의 정보 데이터 표현 $GPVTG, h. h, T, m. m, M, s. s, N, s. s, K, M*hh<CR><LF> Ex) $GPVTG, 89. 68, T, , M, 0. 00, N, 0. 0, K*5 F Embedded System Lab. II 19
NMEA n ZDA – Time and Date ü ü 현재 UTC 시간, 날짜 등의 정보 데이터 표현 $GPZDA, <hhmmss. dd>, <ddmmyyyy>, <xx>, <yy>*hh Ex) $GPZDA, 132358. 14, 04122002, 00*6 A Embedded System Lab. II 20
GPS Device Driver #ifndef __KERNEL__ #define __KERNEL__ #endif #ifndef MODULE #define MODULE #endif #include #include #include <linux/module. h> <linux/kernel. h> <linux/version. h> <linux/fs. h> <linux/errno. h> <linux/types. h> <linux/fcntl. h> <linux/mm. h> <linux/init. h> <asm/io. h> <asm/uaccess. h> <asm/hardware. h> Embedded System Lab. II // printk() // everything. . . // error codes // size_t // O_ACCMODE 22
GPS Device Driver static int gps_init(void); static void gps_exit(void); static int gps_init(void) { GAFR 1_L &=~GPIO_28; // Set GPDR 1, BIT GPIO_46 GAFR 1_L |=GPIO_29; // Set GPDR 1, BIT GPIO_46 = GAFR 1_L |=GPIO_30; // Set GPDR 1, BIT GPIO_47 = GAFR 1_L &=~GPIO_31; // Set GPDR 1, BIT GPIO_47 printk("<<<<< init module >>>>n"); return 0; } static void gps_exit(void) { printk("<<<<< exit module >>>>n"); } EXPORT_NO_SYMBOLS; module_init(gps_init); module_exit(gps_exit); Embedded System Lab. II 23 =0 1 1 =0
GPS Test Program #include #include #include <stdio. h> <stdlib. h> <unistd. h> <fcntl. h> <sys/ioctl. h> <sys/signal. h> <sys/types. h> <string. h> <termios. h> static char receive_buff[256]; static char info_data[30][20]; static int handle; // GPGGA Data short GGAHour; short GGAMinute; short GGASecond; double GGALatitude; double GGALongitude; short GGAGPSQuality; short GGANum. Of. Sats. In. Use; double GGAHDOP; double GGAAltitude; unsigned short GGACount; int GGAOld. VSpeed. Seconds; double GGAOld. VSpeed. Alt; double GGAVert. Speed; Embedded System Lab. II // < 0 = South, > 0 = North // < 0 = West, > 0 = East // 0 = fix not available, 1 = GPS sps mode, 2 = Differential GPS, SPS mode, fix valid, // 3 = GPS PPS mode, fix valid // Altitude: mean-sea-level (geoid) meters 24
GPS Test Program // GPGSA short GSAMode; short GSAFix. Mode; double GSAPDOP; double GSAHDOP; double GSAVDOP; unsigned short GSACount; // GPRMC short RMCHour; short RMCMinute; short RMCSecond; short RMCData. Valid; double RMCLongitude; double RMCGround. Speed; double RMCCourse; short RMCDay; short RMCMonth; unsigned short RMCYear; double RMCMag. Var; unsigned short RMCCount; Embedded System Lab. II // M = manual, A = automatic 2 D/3 D // 1 = fix not available, 2 = 2 D, 3 = 3 D // A = Data valid, V = navigation rx warning // current longitude // speed over ground, knots // course over ground, degrees true // magnitic variation, degrees East(+)/West(-) 25
GPS Test Program void data_reset(void) { // GPGGA Data GGAHour = 0; GGAMinute = 0; GGASecond = 0; GGALatitude = 0. 0; GGALongitude = 0. 0; GGAGPSQuality = 0; mode, fix valid, // < 0 = South, > 0 = North // < 0 = West, > 0 = East // 0 = fix not available, 1 = GPS sps mode, 2 = Differential GPS, SPS // 3 = GPS PPS mode, fix valid GGANum. Of. Sats. In. Use = 0; GGAHDOP = 0. 0; GGAAltitude = 0. 0; // Altitude: mean-sea-level (geoid) meters GGACount = 0; GGAOld. VSpeed. Seconds = 0; GGAOld. VSpeed. Alt = 0. 0; GGAVert. Speed = 0. 0; // GPGSA GSAMode = 'M'; GSAFix. Mode = 1; GSAPDOP = 0. 0; GSAHDOP = 0. 0; GSAVDOP = 0. 0; GSACount = 0; Embedded System Lab. II // M = manual, A = automatic 2 D/3 D // 1 = fix not available, 2 = 2 D, 3 = 3 D 26
GPS Test Program // GPRMC RMCHour = 0; RMCMinute = 0; RMCSecond = 0; RMCData. Valid = 'V'; RMCLatitude = 0. 0; RMCLongitude = 0. 0; RMCGround. Speed = 0. 0; RMCCourse = 0. 0; RMCDay = 1; RMCMonth = 1; RMCYear = 2000; RMCMag. Var = 0. 0; RMCCount = 0; } // // // magnitic variation, degrees East(+)/West(-) int gps_main(void) { char Buff[256]; int Rx. Count; int loop, input_count; Embedded System Lab. II A = Data valid, V = navigation rx warning current latitude current longitude speed over ground, knots course over ground, degrees true 27
GPS Test Program while(1) { Rx. Count = read( handle, Buff, 1 ); if( Rx. Count == 0 ) { printf( "Receive Time Overn" ); continue; } if( Rx. Count < 0 ) { printf( "Read Errorn" ); break; } for( loop = 0; loop < Rx. Count; loop++ ) { receive_buff[input_count] = Buff[loop]; if (receive_buff[input_count] == 'n') { receive_buff[input_count] = '