Anyone know of one of these? I can't believe I haven't found any in my quick search. It looks like Arduino even supports operator overloading and templates from c++, so you could build a pretty spiffy flexible library! Alas, I'm looking for something quicker than rolling that out myself. Otherwise I'll just be building functionality as I need it :(

Views: 1076

Reply to This

Replies to This Discussion

If you want generic functions for doing matrix operations, then I suggest lifting them from the Sparkfun 9dof IMU DCM source code or ArduIMU or somewhere. I haven't found a downloadable library for those funcitons either.

I noticed in your previous posts that you are using an Atomic 6dof IMU. I also ordered this board almost a year ago, and so far you are the only other person I have seen using it. I am trying to implement DCM on the IMU itself and I have edited the source code to eliminate the options I dont want. It is now set to autorun, outputs in binary only with no 'A' or 'Z' characters delimiting the data, and only issues raw data when I send it a '#' character from the arduino. If you would like the modified code I can send it to you. If I ever get a fully functional DCM algorithm running on the IMU itself, I will post the source code.

The Razor 9dof DCM implementation code is already small enough to run on a ATmega168 so it might be easy to port this over. I am not quite up to this task yet, so if anyone would like to give it a try, please let me know how it turns out. In the meantime, I am going to code from scratch for arduino, then port to the Atomic IMU and run the entire algorithm on it. That way it just gives me angles and the arduino can handle navigation, control, etc.
Jose has recently released a AT168 version of "DCM" for ArduIMU V2 it should be possible to port.
1, Add an option to select a Sf Atomic mode.
2, Define correct gyro and accel input pins.
3, then add SENSOR (-1,1,-1,-1,1,-1) in correct orientation.
4, Test
Can Sf Atomic be programmed with Sf FTDI 3.3v and Arduino AVR?
Does Sf Atomic board need a mod for this?
Add RTS or other signal to 6 pin header?
I program the Atomic with a USBtiny programmer and avrdude. I think I will compile with the Arduino IDE and try to load to the binary with avrdude from the command line. I've never tried that before but I expect it will be pretty straightforward.

I started going through the ArduIMU code, following your suggestions. The Atomic uses pins PC/ADC0-5 for X accel, Y accle, Z accel, pitch, roll, yaw in that order. Am I right in setting sensors[6]={3,4,5,0,1,2} in the ArduIMU code? Also, I am not quite sure about the SENSOR_SIGN[] array. I assume those are the signs of the elements in the update matrix, but I don't understand why the order would change depending on hardware configuration.

I can see now that there will be quite a bit of work involved in making this board work with the ArduIMU code but I think I will try simultaneously to port the code and do a custom DCM implementation. I'm thinking my best bet is probably to get an uncorrected DCM from the Atomic, and then do the normalization on the arduino. I can see it is possible to make the Atomic a fully functional AHRS with enough work.
I added this code for my modified ArduIMU v1.5 with I2C and Air_Start on pin D8

#if BOARD_VERSION == 3 // For v1.5 with !2C mod //mjc A4(SDA), A5(SCL) are now I2C
uint8_t sensors[6] = {0,2,1,3,7,6}; // Use these two lines for Hardware v1.5 (w/ daughterboards) 7,6 //mjc
int SENSOR_SIGN[]= {1,-1,1,-1,1,-1,-1,-1,-1}; //Sensor: GYROX, GYROY, GYROZ, ACCELX, ACCELY, ACCELZ
#endif

// so for Sf Atomic 6DF add

// *** NOTE! Hardware version - Can be used for v1 (daughterboards), v2 (flat) and v1.5 (with !2C mod) & Sparkfun Atomic 6df with xBee //mjc

#define BOARD_VERSION 4 // 1 = v1 IMU, 2 = v2 IMU, 3 = v1.5 IMU with !2C mods, and 4 = Sparkfun 6DF // mjc


#if BOARD_VERSION == 4 // For Sparkfun Atomic 6DF
uint8_t sensors[6] = {3,4,5,0,1,2}; // Use these two lines for Hardware v1.5 (w/ daughterboards) 7,6 //mjc
int SENSOR_SIGN[]= {1,-1,-1,1,-1,1,-1,-1,-1}; //Sensor: GYROX, GYROY, GYROZ, ACCELX, ACCELY, ACCELZ
#endif

// i changed the sign for Z gyro as it is mounted upside down compared to ArduIMUv1 the X & Y gyro's orientation match, Accel xyz are same orientation as flat v2 so use x,x,x,1,-1,1

I hope to make Sf 6DF work with FTDI cable too. I may need to add an A/B mux chip to select gps or FTDI like ArduIMUs have.

You can copy and paste above code.
Colin: I have done what you are saying and here's what you need to do to get the compiled ".hex" file. In fact, I wrote a tutorial for doing this exact thing using ArduinoISP, but I'll just cut out the part on how to get a .hex file since you're using a USBtiny and you know how to use AVRdude:

In Arduino 0018, the compiled program file is usually stored in a place that might be hard to find. To fix this, we can add an extra line to a file called preferences.txt. To find preferences.txt, look at http://www.Arduino.cc/en/Hacking/Preferences. You must add the line build.path=[location] to preferences.txt. Replace [location] with a folder name (so it might end up being "build.path=compiled"), and it will create a folder of that name in the location of Arduino.app. To get the program file, open up your program in Arduino and click "Verify". Do not quit the Arduino program, or the necessary file will be deleted. The file you are looking for will start with the name of your program (eg "ledblink") and end with .hex (eg. "ledblink.cpp.hex").

I hope that helps, I could never find the .hex file otherwise as it was in some hidden temp folder all the time.
Cool, thanks a lot to both of you for the help!

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service