Page 3 of 3

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 12:22 am
by Cronalex
with the DX6i can use this function?

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 9:32 am
by jevermeister

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 9:47 am
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?

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 10:06 am
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

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 10:11 am
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

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 12:57 pm
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?

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 1:09 pm
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.

Re: Inflight ACC-calibration

Posted: Wed Apr 25, 2012 1:24 pm
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!

Re: Inflight ACC-calibration

Posted: Thu Jul 05, 2012 6:20 am
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?

Re: Inflight ACC-calibration

Posted: Thu Jul 05, 2012 7:53 am
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

Re: Inflight ACC-calibration

Posted: Thu Jul 05, 2012 8:01 am
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

Re: Inflight ACC-calibration

Posted: Thu Jul 05, 2012 8:41 am
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

Re: Inflight ACC-calibration

Posted: Thu Jul 05, 2012 9:28 am
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

Re: Inflight ACC-calibration

Posted: Thu Aug 23, 2012 1:36 am
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?

Re: Inflight ACC-calibration

Posted: Fri Aug 24, 2012 6:08 am
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

Re: Inflight ACC-calibration

Posted: Fri Sep 07, 2012 8:41 pm
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

Re: Inflight ACC-calibration

Posted: Thu Oct 18, 2012 9:31 pm
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

Re: Inflight ACC-calibration

Posted: Thu Oct 18, 2012 9:41 pm
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.

Re: Inflight ACC-calibration

Posted: Fri Oct 19, 2012 9:20 pm
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

Re: Inflight ACC-calibration

Posted: Fri Oct 19, 2012 9:59 pm
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

Re: Inflight ACC-calibration

Posted: Sat Oct 20, 2012 11:58 am
by paddytfm
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.

Hi nils
You say :
you switch of aux arm while flying.
I understand , In flight calibration procedure:
AUX OFF is default position
Start flying AUX ON, when stabilisation is OK switch OFF AUX ,then land switch AUX still OFF.

You say :
and the code saves the offset after landing
I understand :
On ground do i need to switch OFF transmiter , set trim to neutral position, switch ON transmiter and fly again switch AUX OFF to default position.

Thank's nils for these last precision
Paddytfm

Re: Inflight ACC-calibration

Posted: Sat Oct 20, 2012 2:48 pm
by jevermeister
hi.
you have to take back any trims on your transmitter you set while you did the inflifht calibration. an alternate way is:to do it in acro mode. no trimming needed.

your welcome.
nils

Inflight ACC-calibration

Posted: Mon Nov 12, 2012 3:20 am
by Eric
I did a test on this yesterday.
But I enable the new alt hold cold as well, this new alt hold use accZ for better alt holding.

The inflight acc calibration code reset accADC[Z] to zero, but the default value to should 1G, so the alt hold code get a very high speed towards the ground, the BaroPID changes to a very high value and the copter jump to a very high alt and finally crashed, one motor and one arm broken.

Questions:
1. Sure we set the accADC[Z] to zero?
2. Alt hold code should be disable by then?
3. Alt code is not robust enough? (or this is the case of broken sensor. BARO reads a high alt, acc get a high speed towards ground)

Re: Inflight ACC-calibration

Posted: Sat Jul 13, 2013 10:17 am
by natael
Hi,

I'm confused with the connection diagrams for the piezzo-buzzer (for the in-flight calibration):
http://www.rcgroups.com/forums/showthread.php?t=1340771

and the bit of code in config.h saying :

Code: Select all

 /**********************************    Buzzer Pin    **********************************/
      /* this moves the Buzzer pin from TXO to D8 for use with ppm sum or spectrum sat. RX (not needed if A32U4ALLPINS is active) */
      //#define D8BUZZER


According to the connection diagrams, the buzzer is shown connected to D8, not TX0. But this comment in config.h suggests that by default the buzzer would go to TX0.
Since the diagrams is for multiwii 1.9 and the code is now at version 2.2, can someone clarify if the correct usage would be to connect to TX0 or to D8 ? or do we have the choice ? I'm flying a Tricopter, on a pro micro (not pro mini but i guess that won't change, will it ?) with wmp and nunchuck.
What typical value of resistor should i use ?

Thanks

[UPDATE] : on the pro micro, i tried to connect to D8 and uncommented the corresponding line in config.h. The buzzer reacts ok but i lost the aux1 signal so i cannot use it to arm the motors.
Should i use the buzzer override on A2 instead of D8 ?

Re: Inflight ACC-calibration

Posted: Sat Jul 27, 2013 2:21 am
by Crashpilot1000
Has anyone a proper inflight trimming code without touching the actual acc calibration?

Re: Inflight ACC-calibration

Posted: Mon Aug 26, 2013 1:27 pm
by Benik3
Hello.
First I must say thanks, great idea!
Second I have a question: What about vibration?
You know probably on every copter you have a little vibration.
Doe's the measurement calculate with it?
The simplest way which I found should be median (because the vibrations are probably always periodical).
Or maybe set for the measuring lower LPF in the code?

Also I must thanks about the comment with min and maxcheck throttles. I searched a lot how to change this and finally I luckily found it here :D

Thank you :)

Re: Inflight ACC-calibration

Posted: Mon Oct 21, 2013 6:16 pm
by hakank
I have read through the thread but I'm still a little bit unsure on how to best proceed. I have a MultiWii Pro / Mega.
DX8
Only a 6 channel receiver. I can add one additional receiver it that helps but I can't find any available rec ports on the MultiWii Pro.
I'm arming it with the sticks. My AUX1 is occupied with:
0=Nothing (I assume that's what's called acro mode?)
1=Angle + Mag (level mode?)
2=Angle +Mag + Baro (Enhanced level mode?)
My AUX2 is occupied with
0=Nothing
1=GPS Hold
2=RTH

On top of that I read from http://www.multiwii.com/wiki/index.php?title=Extra_features#Inflight_ACC_calibration

"Please note: starting with code revision 1275 the passthrough switch has been replaced with a separate Calib switch for this feature."

So I wonder how to best do this exercise with the given data?

Thanks!

Re: Inflight ACC-calibration

Posted: Sun Dec 29, 2013 5:36 pm
by Crashpilot1000
Crashpilot1000 wrote:Has anyone a proper inflight trimming code without touching the actual acc calibration?

I finally came to that subject in "Harakiri" and programmed an "Air-Trim" that doesn't affect the acc calibration. The code is avail. on github "https://github.com/Crashpilot1000" (look in the latest repo/mw.c/"DoAirTrim(void)"). It maybe useful for mwii as well - don't know and don't care.