Commit Graph

226 Commits

Author SHA1 Message Date
Andrew Tridgell b15b11e32d Plane: always stabilize with tailsitters 2017-04-14 12:48:08 +10:00
Andrew Tridgell 46d910539c Plane: fixed a warning 2017-04-11 17:34:40 +10:00
Andrew Tridgell 642a6acfcb Plane: support thrust vectoring in tailsitters
adds Q_TAILSIT_VHGAIN and Q_TAILSIT_VFGAIN, allowing for thust
vectoring in both fixed wing and hover
2017-04-11 17:34:40 +10:00
Andrew Tridgell 664e41cec6 Plane: bring in demanded climb rate over 1 second
when we engage the Z controller in quadplane we bring in the climb
rate slowly to prevent a sudden change in motor demand
2017-04-09 16:45:19 +10:00
Andrew Tridgell 0cf571d338 Plane: moved Z altitude target reset
reset alt target whenever we have not run Z controller for 2s
2017-04-09 16:45:19 +10:00
Mark Whitehorn 7679b758b0 Plane: add parameter RUDD_DT_GAIN for dual motor tailsitter
controls rudder to differential thrust mixing in FW mode
2017-04-06 08:29:44 +10:00
Andrew Tridgell acaef22416 Plane: improve transition from QSTABILIZE to FBWA or QHOVER 2017-04-05 20:00:29 +10:00
Andrew Tridgell 36d8f730e1 Plane: setup better defaults for tailsitters 2017-04-04 10:15:08 +10:00
Andrew Tridgell 5d06e4238f Plane: make the quadplane motors var_info dynamic
this will allow for more quadplane motors class types
2017-03-25 16:22:10 +11:00
Andrew Tridgell af97a3974b Plane: initialise target height correctly on quadplane transition
this fixes a bug where a plane in QSTABILIZE would drop suddenly if
switched to FBWA when the target altitude had not been initialised
2017-03-22 21:34:40 +11:00
Andrew Tridgell bb158a437e Plane: handle bad Q_FRAME_CLASS
default to quad with a warning. This prevents users getting stuck
without being able to set Q_ENABLE=1

thanks to Leonard for noticing
2017-03-18 22:10:20 +11:00
Andrew Tridgell 3f7e7d456f Plane: in fixed wing mode slave quadplane attitude rate controller
For quadplanes this uses the attitude controller from fixed wing
when using the multicopter controller to assist fixed wing
flight. This prevents a rate mismatch between the two controller
leading to oscillation
2017-03-14 14:42:20 +11:00
Andrew Tridgell 2db8589f49 Plane: smarter Z controller initialisation for quadplanes
this is more generic than the previous one used only for the full
position controller
2017-03-14 14:42:20 +11:00
Andrew Tridgell 4ff5bf5af5 Plane: zero integrators and set throttle mix
this zeros fixed wing integrators during TRANSITION_AIRSPEED_WAIT and
uses a zero throttle mix during TRANSITION_TIMER. This should allow
the fixed wing controller more time to adapt to forward flight
2017-02-26 09:20:51 +11:00
Andrew Tridgell c061d5615b Plane: added manual input mask for tailsitter prop-hang
This adds new parameters Q_TAILSIT_MASK and Q_TAILSIT_MASKCH. These
parameters allow a user to use the tailsitter capabilities of a 3D
plane to teach themselves to prop-hang.

It works by allowing the user to setup a switch on their transmitter
to enable manual pass-thru of a set of the input channels to outputs
when in tailsitter hover. The user can then use that switch to allow
learning of hover control in a 3D plane one channel (or two channels)
at a time.
2017-02-26 09:20:13 +11:00
Andrew Tridgell 3bb25eb194 Plane: added Q_TAILSIT_INPUT
this allows the user to control tailsitters either in body frame (like
a plane) or in earth frame (like a multicopter). This is useful for
people wanting to learn to fly prop-hang on 3D planes
2017-02-26 09:20:13 +11:00
Andrew Tridgell ea5186340b Plane: added Q_TILT_RATE_UP and Q_TILT_RATE_DN as separate parameters
allow control of tilt rate separately for UP and DOWN

always allow at least 90 degrees/second for switching to MANUAL
2017-02-25 17:53:26 +11:00
Andrew Tridgell e8b11924f8 Plane: split out the tailsitter transition complete code
use both roll and pitch to trigger completion of transition. This
copes with situations where the plane has managed to get itself rolled
over far enough that it can't recover into hover
2017-02-18 17:26:43 +11:00
Andrew Tridgell d5a3f844f1 Plane: changes for AC_WPNav 2017-02-18 17:26:43 +11:00
Andrew Tridgell c787f4c56f Plane: initial support for tailsitter transitions 2017-02-18 17:26:43 +11:00
Andrew Tridgell 83f3cee99e Plane: initial hooks for tailsitter support 2017-02-18 17:26:43 +11:00
Andrew Tridgell 0fc04b0158 Plane: setup plane frame type parameter flags 2017-02-14 19:50:01 +11:00
Andrew Tridgell c294519925 Plane: lower default Q_M_SPOOL_TIME to 0.25 2017-02-14 09:23:17 +09:00
priseborough 013eb254a2 Plane: use standard unit descriptor for milliseconds 2017-01-27 16:57:42 +09:00
Andrew Tridgell 07cedd8a66 Plane: prevent stability shutdown in transition
this prevents the vertical motors from shutting down while
transitioning if the desired throttle was too low at the start of the
transition
2017-01-25 19:01:15 +11:00
Andrew Tridgell 0d4405106f Plane: removed forcing of trim for motors in quadplane
this caused problems with tricopter tail servos
2017-01-25 19:01:15 +11:00
Andrew Tridgell 5c820adad4 Plane: fixed tilt transition with binary tilt servo
once the tilt is fully fwd then force transition as done at any
airspeed
2017-01-25 19:01:15 +11:00
Andrew Tridgell 586f8a9ca8 Plane: fixes for tilt quadplane after rebase 2017-01-25 19:01:15 +11:00
Andrew Tridgell 54bca768b8 Plane: added Q_TILT_TYPE for retract servo tiltrotors 2017-01-25 19:01:15 +11:00
Andrew Tridgell 2f100b0804 Plane: removed separate tricopter quadplane build
can all be done with one build now
2017-01-12 17:39:37 +11:00
Andrew Tridgell b83f50be0f Plane: use new SRV_Channels API 2017-01-12 17:39:37 +11:00
Andrew Tridgell 1c4bf77cf6 Plane: added custom conversion of Q_FRAME_CLASS parameter 2016-12-31 10:56:01 +09:00
Randy Mackay 934ef55338 Plane: quadplane instantiates motor matrix outside of case
Thanks to khancyr for noticing this
2016-12-31 10:55:23 +09:00
Randy Mackay c6dec5c3f6 Plane: quad plane uses consolidated multicopter classes 2016-12-31 10:55:23 +09:00
Pierre Kancir da1f784e78 Plane : quadplane change to float to avoid the loss of a fractional part 2016-12-05 12:39:31 -08:00
Tom Pittenger f556f705e6 Plane: move various g params to aparms 2016-11-25 19:07:30 -08:00
expntly 0d1e50b50b Plane: fix typo, check wp_nav is initialized 2016-10-27 14:39:50 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 0445b51143 Plane: fixed throttle slew rate in manual for quadplanes 2016-10-12 09:55:37 +11:00
murata b3eecb87ac Plane: To define the same wording. 2016-10-06 10:03:23 -07:00
Andrew Tridgell cb61840ad2 Plane: tell TECS to use synthetic airspeed during transition 2016-10-05 11:52:52 +11:00
Andrew Tridgell 4e017bf5b3 Plane: fixed loiter mode when Q_GUIDED_MODE=1
This fixes the fixed wing behaviour of LOITER mode whne
Q_GUIDED_MODE=1.

Many thanks to the PertUAV team for finding and reporting this bug
2016-10-01 08:37:17 +10:00
Andrew Tridgell 841828541d Plane: fixed auto ICE engine cut in QLAND final 2016-09-29 05:18:55 +10:00
Andrew Tridgell 6d09897b19 Plane: fixed VTOL motor termination in AFS 2016-09-27 11:53:45 +10:00
Andrew Tridgell dac7f45326 Plane: fixed use of multicopter mix_max
we need a settable mix_max for some vehicles
2016-09-21 12:23:19 +10:00
Andrew Tridgell 9b83781b4f Plane: fixed mixer arming error with FMUv4
thanks to Tim Gold for reporting this
2016-09-11 08:25:40 +10:00
Andrew Tridgell 6849f2223d Plane: set initial alt target on takeoff completion
this prevents a sudden motor spike at the start of the transition
2016-09-02 11:12:19 +10:00
Randy Mackay 3052e8f80b Plane: quadplane calls attitude control parameter check 2016-09-02 09:27:19 +09:00
Andrew Tridgell 3d0516fd57 Plane: added Q_ASSIST_ANGLE
this automatically provides quadplane assistance if the angular error
is over the given value for 1 second while flying faster than
Q_ASSIST_SPEED
2016-08-30 08:35:18 +10:00
Andrew Tridgell 33f17588b2 Plane: added auto fence enable on VTOL takeoff
fixes issue#724
2016-08-29 18:04:42 +10:00
Andrew Tridgell c81d8364ac Plane: check for safety switch state in quadplane motor output
get_soft_armed() will be false if safety on
2016-08-29 17:55:35 +10:00
Tom Pittenger ca32bcc58d Plane: add new flight mode AVOID_ADSB to mimic GUIDED 2016-08-17 22:38:54 -07:00
Andrew Tridgell b29b609bcc Plane: added AFS support for quadplanes 2016-08-16 12:56:12 +10:00
Andrew Tridgell 31fb4cc427 Plane: force trims for VTOL motors 2016-08-16 12:53:34 +10:00
Tom Pittenger fc50f145ce Revert "ArduPlane: Convert references to AP_Airspeed. Added automatic migration of ARSPD_FBW_MIN and ARSPD_FBW_MAX (plane parameter) to ARSPD_FBW_MIN and ARSPD_FBW_MAX (library parameter)."
This reverts commit da1b18d918.
2016-08-07 17:54:24 -07:00
AndersonRayner da1b18d918 ArduPlane: Convert references to AP_Airspeed. Added automatic migration of ARSPD_FBW_MIN and ARSPD_FBW_MAX (plane parameter) to ARSPD_FBW_MIN and ARSPD_FBW_MAX (library parameter). 2016-08-04 10:09:04 -07:00
Andrew Tridgell 63317e9430 Plane: added throttle suppression for quadplanes
this tries to prevent motor start when on ground. Motors instead go
into spin_when_armed state
2016-08-04 09:43:40 -07:00
Andrew Tridgell 388b7ad6bd Plane: fixed is_flying_vtol() for non-quadplane 2016-07-27 07:43:16 +10:00
Andrew Tridgell f65b46385c Plane: added engine cut on land final in quadplane 2016-07-25 15:46:17 +10:00
Andrew Tridgell 9602d208a2 Plane: fixed disarm by rudder in quadplane 2016-07-25 06:08:36 +10:00
Andrew Tridgell c926d7d41f Plane: fixed typo in quadplane landing detector
thanks to Paul for spotting this!
2016-07-08 18:38:43 +10:00
Andrew Tridgell 66e43bf6a2 Plane: start with low integrator on back quadplane transition
When changing to alt_hold controller in quadplane with significant
airspeed set the initial integrator to minus the hover throttle to
allow the accel controller to climb slowly
2016-06-27 10:18:20 +10:00
Leonard Hall f1bca63094 Plane: consolidate input_euler_angle calls to use smoothing gain 2016-06-24 17:17:19 +09:00
Randy Mackay ef1385c9ed QuadPlane: add comment that eeprom 28 and 41 were used for THR_MIN, MID 2016-06-18 11:55:49 +09:00
Randy Mackay b456a38432 QuadPlane: remove throttle_mid
motor's hover throttle is automatically updated
2016-06-18 11:55:49 +09:00
Randy Mackay 2523ba892b QuadPlane: set attitude vs throttle priority in attitude controller 2016-06-18 11:55:49 +09:00
Randy Mackay f2b0f09d6f QuadPlane: remove THR_MIN 2016-06-18 11:55:49 +09:00
Andrew Tridgell b1b73e2d99 Plane: improved quadplane landing detector
look for no vertical position change for 5s as well as low motors
2016-06-16 18:17:56 +10:00
Tom Pittenger 773962940c Plane: quadplane for fwd_throttle integrator inhibit reverse thrust and allow min>0 for petrol 2016-06-13 14:31:50 -07:00
Tom Pittenger b6196dfa92 Plane: compiler warning in print: float to double promotion 2016-06-13 14:03:40 -07:00
Andrew Tridgell 107691b7a7 Plane: fixed initial descent rate in quadplane auto land 2016-06-11 14:37:44 +10:00
Andrew Tridgell 19834c12e2 Plane: log start of quadplane transition 2016-06-10 17:48:32 +10:00
Andrew Tridgell 8156b3f7de Plane: fixed quadplane landing transition altitude 2016-06-10 17:48:32 +10:00
Andrew Tridgell 07564aa03f Plane: fixed an attitude control bug in quadplane transition
The motors would briefly spike at the end of the transition which
could cause a major pitch deviation
2016-06-10 17:48:32 +10:00
Tom Pittenger 69f29b51d1 Plane: new param Q_VFWD_ALT to disable VFWD motor below this altitude. Also uses rangefinder 2016-06-10 17:48:31 +10:00
Tom Pittenger b9cee76bbe Plane: fix quadplane integrator to always clip to at least 0 to throttle_max 2016-06-03 23:46:18 -07:00
Tom Pittenger 82763ec8a9 Plane quadplane to use relative_ground_altitude() to take advantage of rangefinder easier 2016-06-03 23:44:21 -07:00
Andrew Tridgell 77b7852ff0 Plane: adjust recommend ranges for quadplane Q_VFWD_GAIN and Q_WVANE_GAIN 2016-06-04 11:04:15 +10:00
Tom Pittenger f83a6ca1ff Plane: fixed variable misspelling 2016-06-02 15:10:51 -07:00
Andrew Tridgell 978a89efa6 Plane: added new ESC calibration method 2016-06-02 18:10:37 +10:00
Andrew Tridgell ba3576f027 Plane: added tuning error reporting for quadplanes 2016-05-28 17:33:30 +10:00
Andrew Tridgell b56d784ae4 Plane: limit to zero pitch in quadplane on initial transition 2016-05-28 15:08:46 +10:00
Andrew Tridgell 20cf326093 Plane: lower throttle threshold for quadplane is_flying 2016-05-28 07:10:13 +10:00
Andrew Tridgell 12e0012b16 Plane: allow for NAV_LOITER_UNLIM and NAV_LOITER_TIME in quadplane 2016-05-11 15:57:41 +10:00
Andrew Tridgell 3fc43b94f9 Plane: separate out auto and guided VTOL states
this prevents a switch to AUTO from using VTOL mode incorrectly
2016-05-11 15:14:43 +10:00
Andrew Tridgell 52ea443d65 Plane: added Q_THR_MIN 2016-05-11 05:55:26 +10:00
Andrew Tridgell a61d608915 Plane: fixed numerical error if starting VTOL landing at destination 2016-05-11 05:55:25 +10:00
Andrew Tridgell 357ed1f4b9 Plane: enable weathervaning in GUIDED and TAKEOFF quadplane modes 2016-05-11 05:55:25 +10:00
Andrew Tridgell 6b358a5618 Plane: added Q_GUIDED_MODE parameter
this allows you to do hybrid VTOL and fixed wing guided mode
2016-05-11 05:55:25 +10:00
Andrew Tridgell 3bd5b42c69 Plane: refactor quadplane land controller as general VTOL position controller 2016-05-11 05:55:25 +10:00
Andrew Tridgell 46bf2b83f5 Plane: use equal thrust in tiltrotors when over Q_TILT_MAX 2016-05-11 05:55:24 +10:00
Andrew Tridgell bbb5f68bb7 Plane: added initial support for tiltrotors and tiltwings 2016-05-11 05:55:23 +10:00
Andrew Tridgell 89a2a92885 Plane: support better build time selection of multicopter frame type
makes it possible to do "make sitl-tri"
2016-05-11 05:55:22 +10:00
skyscraper 7f29903287 ArduPlane: Fix up after refactoring RC_Channel class
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:16 +10:00
Andrew Tridgell 2a7edfd3d1 Plane: fixed setting of failsafe for motors in quadplane 2016-05-07 07:25:33 +10:00
Andrew Tridgell 0fd044c1f7 Plane: added Q_RTL_MODE parameter
used to switch to VTOL landing on RTL
2016-04-30 14:34:47 +10:00
Andrew Tridgell 66d3668ac4 Plane: rapid climb in QRTL if below target altitude 2016-04-30 14:34:47 +10:00
Andrew Tridgell 4666b25258 Plane: initial implementation of QRTL for quadplane RTL 2016-04-30 14:34:47 +10:00
Andrew Tridgell 460885c478 Plane: refactored quadplane landing controller
allow use in other than AUTO mode
2016-04-30 14:34:46 +10:00
Andrew Tridgell ab5ca53e2f Plane: lower default VTOL ANGLE_MAX to 30 degrees
we don't really want a quadplane at 45 degrees or the wing drag gets
far too high
2016-04-29 10:23:26 +10:00