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
efabcaa4
Commit
efabcaa4
authored
3 months ago
by
Samuel Tardieu
Browse files
Options
Downloads
Patches
Plain Diff
Stay in control mode at (0, 0) speed
parent
058814fc
No related branches found
No related tags found
1 merge request
!56
Stay in control mode at (0, 0) speed
Pipeline
#101139
passed
3 months ago
Stage: check
Stage: build
Stage: test
Stage: deploy
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cargo.lock
+1
-1
1 addition, 1 deletion
Cargo.lock
README.md
+3
-4
3 additions, 4 deletions
README.md
controller/Cargo.toml
+1
-1
1 addition, 1 deletion
controller/Cargo.toml
controller/src/logic/mod.rs
+1
-2
1 addition, 2 deletions
controller/src/logic/mod.rs
with
6 additions
and
8 deletions
Cargo.lock
+
1
−
1
View file @
efabcaa4
...
...
@@ -305,7 +305,7 @@ dependencies = [
[[package]]
name = "controller"
version = "1.3.
0
"
version = "1.3.
1
"
dependencies = [
"bootloader-params",
"build-support",
...
...
This diff is collapsed.
Click to expand it.
README.md
+
3
−
4
View file @
efabcaa4
...
...
@@ -240,8 +240,9 @@ then the right motor coefficients.
-
0x21: K_I (4 bytes, or 2×4 bytes). Default value is 0x0000_0000 (0.01171875)
-
0x22: K_D (4 bytes, or 2×4 bytes). Default value is 0x0000_0000 (0.0)
Changing the coefficients will take effect only when the controlled mode
is off, for example by setting the motors to standby mode.
Changing the coefficients will take effect only when the controlled
mode is off, for example by setting the motors to standby mode. Even a
speed of (0, 0) in controlled mode will not use the new coefficients.
## 0x26 PID I accumulator (R)
...
...
@@ -269,8 +270,6 @@ then right), as two 32 bit signed numbers with a 24 bit integer part.
each). The unit is the number of ticks per 100th of seconds.
-
Each motor will be controlled by a separate PID with shared
coefficients.
-
Using a speed of (0, 0) will exit the controlled mode and switch to
raw mode. This allows the PID coefficients to be updated if needed.
-
Speed will be returned as (-32768, -32768) if controlled mode is not
active.
...
...
This diff is collapsed.
Click to expand it.
controller/Cargo.toml
+
1
−
1
View file @
efabcaa4
...
...
@@ -4,7 +4,7 @@ description = "Firmware for DC Motor Driver Hat DFR0592"
authors.workspace
=
true
edition.workspace
=
true
license.workspace
=
true
version
=
"1.3.
0
"
# Update in python/controller.py and tele0592/src/controller.rs as well
version
=
"1.3.
1
"
# Update in python/controller.py and tele0592/src/controller.rs as well
[[bin]]
name
=
"controller-firmware"
...
...
This diff is collapsed.
Click to expand it.
controller/src/logic/mod.rs
+
1
−
2
View file @
efabcaa4
...
...
@@ -185,8 +185,7 @@ fn process_command(
response
.push_i32
(
left_error
)
.unwrap
();
response
.push_i32
(
right_error
)
.unwrap
();
}
&
[
CMD_RAW_MOTOR_SPEED
,
left
,
right
]
|
&
[
CMD_CONTROLLED_MOTOR_SPEED
,
left
@
0
,
0
,
right
@
0
,
0
]
=>
{
&
[
CMD_RAW_MOTOR_SPEED
,
left
,
right
]
=>
{
pid_control
::
disable_controlled_mode
();
if
motor_control
::
set_speed
(
left
,
right
)
.now_or_never
()
...
...
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