Season 2022 sussy play ppid omg#76
Conversation
| PIDController(LiftPIDCoefficients.kI, LiftPIDCoefficients.kI, LiftPIDCoefficients.kD, LiftPIDCoefficients.kF), | ||
| LIFT_MAX_EXTENSION, | ||
| LIFT_MIN_EXTENSION, | ||
| LINEAR_SLIDE_TOLERANCE, |
There was a problem hiding this comment.
Need to make this Lift-specific. It's only used in the lift (fetcher tolerance is a literal constant now)
| null, | ||
| with (FetcherTelePIDCoefficients){PIDController(kP, kI, kD, kF)}, | ||
| FETCHER_MAX_EXTENSION, | ||
| 25, |
There was a problem hiding this comment.
Make this a constant for FETCHER_TOLERANCE
| const val LIFT_MAX_EXTENSION = 900 | ||
| const val LIFT_MAX_EXTENSION = 3.02 | ||
| const val LIFT_MIN_EXTENSION = 0.992 | ||
| const val LIFT_SENSITIVITY = 16.0 |
There was a problem hiding this comment.
With the max range of the lift changed from 900 counts to 2.0 volts, make sure this was scaled down similarly.
| const val FETCHER_SENSITIVITY = 44.0 | ||
| const val FETCHER_MAX_EXTENSION = 900 | ||
| const val LINEAR_SLIDE_TOLERANCE = 5 | ||
| const val LINEAR_SLIDE_TOLERANCE = 5.0 |
There was a problem hiding this comment.
With the max range of the lift changed from 900 counts to 2.0 volts, make sure this was scaled down similarly.
| const val kF = 0.0 | ||
|
|
||
| } | ||
|
|
There was a problem hiding this comment.
With the max range of the lift changed from 900 counts to 2.0 volts, the gains probably need to be scaled up so that more power is generated from a small difference in positions.
| init { | ||
| assert(maxExtensionPosition > minExtensionPosition) { "maxExtensionPosition must be greater than minExtensionPosition" } | ||
| assert(maxCorrectionPower > 0 && maxCorrectionPower < 1.0) { "maxExtensionPower must be between 0 and 1"} | ||
| assert(tolerance >= 0) { "tolerance must be greater than or equal to 0" } |
| liftPotentiometer), | ||
| fetcher = LinearSlide(fetcher, | ||
| null, | ||
| with (FetcherTelePIDCoefficients){PIDController(kP, kI, kD, kF)}, |
There was a problem hiding this comment.
Wait what? Fetcher was not supposed to change in the PR!!!!
| with(LiftPIDCoefficients){ | ||
| hardware.lift.motor.setVelocityPIDFCoefficients(kP, kI, kD, kF) | ||
| hardware.lift.motor.setPositionPIDCoefficients(15.0) | ||
| } |
There was a problem hiding this comment.
This should be deleted. We are not using the internal lift PID anymore
| // telemetry.addData("Fetcher power", hardware.fetcher.extensionPower) | ||
| telemetry.addData("Lift encoder value: ", hardware.lift.extensionEncoder) | ||
| // telemetry.addData("Lift encoder value: ", hardware.lift.extensionEncoder) | ||
| telemetry.addData("Lift encoder value: ", hardware.lift.motor.encoderPosition) |
There was a problem hiding this comment.
Delete this entry, made redundant below.
| telemetry.addData("Lift encoder value: ", hardware.lift.extensionEncoder) | ||
| // telemetry.addData("Lift encoder value: ", hardware.lift.extensionEncoder) | ||
| telemetry.addData("Lift encoder value: ", hardware.lift.motor.encoderPosition) | ||
| telemetry.addData("Lift set point: ", hardware.lift.extensionSetPoint) |
There was a problem hiding this comment.
Delete this entry, made redundant below.
Not sure this will work, but I will review it here.