Cronalex wrote:sorry guys .. but I solved the problem by enabling // Moving Average Gyros by Magnetron1 (Michele Ardito) ########## beta
#define MMGYRO // Active Moving Average Function for Gyros #define MMGYROVECTORLENGHT 10 // Lenght of Moving Average Vector
The quadricopter is stable now, but now I wonder why? if it is activated not working .. I before using this version I used the 1.9 with Average Gyros
moving average of the gyros is really good... I have to try that on the accelerometers I keep you informed!!!
for now I have a problem loading I get this error:
MultiWii_2_0.cpp: In function 'void getEstimatedAltitude()': MultiWii_2_0:1337: error: 'AccZHigh' was not declared in this scope MultiWii_2_0:1337: error: 'AccZLow' was not declared in this scope
stay tuned!!!
Magnetron wrote:Alex, please implement in future version my moving average for gyros and for accs... users on BaroneRosso (italian forum) will appretiate it - they tell me days over days the success of moving averaging stability improvement, please add my comments also that explain hot to set it and try TRUSTED_ACCZ_VEL function to stabilize altitude in association with barometric sensor... the link on discussion... viewtopic.php?f=8&t=1290&start=180#p10679
if it works it works like that of the gyroscopes is a bomb ... is to be loaded in the next version
you are a big Magnetron!!!
Hi, here is a fully barometric routine that will solve your problem:
if (currentTime < deadLine) return; deadLine = currentTime + UPDATE_INTERVAL;
//**** Alt. Set Point stabilization PID **** //calculate speed for D calculation last = BaroHistTab[BaroHistIdx]; BaroHistTab[BaroHistIdx] = BaroAlt/10; BaroHigh += BaroHistTab[BaroHistIdx]; index = (BaroHistIdx + (BARO_TAB_SIZE/2))%BARO_TAB_SIZE; BaroHigh -= BaroHistTab[index]; BaroLow += BaroHistTab[index]; BaroLow -= last; BaroHistIdx++; if (BaroHistIdx == BARO_TAB_SIZE) BaroHistIdx = 0;
BaroPID = 0; //D temp32 = D8[PIDALT]*(BaroHigh - BaroLow) / 40; BaroPID-=temp32; EstAlt = BaroHigh*10/(BARO_TAB_SIZE/2); temp32 = AltHold - EstAlt; if (abs(temp32) < 10 && BaroPID < 10) BaroPID = 0; //remove small D parametr to reduce noise near zoro position // Magnetron1 (Michele Ardito) Trusted Z Acc #if defined(TRUSTED_ACCZ_VEL) BaroPID -= D8[PIDVEL]*(AccZHigh - AccZLow) / 30; #endif
//P BaroPID += P8[PIDALT]*constrain(temp32,(-2)*P8[PIDALT],2*P8[PIDALT])/100; BaroPID = constrain(BaroPID,-150,+150); //sum of P and D should be in range 150
//I errorAltitudeI += temp32*I8[PIDALT]/50; errorAltitudeI = constrain(errorAltitudeI,-30000,30000); temp32 = errorAltitudeI / 500; //I in range +/-60 BaroPID+=temp32; }
Cronalex wrote:sorry guys .. but I solved the problem by enabling // Moving Average Gyros by Magnetron1 (Michele Ardito) ########## beta
#define MMGYRO // Active Moving Average Function for Gyros #define MMGYROVECTORLENGHT 10 // Lenght of Moving Average Vector
The quadricopter is stable now, but now I wonder why? if it is activated not working .. I before using this version I used the 1.9 with Average Gyros
moving average of the gyros is really good... I have to try that on the accelerometers I keep you informed!!!
for now I have a problem loading I get this error:
MultiWii_2_0.cpp: In function 'void getEstimatedAltitude()': MultiWii_2_0:1337: error: 'AccZHigh' was not declared in this scope MultiWii_2_0:1337: error: 'AccZLow' was not declared in this scope
stay tuned!!!
Magnetron wrote:Alex, please implement in future version my moving average for gyros and for accs... users on BaroneRosso (italian forum) will appretiate it - they tell me days over days the success of moving averaging stability improvement, please add my comments also that explain hot to set it and try TRUSTED_ACCZ_VEL function to stabilize altitude in association with barometric sensor... the link on discussion... viewtopic.php?f=8&t=1290&start=180#p10679
if it works it works like that of the gyroscopes is a bomb ... is to be loaded in the next version
you are a big Magnetron!!!
Hi, here is a fully barometric routine that will solve your problem:
if (currentTime < deadLine) return; deadLine = currentTime + UPDATE_INTERVAL;
//**** Alt. Set Point stabilization PID **** //calculate speed for D calculation last = BaroHistTab[BaroHistIdx]; BaroHistTab[BaroHistIdx] = BaroAlt/10; BaroHigh += BaroHistTab[BaroHistIdx]; index = (BaroHistIdx + (BARO_TAB_SIZE/2))%BARO_TAB_SIZE; BaroHigh -= BaroHistTab[index]; BaroLow += BaroHistTab[index]; BaroLow -= last; BaroHistIdx++; if (BaroHistIdx == BARO_TAB_SIZE) BaroHistIdx = 0;
BaroPID = 0; //D temp32 = D8[PIDALT]*(BaroHigh - BaroLow) / 40; BaroPID-=temp32; EstAlt = BaroHigh*10/(BARO_TAB_SIZE/2); temp32 = AltHold - EstAlt; if (abs(temp32) < 10 && BaroPID < 10) BaroPID = 0; //remove small D parametr to reduce noise near zoro position // Magnetron1 (Michele Ardito) Trusted Z Acc #if defined(TRUSTED_ACCZ_VEL) BaroPID -= D8[PIDVEL]*(AccZHigh - AccZLow) / 30; #endif
//P BaroPID += P8[PIDALT]*constrain(temp32,(-2)*P8[PIDALT],2*P8[PIDALT])/100; BaroPID = constrain(BaroPID,-150,+150); //sum of P and D should be in range 150
//I errorAltitudeI += temp32*I8[PIDALT]/50; errorAltitudeI = constrain(errorAltitudeI,-30000,30000); temp32 = errorAltitudeI / 500; //I in range +/-60 BaroPID+=temp32; }
yes DONE COMPILING
THE FUNCTION MUST BE // ?? to use the moving average on accelerometers:
/* This option should be uncommented if ACC Z is accurate enough when motors are running*/ /* should now be ok with BMA020 and BMA180 ACC */ //#define TRUSTED_ACCZ
//#################################################################### // Moving Average Gyros by Magnetron1 (Michele Ardito) ########## beta // if the I2C speed is 100kHz use MMGYROVECTORLENGHT from 2 to 6 best was 2 and MMACCVECTORLENGHT from 4 to 10 best was 6 // if the I2C speed is 400kHz use MMGYROVECTORLENGHT from 2 to 6 best was 4 and MMACCVECTORLENGHT from 4 to 12 best was 8 //#define MMGYRO // Active Moving Average Function for Gyros #define MMGYROVECTORLENGHT 4 // Lenght of Moving Average Vector // Moving Average Accelerometers by Magnetron1 //#define MMACC // Active Moving Average Function for Accelerometers #define MMACCVECTORLENGHT 8 // Lenght of Moving Average Vector // Moving Average ServoGimbal Signal Output //#define MMSERVOGIMBAL // Active Output Moving Average Function for Servos Gimbal #define MMSERVOGIMBALVECTORLENGHT 16 // Lenght of Moving Average Vector /* Trusted AccZ Velocity Vector Magnetron1 /* This option should be uncommented if ACC Z is accurate enough when motors are running*/ #define TRUSTED_ACCZ_VEL
the line //#define TRUSTED_ACCZ is indipendent from my routines... I suggest you to leave it activate (without //)
I have a question regarding the Lipo-Alarm built in the software This is the code
/* for V BAT monitoring after the resistor divisor we should get [0V;5V]->[0;1023] on analog V_BATPIN with R1=33k and R2=51k vbat = [0;1023]*16/VBATSCALE */ #define VBAT // comment this line to suppress the vbat code #define VBATSCALE 131 // change this value if readed Battery voltage is different than real voltage #define VBATLEVEL1_3S 107 // 10,7V #define VBATLEVEL2_3S 103 // 10,3V #define VBATLEVEL3_3S 99 // 9.9V #define NO_VBAT 16 // Avoid beeping without any battery
means, the buzzer should slowly beep at 10,7 V , shouldn´t it ? But when I connect a full 12.4 V Lipo battery, the Buzzer beeps .... What figures must I change to avoid this ?
I have a question regarding the Lipo-Alarm built in the software This is the code
/* for V BAT monitoring after the resistor divisor we should get [0V;5V]->[0;1023] on analog V_BATPIN with R1=33k and R2=51k vbat = [0;1023]*16/VBATSCALE */ #define VBAT // comment this line to suppress the vbat code #define VBATSCALE 131 // change this value if readed Battery voltage is different than real voltage #define VBATLEVEL1_3S 107 // 10,7V #define VBATLEVEL2_3S 103 // 10,3V #define VBATLEVEL3_3S 99 // 9.9V #define NO_VBAT 16 // Avoid beeping without any battery
means, the buzzer should slowly beep at 10,7 V , shouldn´t it ? But when I connect a full 12.4 V Lipo battery, the Buzzer beeps .... What figures must I change to avoid this ?
Karsten
it's not a mw 2.0 error ... may be you do not configure right the vbatscale value I use 121 ...or you have swapped you resistor... check your lipo battery voltage (ex :12v6) check you midle point voltage betwen the 33k & 51k (ex:3v85)
some maths :
3.85 * [(1024/5)] = 3.85 * [204.8] = 788.48
788.48*16 = 12615.68 12615/126 =100 (126 is your 12.6v in mwc ) 100 is your vbatscale simple non ?
there seems to be a problem with hex x config in fw2.0
today i tried the actual fw 2.0. it flew ok but sometimes in left roll there was something wrong. it seemed that the left motor, connected to A0, reacts wrong. in a left roll the motor should decraese rpm but instead the rpm increased for some seconds and fighted against the other motors on the left. this happened not everytime i made a left roll. 3 times in the flight of maybe 4min. doesnt happen in the other directions.
fc. mwc board with pro mini and freeimu v0.4.3 A0 and A1 for left and right motor. ppm sum rx.
today I've play with my little quad I 've noticed a strange bug, I'was flying with a level pid "D" term less then 100,@ 90 exactly, the copter level smoother but after a moment the copter fall down.... may this help in debugging the "buggy" 2.0.
fr3d wrote:today I've play with my little quad I 've noticed a strange bug, I'was flying with a level pid "D" term less then 100,@ 90 exactly, the copter level smoother but after a moment the copter fall down.... may this help in debugging the "buggy" 2.0.
please be more accurate: "after a moment the copter fall down"
warthox wrote:there seems to be a problem with hex x config in fw2.0
today i tried the actual fw 2.0. it flew ok but sometimes in left roll there was something wrong. it seemed that the left motor, connected to A0, reacts wrong. in a left roll the motor should decraese rpm but instead the rpm increased for some seconds and fighted against the other motors on the left. this happened not everytime i made a left roll. 3 times in the flight of maybe 4min. doesnt happen in the other directions.
fc. mwc board with pro mini and freeimu v0.4.3 A0 and A1 for left and right motor. ppm sum rx.
Hi Markus, There is apparently a bug about HEX configs (and probably octo) on a promini with 2.0. I will try to reproduce it.
fr3d wrote:today I've play with my little quad I 've noticed a strange bug, I'was flying with a level pid "D" term less then 100,@ 90 exactly, the copter level smoother but after a moment the copter fall down.... may this help in debugging the "buggy" 2.0.
please be more accurate: "after a moment the copter fall down"
copter stay stable (original wmp+nk+bmp085) during 30/40 secondes and slowly descend until it touch the grass, waiting for another set of propeller to retest original pid settings used if i put Level D term at 100 everythings seems to be ok... may this help.
I saw that there´s a new DEV Version at the downloads section . Unfortuantely there´s no text file what has changed... Could anybody tell us what is new in this DEV ?
// use the Devantech SRF i2c sensors, SRF08, SRF02 // (for now, there is no difference in the SRF0x code, but we may want to differentiate in the future.) //#define SRF02 //#define SRF08 //#define SRF10 //#define SRF23
I have to try... Bluetooth serial can.t support with mw 2.0... but if i.m use mw 1.9 and 2.1 work fine ..... the problem seem ontxrx serial.dll.... pls help me