Tip for ArduPilot 2.6 users: disable the Z sensor for now

Jason Short and I were testing 2.6 today and discovered something funky with the Z sensor calibration (he doesn't use one; I do). Until we sort it out, it's best to disable the Z sensor. Just set this line to 0, as shown below

#define ENABLE_Z_SENSOR 0

Although the code will eventually auto-calibrate without the Z sensor, you can calibrate it immediately on the ground before flying. Just hold the plane vertically and rotate it all the way around so each window of the XY sensor gets pointed at the sky at least once. This has the effect of setting the max readings for each side (which is actually all the Z sensor does). Once you've done that you can launch and it should be calibrated right off the bat.


Views: 53

Comment by Leonardo Lisboa on May 17, 2010 at 7:11am
Hi Chris,

I flew my easystar yesterday witn version 2.6 (first flight) and found that it was wiggling a lot, even I putting a lower value in the roll settings.
Is that the case of this Z sensor issue or should I need to check something else also?

Thanks,
Leonardo

Moderator
Comment by Chris Anderson on May 17, 2010 at 7:25am
Wiggling probably just means that you need to lower the Roll and Pitch gains (start with Roll and then add Pitch). Are you adjusting these:

//5-1
#define SERVO_ROLL_P .006

//6-1
#define SERVO_ROLL_P .006

But just to eliminate the possibility of a miscalibrated Z, do disable it as instructed above. Please let us know how it goes.
Comment by Leonardo Lisboa on May 17, 2010 at 7:45am
Great, thanks. I've put .004 in the ROLL_P setting but I'll try a lower value and disable the Z sensor.
Quick question. I normally fly near the beach, so what happens when the plane moves from flying over the land to flying over the water and back to the land. Due to different temperatures (water and land) can it also confuse the sensors?

Tks,
Leonardo

Developer
Comment by jasonshort on May 17, 2010 at 9:34am
if the plane wiggles more in AUTO than FLY-BY-WIRE, check you are using the airspeed sensor. I wasn't using it but forgot to disable it. That caused the plane to accelerate too much and fly all over the place.
Comment by Greg Fletcher on May 17, 2010 at 7:30pm
Try toning down that filter, its only running at 20 Hz. It's takiing 400 ms to settle and if the plane is in turbulance ...?
analog2 = ((float)analogRead(2) * 0.95) + ((float)analog2 * .05);
ir_max = abs(511 - analog2) * IR_MAX_FIX;
ir_max = constrain(ir_max, 40, 600);
Comment by Greg Fletcher on May 17, 2010 at 8:00pm
That filter is bass_ackwards. Should it be this?

analog2 = ((float)analogRead(2) * 0.05) + ((float)analog2 * .95);

Developer
Comment by jasonshort on May 17, 2010 at 9:21pm
I made a quick update that should make the calibration routine worked better.
Comment by Leonardo Lisboa on May 21, 2010 at 7:01am
Hi Jason & Chris, did this update fix the issue with Z sensor? Can we enable it back again?

Tks,
Leonardo

Moderator
Comment by Chris Anderson on May 21, 2010 at 7:26am
The latest bug fixes are in the zip file. We haven't had a chance to fly them yet this week, so it would be great if you could test them for us.
Comment by Leonardo Lisboa on May 22, 2010 at 6:22pm
Hi Chris, couldn't test with the new file yet (just saw that now).
I've flew my airplane today disabling the Z sensor and it was a must... Even with a windy day (around 10Km/h wind) it flew completely stable and perfeclty.
No issues at all reaching the waypoints and doing a loiter over me after completing the circuit.
I went beyond and tried a landing using fly-by-wire, and it worked. I've left my tranmitter and the plane came to the ground and landed perfectly by itself.
So, disabling the Z sensor made a huge difference...
I'll test the new changes in my next flight.

Cheers,
Leonardo

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The third round was a reliablilty/aerial photography round for both planes and copters, which is now closed. Stay tuned for the next round, beginning soon.

A list of all T3 contests is here

 

© 2012   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service