Inflight ACC-calibration

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: 2559
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: 2559
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

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

Re: Inflight ACC-calibration

Post 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

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

Re: Inflight ACC-calibration

Post 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

Eric
Posts: 38
Joined: Thu Nov 08, 2012 7:08 am

Inflight ACC-calibration

Post 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)

natael
Posts: 33
Joined: Mon Sep 10, 2012 1:21 pm

Re: Inflight ACC-calibration

Post 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 ?

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Inflight ACC-calibration

Post by Crashpilot1000 »

Has anyone a proper inflight trimming code without touching the actual acc calibration?

User avatar
Benik3
Posts: 25
Joined: Mon Aug 26, 2013 1:06 pm
Contact:

Re: Inflight ACC-calibration

Post 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 :)

hakank
Posts: 2
Joined: Sat Mar 17, 2012 3:01 pm
Location: Sweden

Re: Inflight ACC-calibration

Post 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!

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Inflight ACC-calibration

Post 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.

Post Reply