Browse Source

Plane: fixed tilt transition with binary tilt servo

once the tilt is fully fwd then force transition as done at any
airspeed
master
Andrew Tridgell 8 years ago
parent
commit
5c820adad4
  1. 5
      ArduPlane/quadplane.cpp
  2. 1
      ArduPlane/quadplane.h
  3. 11
      ArduPlane/tiltrotor.cpp

5
ArduPlane/quadplane.cpp

@ -1011,6 +1011,11 @@ void QuadPlane::update_transition(void) @@ -1011,6 +1011,11 @@ void QuadPlane::update_transition(void)
assisted_flight = false;
}
// if rotors are fully forward then we are not transitioning
if (tiltrotor_fully_fwd()) {
transition_state = TRANSITION_DONE;
}
if (transition_state < TRANSITION_TIMER) {
// set a single loop pitch limit in TECS
if (plane.ahrs.groundspeed() < 3) {

1
ArduPlane/quadplane.h

@ -323,6 +323,7 @@ private: @@ -323,6 +323,7 @@ private:
void tiltrotor_continuous_update(void);
void tiltrotor_binary_update(void);
void tilt_compensate(float *thrust, uint8_t num_motors);
bool tiltrotor_fully_fwd(void);
void afs_terminate(void);
bool guided_mode_enabled(void);

11
ArduPlane/tiltrotor.cpp

@ -229,3 +229,14 @@ void QuadPlane::tilt_compensate(float *thrust, uint8_t num_motors) @@ -229,3 +229,14 @@ void QuadPlane::tilt_compensate(float *thrust, uint8_t num_motors)
}
}
}
/*
return true if the rotors are fully tilted forward
*/
bool QuadPlane::tiltrotor_fully_fwd(void)
{
if (tilt.tilt_mask <= 0) {
return false;
}
return (tilt.current_tilt >= 1);
}

Loading…
Cancel
Save