-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathcopperconfig.ron
68 lines (61 loc) · 1.94 KB
/
copperconfig.ron
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(
tasks: [
(
id: "balpos",
type: "cu_ads7883_new::ADS7883",
),
(
id: "railpos",
type: "cu_rp_encoder::Encoder",
config: {
"clk_pin": 26,
"dat_pin": 20,
},
),
(
id: "balpos_pid",
type: "tasks::BalPID",
config: {
"kp": 0.015, // 0.02 1 / 168 ticks = .00593
"kd": 0.01,
"ki": 0.0,
"setpoint": 3072.0, // the perfect sim
"cutoff": 170.0, // cut off if the measured value is outside of +/- 170 ticks around the setpoint
},
),
(
id: "railpos_pid",
type: "tasks::PosPID",
config: {
"kp": 0.0005, // 0.02 1 / 168 ticks = .00593
"kd": 0.5,
"ki": 0.0,
"setpoint": 0.0,
"cutoff": 1000.0, // cut off if the it is about to hit the side of the rail
"sampling_ms": 100,
},
),
(
id: "merge_pids",
type: "tasks::PIDMerger",
),
(
id: "motor",
type: "cu_rp_sn754410_new::SN754410",
config: {
"deadzone": 0.3, // this is the minimum value for the motor to move.
"dryrun": false,
},
),
],
cnx: [
(src: "balpos", dst: "balpos_pid", msg: "cu_ads7883_new::ADSReadingPayload"),
(src: "railpos", dst: "railpos_pid", msg: "cu_rp_encoder::EncoderPayload"),
(src: "balpos_pid", dst: "merge_pids", msg:"cu_pid::PIDControlOutputPayload"),
(src: "railpos_pid", dst: "merge_pids", msg:"cu_pid::PIDControlOutputPayload"),
(src: "merge_pids", dst: "motor", msg:"cu_rp_sn754410_new::MotorPayload"),
],
monitor: (
type: "cu_consolemon::CuConsoleMon",
)
)