Repository navigation
Shooter Subsystem Rework: Add Rotor Subsystem - #114
Open
CanineSatsuma6 wants to merge 4 commits into
Open
CanineSatsuma6 wants to merge 4 commits into
CanineSatsuma6 wants to merge 4 commits into
Conversation
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.
Note: This PR is one of several in a series of PRs designed to rework our shooter subsystem to address issues with maintainability and readability and reintroduce some semblance of simplicity. Any PR that's merging into the
shooter-subsystem-reworkbranch and NOTmainis a part of this series.Background
This PR adds in the "Rotor" component of the larger shooter subsystem. It also lays a foundation for how other components of the shooter subsystem will be created. Important notes include:
setVoltsthat sets the motor volts and a function calledcmdSetVoltswhich returns a command to execute thesetVoltsfunction, you can instead get the command by calling_component.commands.setVolts();. Not strictly necessary, but the code looks nicer in my opinion.Code Structure
The overall design for the rotor code looks something like this:
erDiagram Rotor ||--|| RotorIO : "uses" RotorIO ||--|| RotorIOReal : "is (real robot)" RotorIO ||--|| RotorIOSim : "is (simulated robot)" Rotor ||--|| RotorIOInputs : "uses" RotorIOInputs ||--|| RotorIOReal : "provides" RotorIOInputs ||--|| RotorIOSim : "provides"Rotor Behavior
The idea for how the rotor will be controlled is simple: instead of supplying a voltage when turning the rotor on, we will now supply an angular velocity. This will allow us to feed fuel into the feeder more consistently and under different loads (e.g. low battery or full hopper).
The PID controller for velocity control will need some tuning. I set up simulation to get something close to make sure the logic was behaving mostly correct. When setting the desired velocity to 100 RPM, I get the below plots of applied voltage and measured velocity: