Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Koniarik
emlabcpp
Commits
73cc8f7f
Commit
73cc8f7f
authored
Nov 16, 2021
by
Jan Koniarik
Browse files
pid update now returns actual output
parent
3d3848bf
Pipeline
#102279
passed with stage
in 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/emlabcpp/pid.h
View file @
73cc8f7f
...
...
@@ -77,12 +77,12 @@ public:
/// Algorithm changes it's internal value output_ to the value that should be set to a
/// 'thing' that controls input_ value. It tries to control the 'thing' so the input
/// eventually converges to 'desired' value
void
update
(
time_type
now
,
float
input
,
float
desired
)
float
update
(
time_type
now
,
float
input
,
float
desired
)
{
float
t_diff
=
static_cast
<
float
>
(
now
-
last_time_
);
if
(
t_diff
==
0.
f
)
{
return
;
return
output_
;
}
float
error
=
desired
-
input
;
...
...
@@ -97,6 +97,8 @@ public:
last_input_
=
input
;
last_time_
=
now
;
return
output_
;
}
float
get_output
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment