Posted by Jordi Muñoz on September 30, 2009 at 4:59pm
Hi there, well I'm happy to announce the new ArduPilot 2.4 firmware, i still have many things to add, but i will leave them for 2.5 .What's new:-Improved ADC conversion, now uses interrupts to free some CPU.-uBlox parser bug fix, now i can navigate better.-Added a new header option called "ALT_HOLD_HOME". Let you select what altitude you want to hold for home, 0 will hold the altitude you are when you switch to RTL, 1 = will hold the altitude defined on the confiq. tool.-Altitude hold dramatically improved for my Easystar. (Thanks to Bill!).-Airspeed and throttle control improved.To do:-Add Happy Kill More code for Remzibi Integration.-Change the TX protocol to binary.-Use interrupts for the serial output.-Header typos correction.-Maybe cross-track error or another solution to fly straight lines between waypoints.Source Code: ArduPilot_EasyStar_V24.zipMy header: easystar.h
In my opinion configuration of MTK chipsets of GPS modules need some changes as in my understanding are some mist described .
This lines in fact set update frequencys :
#define LOCOSYS_REFRESH_RATE_200 "$PMTK220,200*2C" //200 milliseconds
#define LOCOSYS_REFRESH_RATE_250 "$PMTK220,250*29\r\n" //250 milliseconds
So first set update for 5Hz(every 200ms) and second as 4Hz(every 250ms) - and it is OK .
But this line show as what info must be transmitted by every by update :
#define NMEA_OUTPUT_1HZ "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC
So in fact not define 1Hz , but nuber 1 define transmit this selected info every update (this update frequency set by line "$PMTK220,200*2C" - 5Hz for example) .
this line will define selected info transmit every 5 updates :
#define NMEA_OUTPUT_5HZ "$PMTK314,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 5HZ
So in fact , when 5Hz is set by "$PMTK220,200*2C" , it not define transmition for 5Hz but for 1Hz only , as it say - transmit this selected string every 5 updates .
So I propose to exchange all of this :
#define NMEA_OUTPUT_5HZ "$PMTK314,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 5HZ
#define NMEA_OUTPUT_4HZ "$PMTK314,0,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 4HZ
#define NMEA_OUTPUT_3HZ "$PMTK314,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 3HZ
#define NMEA_OUTPUT_2HZ "$PMTK314,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 2HZ
#define NMEA_OUTPUT_1HZ "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 1HZ
to only this line :
#define NMEA_OUTPUT_GGA_RMC "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC
And frequency of update will select only this lines :
#define LOCOSYS_REFRESH_RATE_200 "$PMTK220,200*2C" //200 milliseconds - 5Hz update
#define LOCOSYS_REFRESH_RATE_250 "$PMTK220,250*29\r\n" //250 milliseconds - 4Hz update
so variable LOCOSYS_REFRESH_RATE_200 - can be changed to LOCOSYS_REFRESH_RATE_5Hz
and variable LOCOSYS_REFRESH_RATE_250 - can be changed to LOCOSYS_REFRESH_RATE_4Hz
Also add this lines selecting modules to work with WAAS correction positioning system :
#define WAAS_SET1 "$PMTK313,1*2E"
#define WAAS_SET2 "$PMTK301,2*2E"
So usage in GPS_NMEA sketch can be :
void init_gps(void)
{
pinMode(12, OUTPUT);//Status led
Serial.begin(9600);
delay(1000);
Serial.println(LOCOSYS_BAUD_RATE_38400);
Serial.begin(38400);
delay(500);
Serial.println(LOCOSYS_REFRESH_RATE_5Hz);
delay(500);
Serial.println(NMEA_OUTPUT_GGA_RMC);
delay(500);
Serial.println(WAAS_SET1);
Serial.println(WAAS_SET2);
}
All are .println to end each line by CR LF char .
This config will work well with every MTK based GPS modules - as Locosys , em85 and GT(delivered with OSD set) , if some wants - can try also 10Hz update with GT modules :) .
Can be added in next ver. ?
Are those fire and forget missiles? I think in reality you'll get a lot of torque on your airframe when the first missile fires. You should probably validate your airframe alignment before firing the second missile (rather than just waiting a second.) Here the whole time Jordi's been talking about Miss Duino I thought he was referring to his girlfriend. :-)
Comments
This lines in fact set update frequencys :
#define LOCOSYS_REFRESH_RATE_200 "$PMTK220,200*2C" //200 milliseconds
#define LOCOSYS_REFRESH_RATE_250 "$PMTK220,250*29\r\n" //250 milliseconds
So first set update for 5Hz(every 200ms) and second as 4Hz(every 250ms) - and it is OK .
But this line show as what info must be transmitted by every by update :
#define NMEA_OUTPUT_1HZ "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC
So in fact not define 1Hz , but nuber 1 define transmit this selected info every update (this update frequency set by line "$PMTK220,200*2C" - 5Hz for example) .
this line will define selected info transmit every 5 updates :
#define NMEA_OUTPUT_5HZ "$PMTK314,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 5HZ
So in fact , when 5Hz is set by "$PMTK220,200*2C" , it not define transmition for 5Hz but for 1Hz only , as it say - transmit this selected string every 5 updates .
So I propose to exchange all of this :
#define NMEA_OUTPUT_5HZ "$PMTK314,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 5HZ
#define NMEA_OUTPUT_4HZ "$PMTK314,0,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 4HZ
#define NMEA_OUTPUT_3HZ "$PMTK314,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 3HZ
#define NMEA_OUTPUT_2HZ "$PMTK314,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 2HZ
#define NMEA_OUTPUT_1HZ "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC to 1HZ
to only this line :
#define NMEA_OUTPUT_GGA_RMC "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" //Set GGA and RMC
And frequency of update will select only this lines :
#define LOCOSYS_REFRESH_RATE_200 "$PMTK220,200*2C" //200 milliseconds - 5Hz update
#define LOCOSYS_REFRESH_RATE_250 "$PMTK220,250*29\r\n" //250 milliseconds - 4Hz update
so variable LOCOSYS_REFRESH_RATE_200 - can be changed to LOCOSYS_REFRESH_RATE_5Hz
and variable LOCOSYS_REFRESH_RATE_250 - can be changed to LOCOSYS_REFRESH_RATE_4Hz
Also add this lines selecting modules to work with WAAS correction positioning system :
#define WAAS_SET1 "$PMTK313,1*2E"
#define WAAS_SET2 "$PMTK301,2*2E"
So usage in GPS_NMEA sketch can be :
void init_gps(void)
{
pinMode(12, OUTPUT);//Status led
Serial.begin(9600);
delay(1000);
Serial.println(LOCOSYS_BAUD_RATE_38400);
Serial.begin(38400);
delay(500);
Serial.println(LOCOSYS_REFRESH_RATE_5Hz);
delay(500);
Serial.println(NMEA_OUTPUT_GGA_RMC);
delay(500);
Serial.println(WAAS_SET1);
Serial.println(WAAS_SET2);
}
All are .println to end each line by CR LF char .
This config will work well with every MTK based GPS modules - as Locosys , em85 and GT(delivered with OSD set) , if some wants - can try also 10Hz update with GT modules :) .
Can be added in next ver. ?
LOL!
-Peter