#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.
Comments
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
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
Tks,
Leonardo
analog2 = ((float)analogRead(2) * 0.05) + ((float)analog2 * .95);
analog2 = ((float)analogRead(2) * 0.95) + ((float)analog2 * .05);
ir_max = abs(511 - analog2) * IR_MAX_FIX;
ir_max = constrain(ir_max, 40, 600);
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
//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.