HMC5883 spinnt, dreht bei rückwärtsflug um 180°!

Antworten
schmo90
Beiträge: 1
Registriert: 05.02.2014 00:29:11

#1 HMC5883 spinnt, dreht bei rückwärtsflug um 180°!

Beitrag von schmo90 »

Guten Tag habe ein riesiges Problem was sich irgendwie nicht lösen lässt

Habe von amazon den HMC5883 in meinen Nanowii (Multiwii 2.3) verbaut funktioniert soweit relativ gut

AUßer ich fliege nach hinten!!
Sobald der Kompass 90° nach hinten steigt hübt er schlagartig in die entgegengesetzte richtung nicht nur in der GUi sondern auch im Realen Flug!

Wie kann man das problem beheben?

Habe die Orientierung shcon oft angepasst, ca 10000x mal neu kalibriert jedoch nichts scheint zu helfen.....
bitte um hilfe, sofern das forum noch aktiv ist....

Vielen Dank
Benutzeravatar
Lindbaergh
Beiträge: 8
Registriert: 10.02.2014 20:27:44

#2 Re: HMC5883 spinnt, dreht bei rückwärtsflug um 180°!

Beitrag von Lindbaergh »

Moin unter Multiwii 2.1 gab mal das Problem das bei bestimten IMU's das einstellen der Temperatur Kompensation des 5883 nicht richtig funktioniert hat. Meine IMU von csg_extreme hatte auch den Fehler, über Google bin ich im Multiwii Forum fündig geworden: http://www.multiwii.com/forum/viewtopic ... 3&start=20 . Ich habe dann die Sensors.ino wie beschrieben geändert

// ************************************************************************************************************
// I2C Compass HMC5843 & HMC5883
// ************************************************************************************************************
// I2C adress: 0x3C (8bit) 0x1E (7bit)
// ************************************************************************************************************
#if defined(HMC5843) || defined(HMC5883)
#define MAG_ADDRESS 0x1E
#define MAG_DATA_REGISTER 0x03

void Mag_init() {
delay(100);
// force positiveBias
i2c_writeReg(MAG_ADDRESS ,0x00 ,0x71 ); //Configuration Register A -- 0 11 100 01 num samples: 8 ; output rate: 15Hz ; positive bias
delay(50);
// set gains for calibration
i2c_writeReg(MAG_ADDRESS ,0x01 ,0x60 ); //Configuration Register B -- 011 00000 configuration gain 2.5Ga
i2c_writeReg(MAG_ADDRESS ,0x02 ,0x01 ); //Mode register -- 000000 01 single Conversion Mode

// read values from the compass - self test operation
// by placing the mode register into single-measurement mode (0x01), two data acquisition cycles will be made on each magnetic vector.
// The first acquisition values will be subtracted from the second acquisition, and the net measurement will be placed into the data output registers
delay(100);
getADC();
delay(10);
#if defined(HMC5883)
magCal[ROLL] = 1160.0 / abs(magADC[ROLL]);
magCal[PITCH] = 1160.0 / abs(magADC[PITCH]);
magCal[YAW] = 1080.0 / abs(magADC[YAW]);
#else
magCal[ROLL] = 1000.0 / abs(magADC[ROLL]);
magCal[PITCH] = 1000.0 / abs(magADC[PITCH]);
magCal[YAW] = 1000.0 / abs(magADC[YAW]);
#endif

// leave test mode
i2c_writeReg(MAG_ADDRESS ,0x00 ,0x70 ); //Configuration Register A -- 0 11 100 00 num samples: 8 ; output rate: 15Hz ; normal measurement mode
i2c_writeReg(MAG_ADDRESS ,0x01 ,0x20 ); //Configuration Register B -- 001 00000 configuration gain 1.3Ga
magCal[ROLL] = 1.16; //ZEN workaround for buggy boards which dont have temperature compensation.
magCal[PITCH] = 1.16; //ZEN see http://www.multiwii.com/forum/viewtopic ... 3&start=20
magCal[YAW] = 1.08; //ZEN
i2c_writeReg(MAG_ADDRESS ,0x02 ,0x00 ); //Mode register -- 000000 00 continuous Conversion Mode

magInit = 1;
}


Seit dem funktioniert mein MAG bestens. Ob das bei Multiwii 2.3 auch noch der Fall ist weiß ich nicht, aber es ist ein Anfang um mit der Suche nach einer Lösung zu beginnen.
Antworten

Zurück zu „Allgemeines“