• Welcome to Redshift Project Depot.

Algorithm for intake

Started by Louis L, January 27, 2016, 11:52:14 PM

Previous topic - Next topic

Louis L

I talked to Steffen and Ed about the intake. There are three intake functions

  • Get ball from ground and put into Hold.
  • Deliver ball from Hold to shooter Cradle *.
  • Flush ball from Hold under low roller. This can be used as a low speed shooter if necessary.
  • Shoot low ball. This is a higher speed shot with force, using the upper and lower roller. It should be useful for scoring into the low goal.
Function 1

  • Check the Hold sensor to make sure Hold is empty. If not empty, don't proceed.
  • Engage lower roller.
  • Wait for Hold sensor to detect ball.
  • Shut off motors.
Function 2 *

  • Check the Hold sensor to make sure the Hold is not empty. If empty, don't proceed.
  • Engage upper and lower roller.
  • Wait for hold sensor to detect ball.
  • Shut off motors.
Function 3

  • Don't check Hold sensor because this function can be used as a non-automated mode
  • Engage lower roller to flush boulder. Do this as long as button is pressed.
  • Shut off motor
Function 4

  • Check for Hold sensor. If there is no ball, do nothing.
  • Engage lower roller and reverse upper roller.
  • Wait for Hold sensor to no longer have ball.
  • Pause to allow ball to exit.
  • Check 1 second timeout. If the timed-out, bail out now and reset. state.
  • Shut off motors.
* Note that function 2 does not exist if we do the Boulder shot all in one motion. The Boulder still has to make its way into the catapult but there is not controller button for it.

Louis L

One of the unknowns is whether our Boulder shooter will be primed most of the time or not. By "primed" I mean that the catapult has been pulled back and is ready to trigger at any time. It obvious danger here is that if there's a Boulder loaded, the catapult may trigger accidentally if bumped (or some other way). Also in order to have this priming stage, we need a way to detect and set this physical condition on the catapult.

The alternative is to do the shooting all in one motion - that is prime, load Boulder, trigger. We probably would still need a pause at the prime position to allow the Boulder to be loaded but we can place that burden on the motor for a little bit. The downside of this setup is the speed with which all this takes place. We can't just shoot when we want to. Of course this may not be an issue if defensive play is not possible - it's hard to tell from the rules what is legal and what is now; the rules seem to want some level of defense yet forbid most of it!

The upshot is that if we it all in one motion, then Function 2 does not exist by itself; it becomes part of the shooting routine and not standalone.

Louis L

Important info on the intake motors voltage/direction.

The lower motor:

  • use a negative voltage to flush
  • use a positive voltage to intake Boulder to Hold
  • use a positive voltage for low shot
The upper motor:

  • use a positive voltage for low shot
  • use a negative voltage to bring Boulder from Hold to Cradle

Louis L

We're adding a motor to lift and drop the intake mechanism.

There are 3 positions for the intake - Up, Float, PressDown

Button Left Trigger - while pressed, will press the intake down to keep the intake from bouncing. If the intake is Up, this does nothing.
Button B - while pressed, will perform a low-shot (combination of flush with press-down).
Button Y - toggle between the intake in the "up" and "float" position. This button can be toggled before the previous state has been reached (allows up/float to change mid-stride)
For all other buttons, the intake must be in the Floating position.

If Intake is Up
  ? Can we shoot with a Boulder
  no other intake action is allowed
If Intake is Floating
  Same as before
If Intake is PressedDown
  no other intake action is allowed

Left trigger has priority over any other intake buttons
Y button has 2nd highest priority
B button - priority is where it was before

Encoder values - we have 497 ticks per output shaft revolution.
(1) Reset at the beginning of the world
(2) To account for drift errors, the Up position will be count < 21
(3) the Float position will be [TBD] +/- 21 (try and center within range)