Skip to content

Conversation

@qwertychouskie
Copy link

  • During the 1 second catapult retraction, you would loose control over the entire rest of the robot. If the robot is driving while the retract button is pressed, that 1 second is definitely enough to have the robot end up running into something it shouldn’t. The irony is that after the 1 second wait, the motor power never got changed, so it was unnecessary as written. Changed to use a proper timer, and added a variable for hold power (this should be tested on a real robot and adjusted accordingly!)
  • There were a couple calls to setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE) in the loop, these do nothing as these motors are already set to BRAKE in the init section.
  • The runmodes of all the motors are now initialized and encoders reset, making sure nothing carries over from other OpModes.

Mistakes are possible, please test on a real robot :)

- During the 1 second catapult retraction, you would loose control over the entire rest of the robot. If the robot is driving while the retract button is pressed, that 1 second is definitely enough to have the robot end up running into something it shouldn’t.  The irony is that after the 1 second wait, the motor power never got changed, so it was unnecessary as written.  Changed to use a proper timer, and added a variable for hold power (this should be tested on a real robot and adjusted accordingly!)
- There were a couple calls to setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE) in the loop, these do nothing as these motors are already set to BRAKE in the init section.
- The runmodes of all the motors are now initialized and encoders reset, making sure nothing carries over from other OpModes.
@drwho495
Copy link

@qwertychouskie you absolutely should not power the lift on all of the time. You can do a homing process to fix this. I will make a fork of this repo then send you a link so you can cherrypick my changes.

We used 0.1 power for hold and 0.4 seconds for down time, but I put 0.15 and 0.5 here just for a bit of extra margin (different motors/batteries/etc may be slightly different).
Before this, the motor stalling issue would still exist when the catapult was in the UP state.
@qwertychouskie
Copy link
Author

20f6a4d is only a partial fix, as leaving the catapult up will still burn out the motor. The code here should fix all situations that cause motor burnout, and also makes the driver experience better (catapult auto-retracts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants