Redshift Project Depot

FRC 2016 (Stronghold) => Robot Software => Topic started by: Louis L on January 27, 2016, 11:56:16 PM

Title: Autonomous Modes and Algorithms
Post by: Louis L on January 27, 2016, 11:56:16 PM
We should account for different autonomous possibilities. If we want to have a physical setup switch (like in 2014) we need to take into account how many DIO pins we have available!

Different Auto Modes
In 214, we used toggle switches mounted on the robot select the autonomous mode. This was nice because we did not have to rely on any communication with the DS to make autonomous work. If we do this again for 2016, we need to make sure we have enough DIO pins on the roboRio to accommodate the input selection as well as any other sensor I/O.
Algorithms
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 03, 2016, 10:24:54 PM
Matt S. and I had a conversation earlier tonight about using sensors to determine our position after we cross the Outer Works. We touched on using the sonar, and didn't think it was reliable enough. But thinking about it further, since we are hoping to mount two of them, maybe it is possible to use them.

One option is to cross far enough to get the points. Don't bother shooting. This means we use the gyro for orientation (assuming we're crossing anywhere other than the low bar), then the sonars to ensure we go far enough.

If we want to shoot, we'll have to do a lot more.

We may have to do different things depending on which path through the Outer Works we take since the Tower is in the way in the middle of the field and not on the outside.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 09, 2016, 02:13:28 PM
Added another option for autonomous - starting in the Spy Box and shooting a Boulder into the upper goal. We don't get points for crossing a defense but it's more likely we'll get points for the goal.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 17, 2016, 10:59:34 PM
We went over the possible autononous modes. We have 2 wiring options.
Here are the possible autonomous options. The robot may treat each differently or may group some together depending on how well the robot works.
The targets are named 'a', 'b' and 'c' where 'a' is the left-most upper goal and 'c' is the right-most upper goal. We don't shoot at 'c'. The defenses are named '1' to '5' going from left to right. '1' is therefore the low-bar.
Switch 1 - Analog Input 2:
Switch 2 - Analog Input 3:
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 18, 2016, 02:29:06 PM
I've made 2 rotary switches with 4.7K resistor arrays. These will be used to select the autonomous mode. Here are the voltage measurements given a 5.1 V supply as measured by the Fluke voltmeter. The actual voltage measured will depend on the supply voltage and the analog-to-digital converter in the roboRio. The software should allow for an error margin so that we can account for voltage variations.

Position # Unit 1   Unit 2   Avg Target
   1         4.328      4.332     4.3
   2         3.458      3.470     3.4
   3         2.588      2.610     2.6
   4         1.719      1.738     1.7
   5         0.851      0.868     0.8
   6         0.000      0.000     0.0

For software purposes, a voltage variance of +/- 0.2V centered about the above targets should be more than enough to detect which selection is being made.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 20, 2016, 07:53:54 PM
Another update.

I've redefined things yet again so that if we drive through the defenses but don't go under the low bar, software knows where we're starting from and will only lower the shooter to get under the low bar. For all other defenses, keep the shooter up.

Here's the new rotary switch layout and usage:

We use 2 six-position rotary switches, each wired to an analog input on the roboRio.

Here are the possible autonomous options. The robot may treat each differently or may group some together depending on how well the robot works.

The targets are named 'a', 'b' and 'c' where 'a' is the left-most upper goal and 'c' is the right-most upper goal. We don't shoot at 'c'. The defenses are named '1' to '5' going from left to right. '1' is therefore the low-bar.

Switch 1 - roboRio Analog Input 2:
Switch 2 - roboRio Analog Input 3:
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 21, 2016, 07:10:08 PM
The autonomous rotary switches are done. They are mounted in a plastic box which will be bolted on the robot. We hooked it up to the AIN on the roboRio testbed and measured the voltages - see previous post for the voltages to check for. Make sure to allow for some tolerance.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 22, 2016, 09:53:59 AM
One of the things we tested on Sunday was how to carry the Boulder at the start of the match. The rules require that the robot be fully inside its frame perimeter at the start of the match. For us this implies the intake must be vertically staged, resting against the shooter. So where will the Boulder be stored?

To drop the intake, all we need to do is move the robot forwards a short distance; physics does the rest and the intake comes down (at this moment, we don't have a driven mechanism to move the intake arm so once it's down, it's down).

If we rest the Boulder on the shooter in the "up" position, it will fall off forwards when we move the robot to drop the intake, so that's no good.

If we lower the shooter without first dropping the intake, the intake will fall onto top of the shooter and that's really bad.

Luckily we can wedge the Boulder in the intake between the rollers, then lower the intake by moving the robot forwards. This will pinch the ball in roughly the same spot against the bumper - but a little higher up. From this position we can load the Boulder into the shooter, cross the Rough Terain, etc. We should probably drive the upper roller down a little bit to better secure it against the lower roller.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on February 27, 2016, 12:16:28 PM
After playing with the accelerometer in the roboRio as well as looking at other accelerometer options, I think we should pull the plug on it and run autonomous based on time instead of distance.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on March 06, 2016, 12:27:45 AM
Here are the values for various autonomous modes:

All of these assume a Boulder is carried in the intake. Each starts with:
   0.1 seconds at 0.6 speed to lower intake. Wait 1 sec. Pinch Boulder.
   This action will move the robot forwards before doing stuff below.

Mode 1 - driving to OuterWorks -
   0.9 seconds at -0.55 speed
Mode 2 - driving over defenses at positions 2, 3, 4, 5 (not low bar) No boulder shot -
   1.75 seconds at -0.80 speed.
Mode 2 - driving under low bar at position 1; no Boulder shot -
   lower shooter with 3 second timeout,
   3.0 seconds at -0.5 speed.
Mode 3 - spybox shot
   Run do-it-all

Note - all forward speeds are negative.
Title: Re: Autonomous Modes and Algorithms
Post by: Louis L on March 06, 2016, 08:59:48 AM
One more thing. The settling time for hold 2 cradle is now 1 second.