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
450e7c67
Commit
450e7c67
authored
7 years ago
by
bresch
Committed by
Roman Bapst
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Multicopter mixer - Remove arbitraty boost gain during saturation
parent
096e2ec6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/mixer/mixer_multirotor.cpp
+3
-10
3 additions, 10 deletions
src/lib/mixer/mixer_multirotor.cpp
with
3 additions
and
10 deletions
src/lib/mixer/mixer_multirotor.cpp
+
3
−
10
View file @
450e7c67
...
...
@@ -179,10 +179,6 @@ MultirotorMixer::mix(float *outputs, unsigned space)
// clean out class variable used to capture saturation
_saturation_status
.
value
=
0
;
// thrust boost parameters
float
thrust_increase_factor
=
1.5
f
;
float
thrust_decrease_factor
=
0.6
f
;
/* perform initial mix pass yielding unbounded outputs, ignore yaw */
for
(
unsigned
i
=
0
;
i
<
_rotor_count
;
i
++
)
{
float
out
=
roll
*
_rotors
[
i
].
roll_scale
+
...
...
@@ -216,18 +212,15 @@ MultirotorMixer::mix(float *outputs, unsigned space)
boost
=
-
(
max_out
-
1.0
f
);
}
else
if
(
min_out
<
0.0
f
&&
max_out
<
1.0
f
&&
max_out
-
min_out
>
1.0
f
)
{
float
max_thrust_diff
=
thrust
*
thrust_increase_factor
-
thrust
;
boost
=
math
::
constrain
(
-
min_out
-
(
1.0
f
-
max_out
)
/
2.0
f
,
0.0
f
,
max_thrust_diff
);
boost
=
-
min_out
-
(
1.0
f
-
max_out
)
/
2.0
f
;
roll_pitch_scale
=
(
thrust
+
boost
)
/
(
thrust
-
min_out
);
}
else
if
(
max_out
>
1.0
f
&&
min_out
>
0.0
f
&&
max_out
-
min_out
>
1.0
f
)
{
float
max_thrust_diff
=
thrust
-
thrust_decrease_factor
*
thrust
;
boost
=
math
::
constrain
(
-
(
max_out
-
1.0
f
-
min_out
)
/
2.0
f
,
-
max_thrust_diff
,
0.0
f
);
boost
=
-
(
max_out
-
min_out
-
1.0
f
)
/
2.0
f
;
roll_pitch_scale
=
(
1
-
(
thrust
+
boost
))
/
(
max_out
-
thrust
);
}
else
if
(
min_out
<
0.0
f
&&
max_out
>
1.0
f
)
{
boost
=
math
::
constrain
(
-
(
max_out
-
1.0
f
+
min_out
)
/
2.0
f
,
thrust_decrease_factor
*
thrust
-
thrust
,
thrust_increase_factor
*
thrust
-
thrust
);
boost
=
-
(
max_out
-
1.0
f
+
min_out
)
/
2.0
f
;
roll_pitch_scale
=
(
thrust
+
boost
)
/
(
thrust
-
min_out
);
}
...
...
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