3D Robotics
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.


E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • 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
  • 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
  • 3D Robotics
    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.
  • Hi Jason & Chris, did this update fix the issue with Z sensor? Can we enable it back again?

    Tks,
    Leonardo
  • Developer
    I made a quick update that should make the calibration routine worked better.
  • That filter is bass_ackwards. Should it be this?

    analog2 = ((float)analogRead(2) * 0.05) + ((float)analog2 * .95);
  • 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);
  • Developer
    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.
  • 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
  • 3D Robotics
    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.
This reply was deleted.