Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit a6a1bc6

Browse files
authored
Merge pull request #57 from Gabe-Mitnick/master
Add current limiting
2 parents f6fa6e5 + 4c443c3 commit a6a1bc6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Robot2018/src/org/usfirst/frc/team199/Robot2018/RobotMap.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,20 @@ public class RobotMap {
6868
* the TalonSRX to configure
6969
*/
7070
private void configSRX(WPI_TalonSRX mc) {
71+
// stuff cole said to put
7172
int kTimeout = (int) Robot.getConst("kTimeoutMs", 10);
7273
mc.configNominalOutputForward(0, kTimeout);
7374
mc.configNominalOutputReverse(0, kTimeout);
7475
mc.configPeakOutputForward(1, kTimeout);
7576
mc.configPeakOutputReverse(-1, kTimeout);
77+
78+
// current limiting stuff cole said to put
79+
mc.configPeakCurrentLimit(0, 0);
80+
mc.configPeakCurrentDuration(0, 0);
81+
// 40 amps is the amp limit of a CIM. also, the PDP has 40 amp circuit breakers,
82+
// so if we went above 40, the motors would stop completely.
83+
mc.configContinuousCurrentLimit(40, 0);
84+
mc.enableCurrentLimit(true);
7685
}
7786

7887
/**
@@ -83,6 +92,7 @@ private void configSRX(WPI_TalonSRX mc) {
8392
* the VictorSPX to configure
8493
*/
8594
private void configSPX(WPI_VictorSPX mc) {
95+
// stuff cole said to put
8696
int kTimeout = (int) Robot.getConst("kTimeoutMs", 10);
8797
mc.configNominalOutputForward(0, kTimeout);
8898
mc.configNominalOutputReverse(0, kTimeout);

0 commit comments

Comments
 (0)