Search found 34 matches

by ciskje
Wed Mar 28, 2012 9:59 am
Forum: Software development
Topic: mwc 2.0 ++
Replies: 25
Views: 8957

Re: mwc 2.0 ++

If you do not see the value of properly variable naming and good comments then you're clearly not qualified to contribute to this discussion. :)
by ciskje
Fri Mar 23, 2012 1:55 pm
Forum: Software development
Topic: Back drift issue
Replies: 15
Views: 4838

Re: Back drift issue

And what do you think if MAG datas would be used for compensation of angle calculation? When mag is calibrated corretly, it gives the exact position in three axis. I'm still looking for the proper accMag values, Alexinparis, could you help a bit and suggest some values for that? MAG data are probab...
by ciskje
Fri Mar 23, 2012 1:47 pm
Forum: Software development
Topic: Perhaps a bug inside the mag calibration
Replies: 12
Views: 4709

Re: Perhaps a bug inside the mag calibration

The purpose of the current code is to define the MAG sensor you like, on then work only with the "MAG" definition via generic functions shared among all MAG sensors. This way, when you add a new mag device, it's very easy to update the code without changing everything. Clearly, but this i...
by ciskje
Fri Mar 23, 2012 1:07 pm
Forum: Software development
Topic: MultiWii 2.0 is coming
Replies: 256
Views: 106989

Re: MultiWii 2.0 is coming

Earth magnetic field is [0.2;0.7] (from equator to the poles) Gauss Positive BIAS during init for x&y is 1.16 Gauss, z is 1.08 (check this difference Alex!) Maximum field is so 1.86 Gauss We can work without problem with 1.3 Ga scale. (and a lot far away from overflow with the 2.5Ga during init...
by ciskje
Thu Mar 22, 2012 12:12 pm
Forum: Software development
Topic: Perhaps a bug inside the mag calibration
Replies: 12
Views: 4709

Re: Perhaps a bug inside the mag calibration

MMmmmmm, this is a solution to the problem: #if defined(MAG3110) && !defined(MAG) ...blabla... init read etc. #define MAG #else #error There are 2 or more MAG defined #endif So every programmer doesn't modify a common part (and the maintainer can only cut&copy the part) , and also you ca...
by ciskje
Thu Mar 22, 2012 12:04 pm
Forum: Software development
Topic: Perhaps a bug inside the mag calibration
Replies: 12
Views: 4709

Re: Perhaps a bug inside the mag calibration

There is also another good method:

#if defined(MAG3110) && !defined(MAG)

...blabla...
#else
by ciskje
Thu Mar 22, 2012 11:54 am
Forum: Software development
Topic: Accelerometer fluctuation
Replies: 3
Views: 1655

Re: Accelerometer fluctuation

Reading source code rapidly, NUNCHUCK is autodetected, but I think you can enable another acc without problem.
NUNCHUCK is too much sensible in the rotating range of the motors.
by ciskje
Wed Mar 21, 2012 10:10 pm
Forum: Software development
Topic: Accelerometer fluctuation
Replies: 3
Views: 1655

Re: Accelerometer fluctuation

NK is not a good choice.
by ciskje
Wed Mar 21, 2012 9:25 pm
Forum: Software development
Topic: Perhaps a bug inside the mag calibration
Replies: 12
Views: 4709

Re: Perhaps a bug inside the mag calibration

in only one place: #if defined(HMC5883) || defined(HMC5843) || defined(AK8975) || defined(MAG3110) || defined(LASTUBERALLESMAG) .... x100 .... || defined(LASTKNOWNMAGINTHEWHOLEWORLD) #define MAG #endif all over the program: #if defined(MAG) blablabla calibration #endif #if defined(MAG) blablabla com...
by ciskje
Wed Mar 21, 2012 2:04 pm
Forum: Software development
Topic: HMC5883L new calibration method (BUG for Alex)
Replies: 7
Views: 19048

Re: HMC5883L new calibration method (BUG for Alex)

no problem with performance, thankfully to the excellent compiler! :)
No virtual functions so no additional load during runtime, floating point lib in gcc for AVR are really optimized.
It is ready to be used on STM32 :)

New mag initialization inside to return IN TOPIC.
by ciskje
Wed Mar 21, 2012 12:35 pm
Forum: Software development
Topic: HMC5883L new calibration method (BUG for Alex)
Replies: 7
Views: 19048

Re: HMC5883L new calibration method (BUG for Alex)

Oh yes! I love to program clean and with FLOATING POINT fully with 32-bit.
You can see my personal multicopter project: http://code.google.com/p/simplo/
by ciskje
Wed Mar 21, 2012 10:56 am
Forum: Software development
Topic: HMC5883L new calibration method (BUG for Alex)
Replies: 7
Views: 19048

Re: HMC5883L new calibration method (BUG for Alex)

yes noobie, There is a problem, searching for min/max and extracting only the zero is not correct, with soft-iron effect the range (also with the test of the fixed field of the BIAS) are different for x,y,z. If you have metallic surface near the sensor (every quad have this problem), the range chang...
by ciskje
Wed Mar 21, 2012 9:21 am
Forum: Software development
Topic: Perhaps a bug inside the mag calibration
Replies: 12
Views: 4709

Re: Perhaps a bug inside the mag calibration

I think that the best will be to introduce a define for MAG_PRESENT non for every hardware supported.
by ciskje
Tue Mar 20, 2012 8:59 pm
Forum: Software development
Topic: MultiWii 2.0 is coming
Replies: 256
Views: 106989

Re: MultiWii 2.0 is coming

Earth magnetic field is [0.2;0.7] (from equator to the poles) Gauss Positive BIAS during init for x&y is 1.16 Gauss, z is 1.08 (check this difference Alex!) Maximum field is so 1.86 Gauss We can work without problem with 1.3 Ga scale. (and a lot far away from overflow with the 2.5Ga during init)...
by ciskje
Tue Mar 20, 2012 4:27 pm
Forum: Software development
Topic: HMC5883L new calibration method (BUG for Alex)
Replies: 7
Views: 19048

HMC5883L new calibration method (BUG for Alex)

Hello to all. The BIAS positive for the HMC5883L are different for X&Y than Z, the field generated for X&Y are 1.16 Gauss, Z have 1.08 Gauss (that is 7% difference) according to datasheet. This is a method to compensate: magCal[ROLL] = 1160.0 / abs(magADC[ROLL]); magCal[PITCH] = 1160.0 / abs...
by ciskje
Wed Mar 07, 2012 10:23 pm
Forum: Software development
Topic: Support for MPU6050
Replies: 96
Views: 218038

Re: Support for MPU6050

if you have q0 q1 q2 q3 (you must normalize it) and want to convert to roll pitch yaw: // normalise quaternion norm = sqrt(q0*q0 + q1*q1 + q2*q2 + q3*q3); q0 = q0 / norm; q1 = q1 / norm; q2 = q2 / norm; q3 = q3 / norm; y=atan2(2*q1*q2+2*q0*q3,2*q0*q0+2*q1*q1-1); p=-asin(2 * q1 * q3 - 2 * q0 * q2); /...
by ciskje
Fri Mar 02, 2012 3:34 pm
Forum: Software development
Topic: dev20120225 orientation warning!!!
Replies: 26
Views: 10379

Re: dev20120225 orientation warning!!!

Also Miniwii with this version have wrong orientation: Correct one is: #if defined(MINIWII) #define ITG3200 #define BMA180 #define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = X; accADC[PITCH] = -Y; accADC[YAW] = -Z;} #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = Y; gyroADC[PITCH] = -X; gyroADC[YAW...
by ciskje
Sun Oct 23, 2011 6:00 pm
Forum: Software development
Topic: BUG: GYRO_ORIENTATION is not applied to WMP
Replies: 6
Views: 2789

Re: BUG: GYRO_ORIENTATION is not applied to WMP

void Gyro_getADC () { TWBR = ((16000000L / 400000L) - 16) / 2; // change the I2C clock rate to 400kHz i2c_getSixRawADC(ITG3200_ADDRESS,0X1D); GYRO_ORIENTATION( + ( ((rawADC[2]<<8) | rawADC[3])/4) , // range: +/- 8192; +/- 2000 deg/sec - ( ((rawADC[0]<<8) | rawADC[1])/4 ) , - ( ((rawADC[4]<<8) | raw...
by ciskje
Sat Oct 22, 2011 3:02 pm
Forum: Software development
Topic: Code modification to allow different WM+ orientation
Replies: 2
Views: 1546

Re: Code modification to allow different WM+ orientation

You can't apply directly GYRO_ORIENTATION because value from WMP are not zero centered.
In the other thread I have found a working patch.
by ciskje
Sat Oct 22, 2011 3:00 pm
Forum: Software development
Topic: BUG: GYRO_ORIENTATION is not applied to WMP
Replies: 6
Views: 2789

Re: BUG: GYRO_ORIENTATION is not applied to WMP

Is this integrated in the source code?
by ciskje
Sat Oct 22, 2011 2:52 pm
Forum: Software development
Topic: BUG: ITG3200 32767 is not 2000 deg/s!
Replies: 0
Views: 1287

BUG: ITG3200 32767 is not 2000 deg/s!

32767 is not 2000 deg/s

ITG3200 have a 14.375 LSB/(deg/s) (read the datasheet) so

32767/14.375 is 2279.44 deg/s

2000 is only a value for the reference scale.

This affect the stable mode.
by ciskje
Sat Oct 22, 2011 2:50 pm
Forum: Software development
Topic: MultiWii port to STM8S105
Replies: 19
Views: 6848

Re: MultiWii port to STM8S105

Sorry Alex you are wrong:

32767 is not 2000 deg/s

ITG3200 have a 14.375 LSB/(deg/s) (read the datasheet) so

32767/14.375 is 2279.44 deg/s

2000 is only a value for the reference scale.
by ciskje
Sat Oct 22, 2011 2:42 pm
Forum: Software development
Topic: BUG: 29 byte waited 31 readed (1.8p2)
Replies: 0
Views: 897

BUG: 29 byte waited 31 readed (1.8p2)

In the serial section:

case 'W': //GUI write params to eeprom @ arduino
while (Serial.available()<29) {}

But with the 2 new byte from powermeter you read 31 byte.
by ciskje
Fri Sep 30, 2011 7:28 pm
Forum: Software development
Topic: BUG: GYRO_ORIENTATION is not applied to WMP
Replies: 6
Views: 2789

Re: BUG: GYRO_ORIENTATION is not applied to WMP

int roll,pitch,yaw; // BUG Correction GYRO_ORIENTATION is not applied when you have WMP // You must save it to exclude swap between vars roll=gyroADC[ROLL]; pitch=gyroADC[PITCH]; yaw=gyroADC[YAW]; GYRO_ORIENTATION( roll, pitch, yaw); In the last dev version there aren't these lines of code to apply...
by ciskje
Tue Sep 20, 2011 8:52 am
Forum: Software development
Topic: Android tool to modify PID settings
Replies: 65
Views: 34810

Re: Android tool to modify PID settings

Please can you reverse the bar on the gyro? when value are positive bar goes negative.
by ciskje
Wed Sep 14, 2011 4:19 pm
Forum: Software development
Topic: Teensy Support ?
Replies: 24
Views: 11924

Re: Teensy Support ?

Taken from Baronpilot: B0, B1 B2 B3 B4 have PCINT also on Teensy 2.0+ void setupRx() { #ifdef TEENSYP pinMode(PIN_B0,INPUT); pinMode(PIN_B1,INPUT); pinMode(PIN_B2,INPUT); pinMode(PIN_B3,INPUT); pinMode(PIN_B4,INPUT); PCICR |= (1<<PCIE0); PCMSK0 = (1<<PCINT0) | (1<<PCINT1) | (1<<PCINT2) | (1<<PCINT3)...
by ciskje
Mon Sep 12, 2011 1:30 pm
Forum: Software development
Topic: BUG: GYRO_ORIENTATION is not applied to WMP
Replies: 6
Views: 2789

BUG: GYRO_ORIENTATION is not applied to WMP

You must add this to the end of gyro_common in sensors.pde to apply GYRO_ORIENTATION to WMP: void GYRO_Common() { static int16_t previousGyroADC[3] = {0,0,0}; static int32_t g[3]; uint8_t axis; if (calibratingG>0) { for (axis = 0; axis < 3; axis++) { // Reset g[axis] at start of calibration if (cali...
by ciskje
Wed Apr 06, 2011 8:34 pm
Forum: Software development
Topic: MARG sensor fusion AHRS
Replies: 27
Views: 9349

Re: MARG sensor fusion AHRS

Great Syberian, I don't understand only why you can't put it in a normal arduino code is not so big.
by ciskje
Mon Mar 28, 2011 8:33 pm
Forum: Software development
Topic: Bug in getEstimatedAttitude
Replies: 2
Views: 1760

Re: Bug in getEstimatedAttitude

This can cause an angle jump.
by ciskje
Mon Mar 28, 2011 8:30 pm
Forum: Software development
Topic: Bug in getEstimatedAttitude
Replies: 2
Views: 1760

Bug in getEstimatedAttitude

last line is:
for (axis=0;axis<2;axis++) angle[axis] = A[axis]*570.29577951; //angle in multiple of 0.1 degree

but 180/M_PI is 57.29

so the line must be:
for (axis=0;axis<2;axis++) angle[axis] = A[axis]*572.9577951; //angle in multiple of 0.1 degree
by ciskje
Mon Mar 28, 2011 8:29 pm
Forum: Software development
Topic: Alex: code optimization
Replies: 3
Views: 1904

Re: Alex: code optimization

Arduino (sigh) compile with -Os (for size), but you can modify it to compile with -O2
by ciskje
Sat Mar 26, 2011 7:35 pm
Forum: Software development
Topic: 1_prebis7: ITG3200 driver: Overflow issue
Replies: 4
Views: 2895

Re: 1_prebis7: ITG3200 driver: Overflow issue

-32768 is

over 2000 degrees/sec!!! nearly 330 rpm, or 90 degree in 0.045s a very very very fast movement!
by ciskje
Sat Mar 26, 2011 7:24 pm
Forum: Software development
Topic: Alex: code optimization
Replies: 3
Views: 1904

Re: Alex: code optimization

GCC do this automatically.
by ciskje
Sat Mar 26, 2011 12:26 am
Forum: Software development
Topic: MultiWii v1.preter7 released
Replies: 22
Views: 7306

Re: MultiWii v1.preter7 released

The scale for the gyro has been moved so the new L3G4200D doen't have a correct scale, please add: gyroADC[ROLL] = ((rawADC_L3G4200D[1]<<8) | rawADC_L3G4200D[0])/20 ; gyroADC[PITCH] = ((rawADC_L3G4200D[3]<<8) | rawADC_L3G4200D[2])/20 ; gyroADC[YAW] = -((rawADC_L3G4200D[5]<<8) | rawADC_L3G4200D[4])/2...