Commit Graph

90 Commits

Author SHA1 Message Date
Andrew Tridgell b4c6a0e30e AP_TECS: added logging of speed_weight and state flags 2016-03-26 08:41:09 +11:00
Andrew Tridgell 8ff932b61c AP_TECS: allow underspeed to end faster
we now can exit an underspeed condition if we stay above min speed for
3 seconds and also reach 15% above min speed. This prevents a problem
with the thrust line causing downpitch leading to a crash due to too
much throttle
2016-03-26 07:44:22 +11:00
Lucas De Marchi 9271e97c0b AP_TECS: replace header guard with pragma once 2016-03-16 18:40:43 +11:00
Tom Pittenger a85d4f2f4b AP_TECS: reverse-thrust cleanup
- throttle slew rate was using % full range including the negative range (-100 to +100 instead of 0 to 100) which meant it was faster
- throttle integrator windup limit was higher than normal because it's a porportional to throttle max - min but that makes no sense when min is negative causing larger limits
2016-03-10 15:34:52 +11:00
Tom Pittenger 67e2db7975 AP_TECS: add TECS_LAND_PDAMP
// @Description: This is the damping gain for the pitch demand loop. Increase to add damping  to correct for oscillations in speed and height. If set to 0 then TECS_PTCH_DAMP will be used instead.
2016-03-02 10:54:21 -08:00
Tom Pittenger fcb802cccc AP_TECS: add TECS_LAND_I_GAIN and TECS_TKOFF_I_GAIN
// more integral gain options for land
2016-03-02 10:54:20 -08:00
Tom Pittenger a139789693 AP_TECS: add TECS_LAND_TDAMP for land damp
+     // @Description: This is the damping gain for the throttle demand loop during and auto-landing. Same as TECS_THR_DAMP but only in effect during an auto-land. Increase to add damping to correct for oscillations in speed and height. When set to 0 landing throttle damp is controlled by TECS_THR_DAMP.
2016-03-02 10:54:19 -08:00
Tom Pittenger da01ceee53 AP_TECS: change order of update_speed() so it's not using the previous EAS_dem
bug reported by @NUAAFLY https://github.com/diydrones/ardupilot/issues/1547
2016-02-12 13:23:02 -08:00
Tom Pittenger afe9f544e5 AP_TECS: remove incorrect comment about TECS running at 5Hz, it runs at 10Hz. 2016-02-12 13:04:11 -08:00
Tom Pittenger 67ce22660e AP_TECS: 1/3 new param TECS_LAND_SRC for Land Sink Rate Change
// @Description: When zero, the flare sink rate (TECS_LAND_SINK) is a fixed sink demand. With this enabled the flare sinkrate will increase/decrease the flare sink demand as you get further beyond the LAND waypoint. Has no effect before the waypoint. This value is added to TECS_LAND_SINK proportional to distance traveled after wp. With an increasing sink rate you can still land in a given distance if you're traveling too fast and cruise passed the land point. A positive value will force the plane to land sooner proportional to distance passed land point. A negative number will tell the plane to slowly climb allowing for a pitched-up stall landing. Recommend 0.2 as initial value.
2016-02-12 11:38:40 -08:00
Tom Pittenger e40bba3d13 AP_TECS: removing mission_cmd in TECS and making it bool is_landing
this is reverse-thrust cleanup
2016-02-12 11:08:47 -08:00
Tom Pittenger a0755a84e7 AP_TECS: change param TECS_LAND_SPDWGT default from +1 to -1 2016-02-12 20:36:18 +11:00
Tom Pittenger 149cc7c5da AP_TECS: increase range of TECS_LAND_PMAX to include negative 2016-02-10 22:18:08 -08:00
Andrew Tridgell 13c217c060 AP_TECS: make demanded airspeed during landing stages clearer 2016-02-09 14:18:02 +11:00
Tom Pittenger 5ba2bff85f AP_TECS: Reverse Thrust
Reverse thrust for controlled landings, even with much steeper approach slopes. This is achieved by allowing throttle demand to go negative to maintain a target airspeed. A Pre-Flare stage was added, triggered by an altitude, to allow for a slower airspeed just before land. That lower airspeed can be near stall.
new params TECS_APPR_SMAX - sink rate max during approach
2016-02-09 14:18:02 +11:00
Tom Pittenger 5338a76a58 AP_TECS: add flight stage LAND_PREFLARE 2016-02-09 14:18:02 +11:00
Tom Pittenger eeb77c3413 AP_TECS: updated TECS_LAND_SPDWGT param description 2016-01-30 07:31:10 +11:00
Andrew Tridgell 4f9927beda AP_TECS: added set_pitch_max_limit() API 2016-01-19 11:05:56 +11:00
Tom Pittenger db8a2f7e8b AP_TECS: changed land_spdwgt to be sliding scale 2016-01-09 13:25:02 +11:00
Andrew Tridgell b3bd83b1c6 AP_TECS: no underspeed when in VTOL 2016-01-09 07:38:52 +11:00
Tom Pittenger 70a45680ed AP_TECS: fixed param desc for TECS_LAND_THR 2016-01-07 09:36:54 +11:00
Andrew Tridgell 9188670e03 AP_TECS: added get_height_rate_demand() call 2016-01-06 22:47:38 +11:00
Don Gagne 605fedc1c0 AP_TECS: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Jonathan Challinger b0f58248a5 AP_TECS: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Lucas De Marchi fef364e4e8 AP_TECS: avoid comparison between signed and unsigned 2015-12-01 16:28:18 -02:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Caio Marcelo de Oliveira Filho c70dda526c AP_TECS: use millis/micros/panic functions 2015-11-20 12:34:46 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Andrew Tridgell 094b9cb35e AP_TECS: reformat using astyle 2015-09-16 14:24:45 +10:00
Andrew Tridgell 36432e6515 AP_TECS: use climb rate filter consistently between DCM and EKF
we should use baro height not hgt_afe for the climb rate filter. This
makes the climb rate consistent with the one from the EKF. The lidar
correction comes in with the demanded height, not the observed height
2015-09-16 14:24:44 +10:00
Tom Pittenger 46a83c7ae9 AP_TECS: added flight stage FLIGHT_LAND_ABORT
- do what TAKEOFF does in tecs, push the throttle up
2015-09-09 09:04:24 +10:00
Gustavo Jose de Sousa 1fbbe3ed81 AP_TECS: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:24 +10:00
Peter Barker 457f77314e AP_TECS: use 64-bit timestamps for dataflash logs 2015-05-27 11:54:16 +10:00
Andrew Tridgell cf4602afc1 AP_TECS: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Michael du Breuil 04e9141881 AP_TECS: Allow tecs to control throttle during takeoff 2015-04-16 08:56:37 +10:00
Andrew Tridgell 5a4ed85588 AP_TECS: added TECS_LAND_PMAX
this limits maximum pitch during the flare, which both reduces
integrator windup and prevents too high pitch which can cause a stall
2015-03-19 14:46:41 +11:00
Andrew Tridgell 569626ac1a AP_TECS: fixed APM2 build 2015-03-16 08:40:18 +11:00
Andrew Tridgell 060f553097 AP_TECS: provide a much smoother transition before flare
this moves the pitch constraint smoothly between unconstrained and
fully constrained over two time constants before the flare. This
greatly reduces the sudden pitch changes at flare
2015-03-15 13:52:17 +11:00
Andrew Tridgell 4e5510c99e AP_TECS: fixed warning 2015-01-01 15:14:48 +11:00
Andrew Tridgell 597273cfff AP_TECS: remove lag from height demand in landing
this predicts ahead the height demand for landing, where we have a
continuous demanded descent. This removes the effect of the lag
introduced by the height demand filters
2014-12-18 09:58:12 +11:00
Andrew Tridgell 70f5ec60e8 AP_TECS: added get_land_sinkrate() 2014-12-15 21:51:07 +11:00
priseborough e2d47f836e AP_TECS: Fix bug causing plane to fly high on landing approach
The introduction of the height rate flare logic caused the demanded height rate to be zero except when a flare manouevre was being performed. This caused the plane to lag behind height changes if the D gain was non-zero, which caused it to fly high during landing approach.
2014-12-14 09:43:46 +11:00
priseborough 053c5054f3 AP_TECS: Change default landing damp gain to 0.5 2014-11-29 20:03:49 +11:00
priseborough 0912f05e7c AP_TECS: Add parameter to adjust height rate gain during flare 2014-11-29 20:03:41 +11:00
priseborough 11aefa6858 AP_TECS: Fix bug in parameter label 2014-11-29 20:03:37 +11:00
priseborough bd97f15d06 AP_TECS: make flare height demand consistent with height rate demand 2014-11-29 20:03:34 +11:00
Andrew Tridgell eb22815668 AP_TECS: fixed range values 2014-11-26 19:02:51 +11:00
Andrew Tridgell abba6395ad AP_TECS: fixed spelling error 2014-11-18 11:12:57 +11:00
Andrew Tridgell 1552278fa3 AP_TECS: use aparm.stall_prevention 2014-11-13 14:05:33 +11:00
Andrew Tridgell bf591b0008 AP_TECS: take load factor into account in min airspeed
this will push up minimum airspeed when turning
2014-11-12 13:36:02 +11:00