All pages
Powered by GitBook
1 of 1

Loading...

Programming - Flywheel

The largest function within the program is that for the flywheel control. Let's break it down!

Full flywheel control function

Manual Flywheel Control

Manual controls for the flywheel motor

At the beginning of the flywheelControls function is the manual control for the flywheel. When triangle is held, the flywheel will spin up to the targetVelocity BUT the feeder will not activate.

When square is held, the flywheel will spin in reverse near half power. This is intended to help with unsticking or repositioning game pieces if needed.

Flywheel Auto Sequence

The flywheel sequence for controlling the feeder and flywheel together

Next is the sequence for the flywheel and feeder to activate together. When the flywheel spins up to the targetVelocity while left bumper is held, the feeder will wait until the current velocity is within range before also turning on. This is intended to prevent game pieces feeding too early for more consistent launches!

It's recommended to take some time testing this on your specific robot and making adjustments to this range based on your team's preferred launch location and robot set up.

Manual Feeder Control

Manual control for the feeder servo

The feeder is controlled by a servo and intended to allow control of how the game pieces feed down into the flywheel.

Similar to the flywheel, there are manual controls for the servo feeder. When up on the dpad is pressed, the feed will move game pieces into the chute for the flywheel. When down on the dpad is pressed, the servo will spin in reverse pushing game pieces back into the intake. This is intended to help with unsticking or repositioning game pieces.

Disabling Actuators

The end of the flywheel function where the actuators turn off

Lastly, if no button in the if/else statement is currently pressed then the flywheel motor and servo will be set to 0 power to be turned off.