Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Ardupilot
Commits
560985b5
Commit
560985b5
authored
13 years ago
by
Jason Short
Browse files
Options
Downloads
Patches
Plain Diff
made I term return in same pattern as D term
parent
75919436
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
libraries/AC_PID/AC_PID.cpp
+4
-4
4 additions, 4 deletions
libraries/AC_PID/AC_PID.cpp
with
4 additions
and
4 deletions
libraries/AC_PID/AC_PID.cpp
+
4
−
4
View file @
560985b5
...
...
@@ -28,8 +28,9 @@ int32_t AC_PID::get_i(int32_t error, float dt)
}
else
if
(
_integrator
>
_imax
)
{
_integrator
=
_imax
;
}
return
_integrator
;
}
return
_integrator
;
return
0
;
}
int32_t
AC_PID
::
get_d
(
int32_t
input
,
float
dt
)
...
...
@@ -73,8 +74,7 @@ int32_t AC_PID::get_pid(int32_t error, float dt)
// Compute derivative component if time has elapsed
if ((fabs(_kd) > 0) && (dt > 0)) {
_derivative = (error - _last_input) / dt;
_derivative = (error - _last_error) / dt;
// discrete low pass filter, cuts out the
// high frequency noise that can drive the controller crazy
...
...
@@ -82,7 +82,7 @@ int32_t AC_PID::get_pid(int32_t error, float dt)
(dt / ( _filter + dt)) * (_derivative - _last_derivative);
// update state
_last_
input
= error;
_last_
error
= error;
_last_derivative = _derivative;
// add in derivative component
...
...
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