diff --git a/flight/AHRS/ahrs.c b/flight/AHRS/ahrs.c index 5749ff396..e52795538 100644 --- a/flight/AHRS/ahrs.c +++ b/flight/AHRS/ahrs.c @@ -62,15 +62,15 @@ void DMA1_Channel1_IRQHandler() __attribute__ ((alias ("AHRS_ADC_DMA_Handler"))) // For debugging the raw sensors //#define DUMP_RAW -//#define DUMP_FRIENDLY +#define DUMP_FRIENDLY /** * @addtogroup AHRS_Definitions * @{ */ // Currently analog acquistion hard coded at 480 Hz -#define ADC_OVERSAMPLE 12 -#define EKF_RATE ((float) 480 / ADC_OVERSAMPLE) +#define ADC_OVERSAMPLE 40 +#define EKF_RATE ((float) 4*480 / ADC_OVERSAMPLE) #define ADC_CONTINUOUS_CHANNELS PIOS_ADC_NUM_PINS #define CORRECTION_COUNT 4 diff --git a/flight/AHRS/inc/pios_board.h b/flight/AHRS/inc/pios_board.h index eabfd0b85..a0100442a 100644 --- a/flight/AHRS/inc/pios_board.h +++ b/flight/AHRS/inc/pios_board.h @@ -193,7 +193,7 @@ TIM8 | | | | #define PIOS_ADC_NUM_ADC_CHANNELS 2 #define PIOS_ADC_USE_ADC2 1 #define PIOS_ADC_CLOCK_FUNCTION RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2, ENABLE) -#define PIOS_ADC_ADCCLK RCC_PCLK2_Div8 +#define PIOS_ADC_ADCCLK RCC_PCLK2_Div2 /* RCC_PCLK2_Div2: ADC clock = PCLK2/2 */ /* RCC_PCLK2_Div4: ADC clock = PCLK2/4 */ /* RCC_PCLK2_Div6: ADC clock = PCLK2/6 */ diff --git a/flight/AHRS/pios_board.c b/flight/AHRS/pios_board.c index 1c9a89b44..257509243 100644 --- a/flight/AHRS/pios_board.c +++ b/flight/AHRS/pios_board.c @@ -157,7 +157,7 @@ void USART3_IRQHandler() __attribute__ ((alias ("PIOS_USART_aux_irq_handler"))); const struct pios_usart_cfg pios_usart_aux_cfg = { .regs = USART3, .init = { - .USART_BaudRate = 115200, + .USART_BaudRate = 230400, .USART_WordLength = USART_WordLength_8b, .USART_Parity = USART_Parity_No, .USART_StopBits = USART_StopBits_1, diff --git a/ground/src/experimental/SerialLogger/analyzeINSGPS.m b/ground/src/experimental/SerialLogger/analyzeINSGPS.m index 8561d228f..a47a4d54b 100644 --- a/ground/src/experimental/SerialLogger/analyzeINSGPS.m +++ b/ground/src/experimental/SerialLogger/analyzeINSGPS.m @@ -43,6 +43,8 @@ if(gaps) % get biggest contiguous chunk data = data(idx); end +data(end) = []; % delete in case partial update + q = cat(1,data.q); accel = cat(1,data.accel); gyro = cat(1,data.gyro);