ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
https://docs.ctre-phoenix.com/en/latest/ch16_ClosedLoop.html#calculating-velocity-feed-forward-gain-kf
2
Falcon500Motor UsedFalcon 500 Intergrated EncoderEncoder Used
3
12.6.2. Motion Magic Closed-Loop Walkthrough – Collect Sensor Data – JavaEnter User Data
4
21690units per 100msReturned Data
5
10.54961089Rev per 100ms2056
Feedback Native Units
6
6330RPM
7
Sanity check (Motor RPM)
8
6380Motor RPMSport 57lower chain to Upper10 turn Pot
9
1Gear Box ~ratio** at the encoder80 : 1 X28 : 22 X 10
10
6380~ mesured RPM801.272727273101018.181818
11
12.6.3. Motion Magic Closed-Loop Walkthrough – Calculate F-Gain – Java
12
0.04716459198F-gain = (100% X 1023) / units per 100ms
13
14
1023 =~1024
15
16
12.6.4. Motion Magic Closed-Loop Walkthrough – Initial Cruise-Velocity/Acceleration – Java
17
Initial Cruise-Velocity (arbitrarily% * units per 100ms)
18
0.25% of the top speed.
19
5423Initial Cruise VelocityWarning Value is Greater than mesured max
20
21
Initial acceleration value (arbitrarily acceleration is in terms of change in velocity per second
22
2Sec
23
2711.25Initial acceleration
24
25
12.6.5. Motion Magic Closed-Loop Walkthrough – P-Gain – Java
26
1475Given an error
27
10%% of motor output can start typically at 10%
28
0.0693559322P-gain = (% motor output X 1023) / (error)
29
Sanity check (error * P-gain) / % motor = 1023
30
1023 =~1023
31
*Tune P-Gain
32
0.069Final P-gain Value
33
34
35
12.6.6. Motion Magic Closed-Loop Walkthrough – D-Gain – Java
36
10D-gain can start typically at 10 X P-gain
37
0.69D-Gain
38
39
12.6.7. Motion Magic Closed-Loop Walkthrough – I-Gain – Java
40
0.001I-gain if required start ~.001
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100