lunes, 15 de noviembre de 2010

Tracking system

English
 We want to take a step in our project and we met the tracking, we want to know the path that our rocket does. In another post we talk about APRS, we don't discard it yet, but we will decant to a GPS + Arduino system, the problem of this system is that we need to recover the platform to treat the data, we don't have this problem with the APRS as we receive the coordinates via radio.

GPS installation and configuration
We put a DB-9 female connector to the GPS, we feed it with 5 volts and connect it directly to the computer and we look at the results in the arduino's hyperterminal (speed: 4800 baud).

We can see the results in the annex #1.


The 4 sentence by default that give us the GPS are repeated periodically, we can know the meaning of each frame in the GPS specifications that you can find in the link of the Annex #2 (the GPS does not converge since we are in the lab).

Condition the GPS signal with TTL level converter. Image only use the settings to low because we only want to receive data from GPS, doeth he Transmission cable does not use GPS. 

We use a board made by us based on ATmega (Arduino), this was design  for the WikiSat project and his name is AWIP. 

We went outside with a laptop and switch on the board with the GPS, this converges almost immediately and with startling accuracy. 

As we mentioned at the beginning, the system we have chosen have not wireless transmission and therefore will have to save the data that GPS provide us. And the way this data will be stored in an EEPROM (Programmable ROM) for subsequent extraction and treatment. 

And to end we made up a safe system of ignition, it is a remote control that we call "FIREBOX". It consists of a 9 volt battery with internal circuitry and its most important function is to prevent accidentally rocket launched. First you have to turn on, some LED's warn us that the rocket is armed and the other that the GPS is aligned, once we see that the GPS is aligned, we burn the arduino to below (without wasting time and memory that we have is quite low) ignite the rocket.


Castellano
Queremos dar un paso en nuestro proyecto y nos topamos con el tracking, queremos saber el recorrido que hace nuestro cohete. En otra entrada hablamos del APRS, no lo desechamos aún pero nos vamos a decantar hacia un sistema GPS + Arduino, el problema de este sistema es que necesitamos recuperar la plataforma para poder tratar los datos mientras que con el APRS recibíamos las coordenadas via radio.

Montaje y configuración del GPS:
Ponemos un conector DB-9 hembra al GPS, lo alimentamos con 5 voltios y lo conectamos directamente al ordenador y miramos los resultados en el hiperterminal del arduino (velocidad: 4800 baud).

Podemos ver los resultados en annex #1.

Las 4 "frase" por defecto (default) que nos da el GPS se repiten periodicamente, se puede saber el significado de cada trama en las especificaciones del GPS que podeis encontrar en el enlace del Annex #2 (el GPS no converge ya que estamos dentro del laboratorio).

Acondicionamos la señal del GPS con un convertidor de nivel TTL. De la imagen solo usamos la configuración de a bajo ya que solo queremos recibir datos del GPS, el cable de transmissión hacial el GPS no lo utilizaremos.


Utilizamos una placa hecha por nosotros en base ATmega (arduino), esta se diseñó para el proyecto WikiSat y su nombre es AWIP
 
Salimos al exterior con un ordenador portátil y encendimos la placa con el GPS, este converge casi inmediatamente y con una precisión asombrosa.

Como hemos comentado al principio, el sistema que hemos elegido no dispone de transmisión inalámbrica y por lo tanto se tendrán que almacenar los datos que nos proporciona el GPS. Y la manera de almacenar estos datos sera mediante la EEPROM (memoria ROM programable) para su posterior extracción y tratado.

Ya para terminar nos inventamos un sistema seguro de ignición, se trata de un mando a distáncia que hemos llamado "FIREBOX". Consta de una pila de 9 voltios con una circuiteria interior y su funcion más importante es evitar que se lance el cohete accidentalmente. Primero se tiene que encender, unos leds nos advierten que el cohete esta armado y otro de si el GPS esta alineado, una vez vemos que el GPS esta alineado, ponemos a grabar el arduino para seguidamente (sin perder tiempo ya que la memoria que tenemos es bastante escasa) igniciar el cohete.

Annex #1:
$GPRMC,163918,V,2503.7166,N,12138.4152,E,,,121110,003.5,W*7A
$GPGGA,163918,2503.7166,N,12138.4152,E,0,00,,,M,,M,,*50
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,21,14,192,00,22,69,310,00*7A
$GPRMC,163919,V,2503.7166,N,12138.4152,E,,,121110,003.5,W*7B
$GPGGA,163919,2503.7166,N,12138.4152,E,0,00,,,M,,M,,*51
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,21,14,192,00,22,69,310,00*7A
$GPRMC,163920,V,2503.7166,N,12138.4152,E,,,121110,003.5,W*71
$GPGGA,163920,2503.7166,N,12138.4152,E,0,00,,,M,,M,,*5B
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,21,14,192,00,22,69,310,00*7A
$GPRMC,163921,V,2503.7166,N,12138.4152,E,,,121110,003.5,W*70
$GPGGA,163921,2503.7166,N,12138.4152,E,0,00,,,M,,M,,*5A
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,21,14,192,00,22,69,310,00*7A
$GPRMC,163922,V,2503.7166,N,12138.4152,E,,,121110,003.5,W*73
$GPGGA,163922,2503.7166,N,12138.4152,E,0,00,,,M,,M,,*59
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,21,14,192,00,22,69,310,00*7A

Annex #2:
http://static.garmincdn.com/pumac/425_TechnicalSpecification.pdf

Annex #3:
CP210x USB driver
http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx

Arduino code:
// ATmega168@16MHz 5V
// Garmin GPS-18x VLC 010-00321-36
// http://www8.garmin.com/manuals/GPS18x_TechnicalSpecifications.pdf
// 1 Bounding.     Vcc (+5)
// 2 White.        Data in. The satellite sends TTL level, NMEA information, from the satellite (Function not used)
// 3 Green.        Data out. The FIRE BOX send TTL level, NMEA information, to the satellite (Function not used)
// 4 Small black.  Igniter 9Vcc. The FIRE BOX provide ground to the Igniter
// 5 Black.       *GND
// 6 Red.         *Armed. The satellite starts to record puting to LOWLEVEL (GND)
// 7 Yellow.      *GPS aligned. The satellite sends a flashing signal 5Vcc
// 8 Small black.  Igniter 9Vcc. The FIRE BOX provide Positive to the Igniter
// 9 -             Not connected
// * Means that should be connected to the satellite
// WARNING: The switches must be in OFF or DOWN position before to plug the wires into the FIREBOX
// This configuration needs a FIREBOX whit a charget 9V battery for the igniter (1.5V Bulb filled with powder and covered by epoxy)
// When de satellite has GPS coverage, the ALIGNED led will flash. Rise the ARMED switch and then rise the LAUNCH to start the ignition
// http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&fname=/SGI_EndUser/MSB3xx_UG/ch07.html
//
// Battery pack before launch 6.35V


#include <SoftwareSerial.h>
#include <EEPROM.h>
SoftwareSerial GPS = SoftwareSerial(11,13); // SoftwareSerial(rxPin, txPin)
int addr;
int val;
int onair;
byte a[13];
void setup ()
{
  pinMode(12, INPUT); // 12 is the ISP central top pin
  addr = 0;
  val = 36; // '$' 36=00100100
  onair=0;
  a[0] = 0;
  a[1] = 0;
  a[2] = 0;
  a[3] = 0;
  a[4] = 0;
  a[5] = 0;
  a[6] = 0;
  a[7] = 0;
  a[8] = 0;
  a[9] = 0;
  a[10] = 0;
  a[11] = 0;
  a[12] = 0;
  GPS.begin(4800);
  Serial.begin(115200);
}


byte Next()
{
  // BYTE, BIN, OCT, HEX, 1 = number of decimals
  val = byte(GPS.read());
  Serial.print(val, BYTE);
  if(digitalRead(12) == LOW)
  {
    onair = 1;
  }
  return val;
}

void loop()
{
// $GPGSA,A,1,,,,,,,,,,,,,,,*1E
// $GPGSV,2,1,08,02,18,099,00,04,14,066,00,09,50,112,00,22,03,255,00*77
// $GPGSV,2,2,08,25,56,278,00,27,36,117,00,29,24,198,00,30,19,263,00*7E
// $GPRMC,060937,V,4116.5264,N,00159.1348,E,,,131110,000.8,W*77
// $GPGGA,060937,4116.5264,N,00159.1348,E,0,00,,,M,,M,,*52
  if(Next()=='$')
  {
    if(Next()=='G')
    {
      if(Next()=='P')
      {
        if(Next()=='G')
        {
          if(Next()=='G')
          {
            if(Next()=='A')
            {
              //Serial.println(" GPRMC sequence");
              while(Next()!='.');
              // Latitude sequence
              a[0] = Next();
              a[1] = Next();
              a[2] = Next();
              a[3] = Next();
              while(Next()!='.');
              // Longitude sequence
              a[4] = Next();
              a[5] = Next();
              a[6] = Next();
              a[7] = Next();
/*
              while(Next()!=',');
              while(Next()!=',');
              while(Next()!=',');
              while(Next()!=',');
              while(Next()!=',');
              // Altitude sequence
              a[8] = Next();
              a[9] = Next();
              a[10] = Next();
              a[11] = Next();
              a[12] = Next();
*/
            }
            if((addr<512) && (onair==1))
            {
              Serial.println("");
              EEPROM.write(addr, a[0]);
              addr++;
              EEPROM.write(addr, a[1]);
              addr++;
              EEPROM.write(addr, a[2]);
              addr++;
              EEPROM.write(addr, a[3]);
              addr++;
              EEPROM.write(addr, a[4]);
              addr++;
              EEPROM.write(addr, a[5]);
              addr++;
              EEPROM.write(addr, a[6]);
              addr++;
              EEPROM.write(addr, a[7]);
              addr++;
/*
              EEPROM.write(addr, a[8]);
              addr++;
              EEPROM.write(addr, a[9]);
              addr++;
              EEPROM.write(addr, a[10]);
              addr++;
              EEPROM.write(addr, a[11]);
              addr++;
              EEPROM.write(addr, a[12]);
              addr++;
*/
            }
          }
        }
      }
    }
  }
}


Pictures (Fotos):

 Picture #1
Garmin GPS 18x LVC.
Picture #2
TTL level converter, we only use the botom configuration.
Convertidor de nivel TTL, nosotros solo usamos la configuración de abajo.

Link:
http://freecircuitdiagram.com/2009/03/27/simple-ttl-rs232-level-converter-using-transistor/

Picture #3
TTL level converter.
Convertidor de nivel TTL.
Picture #4
Picture #5
Picture #6
GPS + AWIP system in the stage2 nose.
Sistema GPS + AWIP en el morro de la etapa 2.
Picture #7
FIREBOX.
Picture #8
FIREBOX pins
Pins de la FIREBOX

No hay comentarios:

Publicar un comentario