81 Commits

Author SHA1 Message Date
Silvan Fuhrer
ffb8fb4383 Allocation: add SteeringWheel type control surface
Directly use yaw controls for it, and don't add it to the allocation matrix,
as that would have an effect on rudder scaling if the wheel also would have
a yaw effectiveness.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-08-12 09:43:12 +02:00
Silvan Fuhrer
9e18b351bc Allocation: add Single Channel Aileron to CS types
This is the control surface type for airframes that have only a
single aileron servo or have the ailerons on a single output channel.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-08-12 09:43:12 +02:00
Silvan Fuhrer
c6d1b1f50f Allocation: add A-tail servo type
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-08-12 09:43:12 +02:00
Beat Küng
f2db7b8deb control_allocator: hide motor positions for fixed-wings
should not be set for now
2022-08-12 09:43:12 +02:00
Beat Küng
923a90d78b control_allocator: set default control surface type to (not set)
Before it was set to left aileron, but the torque values were all 0.
2022-08-12 09:43:12 +02:00
Daniel Agar
a73efd9c4f NuttX carry minimal c++ cmath (replacing Matrix stdlib_imports.hpp) 2022-07-12 08:05:06 -04:00
Beat Küng
0ab61aee2e control_allocator: show motor axis for MC (as advanced) 2022-06-04 07:40:29 +02:00
Beat Küng
0074894637 control_allocator: disable backup schedule with lockstep
The backup schedule triggers updates too early and leads to simulator errors:
ERROR [simulator] poll timeout 0, 22
2022-05-31 07:17:30 +02:00
Alessandro Simovic
20ccfbb719 control_allocator: remove failed motor from effectiveness
- limit to handling only 1 motor failure
- Log which motor failures are handled
- Remove motor from effectiveness matrix without
  recomputing the scale / normalization
2022-05-12 07:58:56 +02:00
Silvan Fuhrer
866f9fa95b Control Allocation: add option to disable yaw by differential thrust
This replaces the propeller_torque_disabled flag to disable yaw by differential thrust
for tiltrotor and tailsitter VTOLs, as propeller_torque_disabled is not enough to set
effectiveness of an acutator in the yaw axis to 0 in case it's tilted.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-11 10:19:37 +02:00
Silvan Fuhrer
46179586fb Control Allocation: Tiltrotor: pass only thrust magnitude instead of 3D thrust to allocator
Special case tiltrotor: instead of passing a 3D thrust vector (that would mostly have a x-component in FW, and z in
MC), pass the vector magnitude as z-component, plus the collective tilt. Passing 3D thrust plus tilt is not feasible as they
can't be allocated independently, and with the current controller it's not possible to have collective tilt calculated
by the allocator directly.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-11 10:19:37 +02:00
Beat Küng
5cdb6fbd8e control_allocator: add helicopter mixer
Same logic as the existing mixer.
Untested.
2022-05-10 08:57:39 +02:00
Beat Küng
32402f31df control_allocator: increase max num motors to 12 2022-05-10 08:57:39 +02:00
Beat Küng
9f5c5591a2 ActuatorEffectivenessRotors: fix motor count check
Check during init to avoid out-of-bound access.
2022-05-10 08:57:39 +02:00
Silvan Fuhrer
089673ff35 only allow positive spoiler and flap controls
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Silvan Fuhrer
21a2892f47 use actuator_controls[8] for collective tilt for tiltrotor VTOL, instead of [4]
[4] is reserved for Flaps, so also having the tilt on it was preventing us from
using flaps on tiltrotors, and other ripple effects.
By using [8] the tilt is separated from all other channels - it requires to increase the size of
actuator_controls by 1 to 9.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Beat Küng
4338976247 ActuatorEffectivenessRotors: add missing getEffectivenessMatrix
Fixes MOTORS_6DOF
2022-04-28 19:51:28 -04:00
Daniel Agar
6135bb384b cleanup module callback registration failed errors 2022-03-23 20:44:50 -04:00
Daniel Agar
f4c3084c26 init adjustments to ensure used topics are advertised early (primarily for logging)
- multi-EKF create each instance as soon as IMU & mag are advertised (before device id populated)
2022-03-23 16:51:16 -04:00
Beat Küng
ddad4c31c9 control_allocator: compute thrust scaling individually per axis
Before, adding the pusher to the same matrix as the upwards motors affected
the scaling for the upwards motors, resulting in values not equal to -1
anymore.
2022-02-25 08:30:58 +01:00
Beat Küng
76d8d8cae6 control_allocator: generic motor configuration for standard vtols
This adds the pusher/puller to the standard motors and makes the axis
configurable.
2022-02-25 08:30:58 +01:00
Beat Küng
b2dc9ee710 control_allocator: add title & help url to geometry UI 2022-02-25 08:30:58 +01:00
Charles Cross
1e32398217 Adds scheduling call to ControlAllocator initialization 2022-02-25 08:16:08 +01:00
Charles Cross
aecfbef128 Enables 20Hz backup scheduling for ControlAllocator 2022-02-25 08:16:08 +01:00
Charles Cross
51c055832f Changes ControlAllocator to always publish actuator controls and status 2022-02-25 08:16:08 +01:00
Beat Küng
960003a86a control_allocator: fix weak authority matrix check & update
- use max(fabsf(val)) instead of max(val)
- use correct actuator count
2022-02-21 11:17:00 -05:00
Jukka Laitinen
9449ed6e66 Add support for protected build in drivers, systemcmds and modules Kconfig
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:58:58 +01:00
Silvan Fuhrer
c51dc3b4b7 ControlAllocator: Set all the elements of a row to 0 if that row has weak authority
Weak authority on a axis is currently defined as: none of the actuators have an
effectivness on this particular axis larger than 0.05.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-02-17 13:21:50 +01:00
Silvan Fuhrer
97a280d41d CA: Tiltrotor: set tilts to exactly -1 or 1 if close to these end points
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-02-17 13:21:50 +01:00
Silvan Fuhrer
df0e402c44 CA: refactor logic for matrix updating
-pass flag EffectivenessUpdateReason into effectiveness, indicating if there was an external
update or not. Reasons for external updates are:
  -config changes (parameter)
  -motor failure detected or certain redundant motors are switched off to save energy

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-02-14 09:23:10 +01:00
Silvan Fuhrer
cbb8c90245 ControlAllocation: fix calculation of roll/pitch normalization scale
Take into account the actual number of roll and pitch acutators,
instead of assuming that all actuators have a roll/pitch component.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-19 08:22:12 +01:00
Silvan Fuhrer
0950bb81ab ControlAllocation: update normalization scale only if matrix updated is forced
The forced flag is used to distinguish between updates due to a configuration
(parameter) change (only enabled when disarmed), and matrix updates due to motor
tilt change. Only update the normalization scale if the forced flag is true, and
use a tilt angle of vertical position for it to have the scales tilt-invariant.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-19 08:22:12 +01:00
Beat Küng
66cbbf9f2e control_allocator: use 'bidirectional' to clarify reversible motors 2022-01-14 12:18:29 -05:00
Beat Küng
d202bf9631 control_allocator: add scope to reduce stack usage by 256B 2021-12-24 20:06:13 -05:00
Silvan Fuhrer
1ad66e606b ControlAllocation: introduce convention for control surface deflection sign
- horizontal control surfaces: up=positive deflection
- vertical control surfaces (rudder): right=positive deflection
- mixed (V-Tail): up=positive deflection

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:06:13 -05:00
Beat Küng
5259877b1b control_allocator: update matrix normalization
- only normalize rpy for MC matrices
- for thrust use the 3D vector, so it works for FW and tilt rotors as well

This keeps MC unchanged.
2021-12-24 20:06:13 -05:00
Silvan Fuhrer
478724c9fe EffectivenessTiltrotor: fix logic for matrix update
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:06:13 -05:00
Silvan Fuhrer
39d441317a ActuatorEffectivenssTailsitterVTOL: only enable MC yaw control if more than 3 rotors
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:06:13 -05:00
Silvan Fuhrer
426aa76a59 CA/VTOL: change description of VT_ELEV_MC_LOCK as it applies to not just elevons
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:06:13 -05:00
Silvan Fuhrer
18008b2de7 CA module.yaml: add motor direction function also to UI for Tailsitter an Tiltrotor
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:06:13 -05:00
Beat Küng
8c782b7cd9 control_allocator: add Custom + MC with tilts effectiveness
The param group is changed to Geometry, as this reflects the naming in the
QGC UI.
2021-12-24 20:06:13 -05:00
Beat Küng
627ec0df5d control_allocator: increase STACK_MAIN to 3000
It was exceeding 2000
2021-12-24 20:06:13 -05:00
Beat Küng
4d38742371 control_allocator: show VT_ELEV_MC_LOCK for vtol mixers in config ui 2021-12-24 20:06:13 -05:00
Silvan Fuhrer
07306c4be3 control_allocator: add support for Tailsitter VTOL
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:06:13 -05:00
Beat Küng
4f8e6a9548 control_allocator: do not update params while armed
As a precaution
2021-12-24 20:06:13 -05:00
Beat Küng
e04b4a8dbf control_allocator: add 6DOF configuration 2021-12-24 20:06:13 -05:00
Beat Küng
4c80adfaf1 control_allocator: implement trim + slew rate limits configuration 2021-12-24 20:06:13 -05:00
Beat Küng
8d9e2a28c4 control_allocator: add fixed-wing actuator effectiveness 2021-12-24 20:06:13 -05:00
Beat Küng
4d2a403afa control_allocator: add rover actuator effectiveness
This can be generalized later
2021-12-24 20:06:13 -05:00
Beat Küng
ed3a115c8f control_allocator: add status publication rate limitation comment 2021-12-24 20:06:13 -05:00