Mongoose 9DOF IMU with BMP085
Mongoose 9DOF IMU with BMP085
We have a 9DOF IMU board that looks like it could work with the Multiwii firmware. It has the following parts on it:
-Atmega328p with arduino bootloader running at 3.3V and 8MHz
-ITG3200 3 axis gyro
-ADXL345 3 axis accelerometer
-HMC5883L 3 axis magnetometer
-BMP085 barometric pressure sensor
-on board 3.3v regulator
-SPI bus, I2C bus, UART, and 9 additional IO pins brought out to 0.1inch headers
http://store.ckdevices.com/products/Mongoose-9DoF-IMU-with-Barometric-Pressure-Sensor-.html
The price is $115 CAD with free worldwide shipping.
It looks like the Multiwii firmware would work will all of these sensors with a bit of tweaking, and that there are enough IO pins for connecting to the RC receiver and 4 motor controllers. We have working AHRS code, so the I2C code for talking to the sensors could be pulled from that if needed.
Right now we are populating it with a 8MHz crystal, but it is possible to run the Atmega328p at 3.3v and 16MHz (it is overclocking it a bit, but it works fine. We've been doing one one of our other designs, and the Flytron guys have been doing it for a while without any problems). If this is of interest to anyone, we could offer a 16MHz version and also change the bootloader over to 16MHz as well.
Thanks,
Cory
-Atmega328p with arduino bootloader running at 3.3V and 8MHz
-ITG3200 3 axis gyro
-ADXL345 3 axis accelerometer
-HMC5883L 3 axis magnetometer
-BMP085 barometric pressure sensor
-on board 3.3v regulator
-SPI bus, I2C bus, UART, and 9 additional IO pins brought out to 0.1inch headers
http://store.ckdevices.com/products/Mongoose-9DoF-IMU-with-Barometric-Pressure-Sensor-.html
The price is $115 CAD with free worldwide shipping.
It looks like the Multiwii firmware would work will all of these sensors with a bit of tweaking, and that there are enough IO pins for connecting to the RC receiver and 4 motor controllers. We have working AHRS code, so the I2C code for talking to the sensors could be pulled from that if needed.
Right now we are populating it with a 8MHz crystal, but it is possible to run the Atmega328p at 3.3v and 16MHz (it is overclocking it a bit, but it works fine. We've been doing one one of our other designs, and the Flytron guys have been doing it for a while without any problems). If this is of interest to anyone, we could offer a 16MHz version and also change the bootloader over to 16MHz as well.
Thanks,
Cory
Re: Mongoose 9DOF IMU with BMP085
interesting.
How do servos or ESCs cope with pwm signals @3.3 volts level?
How do servos or ESCs cope with pwm signals @3.3 volts level?
Re: Mongoose 9DOF IMU with BMP085
I've never had a problem using servos with 5V power and 3.3V pwm signal in the past. We've been using Mongoose with HXT900 servos to do some camera control, and it has been working fine. I also just did a test on a HK-30A ESC to see how low the pwm signal could get. I reduced the voltage of the pwm signal down to 2.1V and the ESC was still working fine. So for the bit of hardware I've tested it doesn't seem to be a problem.
Cory
Cory
Re: Mongoose 9DOF IMU with BMP085
You could also provide this little board with a preloaded firmware that will do the data acquisition from all the sensors on the board automatically and drops them over i2c all in one transaction so we can use it with arduino boards. (Food for the brains ... )
Re: Mongoose 9DOF IMU with BMP085
The current firmware does output roll pitch and yaw angles as well as all the raw sensor data over the UART with a 50Hz update rate. So it could be used as is to do exactly what you are talking about.
Another idea would be to use the SPI port to transfer data between the Mongoose and the main controller, with the main controller being the SPI master. If the transfer was done as binary (instead of ASCII) this would be very fast and allow for lots of savings on the processor bandwidth on the main controller as compared to polling all the sensors over I2C as is done in most setups. I think all the data could be sent in about 40 bytes and if the SPI was running at 4MHz, the compete transfer would only take about 100usec. This is at least 10 times faster than if the main processor was to poll all the sensors over I2C.
If anyone is interested in using Mongoose this way, I could work on making a firmware release that supports this.
-Cory
Another idea would be to use the SPI port to transfer data between the Mongoose and the main controller, with the main controller being the SPI master. If the transfer was done as binary (instead of ASCII) this would be very fast and allow for lots of savings on the processor bandwidth on the main controller as compared to polling all the sensors over I2C as is done in most setups. I think all the data could be sent in about 40 bytes and if the SPI was running at 4MHz, the compete transfer would only take about 100usec. This is at least 10 times faster than if the main processor was to poll all the sensors over I2C.
If anyone is interested in using Mongoose this way, I could work on making a firmware release that supports this.
-Cory
Re: Mongoose 9DOF IMU with BMP085
I will be interested in ordering this ... i will contact you as soon as i get the money available.
I will use it as sensor board and the processing i will do with a arduino mega.
50Hz update seems ok (any other opinions) for a flying drone.
Also SPI data transfer wold be nice also ... but i think will be more complicated to read the data.
I will use it as sensor board and the processing i will do with a arduino mega.
50Hz update seems ok (any other opinions) for a flying drone.
Also SPI data transfer wold be nice also ... but i think will be more complicated to read the data.
Re: Mongoose 9DOF IMU with BMP085
I could make some Arduino example code that shows how to read data from the Mongoose using SPI. 50Hz is the standard sensor update rate, but it can go as high as 200Hz.
-Cory
-Cory
Re: Mongoose 9DOF IMU with BMP085
ckdevices wrote:I could make some Arduino example code that shows how to read data from the Mongoose using SPI. 50Hz is the standard sensor update rate, but it can go as high as 200Hz.
-Cory
This is great ... i think 200Hz is more than needed for a simple flying drone. For more complex flying with more sensors like proximity, air speed, etc the faster the better, so a SPI data read wold be nice.
Re: Mongoose 9DOF IMU with BMP085
I have managed to implement multiwii 1.9 on mongoose as stand alone stabilization system. You can find details here:
http://www.fuzzydrone.org/2012/01/connecting-motors-and-radio-receiver-to.html
and
http://www.fuzzydrone.org/2012/01/mongoose-multiwii-19-download.html
It is time to include it.
http://www.fuzzydrone.org/2012/01/connecting-motors-and-radio-receiver-to.html
and
http://www.fuzzydrone.org/2012/01/mongoose-multiwii-19-download.html
It is time to include it.
Re: Mongoose 9DOF IMU with BMP085
HI matbogdan,
I have made a merge with the latest shared code.
I want you to confirm the functionality.
/Patrik
I have made a merge with the latest shared code.
I want you to confirm the functionality.
/Patrik
Re: Mongoose 9DOF IMU with BMP085
I have checked and made some changes so we can compile with mongoose strap config.
This is for multiwii shared. I could not make the camera stabilization work but I will keep on working for this.
At this point I have all sensors working, RX PPM sum working OK and all motors of Quadrocopter working as they are supposed to work.
Here are the DIFF changes from revision 545:
def.h
Output.pde
RX.pde
Serial.pde
This should compile the changes for MONGOOSE board and should make all sensors work. Same are the motors and RX PPM SUM.
Please check it yourself and commit if necessary to shared for now.
I do not recommend this version of MONGOOSE changes to be used in flying drone yet until it is committed so I can check if it is flyable.
The owners of MONGOOSE can use for now the version i have posted on my blog that is a MultiWii 1.9 adapted for MONGOOSE.
PS: if you need the working files so you can do diff and get the changes yourself, I can upload my working multiwii shared here, but the diff from from revision 545 should be fine so you can commit the changes.
This is for multiwii shared. I could not make the camera stabilization work but I will keep on working for this.
At this point I have all sensors working, RX PPM sum working OK and all motors of Quadrocopter working as they are supposed to work.
Here are the DIFF changes from revision 545:
def.h
Code: Select all
--- C:/TMP/def.h-revBASE.svn001.tmp.h Mon Feb 6 01:49:44 2012
+++ D:/#tricopter/multiwiiSVN/trunk/MultiWii_shared/def.h Mon Feb 6 18:58:28 2012
@@ -1,6 +1,8 @@
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
- #define PROMINI
+#if !defined(MONGOOSE1_0)
+ #define PROMINI
#endif
+#endif
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#define MEGA
#endif
@@ -215,38 +217,35 @@
#define LEDPIN_TOGGLE PIND |= 1<<4; //switch LEDPIN state (digital PIN 13)
#define LEDPIN_OFF PORTD &= ~(1<<4);
#define LEDPIN_ON PORTD |= (1<<4);
-/*
- #define DIGITAL_SERVO_TRI_PINMODE pinMode(3,OUTPUT); //also right servo for BI COPTER
- #define DIGITAL_SERVO_TRI_HIGH PORTD |= 1<<3;
- #define DIGITAL_SERVO_TRI_LOW PORTD &= ~(1<<3);
- #define DIGITAL_TILT_PITCH_PINMODE pinMode(A0,OUTPUT);
- #define DIGITAL_TILT_PITCH_HIGH PORTC |= 1<<0;
- #define DIGITAL_TILT_PITCH_LOW PORTC &= ~(1<<0);
- #define DIGITAL_BI_LEFT_PINMODE pinMode(11,OUTPUT);
- #define DIGITAL_BI_LEFT_HIGH PORTB |= 1<<3;
- #define DIGITAL_BI_LEFT_LOW PORTB &= ~(1<<3);
-*/
#define PPM_PIN_INTERRUPT attachInterrupt(0, rxInt, RISING); //PIN 0
#define SPEK_SERIAL_VECT USART_RX_vect
#define SPEK_BAUD_SET UCSR0A = (1<<U2X0); UBRR0H = ((F_CPU / 4 / 115200 -1) / 2) >> 8; UBRR0L = ((F_CPU / 4 / 115200 -1) / 2);
#define SPEK_SERIAL_INTERRUPT UCSR0B |= (1<<RXEN0)|(1<<RXCIE0);
#define SPEK_DATA_REG UDR0
-// #define MOTOR_ORDER 9,10,11,3,6,5 //for a quad+: rear,right,left,front
+
#define MOTOR_ORDER 11,10,9,3 //for a quad+: RRight ,FRight ,RLeft, FLeft, n, n
- #define DIGITAL_TILT_PITCH_PINMODE pinMode(6,OUTPUT);
- #define DIGITAL_TILT_PITCH_HIGH PORTD |= 1<<6;
- #define DIGITAL_TILT_PITCH_LOW PORTD &= ~(1<<6);
+ #define SERVO_1_PINMODE ;//pinMode(6,OUTPUT);
+ #define SERVO_1_PIN_HIGH ;//PORTD |= 1<<6;
+ #define SERVO_1_PIN_LOW ;//PORTD &= ~(1<<6);
- #define DIGITAL_TILT_ROLL_PINMODE pinMode(A1,OUTPUT); //unused
- #define DIGITAL_TILT_ROLL_HIGH PORTC |= 1<<1; //unused
- #define DIGITAL_TILT_ROLL_LOW PORTC &= ~(1<<1); //unused
+ #define SERVO_2_PINMODE ;//pinMode(6,OUTPUT);
+ #define SERVO_2_PIN_HIGH ;//PORTD |= 1<<6;
+ #define SERVO_2_PIN_LOW ;//PORTD &= ~(1<<6);
- //#define DIGITAL_CAM_PINMODE pinMode(6,OUTPUT);
- //#define DIGITAL_CAM_HIGH PORTC |= 1<<6;
- //#define DIGITAL_CAM_LOW PORTC &= ~(1<<6);
+ #define BUZZERPIN_PINMODE ;
+ #define BUZZERPIN_ON ;
+ #define BUZZERPIN_OFF ;
+ #define POWERPIN_PINMODE ;
+ #define POWERPIN_ON ;
+ #define POWERPIN_OFF ;
+ #define STABLEPIN_PINMODE ;
+ #define STABLEPIN_ON ;
+ #define STABLEPIN_OFF ;
+ #define I2C_PULLUPS_DISABLE ;
+
//RX PIN assignment inside the port //for PORTD
#define THROTTLEPIN 2
#define ROLLPIN 4
@@ -254,8 +253,8 @@
#define YAWPIN 6
#define AUX1PIN 7
#define AUX2PIN 0 // optional PIN 8 or PIN 12
- //#define CAM1PIN 1 // unused
- //#define CAM2PIN 3 // unused
+ #define CAM1PIN 1 // unused
+ #define CAM2PIN 3 // unused
#define ISR_UART ISR(USART_UDRE_vect)
#define V_BATPIN A3 // Analog PIN 3
#define PSENSORPIN A2 // Analog PIN 2
Output.pde
Code: Select all
--- C:/TMP/Outpu-revBASE.svn001.tmp.pde Mon Feb 6 01:28:14 2012
+++ D:/#tricopter/multiwiiSVN/trunk/MultiWii_shared/Output.pde Mon Feb 6 18:32:45 2012
@@ -53,7 +53,7 @@
OCR2A = motor[7]>>3; // pin 10
#endif
#endif
- #if defined(PROMINI)
+ #if defined(PROMINI) || defined(MONGOOSE1_0)
#if (NUMBER_MOTOR > 0)
#ifndef EXT_MOTOR_RANGE
OCR1A = motor[0]>>3; // pin 9
@@ -128,7 +128,7 @@
TCCR2A |= _BV(COM2A1); // connect pin 10 to timer 2 channel A
#endif
#endif
- #if defined(PROMINI)
+ #if defined(PROMINI) || defined(MONGOOSE1_0)
for(uint8_t i=0;i<min(NUMBER_MOTOR,4);i++)
pinMode(PWM_PIN[i],OUTPUT);
#if (NUMBER_MOTOR > 0)
@@ -150,13 +150,13 @@
#if defined(SERVO)
initializeServo();
#endif
- #if (NUMBER_MOTOR == 6) && defined(PROMINI)
+ #if (NUMBER_MOTOR == 6) && ( defined(PROMINI) || defined(MONGOOSE1_0) )
initializeSoftPWM();
#if defined(A0_A1_PIN_HEX)
pinMode(5,INPUT);pinMode(6,INPUT); // we reactivate the INPUT affectation for these two PINs
pinMode(A0,OUTPUT);pinMode(A1,OUTPUT);
#endif
- #elif (NUMBER_MOTOR == 8) && defined(PROMINI)
+ #elif (NUMBER_MOTOR == 8) && ( defined(PROMINI) || defined(MONGOOSE1_0) )
initializeSoftPWM();
#if defined(A0_A1_PIN_HEX)
pinMode(5,INPUT);pinMode(6,INPUT); // we reactivate the INPUT affectation for these two PINs
@@ -196,7 +196,7 @@
TIMSK0 |= (1<<OCIE0A); // Enable CTC interrupt
// timer 0B for hex with servo tilt
- #if (NUMBER_MOTOR == 6) && defined(PROMINI)
+ #if (NUMBER_MOTOR == 6) && ( defined(PROMINI) || defined(MONGOOSE1_0) )
TIMSK0 |= (1<<OCIE0B);
#endif
}
@@ -318,7 +318,7 @@
}
#endif
-#if (NUMBER_MOTOR > 4) && defined(PROMINI)
+#if (NUMBER_MOTOR > 4) && ( defined(PROMINI) || defined(MONGOOSE1_0) )
void initializeSoftPWM() {
// if there are servos its alredy done
#if (NUMBER_MOTOR == 6) && not defined(SERVO)
@@ -499,7 +499,7 @@
#endif
#ifdef SERVO_TILT
- #if defined(A0_A1_PIN_HEX) && (NUMBER_MOTOR == 6) && defined(PROMINI)
+ #if defined(A0_A1_PIN_HEX) && (NUMBER_MOTOR == 6) && ( defined(PROMINI) || defined(MONGOOSE1_0) )
#define S_PITCH servo[0]
#define S_ROLL servo[1]
#else
RX.pde
Code: Select all
--- C:/TMP/RX.pd-revBASE.svn001.tmp.pde Mon Feb 6 01:28:14 2012
+++ D:/#tricopter/multiwiiSVN/trunk/MultiWii_shared/RX.pde Mon Feb 6 18:33:09 2012
@@ -25,7 +25,7 @@
// Configure each rc pin for PCINT
void configureReceiver() {
#if !defined(SERIAL_SUM_PPM) && !defined(SPEKTRUM) && !defined(SBUS) && !defined(BTSERIAL)
- #if defined(PROMINI)
+ #if defined(PROMINI) || defined(MONGOOSE1_0)
// PCINT activated only for specific pin inside [D0-D7] , [D2 D4 D5 D6 D7] for this multicopter
PORTD = (1<<2) | (1<<4) | (1<<5) | (1<<6) | (1<<7); //enable internal pull ups on the PINs of PORTD (no high impedence PINs)
PCMSK2 |= (1<<2) | (1<<4) | (1<<5) | (1<<6) | (1<<7);
@@ -67,7 +67,7 @@
static uint16_t edgeTime[8];
static uint8_t PCintLast;
- #if defined(PROMINI)
+ #if defined(PROMINI) || defined(MONGOOSE1_0)
pin = PIND; // PIND indicates the state of each PIN for the arduino port dealing with [D0-D7] digital pins (8 bits variable)
#endif
#if defined(MEGA)
Serial.pde
Code: Select all
--- C:/TMP/Seria-revBASE.svn001.tmp.pde Mon Feb 6 01:28:14 2012
+++ D:/#tricopter/multiwiiSVN/trunk/MultiWii_shared/Serial.pde Mon Feb 6 18:34:00 2012
@@ -171,7 +171,7 @@
#define SERIAL_RX_BUFFER_SIZE 64
-#if defined(PROMINI)
+#if defined(PROMINI) || defined(MONGOOSE1_0)
uint8_t serialBufferRX[SERIAL_RX_BUFFER_SIZE][1];
volatile uint8_t serialHeadRX[1],serialTailRX[1];
#endif
@@ -217,7 +217,7 @@
}
}
-#if defined(PROMINI) && !(defined(SPEKTRUM))
+#if (defined(PROMINI) || defined(MONGOOSE1_0)) && !(defined(SPEKTRUM))
SIGNAL(USART_RX_vect){
uint8_t d = UDR0;
uint8_t i = (serialHeadRX[0] + 1) % SERIAL_RX_BUFFER_SIZE;
This should compile the changes for MONGOOSE board and should make all sensors work. Same are the motors and RX PPM SUM.
Please check it yourself and commit if necessary to shared for now.
I do not recommend this version of MONGOOSE changes to be used in flying drone yet until it is committed so I can check if it is flyable.
The owners of MONGOOSE can use for now the version i have posted on my blog that is a MultiWii 1.9 adapted for MONGOOSE.
PS: if you need the working files so you can do diff and get the changes yourself, I can upload my working multiwii shared here, but the diff from from revision 545 should be fine so you can commit the changes.