Skip to content

Commit 779e242

Browse files
Remove unused PID controller code
Removed commented-out PID controller configuration and methods.
1 parent 623834b commit 779e242

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lib/motor-controllers/thrifty-nova.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ export const getInitialization = () => `motor = new ThriftyNova(canID);
77
// Configure motor
88
motor.setBrakeMode(brakeMode);
99
10-
// // Configure PID controller
11-
// pidController = motor.getPIDController();
12-
// pidController.setP(kP);
13-
// pidController.setI(kI);
14-
// pidController.setD(kD);
15-
1610
// Set ramp rates
1711
{{#if enableOpenLoopRamp}}
1812
motor.setOpenLoopRampRate(openLoopRampRate);
@@ -40,13 +34,9 @@ export const getMethods = () => ({
4034

4135
getVelocityMethod: `return encoder.getVelocityQuad() / gearRatio;`,
4236

43-
setPositionMethod: `double adjustedPosition = position * gearRatio;
44-
double ffVolts = feedforward.calculate(getVelocity(), acceleration);
45-
pidController.setReference(adjustedPosition, ControlMode.POSITION, ffVolts);`,
37+
setPositionMethod: ``,
4638

47-
setVelocityMethod: `double adjustedVelocity = velocity * gearRatio;
48-
double ffVolts = feedforward.calculate(velocity, acceleration);
49-
pidController.setReference(adjustedVelocity, ControlMode.VELOCITY, ffVolts);`,
39+
setVelocityMethod: ``,
5040

5141
setVoltageMethod: `motor.setVoltage(voltage);`,
5242

0 commit comments

Comments
 (0)