Inflight ACC-calibration

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Alexinparis wrote:Hi,
I would prefer to not add another checkbox item for this. The GUI is nearly full...
You can maybe use the pass trough checkbox: this checkbox is only relevant for fix wing configs and has currently no usefulness for multi rotor configs


Hey Alex,
confirmed, I can understand that. Together with de if defined accinflight this makes sense.



Nils

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Okay,
just commited it into multwii_shared:

Log message

Added InflightAccCalibration
A. Using BoxPassthru
1. Start and eliminate drift (hover, acro),activate Passthru (Beep,beep)
2. Land and deactivate Passthru: beeeep. new value stored
3. take back any trims!!! start again: no drift.

B. Alternatively using Stick Combi (to save aux channels):
1. before starting: stick Combo:
Low throttle + Yaw Left + Pitch forward + Roll right: Beep Beep,
function armed (do it again to disarm: beep beep beep)
2. Start and eliminate drift (hover, acro).
3. turn off motors while airborne (failsafe will prevent crash): beep
4. Land and do combo again: BEEEEP, values are stored
5. take back any trimming an start again: no drift

Affected files expand all collapse all
Modify /trunk/MultiWii_shared/MultiWii.ino diff
Modify /trunk/MultiWii_shared/Sensors.pde diff
Modify /trunk/MultiWii_shared/config.h diff

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Inflight ACC-calibration

Post by Hamburger »

Feport:
I use activation v ia passthru bound to TX button.
When I a cidenfally turn off while sfill flying Copter crash. Frame broken.
End of experiment.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Inflight ACC-calibration

Post by PatrikE »

I have a issue...
Acc-trim on airplane .
Start,test,Land,Trim;Satrt,Test,land,Trim................

Inflight ACC-calibration would be great in the airplane and Heli.

If i use Inflight ACC-calibration on airplane and helicopter and use Passthru...
Acc will calibrate every time i switch to Passthru.!.. :o

I suggest using Both Passthru and Beeper to actvate Inflight ACC-calibration.

Is it a possible thing to do?
Just fly level in passthru and flipp BeeperSwitch.
Land and save settings.
Or is it's possible to save in air?

/Patrik

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Oh sh...

sorry to hear that Hamburger, I hope the damage wasn't too expensive. I think I owe you one.

I found a few glitches regarding the implementation of the switch, it was not compatible to the arming method of the combo, but that does not explain your crash.

Do you want to describa what happenend exactly?

What did you turn off? The Pass thru button or the arming button.
Was the crash a constand cascading drift without the possibility to control the copter? If yes, the Saving to eeprom process has been started.

Regarding the airplane mode, I will concentrate onto the issue Hamburger had, until this is fixed for sure: feature freeze. But you can map the function to another box, I am not too happy with the use of passtrhu either but alex asked me not to implement another button. deactivate the passthru metho in the code and use the combo.


Nils

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Inflight ACC-calibration

Post by Hamburger »

Nils,
jevermeister wrote:sorry to hear that Hamburger, I hope the damage wasn't too expensive. I think I owe you one.

it seems I collect too many, recently!
I was willing to test it, but from code in _shared I did not expect such drastic response. Ah, live and learn.
I found a few glitches regarding the implementation of the switch, it was not compatible to the arming method of the combo, but that does not explain your crash. Do you want to describa what happenend exactly?

Here is what I did:
- assign activation via passthru to TX switch
- set switch to OFF
- arm, fly in level mode, recognize some drift, so want to do your callibration thing
- use TX sticks to keep copter steady, turn TX switch ON
- fly some more seconds
- while flying, accidentally turn TX switch OFF again -> copter flips, crashes, breaks.
- the end.

I did not check the code - is eeprom write done when TX-switch->off, regardless of armed status?

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

I coded it the way that you will have to land for writing to eeprom, writing to eeprom while airborne will lead to a crash.

I check the variable "armed". onl if armed = 0 the routine will write to eeprom, but I found out that armed is set to 0 even if the failsafe prevents the motors to stop becaus minthrottle is not applied.

I am on it.

Nils

ygl611
Posts: 9
Joined: Mon Mar 05, 2012 1:29 am

Re: Inflight ACC-calibration

Post by ygl611 »

Thanks jevermeister's methods of Inflight ACC-calibration,it works!

After tried it serveral times , I changed some code ,so my Inflight ACC-calibration like this:

1.Calibrate gyro and ACC as usual , Armed,then continiue Keep RC sticks in Armed over 4S untill LED flash.
2.Start and use trim to eliminate drift (hover, ACRO or Level mode,I prefer to Level mode), activate MAG (or Headfree, Passthru,just chang the code ), LED stop flash and then on.
3. Land and deactivate MAG, Throttle lowest(< mincheck), new value stored
4.Take back any trims!!! start again: no drift.

Senors.pde, line 281, coment this to save loop time

Code: Select all

//blinkLED(10,10,2);      //buzzer for indicatiing the start inflight


MultiWii_dev_20120225.ino
Add inflightcalibratedAccTime

Code: Select all

void annexCode() { //this code is excetuted at each loop and won't interfere with control loop if it lasts less than 650 microseconds
  static uint32_t buzzerTime,calibratedAccTime;
  static uint32_t inflightcalibratedAccTime;


Instead of :

Code: Select all

 if ( (calibratingA>0 && (ACC || nunchuk) ) || (calibratingG>0) ) {  // Calibration phasis
    LEDPIN_TOGGLE;
  } else {
    if (calibratedACC == 1) {LEDPIN_OFF;}
    if (armed) {LEDPIN_ON;}
  }


To be:

Code: Select all

  if ( (calibratingA>0 && (ACC || nunchuk) ) || (calibratingG>0) ) {  // Calibration phasis
    LEDPIN_TOGGLE;
  } else {
    if (calibratedACC == 1) {LEDPIN_OFF;}
    if (armed) {
      #if defined(InflightAccCalibration)
        if ( AccInflightCalibrationArmed ) {
          if (currentTime > inflightcalibratedAccTime) { inflightcalibratedAccTime = currentTime + 50000; LEDPIN_ON;}
        }
      else
      #endif 
     {LEDPIN_ON;}
    }
  }


Instead of :

Code: Select all

#if defined(InflightAccCalibration)  
        else if (armed == 0 && rcData[YAW] < MINCHECK && rcData[PITCH] > MAXCHECK && rcData[ROLL] > MAXCHECK){
          if (rcDelayCommand == 20){
            if (AccInflightCalibrationMeasurementDone){                //trigger saving into eeprom after landing
              AccInflightCalibrationMeasurementDone = 0;
              AccInflightCalibrationSavetoEEProm = 1;
            }else{
              AccInflightCalibrationArmed = !AccInflightCalibrationArmed;
              if (AccInflightCalibrationArmed){blinkLED(10,1,2);}else{blinkLED(10,10,3);}
            }
          }
       }
#endif


To be:

Code: Select all

#if defined(InflightAccCalibration)  
        else if ( (rcData[YAW] > MAXCHECK || rcData[ROLL] > MAXCHECK) && rcData[PITCH] < MAXCHECK && armed == 1 && calibratingG == 0) { 
          if (rcDelayCommand == 200){
              //calibratingA=400;
              AccInflightCalibrationArmed = !AccInflightCalibrationArmed;
            }
        }
        else if(AccInflightCalibrationMeasurementDone){                //trigger saving into eeprom after landing
              AccInflightCalibrationMeasurementDone = 0;
              AccInflightCalibrationSavetoEEProm = 1;
              blinkLED(10,10,2);
        } 
#endif


Finally, comment some sentence, "!rcOptions[BOXARM]" changed to "rcOptions[BOXMAG]"

Code: Select all

#if defined(InflightAccCalibration)  
      if (AccInflightCalibrationArmed && armed == 1 && rcData[THROTTLE] > MINCHECK && rcOptions[BOXMAG] ){              // Copter is airborne and you are turning it off via boxarm : start measurement
        InflightcalibratingA = 50;
        AccInflightCalibrationArmed = 0; 
      } 
      /*if (rcOptions[BOXPASSTHRU]) {      //Use the Passthru Option to activate : Passthru = TRUE Meausrement started, Land and passtrhu = 0 measurement stored
        if (!AccInflightCalibrationActive && !AccInflightCalibrationMeasurementDone){
          InflightcalibratingA = 50;
        }
      }else if(AccInflightCalibrationMeasurementDone && armed == 0){
        AccInflightCalibrationMeasurementDone = 0;
        AccInflightCalibrationSavetoEEProm = 1;
      }*/
#endif


Sorry for my terrible English , i'm from China, Hope you like this method to calibration ACC in flight!

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Inflight ACC-calibration

Post by Noctaro »

Hey,
sounds nice! Wich version of multiwii did you use for your mods? I would like to give it a try. May you upload a moded archive of the firmware you used? Thanks for sharing your idea :)

greetz Noc

ygl611
Posts: 9
Joined: Mon Mar 05, 2012 1:29 am

Re: Inflight ACC-calibration

Post by ygl611 »

Noctaro wrote:Hey,
sounds nice! Wich version of multiwii did you use for your mods? I would like to give it a try. May you upload a moded archive of the firmware you used? Thanks for sharing your idea :)

greetz Noc


Multiwii 20120225,the lastest Multiwii 2.0 aslo works! :)

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hi,
I was in the GPS code. Sorry for not stating. I changed the buzzer code so blinkled is not used.
Can you post a diff of your changes?It would be easier to underatand.

Thanks for revisiting the code.Glad to see you guys are interested in it.

Nils

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: Inflight ACC-calibration

Post by howardhb »

Just tested In-flight calibration with V2.0 preversion2 using stick method.

My copter has ITG3205, BMA180, HMC5883L and BMP085 with PPM SUM with Spektrum Orange clone 6ch receiver.
Using SuperSimple HK-HW20A ESC's flashed with latest SimonK firmware: Very big improvement in stability - smooth flying copter.
http://www.rcgroups.com/forums/showthre ... update+esc

I arm the motors using AUX1

I don't have a buzzer connected (Parisv4.0 r3) ,but I do have LED strips, and it displays 2 short flashes when activating the calibration mode before take-off.
(stick method - Throttle low, yaw left, pitch forward, roll right)
Then, after trimming (level mode) using trim levers on my transmitter, I flipped motor switch to OFF (AUX1) I saw 3 short flashes?
(motors did NOT stop in flight! hahahaha)
Land the copter. (copter dis-arms automatically as throttle is lowered to zero - AUX1 is still low/off)

Apply "stick method" again, I saw 3 flashes.

zero "trim" on transmitter.

Armed the copter and took off again.....perfectly level.
Hover hands off for 10 seconds.... Perfect! :mrgreen:

Thanks @jevermeister.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Good to hear that it is working as intended.
Thank you for your feedback.

Nils

User avatar
fr3d
Posts: 97
Joined: Sun Feb 06, 2011 11:21 am
Location: Cappelle la grande near the ch'ti village
Contact:

Re: Inflight ACC-calibration

Post by fr3d »

plz can someone confirm to me "inflight calibration procedure"
I can arm motor from an aux channel ...
after trimming as used to in acro mode (transmitters subtrims)
and leveled mode (motor off throttle max a few stick mouvements on roll and pitch depend of leading)
my copter is pretty stable in both configurations now :lol:

inflight calibration procedure :
motor off (off course... -> ->)
I do the "stick method" to arm inflight calibration (yaw left, throttle min, pitch max, roll right)
I must see 2 flashs ... on/off/on/off with power led
do I I enable stab mode from my transmitter ? [stable led(red) is on ]
I arm motor power led, [stable led] and motors are on
I take off
I disarm motor :o
I trim with my transmitter in order to get a rock solid stable mode :?
I land, motors stop at min throttle :D
I do the stick method once's again
I put my trim at zero/null point, not subtrim right ?
I can dust off now with arm switch
is it correct ?

on my futaba I have subtrim (a modified neutral point in a menu ) and trims switch near sticks.
regards

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Correct.

The trim method via transmitter is ok if u do not need to swtisch between hover and acro mode, but if you are satisfied with trimming in hover and switch to acro you copter can make severe dvings. I do not use trimmmings for nick and roll, only fpor yaw and throttle. It is too dangerous imho.

Nils

User avatar
fr3d
Posts: 97
Joined: Sun Feb 06, 2011 11:21 am
Location: Cappelle la grande near the ch'ti village
Contact:

Re: Inflight ACC-calibration

Post by fr3d »

ok, in usual flight I flight in acro mode, I use only stable mode when I lose my copter orientation this mode save copter's life many time because with quadcopter all sides are l the same.... even with leds and colored propeller
at far distance you can't see anything... :twisted: only fighting against gravity.... :!: http://www.youtube.com/watch?v=9CsZBu88lEM
I would like to make a fpv quadX-8 so. A good hover mode will be needed and I will surrely switch between acro and hover mode without this it will be boring a bit :D .

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Inflight ACC-calibration

Post by Hamburger »

Hi Nils,
to be more conform with rest of code I just submitted a change of macro spelling from InflightAccCalibration to INFLIGHT_ACC_CALIBRATION.
Hope you don't mind.
Cheers, Hamburger

Tazzy
Posts: 75
Joined: Sun Jun 19, 2011 4:45 pm
Location: Sweden

Re: Inflight ACC-calibration

Post by Tazzy »

Hello Nils
I did try your calibration procedure and it works ok BUT when i switch off throttle activation in flight the quad will tilts hard to right a couple of meters then i can land and save .... have you seen this problem before ? i have a paris v3 bord with nk and wm+ all orginal, Barro and mag ...
Its kind off scary to activate in air ;)

// Tazzy

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

@ Hamburger: No Problem at all, I am glad the function stays in the code ;-)

@Tazzy: I nboticed that effect once, I need to do some testing again. But I do not have much time left right now, I will try to do some testing on sunday.

Hope I find the bug..

User avatar
fr3d
Posts: 97
Joined: Sun Feb 06, 2011 11:21 am
Location: Cappelle la grande near the ch'ti village
Contact:

Re: Inflight ACC-calibration

Post by fr3d »

Tazzy wrote:Hello Nils
I did try your calibration procedure and it works ok BUT when i switch off throttle activation in flight the quad will tilts hard to right a couple of meters then i can land and save .... have you seen this problem before ? i have a paris v3 bord with nk and wm+ all orginal, Barro and mag ...
Its kind off scary to activate in air ;)

// Tazzy

can't remember but I'm almost sure you have to do a good level calibration on your desktop, for exemple, with multiwiiconf. And you have to calibrate your copter with standard acc calibration (motor off, stable on, throttle stick at mximum, then a few sticks mouvements on opposite side of leading, ex:copter tilt to the right make a few roll left stick mouvements ...) after that inflight calibration will be easyer.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hi,
I made a short glimpse at the code and I think the badly drift problem is related to this:


Code: Select all

          // Clear global variables for next reading
          accADC[axis]=0;
          accZero[axis]=0;


I do this 50 cycles and then I store the values. I think this causes the drift...

In stable conditions this shouldn't be a problem but If you have some wind ore other disturbing parameters this will cause a adrift.

I have to zero these values to do a correct calibration, I will rethink that.

Sorry for the inconvenience guys...

EDIT:
Absolutely untrue!!!
The drift also happens in ACRO mode with no ACC included in the control process, so this might be a problem with the cycle time...

Nils

Tazzy
Posts: 75
Joined: Sun Jun 19, 2011 4:45 pm
Location: Sweden

Re: Inflight ACC-calibration

Post by Tazzy »

fr3d: I did a desk calibration on both wm+ and nk and also a "manual" adjust first then i tested a inflight acc cal and it will fly hard to left before i will get it to stop .... then i land and save to eprom and all is perfect callibrated .....

I did try this 3 times this morning and it do the same all the time .....

So the conclusion is try this in safe area and on good hight not low like i did ;)

// Tazzy

Tazzy
Posts: 75
Joined: Sun Jun 19, 2011 4:45 pm
Location: Sweden

Re: Inflight ACC-calibration

Post by Tazzy »

Nils
yes when you say cycle time i think we are on the right way ....
i have high cycle time at normal about 5800ms but it fly good so i have never care about it

// Tazzy

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hi,
I took a close look at the code and I believe it may be this part:

Code: Select all

        if (InflightcalibratingA == 1) {
          AccInflightCalibrationActive = 0;
          AccInflightCalibrationMeasurementDone = 1;
          blinkLED(10,10,2);      //buzzer for indicatiing the start inflight


the blink LED Command stops the code for a few moments, maybe it is causing this behavior.

Unfortuenally I was unable to test it inflight in my basement...

I have very bad weather right now and I am unable to flight right now, can someone check my theory by removing this line in sensors.pde line #302:

Code: Select all

        blinkLED(10,10,2);      //buzzer for indicatiing the start inflight


Please be careful not to crash your copter.


Nils

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Okay,
it is the blinkLED command.
One can see a severe rise in cycletime if the blinkled is activated,
I replaced it with togglebeep in the trunk.

SORRY!!

Nils

Tazzy
Posts: 75
Joined: Sun Jun 19, 2011 4:45 pm
Location: Sweden

Re: Inflight ACC-calibration

Post by Tazzy »

Sorry Nils for my slow reaction i have been on skii holiday.
I will test it out asap when im back at home and have some better weather
Thanks for the good work :)

// Fredde

jrt4fun
Posts: 11
Joined: Fri Mar 16, 2012 2:37 pm

Re: Inflight ACC-calibration

Post by jrt4fun »

Hi,

The inflight acc-calibration is working great.

Quad stays rock solid, no drift.
Afterwards activated the 'alt hold' --> hands off hovering

Great coding job :)

Next to test is my other quad with the Mega board + GPS... hoping for some good wheather

Version 2.0
Crius Multiwii SE
Keda 20-50S 8A 1088kv
Hobbywing 10A esc

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Inflight ACC-calibration

Post by Federico »

Hi, I am using MultiWii 2.0
I don't understand if the inflight calibration is ready in my software version and I don't get how to use it...
Is there an official "manual" for this calibration function?
Thanks!
Federico

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

You are right, there is no doc right now.

I provided one in the SVN code but we should add one in the FAQ.
I will contact alex on that topic.

Nils

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Inflight ACC-calibration

Post by Federico »

Thank you, going trough the forum looking for docs it's a bit difficult. I am going to check out the SVN code in the meantime.
By the way, I can't wait to try this out. Thanks for your work!
Fede

Cronalex
Posts: 51
Joined: Tue Mar 20, 2012 8:41 pm

Re: Inflight ACC-calibration

Post by Cronalex »

with the DX6i can use this function?


User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Inflight ACC-calibration

Post by Hamburger »

Nils, good howto.
two Q:
1. with passThrough method - is there now some protection against writing eeprom during flight (while still armed)?
2. both step5: with trim to revert to neutral you mean trim on the TX?

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hi,
the Code only writes to eeprom if the switch is took back AND motors are off ;-)

BTW.: The EEPROM write crashes the copter because of the loong beep. There is a wait command in that buzzer routine, if we delete that it should be possible to write into eeprom inflight.
BUT I think you should avoi changing parameters while inflight: bad idea!!!

2. Take back tx trimming, correct

Nils

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Inflight ACC-calibration

Post by Hamburger »

Nils,
ok. thanks for the quick reply (and the fix for 1.) That copter frame is glued together long since, so I can activate that feature for good now.
Hamburger

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Inflight ACC-calibration

Post by Federico »

I don't get one thing but it's probably because english is not my language. Take back trims means that I have to set them to neutral, 0 ?

With my usual copter I have trimmed my transmitter and I have no drift. If I remove this trim and I don't use accelerometers because I don't switch them on (sometimes), should I expect drift?

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hey fede,

usually you trim an aircraft to get neutral behavior. In case of a copter with hover and acro mode this is dangerous.
If you trim your hover mode so the copter does no drift in hover and switch to acro. it will bank into the direction you moved your trim. a trim is nothing less than constantly applying a stick movent into a direction. it is the same like compensating a drift "by hand"

angular velocity and absolute angle are two very different principles and cannot mix.

So even alex says: "Do not use tx trim"
He implemented the triming method via stick inputs to insert a trim into the eeprom to deal with the drift you nearly always get - because every copter is a little croocked or an acc is not exactly levely soldered etc.

In case of this funciton you temporarily use the trims on your tx to achive a neutral point without any drift and transfer the difference between the original neutral point into the ram of the copter.
after landing it calculates a new neutral point and writes it to the software trim i mentioned above.
If you start now without taking the tx trims back it will drift very bad because you add a deviation to a deviation. so you will have to move all trimming sliders on your tx to neutral to achieve a secure flyable copter.

please accept the following advice: I use acro mode to auto calibration because using acc is not very elegant and uses time. but you have to be good in acro flying to do that.

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Inflight ACC-calibration

Post by Federico »

Thanks! Now it's really clear. You should add this to your howto , it will be useful for noobs too :-)
I am going to try and report the restult!

p25o1
Posts: 33
Joined: Thu Mar 29, 2012 3:19 pm

Re: Inflight ACC-calibration

Post by p25o1 »

hi all,

the inflight calibration is a very cool idea, and very practical to use.

for me i end up changing the camera location on the quad frequently, so i always have to go in loops (take off->observe->land->tune->takeoff->loop) to calibrate.

i tried to enable the in flight calibration, but i get "toggleBeep" declaration error in Sensors.ino

i'm using 2.1 dev and also tried r949.

Anyone faced this before?

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hi,the problem is already spotted and fixed in the shared trunk.
The variabledeclaration was in a if defined block but the variable usw was not. these things happen if someone does not make a proper testbench run.

:-/

Nils

p25o1
Posts: 33
Joined: Thu Mar 29, 2012 3:19 pm

Re: Inflight ACC-calibration

Post by p25o1 »

thx for the response,

is it fixed in the post r949 builds , /or can you share with me a the code to fix it.

not sure what is "shared trunk" lool

thx

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

BAsically you have to put each use of toggleBeep into a if defined stetement:

For instance

Code: Select all

          }else{ 
              AccInflightCalibrationArmed = !AccInflightCalibrationArmed;
              #if defined(BUZZER)
              if (AccInflightCalibrationArmed){
                toggleBeep = 2;
              } else {
                toggleBeep = 3;
              }
              #endif
            }


So that the part of the code is only used if the buzzer is defined.

Nils

p25o1
Posts: 33
Joined: Thu Mar 29, 2012 3:19 pm

Re: Inflight ACC-calibration

Post by p25o1 »

thx ,, i'll try it out.

edit:
just figured out the "branch" part lool,

i'll try it out ,

next stop, ACROTRAINER branch, nice to try out

arkcom
Posts: 6
Joined: Sun Aug 19, 2012 10:35 am

Re: Inflight ACC-calibration

Post by arkcom »

Hello,
I'm having some unpredictable results with this. Testing on the bench with the configurator connected, it seems to calibrate z correctly, but saves a random value for pitch and roll. Anywhere from -250 to 70 when sitting level. Standard Calibrate ACC button in GUI works fine. Any ideas as to what's up?

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Inflight ACC-calibration

Post by ziss_dm »

Hi,

Just a quick question: Why we have "In-flight calibration" instead "In-flight level trim"? The "In-flight level trim" is also easier to implement. ;)

regards,
ziss_dm

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

it is level trim, I jsut called it calibration.
look at the code,
I measure the difference between the current trim and the flying angle and compensate that.

Nils

paddytfm
Posts: 8
Joined: Sun Aug 07, 2011 9:07 pm

Re: Inflight ACC-calibration

Post by paddytfm »

HI everybody
I have a proposition to do for inflight calibration with The 5th channel used as level mode switch.
If in or while normal mode do a short time toggle switch in level mode and back to normal mode.
If in or while level mode do a short time toggle switch in normal mode and back to level mode. It is quite similar to passthrouht selection but with only the 5th channel used not more. Hope you anderstand what i explain . Tell me if somebody implement this idea
Regards
Paddytfm

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

Hi,I read your idea in my blog.Would be hard to implement.We would need a timing for that and a lot of users will have problems with that. Please use the stick combo. It won't interfere with other functions. btw. channel 5 is not hardcoded to level switch.

paddytfm
Posts: 8
Joined: Sun Aug 07, 2011 9:07 pm

Re: Inflight ACC-calibration

Post by paddytfm »

Hi, and thank's for reply.
Right, need timing , less than 1 seconde would be nice.Stick combo does destabilisation of the device in flight. When i say Channel I mean Aux1. What else.
Paddytfm

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Inflight ACC-calibration

Post by jevermeister »

hi.you don't do the combo inflight o_O.
you switch of aux arm while flying. and the code saves the offset after landing. so aux arm or passthru is needed.

nils

Post Reply