Skip to main content

Posts

Showing posts from June, 2013

9DOF IMU on an Arduino MicroSD shield

The SDA and SCL bus lines for the three sensors (magnetometer HMC 5883L, accelerometer and gyro) were joined with not issues checked through the serial communication. (picture below). Biasing was completed with the following pseudo code. It makes use of a  running summation and computes an average once a number of measurements have been collected. /* This is a script to remove signal bias from filtered signal. Author: Paulin Kantue Date: June 2013 */ #define COUNT 50 //Number of values to be counted for biasing boolean computeBias(int raw_vec[], int bias_vec[], int8_t size_count, int8_t *bias_count){   int8_t counter = *bias_count;    boolean flag; // flag to compute sensor bias;   if (counter < COUNT){     for (int i = 0; i < size_count; i++){       bias_vec[i] += raw_vec[i];     }     *bias_count+=1;     flag = true;   }   else {     for (int i = 0; i < size_count; i++){       bias_vec[i] /= COUNT;       raw_vec[i] -= bias_vec[i];     }     flag