From 68a81c69747a5d58a6b172ce10fae1f30f684791 Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Thu, 25 Feb 2016 14:36:00 +0100 Subject: [PATCH] RD94: NAV-SOL --- dropsonde/rd94.txt | 5 +++-- dropsonde/rd94drop.c | 42 +++++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/dropsonde/rd94.txt b/dropsonde/rd94.txt index 4b9273b..9b87442 100644 --- a/dropsonde/rd94.txt +++ b/dropsonde/rd94.txt @@ -3,6 +3,7 @@ Dropsonde RD94 GPS: ublox TIM-5H + FSK 4800 bit/sec Manchester, 8N1: 240 bytes/sec @@ -18,10 +19,10 @@ Frame besteht aus header plus 5 Bloecke mit 16bit-Checksumme. Checksumme: Fletcher16 mod 256 PTU data: float32 (exp|sgn|mantissa) +GPS: ublox5 NAV-SOL - -header | cnt chk0 | P T U1 U2 chk1 | TOW week ecef-X ecef-Y ecef-Z pos-acc vX1 vY1 vZ1 vel-acc sat chk2 | vX2 vY2 vZ2 vel-acc sat chk3 | ID "A5" bat Ti chk4 +header | cnt chk0 | P T U1 U2 chk1 | iTOW fTOW? week ecef-X ecef-Y ecef-Z pAcc vX1 vY1 vZ1 sAcc1 sat chk2 | vX2 vY2 vZ2 sAcc2 sat chk3 | ID "A5" bat Ti chk4 1acffc1d 01 4002 4385 873f3e9f 84b8747c 8419e1c0 8407b540 00 8dc5 b6960a0d 4c6a0200 5b07 03dd b0891417 8284de00 9bd4251e 23010000 3bf6ffff 53050000 25000000 3d000000 ac00 08 18d8 03 66f6ffff 46050000 16000000 3c000000 08 0203 07df0266 4135 069201 c21e 831a2ff0 a80305227006 4126 # check: 00000_00 1acffc1d 01 4102 4487 873f6622 84b83b34 841a7ac0 84088040 00 1da0 aa980a0d ea6b0200 5b07 03dd d0841417 2787de00 9fd4251e 23010000 46f6ffff 47050000 26000000 3b000000 ac00 08 7245 03 52f6ffff 3c050000 26000000 3f000000 08 f7cc 07df0266 4135 069201 071f 83199130 880305216d06 046b # check: 00000_00 1acffc1d 01 4202 4589 873fad73 84b7f7a3 841b8040 84093a40 00 21f9 9e9a0a0d 876d0200 5b07 03dd f27f1417 ca89de00 a4d4251e 23010000 50f6ffff 59050000 13000000 3e000000 ac00 08 daac 03 5af6ffff 59050000 1a000000 3d000000 08 0e57 07df0266 4135 069201 c21e 83195a70 900305227106 d467 # check: 00000_00 diff --git a/dropsonde/rd94drop.c b/dropsonde/rd94drop.c index be6cd3c..1ca3096 100644 --- a/dropsonde/rd94drop.c +++ b/dropsonde/rd94drop.c @@ -30,12 +30,12 @@ typedef struct { int std; int min; int sek; int ms; double lat; double lon; double alt; double X; double Y; double Z; - double posAcc; + double pAcc; double vX1; double vY1; double vZ1; - double vel1Acc; + double sAcc1; int sats1; double vX2; double vY2; double vZ2; - double vel2Acc; + double sAcc2; int sats2; double vN; double vE; double vU; double vH; double vD; double vD2; @@ -314,26 +314,30 @@ void Gps2Date(long GpsWeek, long GpsSeconds, int *Year, int *Month, int *Day) { #define OFS (0x02) // HEADLEN/(2*BITS) #define pos_FrameNb (OFS+0x01) // 2 byte -#define pos_GPSTOW (OFS+0x18) // 4 byte... +// ublox5 NAV-SOL +#define pos_GPSTOW (OFS+0x18) // iTow 4 byte (+ fTOW? 4 byte) #define pos_GPSweek (OFS+0x20) // 2 byte #define pos_GPSecefX (OFS+0x24) // 4 byte #define pos_GPSecefY (OFS+0x28) // 4 byte #define pos_GPSecefZ (OFS+0x2C) // 4 byte -#define pos_GPSposAcc (OFS+0x30) // 4 byte +#define pos_GPSpAcc (OFS+0x30) // 4 byte #define pos_GPSecefV1 (OFS+0x34) // 3*4 byte -#define pos_GPSvel1Acc (OFS+0x40) // 4 byte +#define pos_GPSsAcc1 (OFS+0x40) // 4 byte #define pos_GPSsats1 (OFS+0x46) // 1 byte #define pos_GPSecefV2 (OFS+0x4A) // 3*4 byte -#define pos_GPSvel2Acc (OFS+0x56) // 4 byte +#define pos_GPSsAcc2 (OFS+0x56) // 4 byte #define pos_GPSsats2 (OFS+0x5A) // 1 byte +// PTUsensors #define pos_sensorP (OFS+0x05) // 4 byte float32 #define pos_sensorT (OFS+0x09) // 4 byte float32 #define pos_sensorU1 (OFS+0x0D) // 4 byte float32 #define pos_sensorU2 (OFS+0x11) // 4 byte float32 +// internal #define pos_sensorTi (OFS+0x68) // 4 byte float32 #define pos_ID (OFS+0x5D) // 4 byte -#define pos_rev (OFS+0x61) // 2 byte char // e.g. "A5" +#define pos_rev (OFS+0x61) // 2 byte char? // e.g. "A5" #define pos_bat (OFS+0x66) // 2 byte +// checksums #define pos_chkFrNb (pos_FrameNb-1 + 3) // 16 bit #define pos_chkPTU (pos_sensorP + 17) // 16 bit #define pos_chkGPS1 (pos_GPSTOW + 47) // 16 bit @@ -486,11 +490,11 @@ int get_GPSkoord() { gpx.alt = h; for (i = 0; i < 4; i++) { - byte = frame_bytes[pos_GPSposAcc + i]; + byte = frame_bytes[pos_GPSpAcc + i]; XYZ_bytes[i] = byte; } memcpy(&XYZ, XYZ_bytes, 4); - gpx.posAcc = XYZ / 100.0; + gpx.pAcc = XYZ / 100.0; gpx.X = X[0]; gpx.Y = X[1]; gpx.Z = X[2]; @@ -564,11 +568,11 @@ int get_GPSvel() { gpx.vD = dir; for (i = 0; i < 4; i++) { - byte = frame_bytes[pos_GPSvel1Acc + i]; + byte = frame_bytes[pos_GPSsAcc1 + i]; XYZ_bytes[i] = byte; } memcpy(&XYZ, XYZ_bytes, 4); - gpx.vel1Acc = XYZ / 100.0; + gpx.sAcc1 = XYZ / 100.0; for (k = 0; k < 3; k++) { @@ -585,11 +589,11 @@ int get_GPSvel() { gpx.sats2 = frame_bytes[pos_GPSsats2]; for (i = 0; i < 4; i++) { - byte = frame_bytes[pos_GPSvel2Acc + i]; + byte = frame_bytes[pos_GPSsAcc2 + i]; XYZ_bytes[i] = byte; } memcpy(&XYZ, XYZ_bytes, 4); - gpx.vel2Acc = XYZ / 100.0; + gpx.sAcc2 = XYZ / 100.0; return 0; @@ -795,19 +799,19 @@ void print_frame() { fprintf(stdout, " alt: %.2fm ", gpx.alt); if (option_verbose == 2) { //fprintf(stdout," (%7.2f,%7.2f,%7.2f) ", gpx.X, gpx.Y, gpx.Z); - fprintf(stdout, " (E:%.2fm) ", gpx.posAcc); + fprintf(stdout, " (E:%.2fm) ", gpx.pAcc); } if (option_verbose) fprintf(stdout," sats: %2d ", gpx.sats1); if (option_verbose == 2) { fprintf(stdout," V1: (%5.2f,%5.2f,%5.2f) ", gpx.vX1, gpx.vY1, gpx.vZ1); - fprintf(stdout, "(E:%.2fm/s) ", gpx.vel1Acc); + fprintf(stdout, "(E:%.2fm/s) ", gpx.sAcc1); } fprintf(stdout," vH: %.1fm/s D: %.1f° vV: %.1fm/s ", gpx.vH, gpx.vD, gpx.vU); - fprintf(stdout," ENU=(%.2f,%.2f,%.2f) ", gpx.vE, gpx.vN, gpx.vU); if (option_verbose == 2) { + fprintf(stdout," ENU=(%.2f,%.2f,%.2f) ", gpx.vE, gpx.vN, gpx.vU); fprintf(stdout," V2: (%5.2f,%5.2f,%5.2f) ", gpx.vX2, gpx.vY2, gpx.vZ2); - fprintf(stdout, "(E:%.2fm/s) ", gpx.vel2Acc); + fprintf(stdout, "(E:%.2fm/s) ", gpx.sAcc2); fprintf(stdout," sats: %2d ", gpx.sats2); } @@ -951,7 +955,7 @@ int main(int argc, char **argv) { if (pbuf == NULL) break; frame_rawbits[RAWBITFRAME_LEN+1] = '\0'; len = strlen(frame_rawbits); - if (len > 2*BITS*pos_GPSposAcc) print_bitframe(len); + if (len > 2*BITS*pos_GPSpAcc) print_bitframe(len); } } else { // input: bytes