Commit Graph

13217 Commits

Author SHA1 Message Date
Paul Riseborough a37580ceac mc_pos_control: remove un-used parameter 2018-07-22 17:42:31 +10:00
Paul Riseborough dd3fb84db8 mc_pos_control: Fix parameter description error 2018-07-22 17:42:31 +10:00
Paul Riseborough c9ca27e7c2 ekf2: Update documentation for EKF2_RNG_AID parameter 2018-07-22 17:42:31 +10:00
Paul Riseborough 82780e33b9 mc_pos_control: Add parameter support for terrain hold function
This new mode of altitude control uses terrain following when holding position and normal altitude control when moving.
2018-07-22 17:42:31 +10:00
Kurt Kiefer a114450f51 spektrum_rssi: clear PX4IO_P_SETUP_FEATURES_ADC_RSSI when valid
When we're getting valid rssi input from the telemetry receiver,
clear the flag PX4IO_P_SETUP_FEATURES_ADC_RSSI in r_setup_features.
2018-07-22 08:42:30 +02:00
Kurt Kiefer 597372bec9 Gather RSSI data from Spektrum Telemetry receivers
On SPM4649T receivers with firmware versions at least 1.1RC9, the
serial data will contain an rssi value in dbm, as outlined in the
Remote Receiver Interfacing document section 8.3.1.

If the value received is greater than or equal to zero, the receiver
does not support rssi data, and the incoming value will be ignored.
However, if the value is negative, we can use the rssi value.

When we have a valid rssi, it gets mapped to a percentage from 0 to
100 as expected by mavlink. This mapping is constructed as a
logarithmic function over Spektrum's published minimum and maximum
rssi values, -92dBm to -42dBm as 0 to 100:
100 Log10[1 + (x - min) * (9 / (max - min))]

This change updates all calls to the dsm input rountes to return
the rssi value.

Note that one place this doesn't work with the px4io enabled.
There is a comment left in the absence of analog rssi that:
"we do not actually get digital RSSI regs[PX4IO_P_RAW_RC_NRSSI]".
This restriction has been left in place, as removing it exposes a
problem where the frequency of the control tick is greater than
that of valid dsm frames so the rssi isn't valid every cycle.
2018-07-22 08:42:30 +02:00
Dennis Mannhart 18a3c08659 mc_pos_control: idle to armed state delay controlled by parameter MPC_IDLE_TKF 2018-07-20 09:26:18 +02:00
Dennis Mannhart ab1ae1fb4e mc_pos_control_main: trigger failsafe if no setpoint along D-direction is valid 2018-07-20 09:26:18 +02:00
ChristophTobler 9362f844f4 position control: fix failsafe thrust
invert direction to point upwards and increase to 70% of throttle range between min and hover
2018-07-20 09:26:18 +02:00
ChristophTobler 7cc85885a4 position control: set _skip_controller before calling _interfaceMapping()
Without this failsafe will be overwritten
2018-07-20 09:26:18 +02:00
ChristophTobler 80867343ab mc_pos_control: trigger failsafe if no pos, vel or thrust pair is valid 2018-07-20 09:26:18 +02:00
Dennis Mannhart 260284571d mc_pos_control: move failsafe logic into method 2018-07-20 09:26:18 +02:00
Dennis Mannhart ac2c49218d mc_pos_control: remove mavlink_log_info 2018-07-20 09:26:18 +02:00
Dennis Mannhart f11a65a74f mc_pos_control: fix overwrite for state velocity 2018-07-20 09:26:18 +02:00
Dennis Mannhart f2d559a4c2 mc_pos_control: minor refactor 2018-07-20 09:26:18 +02:00
Matthias Grob cc0bc05156 mc_att_control: remove useless parameter MC_YAW_FF
It scales the yawspeed setpoint arbitrarily by default with 0.5.
This makes no sense because when you give a setpoint of 1rad/s then
you expect the setpoint to get executed. If you want manual yawspeed
response to be less agressive on the stick use the scaling parameter
for the stick MPC_MAN_Y_MAX.
2018-07-20 09:26:18 +02:00
Dennis Mannhart b5731e0ccd FlightTaskOffboard: only start task if control mode flags are met 2018-07-20 09:26:18 +02:00
Dennis Mannhart bf4ac7a9d6 mc_pos_control: for terrain following use range sensor climbrate for velocity estimate 2018-07-20 09:26:18 +02:00
Dennis Mannhart e51e1bbe74 mc_pos_control: replace legacy refactor
Until now we replaced legacy position controller functionality inside
the flight task architecture to split up the huge position control
module into the different tasks and have a modular setup with a clear
setpoint interface. This commit removes all the legacy code and hard
switches to using the flight task architecture for multicopter.

This is done because maintaining and testing everything in parallel is
not sustainable. The architecture is by now tested to cover all basic
legacy functionality and missing corner cases can be fixed a lot easier
with the new architecture.
2018-07-20 09:26:18 +02:00
Dennis Mannhart a5e8eb23ad PositionControl: saturate thrust integral 2018-07-20 09:26:18 +02:00
Dennis Mannhart 5ffcb6af01 PositionControl: set vel_dot to 0 if NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart 7b13803e2c PositionControl: for thrust setpoints only use MPC_MANTHR_MIN for minimum thrust 2018-07-20 09:26:18 +02:00
Dennis Mannhart f30bf215db MulticopterLanddetector: adjust minimum throttle if climb-reate is not enabled 2018-07-20 09:26:18 +02:00
Dennis Mannhart e8620708b3 PositionControl: set states to zero if not valid 2018-07-20 09:26:18 +02:00
Dennis Mannhart e6f6e2085c ControlMath: remove false comment 2018-07-20 09:26:18 +02:00
Dennis Mannhart 9c7c60ddc8 remove mc_pos_control_tests 2018-07-20 09:26:18 +02:00
Dennis Mannhart 89c266e699 by value to reference 2018-07-20 09:26:18 +02:00
Dennis Mannhart 9c2ec3c229 PositionControl: add control states structure 2018-07-20 09:26:18 +02:00
Dennis Mannhart bf15e852ff style-check 2018-07-20 09:26:18 +02:00
Dennis Mannhart 90a7d836fc ControlMath:: add legacy cross_sphere_line method 2018-07-20 09:26:18 +02:00
Dennis Mannhart c2343589d8 move cross_sphere_line_test method into test_controlmath.cpp
remove mc_pos_control_tests since empty
move test_controlmath.cpp into systemcmds/tests directory
2018-07-20 09:26:18 +02:00
Dennis Mannhart 09b7d0f659 the static keywork is a workaround for an internal bug of GCC
"internal compiler error: in trunc_int_for_mode, at explow.c:55"
2018-07-20 09:26:18 +02:00
MaEtUgR 70802ba15a FlightTaskManual: Yaw lock with deadzone and expo
More than a year ago I started the easy to use math::Functions to handle
the always used mathematical SISO functions to be tested and available.

I switched x, y and z stick input to the freesh programmed deadzone and
exponential functions from the library to unify and clarify their use.
I just realized yaw was left over because it lead to a drift problem in
certain new use cases.

Now I'm just adding the yaw stick to the already well working method.
2018-07-20 09:26:18 +02:00
Dennis Mannhart 8a3c7f9e41 PositionControl: style check 2018-07-20 09:26:18 +02:00
Dennis Mannhart 2519d97aa2 PositionControl: add failsafe 2018-07-20 09:26:18 +02:00
Dennis Mannhart 45810ec2b4 PositionControl: replace constraint structure with new constraint message structure 2018-07-20 09:26:18 +02:00
Dennis Mannhart 24e6e4041f PositionControl: format clean up 2018-07-20 09:26:18 +02:00
Dennis Mannhart 89c0259b2a PositionControl: replace overwrite with ModuleParams updateParams method 2018-07-20 09:26:18 +02:00
Dennis Mannhart 4c1fcca294 PositionControl.cpp: replace all params with ModuleParams type. Add method that overwrites
parameter values
2018-07-20 09:26:18 +02:00
Dennis Mannhart 7dbc368779 PositionControl.hpp: inherit from ModuleParams and replace params with ModuleParams type 2018-07-20 09:26:18 +02:00
Dennis Mannhart 6cfb89a8e8 test_controlmath rebase fix: EPS to FLT_EPSILON 2018-07-20 09:26:18 +02:00
Dennis Mannhart caa773008a PositionControl: degrees to radians 2018-07-20 09:26:18 +02:00
Dennis Mannhart 4761f0a344 PositionControl: bug fix Pv replacement with Pp 2018-07-20 09:26:18 +02:00
Dennis Mannhart 83f6398e93 ControlMath: comments refactor 2018-07-20 09:26:18 +02:00
Dennis Mannhart c01fab089a PositionControl parameter renaming. Use the the name as stored in the metadata 2018-07-20 09:26:18 +02:00
Dennis Mannhart cf59c2a2ac PositionControl/mc_pos_control: update comments 2018-07-20 09:26:18 +02:00
Dennis Mannhart 673945f28b PositionControl: check if constraints are below global maximum 2018-07-20 09:26:18 +02:00
Dennis Mannhart 60a9b45c88 Positioncontrol: limit velocity upwards during smooth takeoff 2018-07-20 09:26:18 +02:00
Dennis Mannhart 0f4eb8e766 PositionControl: add integral reset methods 2018-07-20 09:26:18 +02:00
Dennis Mannhart 65a9cd171f PositionControl: variable replacement 2018-07-20 09:26:18 +02:00