Take Back Half Ball Shooter Algorithm By Willem Scholten 1 TBHalgorithm.key - November 18, 2015
Take Back Half Ball Shooter Algorithm
By Willem Scholten
1 TBHalgorithm.key - November 18, 2015
0
10
20
30
40
50
60
70
1 16
31
46
61
76
91
106
121
136
151
166
181
196
211
226
241
256
271
286
301
316
331
346
361
376
391
406
421
436
451
466
481
496
511
526
541
556
571
586
601
616
631
646
661
676
691
706
721
736
751
766
781
796
811
826
841
856
871
886
TargetRPM
ActualRPM
BVoltage
Gain
Kerror
Target RPM = 50 Sampling Rate: 25ms
First Run of un-tuned TBH algorithmNotice difficulty the algorithm has to find a stable match of the target RPM. This means that both Ki and Ke are not tuned right
2 TBHalgorithm.key - November 18, 2015
Start Program
while 1==1
read IME and get tick count
calculate delta tick count
get system uptime in mSec
calculate delta time in mSec
calculate rpm based on delta tick and delta time
wait 25mSec
3 TBHalgorithm.key - November 18, 2015
Motor RPM and Fly Wheel RPM
RPM
of F
ly W
heel
0
225
450
675
900
RPM
of M
otor
0
10
20
30
40
RPMFW RPM
Sampling Rate: 25 mSec
4 TBHalgorithm.key - November 18, 2015
Motor RPM in relation to Velocity of Fly Wheel
Velo
city
m/s
of F
ly W
heel
0
1.25
2.5
3.75
5
RPM
of M
otor
0
5
10
15
20
25
30
35
40
RPMVelocity
Sampling Rate: 25 mSec
5 TBHalgorithm.key - November 18, 2015