add control for shooter, intake and indexer - #6
Merged
Merged
Conversation
The stop binding called setshooterstate, which does not exist, so the build failed.
Right trigger ran the indexer but stopped the intake, so balls waiting where the intake meets the indexer never got in. Tested on the prototype on 30 Sep: balls now pass the handoff.
A jammed indexer drew 8.4 to 11.2 A at 0 ticks/s on the prototype, and held that for as long as the trigger was down. While shooting, the indexer's current and velocity are now sampled every 50 ms; above 7 A and under 150 ticks/s for 0.3 s counts as a jam, and the indexer backs off at -0.6 for 0.2 s before feeding again. After 3 back-offs in one press, the next jam leaves it off until the trigger is released and pressed again. The intake pauses while the indexer backs off, so it doesn't pack the jam tighter. The decision logic is IndexerStallGuard, pure and unit tested against the measured jam. Telemetry shows the indexer's feed state, current and speed, and each jam is logged to logcat under the tag BioBuzz.
In RUN_USING_ENCODER the hub turns power 1.0 into a velocity target of 85% of the motor's rated speed, about 5100 RPM on the 6000 RPM goBILDA motors. SHOOT now switches the shooter to RUN_WITHOUT_ENCODER so power 1.0 is full battery voltage; IDLE and EJECT switch back to closed loop as before. GobildaMotor.setMode clears the cached power on a mode change, since IDLE and SHOOT both use power 1.0 and the cache would otherwise skip the write.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Refactor control logic to have state machines for each subsystem, which controls the subsystem. Then control the state in Robot.java, allowing for easy keybinding.
See ## Controls for new controls.
Shooter
During init, the shooter spins up to full power.
When controller tries to shoot, it will spin the indexer, bringing balls to the shooter.
Tested on the robot
Yes.
Shooter, intake and indexer working.
Controls
Shoot: Right trigger.
Intake: Left trigger.
Eject: East button.
Stop: West button.