Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DC motor driver hat
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
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
DC motor driver hat
Commits
dee7190b
Commit
dee7190b
authored
6 months ago
by
Samuel Tardieu
Browse files
Options
Downloads
Patches
Plain Diff
Use sensible default values for k_i and k_d
parent
3aea844c
No related branches found
No related tags found
1 merge request
!17
Resolve "Set PID coefficients from Python"
Pipeline
#98586
passed
6 months ago
Stage: check
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/src/logic/pid_control.rs
+3
-3
3 additions, 3 deletions
controller/src/logic/pid_control.rs
with
3 additions
and
3 deletions
controller/src/logic/pid_control.rs
+
3
−
3
View file @
dee7190b
...
...
@@ -9,9 +9,9 @@ type PidUnit = Fixed<8>;
// Those coefficients are to be intepreted as `PidUnit` values.
// For example, if `PidUnit` is `Fixed<8>`, a value of 0x40 is
// in fact 0x40 ÷ (1 << 8) = 0.25.
pub
static
K_P
:
AtomicI32
=
AtomicI32
::
new
(
0x40
);
pub
static
K_I
:
AtomicI32
=
AtomicI32
::
new
(
0
);
pub
static
K_D
:
AtomicI32
=
AtomicI32
::
new
(
0
);
pub
static
K_P
:
AtomicI32
=
AtomicI32
::
new
(
0x40
);
// 0.25
pub
static
K_I
:
AtomicI32
=
AtomicI32
::
new
(
0
x03
);
// 0.01171875
pub
static
K_D
:
AtomicI32
=
AtomicI32
::
new
(
-
0x01
);
// -0.00390625
static
CONTROLLED_MODE
:
AtomicBool
=
AtomicBool
::
new
(
false
);
static
LEFT_SPEED
:
AtomicI16
=
AtomicI16
::
new
(
0
);
...
...
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