From 6fa5c986a6f9cadf4ca085426671e895dbb1ba96 Mon Sep 17 00:00:00 2001 From: lukesta182 <33330639+lukesta182@users.noreply.github.com> Date: Thu, 21 Mar 2019 15:11:32 -0600 Subject: [PATCH] fix arm on com bot, will not work on practice inverted sensor phase --- .../java/org/usfirst/frc4388/robot/subsystems/Arm.java | 9 +++++---- .../java/org/usfirst/frc4388/robot/subsystems/Drive.java | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java index 99ec677..44027e0 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java @@ -146,10 +146,11 @@ public class Arm extends Subsystem implements ControlLoopable motor1.configPeakOutputReverse(-1, TalonSRXEncoder.TIMEOUT_MS); motor1.selectProfileSlot(MM_SLOT, 0); - //motor1.config_kF(MM_SLOT, F_Value, TalonSRXEncoder.TIMEOUT_MS); + motor1.config_kF(MM_SLOT, F_Value, TalonSRXEncoder.TIMEOUT_MS); motor1.config_kP(MM_SLOT, P_Value, TalonSRXEncoder.TIMEOUT_MS); motor1.config_kI(MM_SLOT, I_Value, TalonSRXEncoder.TIMEOUT_MS); motor1.config_kD(MM_SLOT, D_Value, TalonSRXEncoder.TIMEOUT_MS); + motor1.setSensorPhase(true); motor1.configForwardLimitSwitchSource(limitSwitchSource, LimitSwitchNormal.NormallyOpen, 0); motor1.configReverseLimitSwitchSource(limitSwitchSource, LimitSwitchNormal.NormallyOpen, 0); @@ -331,7 +332,7 @@ public class Arm extends Subsystem implements ControlLoopable // Do the update if (armControlMode == ArmControlMode.JOYSTICK_MANUAL) { controlManualWithJoystick(); - //System.err.println(motor1.getControlMode()); + System.err.println(motor1.getControlMode()); } else if (!isFinished) { if (armControlMode == ArmControlMode.MOTION_PROFILE) { @@ -340,11 +341,11 @@ public class Arm extends Subsystem implements ControlLoopable } if (armControlMode == ArmControlMode.JOYSTICK_PID){ controlPidWithJoystick(); - //System.err.println(motor1.getControlMode()); + System.err.println(motor1.getControlMode()); } if (armControlMode == ArmControlMode.MOTION_MAGIC){ controlMMWithJoystick(); - //System.err.println(motor1.getControlMode()); + System.err.println(motor1.getControlMode()); } /*else if (armControlMode == ArmControlMode.MP_PATH_VELOCITY) { diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java index f287c6f..166c217 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java @@ -266,7 +266,7 @@ public class Drive extends Subsystem implements ControlLoopable //rightDrive1.setVoltageRampRate(VOLTAGE_RAMP_RATE); //rightDrive1.setNominalClosedLoopVoltage(12.0); rightDrive1.clearFaults(); - rightDrive1.setInverted(false);//false on comp, false on practice + rightDrive1.setInverted(true);//false on comp, false on practice //rightDrive1.setSensorPhase(true);//true on comp 2108, true on microbot //rightDrive1.setSafetyEnabled(false); rightDrive1.setIdleMode(IdleMode.kBrake);