Andrew Tridgell
3c97fad2ec
Plane: changes for GPS field changes
2013-07-10 14:04:22 +10:00
Andrew Tridgell
7aa360b176
Plane: added relative_altitude helper functions
...
prevents some code duplication
2013-07-10 14:04:22 +10:00
Andrew Tridgell
1355b6d89d
Plane: break-up scheduling into smaller pieces
...
ensure mavlink sends don't push us over a scheduling boundary
2013-07-05 18:05:27 +10:00
Andrew Tridgell
d30dd7c3f1
Plane: only run TECS when in an auto-throttle mode
...
this prevents integrator buildup in user controlled modes
2013-07-05 14:55:22 +10:00
Andrew Tridgell
a5bda3ffef
Plane: changed to using a "aircraft parameters" structure
...
this structure can be passed to libraries to give them easy access to
critical user parameters
2013-07-04 16:56:57 +10:00
Paul Riseborough
d62636d309
Plane: added new TECS altitude controller
...
Includes improvements to takeoff/launch detect logic to support hand
launching for X-8 flight
2013-07-04 16:56:57 +10:00
Andrew Tridgell
75ef7c26e1
Plane: update takeoff course when conditions met
...
This allows for change of heading before the final takeoff conditions
are met
thanks to Greg Fletcher for suggesting this
2013-07-01 17:05:13 +10:00
Andrew Tridgell
570ecea6c6
Plane: added secondary rudder support
2013-06-29 17:31:03 +10:00
Andrew Tridgell
056e0ca40d
Plane: APM2 doesn't have channel 9 PWM output
2013-06-24 13:06:54 +10:00
Andrew Tridgell
a1f64d606a
Plane: fixed remaining places where primary channel ordering was assumed
...
should now use rcmap for all inputs
2013-06-03 16:23:48 +10:00
Andrew Tridgell
fb9bf21522
Plane: allow channel mapping of first 4 channels
...
this makes it easier to support DSM and SBUS radios
2013-06-03 16:23:48 +10:00
Andrew Tridgell
bb3171ab5f
Plane: zero attitude integrators on the ground
2013-06-01 22:29:38 +10:00
Andrew Tridgell
cd55ed45e2
Plane: removed the old roll/pitch/yaw PID controllers
...
use the new controllers, with auto parameter conversion
2013-05-31 14:06:56 +10:00
Andrew Tridgell
eba7d6da9a
Plane: removed the old crash_timer code
...
This code is less relevent with the new L1 navigation, and could cause
issues with the pilot not having control after a long dive.
Thanks to Soren for pointing out the issues
See issue #305
2013-05-28 11:19:28 +10:00
Andrew Tridgell
767d9d0eb5
Plane: fixed stick mixing in AUTO modes
...
the mixing was asymmetric. Many thanks to Soren Kuula for noticing this!
2013-05-27 08:24:35 +10:00
Andrew Tridgell
c81421e275
Plane: added MIXING_GAIN parameter
...
this allows for the full range of output on both channels, but can
saturate
2013-05-25 18:28:13 +10:00
Andrew Tridgell
6251d0510a
Plane: obey pitch trim and throttle pitch feed forward in new controllers
...
Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-05-05 21:51:09 +10:00
Andrew Tridgell
11ad9d5a2d
Plane: auto-invert pitch control when upside down
...
this helps to recover when flying inverted, for example when in manual
and hitting the lower altitude geofence
2013-05-05 21:51:09 +10:00
Andrew Tridgell
4e2b88f6e6
Plane: added ATT_CONTROLLER option to select attitude controller
...
set to 1 for the new APM_Control library
2013-05-05 21:51:09 +10:00
Paul Riseborough
8c5b603848
Plane: use new APM_Control API
2013-05-05 21:51:08 +10:00
Andrew Tridgell
9584aa89d9
Plane: replaced constrain() with constrain_float()
2013-05-02 10:27:10 +10:00
Andrew Tridgell
3d7a4d0e6e
Plane: added ELEVON_OUTPUT option
...
this is like the vtail mixer, but for elevons
2013-04-29 12:13:59 +10:00
Andrew Tridgell
0b8c2da4df
Plane: support 12 output channels on PX4
2013-04-25 20:10:53 +10:00
Andrew Tridgell
4f225eff57
Plane: if airspeed enabled, require 5m/s to unsuppress throttle
2013-04-25 20:10:53 +10:00
Andrew Tridgell
8f091e70c8
Plane: move elevon variables into a structure
2013-04-15 14:53:56 +10:00
Andrew Tridgell
11eb0cfce1
Plane: update for new AP_Navigation controller class
...
this switches ArduPlane over to use the L1 navigation controller, via
a generic nav_controller object pointer.
Note that the nav_controller controls all types of navigation now,
including level flight and heading hold. This provides a cleaner
abstraction than the old method of special case navigation handling
Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-04-12 12:48:09 +10:00
Andrew Tridgell
e58f49aeaf
Plane: copy rudder out in TRAINING mode
...
we were doing rudder mixing in training mode, which shouldn't be done
2013-04-05 19:38:43 +11:00
Andrew Tridgell
bd2b9fbe9d
Plane: simplify the VTail mixer to be more like a hardware mixer
...
this should make it easier to trim the vtail
2013-04-05 15:47:51 +11:00
Andrew Tridgell
406921faf1
Plane: added VTAIL_OUTPUT option
...
this allows for software vtail mixing
2013-04-05 15:22:11 +11:00
Andrew Tridgell
683a2919d1
Plane: prevent stick mixing when throttle is below failsafe threshold
...
this fixes issue #40
2013-04-02 10:42:56 +11:00
Andrew Tridgell
2506c216dd
Plane: added a second type of stick mixing
...
this changes STICK_MIXING from a boolean to a tri-state. With
STICK_MIXING=1 it now uses FBW style mixing. With STICK_MIXING=2 it
uses the old style of direct stick mixing.
2013-04-02 08:52:56 +11:00
Andrew Tridgell
e390726bdd
Plane: prevent overflow on large PID gains
...
this uses get_pid_4500() to prevent overflow of servo_out on large PID gains
2013-04-01 22:17:04 +11:00
Andrew Tridgell
dfb14d760b
Plane: added HIL_SERVOS option
...
this allows for real servo output in HIL
2013-03-30 14:38:43 +11:00
Randy Mackay
c2055557f5
Plane: add support for GPS fix type 2D
2013-03-27 11:41:51 +09:00
Andrew Tridgell
1d983b3f2e
Plane: fixed X accel triggering of auto
2013-03-22 11:53:45 +11:00
Andrew Tridgell
0a385cc0ff
Plane: added TKOFF_THR_MINACC option
...
this is used for triggering auto takeoff with a hand launched plane
2013-03-09 14:41:04 +11:00
Michael Warren
9697ff5d6d
Plane: Added extra parameter to specify at what speed in auto-takeoff throttle should engage
...
This adds TKOFF_THR_MINSPD in m/s
2013-03-09 14:19:48 +11:00
Andrew Tridgell
e93888dee9
Plane: make a throttle_cruise of 0 mean always zero throttle
...
this can be used for parachute landing missions
Thanks to Chris Miser for the suggestion
2013-03-09 13:48:39 +11:00
Michael
b9a5be6c8b
Plane: added secondary elevator support
2013-02-05 08:57:58 +11:00
Andrew Tridgell
9058949558
Plane: fixed some warnings
2013-01-16 14:19:25 +11:00
James Bielman
5631f865b2
Update floating point calculations to use floats instead of doubles.
...
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell
4cdb3cd390
Plane: use GRAVITY_MSS
2013-01-02 14:45:08 +11:00
Andrew Tridgell
feca411943
Plane: added new TRAINING mode
...
this mode gives manual control when the roll or pitch is within the
set limits (the same limits as FBW mode), and prevents the pilot from
flying beyond those limits, essentially a "attitude limited manual"
mode
2012-12-20 22:41:58 +11:00
Andrew Tridgell
cf18534163
Plane: use new functions
2012-12-20 14:53:22 +11:00
Pat Hickey
f8dec9ae4a
ArduPlane: fixes to use CONFIG_HAL_BOARD instead of CONFIG_APM_HARDWARE
2012-12-20 14:51:37 +11:00
Pat Hickey
92b0c302f2
ArduPlane: Ported to AP_HAL
2012-12-20 14:51:36 +11:00
Andrew Tridgell
f5abc2c25e
Plane: switch to an enum for flight modes
2012-12-01 08:08:54 +11:00
Andrew Tridgell
0260559147
Plane: fixed throttle slew limit code
...
starting at 1000 is a very bad idea - a petrol engine could cut out
2012-11-28 12:13:09 +11:00
Andrew Tridgell
697c386075
Plane: use correct throttle range in slewrate
2012-11-28 11:42:05 +11:00
Andrew Tridgell
92cd631ce5
Plane: added THR_PASS_STAB parameter
...
this allows direct passthru of throttle in STABILIZE and FBWA, which
is useful for nitro planes wher you have a throttle cut switch that
drops the throttle below normal minimum.
2012-11-26 23:33:05 +11:00
Andrew Tridgell
61f2e18e2e
APM: allow ailerons to move fully during servo demo
2012-11-21 13:34:27 +11:00
Andrew Tridgell
fcbd3a823b
APM: added a new type of auxilary aileron, with rc input
...
a AileronWithInput assumes you have setup your RC transmitter to give
the right trim and input on the secondary aileron
2012-11-21 13:34:26 +11:00
rmackay9
ef727bbb3c
ArduPlane: move to use new INS library instead of IMU library
2012-11-07 19:21:03 +09:00
Andrew Tridgell
c7b47a0e47
APM: allow for arbitrary ranges and reversal on 2nd aileron
...
this ensures you can setup a 2nd aileron with different reversal from
main aileron
2012-11-05 23:37:58 +11:00
Andrew Tridgell
81d507d39e
APM: fixed differential spoilers in manual mode
...
make them follow the elevons
2012-10-31 12:43:53 +11:00
Andrew Tridgell
8c0296b27a
APM: fixed additional aileron channels in manual mode
2012-10-31 12:43:53 +11:00
Xichen Shi
8c46fced16
APM: Added functionality to use differential spoilers in elevon mode
...
spoiler 1 and 2 are connected to 2 auxiliary channels, functions are
set to 16 on left wing and 17 om right wing respectively. Worked in
FBW + mode (auto etc.). No manual mode supported yet (need more
channels in my case).
2012-10-31 12:43:42 +11:00
Andrew Tridgell
d5c35fcc8b
APM: fixed stick mixing for STABILISE mode
...
this is embarrassing
2012-09-24 07:14:30 +10:00
Andrew Tridgell
56c354eb4f
APM: fixed stick mixing in CIRCLE mode on throttle failsafe
...
Many thanks to Andke for finding this bug!
2012-09-23 19:27:42 +10:00
Andrew Tridgell
6bae5ecd51
APM: added THR_SUPP_MAN option
...
this allows for manual throttle control during auto throttle
suppression. This is useful for keeping a petrol engine idling before
takeoff
2012-09-22 20:17:06 +10:00
Andrew Tridgell
12dc2e79cf
APM: save 100 bytes of memory
...
remove flight_mode_strings array
2012-09-18 13:58:49 +10:00
Andrew Tridgell
bad73b0686
APM: fixed elevon mixing
...
this was broken in 2.61
2012-09-13 12:01:40 +10:00
Andrew Tridgell
c9a299665c
APM: added speed scaling to wheeled steering
...
this allows for a larger amount of steering control at low speeds
without causing osciallation after takeoff
2012-09-11 13:37:34 +10:00
Andrew Tridgell
49468953a3
APM: updated for new RC_Channel_aux API
2012-09-08 15:14:41 +10:00
Andrew Tridgell
dec12c7370
APM: use ahrs.airspeed_estimate() in two more places
...
this applies the wind constraint
2012-09-08 11:37:11 +10:00
Andrew Tridgell
e2b8817a89
APM: added the ability to forcibly crash the plane on OBC failsafe breach
...
this allows a user to setup the OBC failsafe system to forcibly crash
the plane (surfaces at limits, zero throttle) when the failsafe system
triggers. This is to allow APM to be used in the Outback Challenge. In
the OBC an external failsafe board also does this using the heartbeat
control pin, so this is an extra safety mechanism.
To prevent users accidentially triggering a crash, this code only
activates if FS_TERM_ACTION is set to to the magic value 42.
2012-08-28 20:18:24 +10:00
Andrew Tridgell
fce01464b1
APM: added ALT_CTRL_ALG parameter
...
this allows you to select different altitude control algorithms. The
current choices are for the default (automatic based on if airspeed is
available), or to force a non-airspeed algorithm
The idea is to make it possible to use airspeed for some things (like
wind speed, speed scaling) but not for alt control
2012-08-28 20:18:24 +10:00
Andrew Tridgell
d13d117e61
APM: removed reset_I() and instead auto-reset integrator in PID library
...
this prevents us resetting key integrators on waypoint change, while
still preventing old integrators being used when a PID starts to be
used again
2012-08-28 20:18:23 +10:00
Andrew Tridgell
dcbd0fbd44
APM: cleanup throttle suppression code and don't use airspeed to unsupress
...
this removes the throttle suppression when any of the conditions are
met once, as otherwise flying slow below 10m could zero the throttle.
It also removes the use of airspeed for disabling throttle
supression. Otherwise a strong gust of wind can cause ArduPlane to
try to takeoff!
2012-08-28 20:18:23 +10:00
Andrew Tridgell
3c7d7ba228
APM: use airspeed estimate for speed scaling if available
2012-08-25 17:49:26 +10:00
Andrew Tridgell
c35530c362
APM: fixed wheeled takeoff with Jons new controllers
2012-08-22 17:34:01 +10:00
Andrew Tridgell
d445482ace
APM: added optional use of new APM_Control library
...
thanks to Jon Challinger for the new controllers!
2012-08-22 12:45:14 +10:00
uncrustify
d5767ef817
uncrustify ArduPlane/Attitude.pde
2012-08-21 19:19:50 -07:00
Andrew Tridgell
c5b77f3909
APM: reset steering PID integrator in reset_I()
2012-08-21 15:01:01 +10:00
rmackay9
6d489947cf
ArduPlane: replaced many "int" with "int16_t", "long" with "int32_t"
2012-08-18 18:26:13 +09:00
Andrew Tridgell
6300fa7399
math: more abs() fixes
...
abs() is 16 bit
2012-08-16 15:17:42 +10:00
Andrew Tridgell
1252ddfe0c
APM: rename RDRSTEER to WHEELSTEER
...
thanks to Jon for the suggestion
2012-08-15 16:28:59 +10:00
Andrew Tridgell
e26e8b3b67
APM: added RDRSTEER_ PID for steering on ground
...
this allows for rolling takeoff with steering, and use of rudder in
landing
2012-08-15 12:39:35 +10:00
Andrew Tridgell
e2c8ec2c9e
APM: removed THROTTLE_REVERSE option
...
Better to use RC3_REV
2012-08-09 10:04:44 +10:00
Andrew Tridgell
e133900c68
APM: Added STICK_MIXING option
...
this replaces the compile time option. Disabling during long distance
flights when the transmitter may be out of range is useful.
2012-08-09 08:53:29 +10:00
Andrew Tridgell
2114acddf1
APM: fixed default flap speed
...
the default of 255 translates to -1 as a AP_Int8, so use zero to mean
no flaps
2012-08-08 13:04:21 +10:00
Andrew Tridgell
5bfd1200d6
APM: change variables to use _cm, _cd and _ms suffix for units
...
this makes it less likely that we mix up units
2012-08-08 12:12:30 +10:00
Amilcar Lucas
9c1ac2d9e6
More work on ch9, 10 and 11
2012-08-04 19:44:41 +02:00
Andrew Tridgell
6bcfe913f7
APM: added a SCALING_SPEED parameter
...
this allows users to adjust the base speed used for scaling roll/pitch
PIDs. This can be used to make PIDs work for both airspeed and
non-airspeed control
2012-07-26 11:30:23 +10:00
Andrew Tridgell
7e697e4abd
APM: switch back to old nav_roll calculation
...
the old nav_roll will be used for the 2.50 release to prevent the need
for re-tuning. For the release after that we will use the new
calculation
2012-07-26 10:03:36 +10:00
Andrew Tridgell
d6e370886f
APM: rename airspeed_cruise to airspeed_cruise_cm to make the units clearer
...
it is in cm/s, not m/s
2012-07-19 11:50:41 +10:00
Andrew Tridgell
1cf5057c61
APM: Use g.airspeed_cruise for turn rate calculation if the airspeed sensor is disabled.
...
This gives our best approximation for auto flight
2012-07-19 11:50:41 +10:00
Jonathan Challinger
c7da63509b
APM: Removed unused YAW_DAMPENER code.
...
YAW_DAMPENER was defined as zero
2012-07-19 11:50:21 +10:00
Jonathan Challinger
d9d055ef78
APM: Removed incorrect nav_gain_scaler from nav_roll calculation.
...
nav_gain_scaler was originally added due to a perceived improvement in
loiter performance, but is incorrect for navigation. Turn rate is a
function of airspeed and bank angle, ground speed has no effect on
that.
2012-07-19 11:50:06 +10:00
Andrew Tridgell
de3c9ce56d
Airspeed: change APM to use new AP_Airspeed library
...
the next step is AHRS dead reckoning
2012-07-16 11:21:50 +10:00
Andrew Tridgell
f6d7d1bc59
APM: changed PID library to do automatic deltat calculation
...
this fixes a problem with the HDNG2RLL PID, which was using the wrong
time base and prevents similar bugs from happening in the future
2012-07-06 19:59:18 +10:00
Pat Hickey
1c00d1ffe3
ArduPlane: Fix effect of ELEVON_REVERSE
...
* Previously, the ELEVON_REVERSE parameter was equivelant in function to the
ELEVON_CH1_REVERSE parameter. These parameter values are found in
g.reverse_elevons and g.reverse_ch1_elevon, and used to map to the radio_out
channels in ArduPlane/Attitude.pde
* It seems the author's intent was for ELEVON_REVERSE to change the sign for
the combination of pitch & roll into ch1 & ch2, as there are already
parameters which change just the sign of ch1 and just the sign of ch2.
* Discovered this bug because I happened to build an elevon airframe which was
not possible to setup with the existing ELEVON_ and RCn_REV parameters.
* This will break existing elevon setups if the user used ELEVON_REVERSE
instead of ELEVON_CH1_REVERSE, since they were previously interchangable.
2012-05-27 22:15:08 -07:00
Andrew Tridgell
b3aa704c49
AirSpeed: added parameter ARSPD_USE
...
setting ARSPD_ENABLE to 1 and ARSPD_USE to 0 allows the airspeed
sensor to be initialised and logged without it being used for flight
control. This is very useful when initially testing an airspeed sensor
in a new plane. It also makes it possible to enable/disable the use of
the airspeed sensor during a flight at any time.
2012-05-22 20:02:23 +10:00
Andrew Tridgell
8afd196907
APM: adapt ArduPlane for AHRS framework
2012-03-19 17:29:02 +11:00
Phil
9242c157ee
APM: Fix rudder in elevon mode.
...
elevon planes can have rudders too
2012-02-16 14:43:24 +11:00
Doug Weibel
a5df59eba3
Remove old debug print
2011-12-24 14:26:35 -07:00
Doug Weibel
7879efb8ae
Fix scaling on "turn coordination" yaw PID so that P gain values fall in "usual" range 0.1 to 10.
2011-12-24 14:26:35 -07:00
Andrew Tridgell
3b148c87d5
geofence: main geo-fence code
...
this implements the primary logic of geo-fencing
2011-12-16 20:11:51 +11:00
Andrew Tridgell
2bd18e937c
throttle: only use throttle slew in auto throttle modes
...
we don't want STABILISE and FBWA to have throttle change limits
2011-12-12 15:14:55 +11:00
Doug Weibel
2ef4c79a7c
Minimum ground speed patch from Claudio Natoli. Thanks Claudio!
...
This patch will boost the target airspeed as necessary to keep the ground speed above a parameter value - param_min_groundspeed. Airspeed is still limited to FBW-max. Setting min_groundspeed to zero (default) disables the feature.
2011-12-09 16:43:25 -07:00