Dennis Mannhart
c9643cb075
mc_pos_control: delete leftover from transitional changes for vel_max_z ( #6822 )
2017-03-20 10:06:29 +01:00
Dennis Mannhart
31aff0b6c0
mc_pos_control: change yaw setpoint to yaw ( #6854 )
2017-03-20 10:05:33 +01:00
Matthias Grob
ca9393eb97
mc_pos_control: fix parameter description of expo for QGC parsing
2017-03-16 11:42:27 +01:00
Dennis Mannhart
e892a51afb
mc_pos_control: delta_t needs to be positive
2017-03-01 11:46:23 +01:00
Dennis Mannhart
7f54f891c1
land_detector: set max height to 100
2017-02-27 22:54:19 +01:00
Dennis Mannhart
6939583650
mc_pos_control: _run_altitude if close to max altitude
2017-02-27 22:54:19 +01:00
Dennis Mannhart
b887654d69
mc_pos_control: fix limit_altitude function
2017-02-27 22:54:19 +01:00
Dennis Mannhart
ca84cc7439
mc_pos_control: delete max altitude, which is not set by landdetector
2017-02-27 22:54:19 +01:00
Dennis Mannhart
c8690fd072
mc_pos_control: limit altitude
...
mc_pos_control: delete spaces
mc_pos_control: cleanup and threshold for velocity control to altitude control when close to max altitude
2017-02-27 22:54:19 +01:00
Daniel Agar
fe4ea6dd63
VTOL mc_pos reset internal state during FW mode
2017-02-25 17:57:05 +01:00
Matthias Grob
8fd27fddcd
mc_pos_control: moved responsibility of the x,y stick deadzone to a mathematical function
...
to prevent a setpoint step when moving the stick over the border of the deadzone
and to enable very small inputs even from a control stick that needs a big deadzone
2017-02-25 11:05:53 +01:00
Matthias Grob
3a358422c4
mc_pos_control: change sign for close to ground + style fix
2017-02-23 23:26:17 +01:00
Dennis Mannhart
de9d05c292
mc_pos_control: uorb home_postition subscription
2017-02-23 23:26:17 +01:00
Dennis Mannhart
cbc54c9917
mc_pos_control: only swithc to velocity control from hold_engaged when user moves stick
2017-02-22 20:48:40 +01:00
Lorenz Meier
d7683e97a3
MC pos control: More landing handling
2017-02-22 09:33:12 +01:00
Lorenz Meier
c55fa9dd3f
MC pos control: add option to use takeoff yaw
2017-02-22 09:21:20 +01:00
Lorenz Meier
4ddc7e22fb
MC pos ctrl: Force slow landing speed below min loiter altitude
2017-02-21 22:01:20 +01:00
Lorenz Meier
1d370f3470
MC pos control: Improve landing handling
2017-02-21 21:57:18 +01:00
Dennis Mannhart
20604989bb
mc_pos_control: have same acceleration max for xy and z
2017-02-21 21:50:00 +01:00
Dennis Mannhart
2788cf8ffc
mc_pos_control: manual stick input fix; deletion of unusued function
2017-02-21 16:47:46 +01:00
Dennis Mannhart
57b7c4fc3d
mc_pos_control: code style fix
2017-02-06 19:10:42 +01:00
Dennis Mannhart
f0978fc9e9
mc_pos_control: set position setpoint during transition based on veloicyt and acceleration
2017-02-06 19:10:42 +01:00
Dennis Mannhart
c141d4ca3f
mc_pos_control: turn off thrust xy when in position hold and altitude hold and thrust z is low
2017-02-06 19:10:42 +01:00
Matthias Grob
c2be4b2b29
mc_pos_control: added exponential curve to manual x,y velocity setpoint
...
controlled by parameter MPC_XY_MAN_EXPO that is disabled (0) by default
2017-02-02 21:24:05 +01:00
Dennis Mannhart
f718b3a97a
mc_pos_control: limit slewrate different in up and down direction
2017-02-02 09:04:59 +01:00
Daniel Agar
7e5f09f408
clang-tidy performance-unnecessary-value-param
2017-02-01 22:15:50 -05:00
Daniel Agar
6631e72d6f
clang-tidy modernize-redundant-void-arg
2017-02-01 22:15:50 -05:00
Daniel Agar
e927f3e040
clang-tidy modernize-use-nullptr
2017-02-01 22:15:50 -05:00
Lorenz Meier
ec2467d4a5
MPC controller: Do not initialize to zero dt but a likely default dt
2017-02-01 20:06:31 +01:00
Dennis Mannhart
299c40f627
mc_pos_control: timestamp fix for vel_sp
2017-02-01 18:30:31 +01:00
Khoi Tran
21f8e07836
Fixed format
2017-01-29 09:37:48 +01:00
Khoi Tran
2428ff9f3a
mc_position_control: Fix divide by zero in scale_control
2017-01-29 09:37:48 +01:00
Dennis Mannhart
f297c45f78
mc_pos_control_main:
...
for landing, set velocity to zero and consider thrust_sp in body frame
instead of NED frame. Also limit thrust_sp_body_z to be larger than 0.0f
2017-01-28 16:23:04 +01:00
Lorenz Meier
f961a12d9a
MC position controller: Stop XY control once ground contact is established
2017-01-28 16:23:04 +01:00
Matthias Grob
34080be68b
mc_pos_control: removed special mode switch calculation
...
because it is not needed anymore with feed forward thrust
it even produced aggressive twitches when used together with the feed forward thrust
2017-01-25 22:42:45 +01:00
Matthias Grob
db581fa5e8
mc_pos_control: hotfix for possible thrust below minimum thrust setting
...
Hotfix after a crash because of a heavily negative desired thrust that got clipped to 0 by the mixer.
0 thrust meant no more attitude tracking.
2017-01-19 18:05:57 +01:00
Lorenz Meier
12767c8538
MC position controller: Stop holding position once ground contact is established.
...
This ensures the system does not tip over on landings. Tested in SITL with a GPS drift model.
2017-01-16 08:25:26 -08:00
Matthias Grob
39f9647291
mc_pos_control: fixed float literals and commented calculations
2017-01-16 08:25:26 -08:00
Matthias Grob
5f3cbbbbc2
mc_pos_control: changed thrust calculation to 3D projection onto body z axis
...
until now the desired thrust was simply the absolute value of the thrust setpoint vector
but a multicopter is only capable of producing thrust in its (negative) body z axis
this leads to excess thrust during attitude tracking errors
one important use case is:
trying to land with minimal thrust in NED z axis against gravity
but the position controller still correcting some small horizontal estimation errors
then this prevents unwanted thrust in a completely wrong direction
2017-01-16 08:25:26 -08:00
Julian Oes
d63db203ba
mc_pos_control: don't publish attitude sp 2x
2017-01-16 08:25:26 -08:00
Matthias Grob
5529023ec1
mc_pos_control: added feed forward hover thrust
...
the velocity controller was misusing the integral part to account for the constant gravitational force offset
the hover throttle from the parameter is now is now directly used as feed forward for the thrust in world z direction
the integrator compensates for inaccurate paarameter but should now be idealy zero
2017-01-16 08:25:26 -08:00
Lorenz Meier
1511838919
Pos control: header cleanup
2016-12-27 21:00:51 +01:00
devbharat
5a8c542d46
Added checks for setting mpc saturation flags
2016-12-27 17:38:00 +01:00
Matthias Grob
eda7848e16
mc_pos_control small refactoring while studying
2016-12-21 08:40:16 +01:00
Dennis Mannhart
22733b1501
mc_pos_control: dont run alt-control when landing
2016-12-15 10:17:03 +01:00
Julian Oes
ef7ade52b1
mc_pos_control: stay landing even after freefall
...
This fixes the following case:
1. VTOL in auto mission descends to land
2. _in_landing is set to true correctly
3. _lnd_reached_ground is set to true because it's detected, motors idle.
4. The vehicle might drop for a few centimeters and _acc_z_lp goes back
up above 4m/s^2, so freefall is detected.
5. The motors spin up again, and _in_landing and _lnd_reached_ground are
both reset to false.
6. Since we're floating at a few centimeters, we can't actyally get to
_vel_z_lp > 0.5, and therefore _in_landing is never triggered after.
7. Thus we never finish the landing.
This is fixed by only resetting _lnd_reached_ground to false but
leaving _in_landing true.
2016-12-15 10:17:03 +01:00
Julian Oes
70fec788d9
mc_pos_control: allow takeoff in offboard mode
2016-12-15 10:17:03 +01:00
Julian Oes
072ba51064
mc_pos_control_main: changes got lost in rebase
2016-12-15 10:17:03 +01:00
Julian Oes
b285827f52
mc_pos_control: remove leftover printf
2016-12-15 10:17:03 +01:00
Julian Oes
65b8bcae12
mc_pos_control: always require takeoff setpoint
...
Problem: The drone started taking off in LOITER (HOLD) mode even if on
ground and did not do a proper takeoff jump. The effect was mostly a
hovering close above ground or tilting/flipping because of integrator
wind-up.
Solution: Stay at minimum throttle until a takeoff setpoint is issued.
2016-12-15 10:17:03 +01:00