435 Commits

Author SHA1 Message Date
Matthias Grob
c7ef12545c mc_att_control_params: lower default roll and pitch attitude gains from 6.5 to 4
6.5 is a relatively high value that was used mostly on smaller, low inertia vehicles ~250-500mm diagonal. There it works great but on larger, higher intertia vehicles this leads to problems.
2025-06-05 19:28:53 +02:00
Matthias Grob
9eaec534ab
mc_att_control_main: fix check for hover thrust estimate update (#24750) 2025-04-22 15:53:51 -08:00
dawr68
f08d01b4d5
Make throttle stick scaling more predictable in mc-stabilized mode (#24710)
* Rescale throttle curve to HTE as option

* Add slew rate to hover thrust estimate

* Update docs to reflect changes

Fix formating

* mc_att_control: suggestions for hover thrust slewing

- Slower slew rate
- Move update of hover thrust estimate into main loop
- Make sure dt for slew rate is correct
- Apply parameter updates if hover thrust estimate not used
- Parameter description in metadata files

* fix: Rescaling cases order

* Rescale to HTE estimate by default

* Update src/modules/mc_pos_control/multicopter_position_control_params.c

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>

* Fix hte sub name

* Update MPC_THR_CURVE description

* Swap thr curve values to make hte rescaling default for value 0

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2025-04-22 16:36:33 +02:00
Matthias Grob
d514cb4903 mc_att_control: use StickYaw class for Stabilized
to make yawing including reset and drift handling consistent with
Altitude and Position mode.
2025-04-22 15:35:26 +02:00
Matthias Grob
45d7f707d7 mc_att_control: remove useless subscription
added in 28fa04438616d16363306878e6bfee0473c77afc
#19633
2025-04-04 13:23:49 +02:00
bresch
3b828e157a MC att: clarify prioritization algorithm
Especially rename "mix" which is just the delta yaw angle
2025-01-30 11:28:26 +01:00
mahimayoga
28fa044386 MC-stabilized: rescale thrust input to hover thrust at zero stick input
Use hover thrust estimate in stabilized mode to rescale stick inputs. Prevents vehicle from losing/gaining altitude when switching from position to stabilized mode.
2025-01-13 11:56:09 +01:00
Jaeyoung Lim
e008ca24f1
Remove euler angles from attitude setpoint (#23482)
* Remove euler angles from attitude setpoint message

* Remove usage of euler angles in attitude setpoint messages

This commit removes the usage of euler angles in the vehicle_attitude_setpoint messages

* Fix standard vtol
2024-08-12 16:42:51 +02:00
Matthias Grob
f2bca92221 Fix duplicate newlines at the end of files 2024-07-19 14:33:36 +02:00
Silvan Fuhrer
982c998ab9 mc_attitude_control: move attitude setpoint pulling to right before usage
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-02-06 17:54:22 -05:00
Silvan Fuhrer
e5cfbbb1ee mc_att_control: remove direct setting of att sp in Stabilized
Instead of directly setting the attitude setpoint for usage inside the same module
only publish it to the uorb topic, which is subscribed to in the same module.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-02-06 17:54:22 -05:00
Silvan Fuhrer
e260a92ccb MC att control: do not update the attitude setpoint directly in transition mode
That enables us to update the pitch setpoint in Stabilized mode
in the VTOL controller (pitch ramp for transition).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-01-12 09:51:55 +01:00
Silvan Fuhrer
acec07fb25 Update src/modules/mc_att_control/mc_att_control_main.cpp
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-09-21 17:25:53 +02:00
Matthias Grob
710f977349 mc_att_control: ramp thrust in after spoolup time 2023-09-21 17:25:53 +02:00
Matthias Grob
4ca366c04f mc_att_control: respect spoolup time in Stabilized mode 2023-09-21 17:25:53 +02:00
Matthias Grob
24111df176 mc_att_control_main: zero minimal thrust when landed
but this time compared to
2fbb70d9ca94f442de1345221be18ba738cda952
the minimum thrust is ramping to not produce a thrust jump.

The better long term solution will be to always have airmode but
with the effect limited to a magnitude of MPC_MANTHR_MIN.
2023-09-21 17:25:53 +02:00
Matthias Grob
43850c24a1 AttitudeControl: remove unnecessary scope operator 2023-04-15 21:57:40 +02:00
bresch
d6fa42fefd mc att: add unit tests for AttitudeControlMath helper 2023-03-22 10:01:27 +01:00
bresch
edaf5bf0cd mc att: extract tilt yaw error compensation to lib 2023-03-22 10:01:27 +01:00
bresch
f65daf7259 mc att: do not pass by euler angles to generate att sp from sticks 2023-03-22 10:01:27 +01:00
Matthias Grob
f887ad6ebf mc_att_control: allow commanding a yaw rate with zero throttle
Still avoiding to build up absolute yaw error in that case.
2023-02-21 19:33:28 +01:00
Matthias Grob
2b0f7879bc mc_att_control_main: separate yaw rate setpoint generation from absolute yaw reset 2023-02-21 19:33:28 +01:00
Matthias Grob
ce5cff55b7 mac_att_control: heading lock in stabilized only after ekf final yaw alignment 2023-02-21 19:33:28 +01:00
Silvan Fuhrer
f0571de731 MCAttitudeController: remove reset of yaw_sp when landed
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-21 19:33:28 +01:00
Matthias Grob
331cb21dee manual_control_setpoint: change stick axes naming
In review it was requested to have a different name for
manual_control_setpoint.z because of the adjusted range.

I started to investigate what naming is most intuitive and found
that most people recognize the stick axes as roll, pitch, yaw, throttle.
It comes at no surprise because other autopilots
and APIs seem to share this convention.

While changing the code I realized that even within the code base
the axes are usually assigned to a variable with that name or
have comments next to the assignment clarifying the axes
using these names.
2022-11-28 19:25:55 +01:00
Matthias Grob
83246c84cf Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]
To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
2022-11-28 19:25:55 +01:00
Daniel Agar
a7bbcd5b04 delete lib/mixer and mixer_module static mixing 2022-09-09 09:14:09 -04:00
Matthias Grob
2edb35b1b5
Functions: add gradual function with arbitrary number of corner points 2022-09-07 08:00:26 +02:00
mcsauder
87a5705960 Rename math::gradual() to math::interpolate() and add unit tests to cover additional corner cases. 2022-08-18 14:18:02 +02:00
Matthias Grob
1f81101994 mc_att_control_main: do not jump throttle scaling when taking off
2fbb70d9ca94f442de1345221be18ba738cda952 made the lowest possible
throttle value commanded by stick in Stabilized mode before taking off 0.
The real world problem with this is that when takeoff is detected then
the entire throttle scaling range jumps from
[0, MPC_MANTHR_MIN]
to [MPC_MANTHR_MIN, MPC_MANTHR_MIN].
As a result whenever MPC_MANTHR_MIN is not zero there is a thrust jump
on every takeoff just at the moment takeoff is detected even when the
stick is moved continuously.

Because of this I suggest to revert to having a higher throttle value
from the beginning on because it's less complicated and there's
no obvious value in starting out with zero thrust if anyways not
possible to go back to zero for safety once takeoff is detected.
2022-08-11 14:18:54 +02:00
Matthias Grob
5b1b6f6080 mc_att_control_main: use gradual() for throttle curve rescale without hover thrust 2022-08-11 14:18:54 +02:00
Hamish Willee
e6eed43648
Spelling errors (#19935) 2022-07-27 14:33:16 +10:00
Daniel Agar
a73efd9c4f NuttX carry minimal c++ cmath (replacing Matrix stdlib_imports.hpp) 2022-07-12 08:05:06 -04:00
mcsauder
6b0788ff46 Standardize variable naming and formatting across vehicle attitude controller files. 2022-05-21 12:22:18 -04:00
Silvan Fuhrer
d8444df11c Set tailsitter flag via vehicle status
Removes the necessity of including vtol_type.h in other modules.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02:00
Daniel Agar
3d590af115 mc_att_control: only apply quat reset if estimate is newer than setpoint 2022-04-25 21:25:29 -04:00
Daniel Agar
6135bb384b cleanup module callback registration failed errors 2022-03-23 20:44:50 -04: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
Daniel Agar
019eaf7038 multicopter: minimize dt jitter by using estimate timestamp_sample 2021-12-17 17:52:28 -05:00
Matthias Grob
fabf865411 Use backwards compatible manual_control_setpoint instead of manual_control_input 2021-11-09 16:05:25 +01:00
Julian Oes
6a6b8d49fc msg: re-use manual_control_input in setpoint
This way we avoid duplication between manual_control_input and
manual_control_setpoint.
2021-11-09 16:05:25 +01:00
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
bresch
9681f819a8 mc_att: inject identification signal in att control output 2021-10-02 18:12:05 -04:00
Daniel Agar
b5430c22c4 AlphaFilter: move from ecl -> mathlib 2021-07-15 10:38:24 -04:00
Beat Küng
629f7ba15b params: ensure short description is only a single line
So a UI can display it properly
2021-03-23 12:55:11 -04:00
Jaeyoung-Lim
6b4ccaa53e Handle invalid yaw rate setpoints 2021-03-14 00:01:57 +01:00
Daniel Agar
bb12fce66c delete RATTITUDE flight mode 2021-03-09 10:47:00 -05:00
Matthias Grob
c96d9a79b8 mc_att_control_params: remove frequency unit from attitude gains 2021-03-08 11:14:01 -05:00
Daniel Agar
d0c9a5fc93
OFFBOARD mode architecture overhaul (#16739)
- handle SET_POSITION_TARGET_LOCAL_NED and SET_POSITION_TARGET_GLOBAL_INT with ORB_ID(trajectory_setpoint)
 - FlightTaskOffboard not needed at all
 - bypass position_setpoint_triplet entirely (start removing extraneous fields)
 - simplify offboard_control_mode to map to supported control modes
2021-03-05 09:39:46 -05:00
Lorenz Meier
15219fbfe5 MC att control: Robustify for throttle scaling
PX4 can support negative (reverse) throttle and the multicopter controller is not expecting this input range. This hardens it against it.
2021-02-14 11:17:28 +01:00