r1233 - gyro calibration repeat if copter moves

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

r1233 - gyro calibration repeat if copter moves

Post by jevermeister »

Hi,
I think we should definetely put this feature into a define!

Many gyros do not like change of climate and will prevent you from flying if you take them out of the warm car/room into the cold and have this feature working.

This feature was implemented a few months ago and ditched because of this.
Maybe it is ok for a MPU but you will have serious problems with some ITG and WMP.
The temperature drift of gyros is the reason for this.

Can I have a feedback from different people with different gyros?

Nils

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by copterrichie »

Back in the days of using the HK401Bs, it was a well know fact to allow the gyros to set and adjust to surrounding temperature. Personally I think people should revisit this technique verse adding more code to the firmware. Then one can also use the stick combination to recalibrate if needed.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by timecop »

There are so many people who are totally unaware the gyro calibration stick combo exists, who continue moving the copter while powering it up (and thus ending up with non-zero gyro offsets), and then attempt to fly.

This is one of the reason I added moron threshold value to baseflight, which allows a certain deadband (to allow for sensor drift) while still discarding calibration if user is obviously a moron (i.e. spinning the board around while plugging in battery), but of course, the proper way would be to make users read manual/wiki (yea, RIGHT) to get educated on the issue.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: r1233 - gyro calibration repeat if copter moves

Post by doughboy »

I think this feature makes sense and should be left as it is.

I think the main point is to get the gyro calibrated properly. if you remove this change, then the user will be worse off, plus its not like the issue you described will go away if this change is backed out. not saying the issue you described does not exist, but probably should be addressed separately.

This feature saves me the trouble of doing manual gyro calibration everytime I plug in the battery. thanks for adding it.

-------------
Go Giants!

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

Re: r1233 - gyro calibration repeat if copter moves

Post by jevermeister »

then please put into a default activated define.this way I can deactivate it. imho, people who are unaware of the calibration at startup should crash their copter to learn it the hard way.

adding features like this without proper notice is not good kung fu btw.

nils

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: r1233 - gyro calibration repeat if copter moves

Post by scrat »

We can't we set gyro calibration when arming?

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: r1233 - gyro calibration repeat if copter moves

Post by dr.tom »

on gimbal equipped MWC multirotors
gimbal servos make all sort of rapid movement during first 3-4 seconds of battery being plugged in,
many times I had to unplug them to allow board to initialise properly before this mod,
so this surely helps, because no unplugging is needed more,

p.s. is there a way to disable servo movement in code for the first 20 seconds?
to delay initialisation of them or something...?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by copterrichie »

dr.tom wrote:on gimbal equipped MWC multirotors
gimbal servos make all sort of rapid movement during first 3-4 seconds of battery being plugged in,
many times I had to unplug them to allow board to initialise properly before this mod,
so this surely helps, because no unplugging is needed more,

p.s. is there a way to disable servo movement in code for the first 20 seconds?
to delay initialisation of them or something...?


On my Bicopters, I power the servos from a separate power source than the FC and power the the FC first. After the FC is powered up, you can do what you like.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by shikra »

Dr Tom has a good point.
Suggest to add code to not move servos during init

I fly mainly tris and have the habit of holding copter still until init is finished. Should fix issue at source.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by copterrichie »

My experience has been, even with the absent of a signal, the servos will move regardless. Maybe the cheap analog servos I am using.

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

Re: r1233 - gyro calibration repeat if copter moves

Post by jevermeister »

I always calibrate the gyros by combo before first start. my landing skid is vety wobbly so I have to wait for it to calm down.
I changed the code.the function is now enclosed by a define. everyone is now happy.

nils

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by Alexinparis »

jevermeister wrote:Many gyros do not like change of climate and will prevent you from flying if you take them out of the warm car/room into the cold and have this feature working.


Gyro drift due to temperature change is a long term process (several minutes)
gyro calibration lasts only a couple of second.

this mod is not dependant with gyro drift

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: r1233 - gyro calibration repeat if copter moves

Post by doughboy »

jevermeister wrote:I always calibrate the gyros by combo before first start. my landing skid is vety wobbly so I have to wait for it to calm down.
I changed the code.the function is now enclosed by a define. everyone is now happy.

nils


you can still do that even with the fix, no?
imho, adding yet another define will only serve to confuse users even more.
I still don't see how adding the option to remove the fix helps.
if the gyro has temp issues, regardless if the feature is in there or not, a manual gyro calibration is needed.
its not like if the quad was perfectly still when the battery is plugged in, that not having this fix will make that gyro calibration any more valid than with the fix.
I'm not sure if you are able to follow my reasoning logic or not.
Anyone else care to chime in on this?

just my 2 cents.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: r1233 - gyro calibration repeat if copter moves

Post by Alexinparis »

I fully agree.
This mod can only make things better.

no define is expected.

doughboy wrote:
jevermeister wrote:I always calibrate the gyros by combo before first start. my landing skid is vety wobbly so I have to wait for it to calm down.
I changed the code.the function is now enclosed by a define. everyone is now happy.

nils


you can still do that even with the fix, no?
imho, adding yet another define will only serve to confuse users even more.
I still don't see how adding the option to remove the fix helps.
if the gyro has temp issues, regardless if the feature is in there or not, a manual gyro calibration is needed.
its not like if the quad was perfectly still when the battery is plugged in, that not having this fix will make that gyro calibration any more valid than with the fix.
I'm not sure if you are able to follow my reasoning logic or not.
Anyone else care to chime in on this?

just my 2 cents.

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

Re: r1233 - gyro calibration repeat if copter moves

Post by jevermeister »

then would someone please tell me how to fly my copter if the gyro is not calibrating because the calibrations starts over and over again?

ps.: I can follow your argumentation.I am not stupid. But I do not share it.

have you tested this feature in reality, like you should have, or is it just theory?

nils

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: r1233 - gyro calibration repeat if copter moves

Post by doughboy »

rebuilt the code again with the fix enabled and maybe reinitialize your eeprom just to make sure. the calibration should only take less than 1 second.
if you are seeing it continue forever (led does not go off), then something is wrong with your setup.
yes I have tested this thoroughly and I can shake the quad and it keeps on calibrating but stops as soon as I put it down.

what you described can happen if your tilt variable is not initialized to 0.
line 268
uint8_t axis, tilt=0;

I think you probably missed that change and incorrectly blaming it to temp issue. As Alex said, the two issues are mutually exclusive and as I said, temp issue should be addressed separately.

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

Re: r1233 - gyro calibration repeat if copter moves

Post by jevermeister »

ok go on then.
feel free to revoke my last commit.
as I said I ested this feature a year ago.
I do not have an educational mandate.

nils

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: r1233 - gyro calibration repeat if copter moves

Post by doughboy »

or if you verified your tilt is initialized to 0, then the other possible cause is

if(abs(gyroADC[axis] - previousGyroADC[axis]) > 8)
is always true. if this is really due to temp issue, adding a define to disable the fix does not really address the temp issue. the problem is still there.

nobody is arguing the temp issue does not exist. please evaluate this more objectively.

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

Re: r1233 - gyro calibration repeat if copter moves

Post by jevermeister »

Hi,
btw.: Please provide us with the proper credits for this code:

http://code.google.com/p/afrodevices/so ... /sensors.c

and at least copy the comments (so true) ;-)

Nils

ps.: please take everythign as serious as possible! This is no irony at all, mutliwii is my life. If I do not succeeed here, I feel worthless. LOL

Nils

Post Reply