Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
18a3c086
Commit
18a3c086
authored
6 years ago
by
Dennis Mannhart
Committed by
Lorenz Meier
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mc_pos_control: idle to armed state delay controlled by parameter MPC_IDLE_TKF
parent
ab1ae1fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/mc_pos_control/mc_pos_control_main.cpp
+9
-10
9 additions, 10 deletions
src/modules/mc_pos_control/mc_pos_control_main.cpp
src/modules/mc_pos_control/mc_pos_control_params.c
+16
-0
16 additions, 0 deletions
src/modules/mc_pos_control/mc_pos_control_params.c
with
25 additions
and
10 deletions
src/modules/mc_pos_control/mc_pos_control_main.cpp
+
9
−
10
View file @
18a3c086
...
...
@@ -130,7 +130,8 @@ private:
(
ParamFloat
<
px4
::
params
::
MPC_TKO_SPEED
>
)
_tko_speed
,
(
ParamFloat
<
px4
::
params
::
MPC_LAND_ALT2
>
)
MPC_LAND_ALT2
,
// altitude at which speed limit downwards reached minimum speed
(
ParamInt
<
px4
::
params
::
MPC_POS_MODE
>
)
MPC_POS_MODE
,
(
ParamInt
<
px4
::
params
::
MPC_ALT_MODE
>
)
MPC_ALT_MODE
(
ParamInt
<
px4
::
params
::
MPC_ALT_MODE
>
)
MPC_ALT_MODE
,
(
ParamFloat
<
px4
::
params
::
MPC_IDLE_TKO
>
)
MPC_IDLE_TKO
/**< time constant for smooth takeoff ramp */
);
control
::
BlockDerivative
_vel_x_deriv
;
/**< velocity derivative in x */
...
...
@@ -142,16 +143,14 @@ private:
PositionControlStates
_states
;
/**< structure that contains required state information for position control */
hrt_abstime
_last_warn
=
0
;
/**< timer when the last warn message was sent out */
static
constexpr
uint64_t
IDLE_BOFORE_TAKEOFF_TIME_US
=
2500000
;
/**< time required to stay idle before enabling smooth takeoff */
/**
* Hysteresis that turns true once vehicle is armed for IDLE_
BOFORE_TAKEOFF_TIME_US micro
seconds.
* Hysteresis that turns true once vehicle is armed for
MPC_
IDLE_
TKO
seconds.
* A real vehicle requires some time to accelerates the propellers to IDLE speed. To ensure
* that the propellers reach idle speed before initiating a takeoff, a delay of IDLE_
BOFORE_TAKEOFF_TIME_US
* that the propellers reach idle speed before initiating a takeoff, a delay of
MPC_
IDLE_
TKO
* is added.
*/
systemlib
::
Hysteresis
_arm_hysteresis
{
false
};
/**< becomes true once vehicle is armed for IDLE_
BOFORE_TAKEOFF_TIME_US
*/
systemlib
::
Hysteresis
_arm_hysteresis
{
false
};
/**< becomes true once vehicle is armed for
MPC_
IDLE_
TKO seconds
*/
/**
* Update our local parameter cache.
...
...
@@ -256,9 +255,6 @@ MulticopterPositionControl::MulticopterPositionControl() :
{
// fetch initial parameter values
parameters_update
(
true
);
// set trigger time for arm hysteresis
_arm_hysteresis
.
set_hysteresis_time_from
(
false
,
IDLE_BOFORE_TAKEOFF_TIME_US
);
}
MulticopterPositionControl
::~
MulticopterPositionControl
()
...
...
@@ -314,9 +310,12 @@ MulticopterPositionControl::parameters_update(bool force)
_flight_tasks
.
handleParameterUpdate
();
/
*
initialize vectors from params and enforce constraints
*/
/
/
initialize vectors from params and enforce constraints
_tko_speed
.
set
(
math
::
min
(
_tko_speed
.
get
(),
_vel_max_up
.
get
()));
_land_speed
.
set
(
math
::
min
(
_land_speed
.
get
(),
_vel_max_down
.
get
()));
// set trigger time for arm hysteresis
_arm_hysteresis
.
set_hysteresis_time_from
(
false
,
(
int
)(
MPC_IDLE_TKO
.
get
()
*
1000000.0
f
));
}
return
OK
;
...
...
This diff is collapsed.
Click to expand it.
src/modules/mc_pos_control/mc_pos_control_params.c
+
16
−
0
View file @
18a3c086
...
...
@@ -628,6 +628,22 @@ PARAM_DEFINE_FLOAT(MPC_TKO_RAMP_T, 0.4f);
*/
PARAM_DEFINE_INT32
(
MPC_POS_MODE
,
1
);
/**
* Delay from idle state to arming state.
*
* For altitude controlled modes, the transition from
* idle to armed state is delayed by MPC_IDLE_TKO time to ensure
* that the propellers have reached idle speed before attempting a
* takeoff. This delay is particularly useful for vehicles with large
* propellers.
*
* @min 0
* @max 10
* @unit sec
* @group Multicopter Position Control
*/
PARAM_DEFINE_FLOAT
(
MPC_IDLE_TKO
,
0
.
0
f
);
/**
* Flag to enable obstacle avoidance
* Temporary Parameter to enable interface testing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment