docs.rs failed to build cu-pid-0.3.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
cu-pid-0.11.0
This is a Generic PID Controller
Check out cu_rp_balancebot for a full example of how to use it.
Task and Input
To be able to use it, you need to specialize it before you can reference it in your copper RON config:
// in mymod.rs
use GenericPIDTask;
pub type MyPID = ;
// MyPayload needs to implement an Into<f32> trait to be able to be used as a reference for the PID controller
Then you can use it in your copper RON config:
(
id: "my_pid",
type: "mymod::MyPID", // Set your type alias here
config: {
"kp": 0.015,
"kd": 0.01,
"ki": 0.00005,
"setpoint": 3176.0,
"cutoff": 170.0,
},
),
[...]
Configuration
kp: Proportional gainki: Integral gainkd: Derivative gainsetpoint: The target valuecutoff: The +/- deviation from the setpoint that is considered acceptable, otherwise the PID will return None ( safety mode)
Output
The PID controller will return a full state with the p, i and d contributions in PIDControlOutput struct: