125 Commits

Author SHA1 Message Date
Matthias Grob
2be687a84c Helicopter: add collective pitch offset to Actuator UI parameters 2023-09-28 08:55:06 +02:00
Matthias Grob
99e2acf89c ActuatorEffectivenessHelicopter: explicitly handle unsaturated case
This became necessary otherwise
the allocation reports saturation all
the time and the rate integrator doesn't work.
2023-09-28 08:53:35 +02:00
Julian Oes
fb30b4d288 control_allocator: Clarify position description
I'm assuming that the rotor positions are given relative to the center
of gravity (CG).

Signed-off-by: Julian Oes <julian@oes.ch>
2023-09-04 08:02:15 +02:00
Silvan Fuhrer
f1b5b4f524
TiltrotorEffectiveness: limit thrust axis tilt to z effectiveness scaling (#21990)
During transition to FF, only allow update thrust axis up to 45° as with a high tilt angle
the effectiveness of the thrust axis in z is apporaching 0, and by that is increasing
the motor output to max.
Transition to HF: disable thrust axis tilting, and assume motors are vertical. This is to avoid
a thrust spike when the transition is initiated (as then the tilt is fully forward).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-25 14:45:14 +02:00
Silvan Fuhrer
410206aa5d
Control Allocation: fixes in yaw saturation detection for vehicles with tilt-for-yaw (#21994)
* ActuatorEffectiveness: base yaw saturation on tilt actuator limits (VTOL Tiltrotor)

* ActuatorEffectiveness: add custom yaw saturation for MC Tilt


---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-24 13:58:58 +02:00
Silvan Fuhrer
0eb276f273
Tiltrotor: move spin up tilt to control allocation (#21991)
EffectivenessTiltrotor: link time when to tilt motors to MC position to COM_SPOOLUP_TIME
- remove VT_TILT_SPINUP and special spin up tilt handling form the VTOL module
- now handle the spoolup in the allocation, directly linked to COM_SPOOLUP_TIME
- leave tilts at disarmed value during spoolup

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-24 13:57:24 +02:00
Beat Küng
03365658d5 VehicleControlMode: add flag_control_allocation_enabled
Allows (external) modes to directly publish actuator_{motors,servos}.
2023-08-21 20:53:51 -04:00
Silvan Fuhrer
eaad11bb74 ActuatorEffectiveness: add comment for 2% magic number to stop motors
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-17 13:28:09 +02:00
Matthias Grob
e776aca9ef UUV: stop motors when commanding zero speed 2023-07-10 18:58:37 +02:00
Matthias Grob
6b7aed3d44 Boats: stop motors when commanding zero speed 2023-07-10 18:58:37 +02:00
Matthias Grob
95a35c972d Rovers: stop motors when commanding zero speed 2023-07-10 18:58:37 +02:00
Matthias Grob
0be6069b83 TiltrotorVTOL: allow stopping front tilted motors in fast forward flight 2023-07-10 18:58:37 +02:00
Matthias Grob
66b451e61f TailsitterVTOL: allow explicitly stop forward motor with zero thrust 2023-07-10 18:58:37 +02:00
Matthias Grob
5568afbb12 StandardVTOL: explicitly stop forward motor with zero thrust 2023-07-10 18:58:37 +02:00
Matthias Grob
6b7b34a71a FixedWing: explicitly stop forward motor with zero thrust
This allows PWM and all other output methods to configure
stopped, idling and full thrust points and use them consistently.
The fact that a fixed wing motor can be stopped when zero thrust
is demanded is explicit and could in principle even be disabled.
The mechanism is the same as for a standard VTOL stopping the
multicopter motors in the fixed wing flight phase.
2023-07-10 18:58:37 +02:00
Matthias Grob
2a077181d9 ActuatorEffectiveness: add function to delectively stop motors with zero thrust 2023-07-10 18:58:37 +02:00
Matthias Grob
a36c922fc0 ActuatorEffectivenessHelicopterTest: adapt to new constructor 2023-07-03 16:21:27 +02:00
Beat Küng
77d6c722a7 helicopter: add tail servo support
as a separate CA_AIRFRAME, as the UI cannot switch between servo/motor.
2023-07-03 16:21:27 +02:00
Beat Küng
989d9243b7 fix control_allocator: correct PRINT_MODULE_USAGE_NAME 2023-04-13 07:46:09 +02:00
Matthias Grob
937d27f8ee Helicopter: add offset for yaw compensation based on collective pitch 2023-03-24 07:16:36 +01:00
Silvan Fuhrer
b16f16598b VTOL: remove virtual actuator_controls and instead use virtual torque/thrust topics
MC/FW rate controller and auto tuner: remove actuator_controls

AirshipAttControl: remove actuator_controls

MulticopterLandDetector: remove actuator_controls

mavlink streams vfr_hud and high_latency2: remove actuator_controls

RoverPositionController: remove actuator_controls

UUVAttitudeController: remove actuator_controls

battery: use length of thrust_setpoint for throttle compensation

VehicleMagnetometer: use length of thrust_setpoint for throttle compensation

Signed-off-by: Silvan Fuhrer
2023-03-16 11:55:45 +01:00
Silvan Fuhrer
1e56d9c219 Rework flaps/spoilers logic
- remove deprecated actuator_controls[INDEX_FLAPS/SPOILERS/AIRBRAKES]
- use new topic normalized_unsigned_setpoint.msg (with instances flaps_setpoint
and spoilers_setpoint) to pass into control allocation
- remove flaps/spoiler related fields from attitude_setpoint topic
- CA: add possibility to map flaps/spoilers to any control surface
- move flaps/spoiler pitch trimming to CA (previously called DTRIM_FLAPS/SPOILER)
- move manual flaps/spoiler handling from rate to attitude controller

FW Position controller: change how negative switch readings are intepreted
for flaps/spoilers (considered negative as 0).

VTOL: Rework spoiler publishing in hover

- pushlish spoiler_setpoint.msg in the VTOL module if in hover
- also set spoilers to land configuration if in Descend mode

Allocation: add slew rate limit of 0.5 to flaps/spoilers configuration change

Instead of doing the flaps/spoilers slew rate limiting in the FW Position Controller
(which then only is applied in Auto flight), do it consistently over all flight
modes, so also for manual modes.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 22:43:41 +01:00
Silvan Fuhrer
4b54ddfe61 Remove INDEX_COLLECTIVE_TILT from actuator_controls and instead use new topic tiltrotor_extra_controls
Tiltrotor_extra_controls also contains collective thrust beside collective tilt, as passing a 3D
thrust setpoint vector beside the tilt is not feasible.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 22:43:41 +01:00
Silvan Fuhrer
83e906e2e9 Control_allocator_status.msg: remove allocated_ fields
It's enough that the setpoints and the unallocated values are logged, from these
 the allocated values can be calculated if required.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Silvan Fuhrer
f44713e8a3 ControlAllocator: enable custom saturation logic to override default one
Custom saturation logic currently implemented for Tiltrotor VTOL and Helicopter.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Silvan Fuhrer
2e20fb7f97 ActuatorEffectiveness: add _collective_ keyword to controls for collective tilt to disinct from yaw tilt
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Silvan Fuhrer
6db92b4011 ControlAllocation: remove actuator trim value from actuator_sp to calculate allocated control
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-04 07:51:25 +02:00
Beat Küng
d948fcd72b fix control_allocator: check if 2. thrust and torque sp topic is valid
Otherwise the 2. setpoint is equal to the first one. This is only an issue
if the 2. instance isn't advertised.
2022-09-21 15:11:11 +02:00
Daniel Agar
a7bbcd5b04 delete lib/mixer and mixer_module static mixing 2022-09-09 09:14:09 -04:00
Beat Küng
4087c27e84
control_allocator: handle saturation flags for helicopters 2022-09-07 08:00:27 +02:00
alexklimaj
aa8d594e9b
Add heli servo trim 2022-09-07 08:00:27 +02:00
Matthias Grob
667e99be81
Helicopter: fix unit test after default throttle curve was changed 2022-09-07 08:00:27 +02:00
Matthias Grob
115cf4d572
Helicopter: More intuitive yaw direction configuration for the common cases 2022-09-07 08:00:27 +02:00
Beat Küng
cecef7e3f6
control_allocator: update heli throttle + collective curve defaults 2022-09-07 08:00:26 +02:00
Beat Küng
7e75b497ae
helicopter: add switch to engage main motor
For helicopters it's useful (e.g. during bringup) to be able to disable
the main rotor while the tail is still controlled to safely land.
2022-09-07 08:00:26 +02:00
Matthias Grob
f32d931117
helicopter: add yaw sign parameter & expose settings in UI 2022-09-07 08:00:26 +02:00
Matthias Grob
349f152601
Helicopter: throttle spoolup upon arming
Uses COM_SPOOLUP_TIME to slowly ramp the throttle and allow the
tailrotor to compensate in a coordinated way based on the yaw
compesation from throttle, see CA_HELI_YAW_TH_S.

This coordinated spoolup is necessary to avoid unsafe yaw twitches
because of the heli rotating until the correct compensation kicks in
through the feedback controller.
2022-09-07 08:00:26 +02:00
Matthias Grob
7bf62373ae
Helicopter: refactor complicated throttle curve logic 2022-09-07 08:00:26 +02:00
Matthias Grob
6a9a049f1e
Helicopter: add unit testing for throttle curve 2022-09-07 08:00:26 +02:00
Matthias Grob
9ba6f4efb7
Helicopter: add yaw compensation from throttle CA_HELI_YAW_TH_S 2022-09-07 08:00:26 +02:00
Matthias Grob
554d965a2d
Helicopter: use absolute value for yaw compensation from collective pitch 2022-09-07 08:00:26 +02:00
Beat Küng
608ab9ff9c
control_allocator: extend description for CA_SP0_ANGx 2022-09-07 08:00:25 +02:00
Beat Küng
e346190e63
helicopter: use tail motor & add CA_HELI_YAW_CP_S 2022-09-07 08:00:25 +02:00
Silvan Fuhrer
6aab44e425 ControlAllocator: publish allocator_status from all active matrices (2 for VTOL, otherwise 1)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-08-19 09:40:48 +02:00
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