Skip to content

Commit e9113c8

Browse files
Smartdashboard stuff
1 parent 8fb53f2 commit e9113c8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/main/java/org/carlmontrobotics/Constants.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,20 @@ public static final class Drivetrainc {
253253
// kP, kI, and kD constants for turn motor controllers in the order of
254254
// front-left, front-right, back-left, back-right.
255255
// Determine correct turn PID constants
256-
public static final double[] turnkP = { 51.078, 60.885, 60.946, 60.986 }; // {0.00374, 0.00374, 0.00374,
256+
public static final double[] turnkP = { 51.078, 60.885, 65.946, 100.986 }; // {0.00374, 0.00374,
257+
// 0.00374,
257258
// 0.00374};
258259
public static final double[] turnkI = { 0, 0, 0, 0 };
259-
public static final double[] turnkD = { 0/* dont edit */, 0.5, 0.42, 1 }; // todo: use d
260+
public static final double[] turnkD = { 0/* dont edit */, 0.5, 0.42, 0.5 };
261+
// public static final double[] turnkD = { 0/* dont edit */, 0.9, 0.9, /* 1.5879
262+
// */ 5.0 };
263+
// // todo: use d
264+
// // todo: use d
260265
// public static final double[] turnkS = {0.2, 0.2, 0.2, 0.2};
261266
public static final double[] turnkS = { 0.13027, 0.17026, 0.2, 0.23262 };
262267

268+
// Changed index 3 of D from 1 to 0.92
269+
// last one back right
263270
// V = kS + kV * v + kA * a
264271
// 12 = 0.2 + 0.00463 * v
265272
// v = (12 - 0.2) / 0.00463 = 2548.596 degrees/s
@@ -279,7 +286,8 @@ public static final class Drivetrainc {
279286
? new boolean[] { false, false, false, false }
280287
: new boolean[] { true, false, true, false });
281288
public static final boolean[] turnInversion =
282-
{ true, true, true, true };
289+
{ false, false, false, false };
290+
// {true, true, true, true };
283291
// kS
284292
public static final double[] kForwardVolts = { 0.26744, 0.31897, 0.27967, 0.2461 };
285293
public static final double[] kBackwardVolts = kForwardVolts;

src/main/java/org/carlmontrobotics/subsystems/Drivetrain.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,13 @@ public void periodic() {
308308
// moduleBL.periodic();
309309
// moduleBR.periodic();
310310
// double goal = SmartDashboard.getNumber("bigoal", 0);
311+
311312
for (SwerveModule module : modules) {
312313
module.periodic();
313314
// module.move(0, goal);
314315
}
316+
modules[3].getCurrentPosition();
317+
SmartDashboard.putNumber("Module3CurrentPos", modules[3].getCurrentPosition().angle.getDegrees());
315318

316319
// field.setRobotPose(odometry.getPoseMeters());
317320

0 commit comments

Comments
 (0)