1)The default baud rate of 57600 has a large error on an 8Mhz AVR.
(http://www.wormfood.net/avrbaudcalc.php) So I set it back to 38400
2)Either my magnetic sensor is bad, or the code is not working well in heading.
Toward that end I modified the code to implement a full compass calibration.
It does not seem to be much better....
The code is attached.
To use it hit an I on the serial port to start an "Iron" cal.
Then sweep the IMU slowly around in all three axis.
While you are doing this the system will show you the max.min and cal values for the three magnetometer axis.
Then hit a X the system will save the cal data in EEPROM and return to normal operation.
On power up it checks to see if it has cal data, if so it says:
Serial.println("Read Stored Compass Calibration");
or
Serial.println("Used Default Compass Calibration");
This is still not exactly quite right so I'd appreciate any ideas or help.
You need to be a member of diydrones to add comments!
Replies