Skip to content
Snippets Groups Projects
Commit efabcaa4 authored by Samuel Tardieu's avatar Samuel Tardieu
Browse files

Stay in control mode at (0, 0) speed

parent 058814fc
No related branches found
No related tags found
1 merge request!56Stay in control mode at (0, 0) speed
Pipeline #101139 passed
......@@ -305,7 +305,7 @@ dependencies = [
[[package]]
name = "controller"
version = "1.3.0"
version = "1.3.1"
dependencies = [
"bootloader-params",
"build-support",
......
......@@ -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.
......
......@@ -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"
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment