Author Topic: Autonomous Modes and Algorithms  (Read 8601 times)

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Autonomous Modes and Algorithms
« 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
  • Drive to Outer Works. Use gyro to guide distance traveled. Simplest auto mode. Can start from any position on the field.
  • Drive under Low Bar into Courtyard to shoot boulder. Do this from directly behind the Low Bar. Use corner shooting postion.
  • Drive under Low Bar into Courtyard to shoot boulder. Allow an alliance partner to occupy the space inline with the low bar. We take an adjacent space and must maneuver to that lane before going under the Low Bar. (Will there be enough time? What shooting position to use if ours is already taken?)
  • Drive through some of the other defenses - Rampart, Rock Wall, Rough Terrain, Moat. Start directly in front of that defense. Shoot to middle upper goal or right corner position (?) Have 4 different starting positions to choose from.
  • Drive through some of the other defenses - Portculis, Cheval de Fris - if our hardware allows us to do this. Start directly in front of that defense. Shoot to middle upper goal or right corner position (?) Have 4 different starting positions to choose from.
  • Start in the Spy Box with a Boulder and shoot it. This may be a good option if we can get a reliable shot from the corner. No points for taking care of the defenses but you get points for the goal. It's a tradeoff.
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.
  • Mode selection switch - anywhere from 1 to 5 or more choices. This is either 4 DIO pins, or 3 DIO with binary encoding, or 1 analog input.
  • Starting position - at most 4 choices (if we ignore the Low Bar position). This is either 4 DIO pins, or 2 DIO with binary encoding, or 1 analog input.
  • Defense selection - at most 9 choices, but if we ignore the Drawbridge, Sally Door, and Low Bar, we're down to 6. If we ignore the Portculis and Cheval de Fris we're at 4. So it up to 9 DIO pins, 4 DIO with binary encoding or 1 analog input.
Algorithms
« Last Edit: February 09, 2016, 02:12:18 PM by Louis L »

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #1 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.

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #2 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.

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #3 on: February 17, 2016, 10:59:34 PM »
We went over the possible autononous modes. We have 2 wiring options.
  • (did not use this) wire each of 2 six-position rotary switches in series for a total of 11 possible options to 1 analog input.
  • (did this) wire each of 2 six-position rotary switches individually to 2 different analog inputs.
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:
  • (position 1) Disable autonomous - do nothing
  • (position 2) Drive to Outer-Works (2 pts)
  • (position 3) Drive through defense from whatever position we're starting from, into the courtyard (10 pts)
  • (position 4) Start from Spy location and shoot Boulder into 'a' (10 pts)
  • (position 5) Cross defense and shoot - see Switch 2 below
  • (position 6) Unused
Switch 2 - Analog Input 3:
  • (position 1) Drive through defense '1' and shoot Boulder into 'a' (20 pts)
  • (position 2) Drive through defense '2' and shoot Boulder into 'a' (20 pts)
  • (position 3) Drive through defense '3' and shoot Boulder into 'b' (20 pts)
  • (position 4) Drive through defense '4' and shoot Boulder into 'b' (20 pts)
  • (position 5) Drive through defense '5' and shoot Boulder into 'b' (20 pts)
  • (position 6) Unused
« Last Edit: February 18, 2016, 05:58:12 PM by Louis L »

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #4 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.
« Last Edit: February 18, 2016, 03:59:39 PM by Louis L »

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #5 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:
  • (position 1, 4.0v) Disable autonomous - do nothing
  • (position 2, 3.2v) Drive to Outer-Works (2 pts)
  • (position 3, 2.4v) Drive through defense from whatever position we're starting from, into the courtyard (10 pts) - see Switch 2 below
  • (position 4, 1.6v) Start from Spy location and shoot Boulder into 'a' (10 pts)
  • (position 5, 0.8v) Cross defense and shoot - see Switch 2 below (20 pts)
  • (position 6, 0.0v) Unused
Switch 2 - roboRio Analog Input 3:
  • (position 1, 4.0v) Starting position is '1'
  • (position 2, 3.2v) Starting position is '2'
  • (position 3, 2.4v) Starting position is '3'
  • (position 4, 1.6v) Starting position is '4'
  • (position 5, 0.8v) Starting position is '5'
  • (position 6, 0.0v) Unused
« Last Edit: February 21, 2016, 11:24:15 AM by Louis L »

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #6 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.

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #7 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.

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #8 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.

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #9 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.

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: Autonomous Modes and Algorithms
« Reply #10 on: March 06, 2016, 08:59:48 AM »
One more thing. The settling time for hold 2 cradle is now 1 second.