You are on page 1of 39

1

Meet the Team

Sam Newitt-8th grade Edison MS


 Documenter
 Programmer
 Designer
 Driver (everything but the drivetrain)
Thomas Butzer-8th grade Edison MS
I have a 10 year old sister, and a 7 year old
brother who slaps me repeatedly each morning Programmer
to get me out of bed. I like playing with my toy  Designer
battlebots, building things, and anything that  Head driver (drivetrain)
involves technology and engineering. My biggest
I live with my parents and my 8 year old brother,
pet peeve is Thomas putting screws back in thewho is constantly annoying me. I like building
wrong bin. Legos and binge watching YouTube. My biggest
pet peeve is Sam getting all worked up about me
putting screws in the wrong bin.
2

Brad Newitt-AP Physics teacher at Lincoln high


school.
 Coach
I live with my beautiful wife, and 3 kids. I enjoy
golfing, basketball and exercising. My biggest pet
peeve is stoplights that are red for no reason.

LOL66-V5 robot brain


 Robot
For the majority of the year I sit on a
workbench while these two “people”
design and program me to stack cubes
and put them in towers. Which is kind
of stupid, I mean come on! Can’t you
guys stack your own cubes? My biggest
pet peeve is having to listen to these
two “humans” get into arguments over
putting screws in bins. Robo-Chicken
 Official Mascot
I am a chicken made out of Vex parts
who gets to have fun riding around on
LOL66. I enjoy intimidating our
opponents by staring at their robot
before a match. My biggest pet peeve
is occasionally getting whacked in the
head with game objects, and falling
apart.
3

7-8-19 (Design/Planning)
Game Analysis.
Today we met and watched the new game video. We took a few notes and
discussed possible strategies.

 Objects:
o Cubes: 66 total-22 of each color. 2 orange are pre-loaded to red, 2
green are pre-loaded to blue. 2 purple are given to the autonomous
winner to be placed into the field during driver control. Cubes are 5 ½
inches.
o Towers: 7 towers-2 are alliance specific. Alliance towers are 18.5
inches. Neutral towers are 18.7 in. (2), 24.7 in. (2), and 38 in (1).
o Scoring zones: Surrounded by a 1-inch triangle bump. The small goal
is 10 X 10 In, Big goal is 10 X 15.5 In.
4

 Scoring:
o (1+However many cubes of that color are in towers) points for each
scored cube.
o 6 points for autonomous bonus-3 for each team if a tie.
 Other important rules:
o No expansion limit.
o SG1: There is not starting tile this year, you just place your robot
against the wall. We will need a good liner-upper for autonomous.
o SG2: You must stay on your side during autonomous.
o SG3: You can’t touch another robot in their protected zone, and you
can’t enter the inner protected zone.
o RSC1: In skills, all cubes count as the same color.

Design Brief
Problem statement: We need to score more points than the opposing
alliance by scoring cubes in goals and placing cubes in towers.
Design statement: Design, build and compete with a robot that is able to
efficiently and effectively score points in the 2019-20 Vex robotics competition,
tower takeover.
Constraints:
 The robot must be within an 18”x18”18” size limit (at the start of the
match) (G4).
 The robot can only be made with Vex material (R5)
 The robot can have no more than 8 V5 smart motors (R17)
 The robot must be able to handle minor bumps by other robots (G12)
 The robot cannot intentionally detach parts (G5).
5

7-11-19 (Design/Planning)
Today we brainstormed ideas for our robot. The robot will have 2-3 systems, the
drive, cube intake thingy, and possibly lift. Today we wrote down and rated
possible systems

Drive and base


Criteria/Constraints: There isn’t anything too in particular we need from the drive
this year, as opposed to other years. It must be able to get over a 1-inch bump,
but most reasonable drives can do that. And, as always, it must be well built, and
somewhat compact.
 H-drive:
o An H-drive consists of two sides, each with one regular tire and one
omni wheel, which are attached in the middle by another beam.
Sometimes H-drives are made with 5 omni wheels, the 5th going
sideways, to allow the robot to move from side to side. This year, we
probably wouldn’t do that, because it would likely take 5 motors,
which is over half.
o Pros:
 Usually pretty stable.
 We have the materials.
 Pretty compact.
o Cons:
 Not as fast.
 Not as easy to drive.
 X-drive:
o An X-drive consists of 4 omni wheels, each angled at 45 degrees.
o Pros:
 Very fast.
 Can move on 2 axis. (Go forward, backward, left, right and
diagonal, making it very easy to drive).
 Pretty compact.
o Cons:
 We would need to get more omni wheels.
6
7

 Mecanum drive
o A standard 4-directional drive, but the special mecanum wheels
allow it to go sideways.
o Pros:
 Can move on 2 axis. (Go forward, backward, left, right and
diagonal, making it very easy to drive).
o Cons:
 Not as fast.
 Not very compact.
 We would need more wheels.
Idea X-drive Rank H-drive Rank Mecanum Rank
drive
Compact- Pretty compact 2 Definitely 3 Not compact 1
ness compact
Fast? Faster than the 3 Medium fast. 2 Medium fast. 2
other two.
Easy to Yes, you can go 3 Not as easy to 2 Yes, you can go 3
drive in all maneuver, but in all directions
directions. we have a lot
of experience
with H-drive
Cost (do Yes, we need 1 No. 3 Yes, we need 1
we need more omni mecanum
to buy wheels. wheels
more?)
Total 9 10 7
Looks like we’ll be going with the H-drive
8
9

Cube Intake/Lift
Criteria/Constraints: The cube intake/lift needs to be able to easily pick up cubes
and stack a lot of them at a time. Then it needs to deposit that stack in the zones
efficiently, and without tipping it over. It needs to be able to easily take cubes in
and out of towers. It would be nice if it could stack on top of cubes that have
already been scored. It would also be great if it could pick up the pre-built stacks.
 DR4B with conveyer belt stacker:
o This would be two vertical conveyors that pick the cube up off of the
ground.
o Pros:
 Probably could pick up cubes pretty easily.
 Could stack on scored cubes.
 Could get cubes easily in and out of towers.
o Cons:
 To score cubes, the lift would have to be lifted up very
tediously.
 Can’t grab pre-made stacks.
 DR4B with rollers:
o This would be two rollers that pick cubes up off the ground and
stacks them in a vertical channel.
o Pros:
 Can easily pick up cubes.
 Could stack on scored cubes.
 Could get cubes easily in and out of towers.
o Cons:
 To score cubes, the lift would have to be lifted up very
tediously.
 Can’t grab pre-made stacks.
10
11

 Tray stacker
o A very complex design: There would be a tilting tray with rollers to
suck cubes in. The rollers could open and close and are on a lift to put
cubes in towers.
o Pros:
 Can pick up cubes easily.
 Could probably get cubes in and out of towers.
 Can easily let the cubes go.
 Can stack a lot of cubes
o Cons:
 Can’t grab pre-built stacks.
 Can’t stack on existing scored cubes.
 DR4B Claw stacker with “door”
o A claw stacks cubes in a vertical channel, which can open the front to
let cubes out.
o Pros:
 Can pick up cubes
 Can score on other scored cubes
 Can easily score the cubes
 Can grab pre-built stacks
 Could probably score in towers
o Cons:
 Might be a bit heavy for the lift
12
13

Idea DR4B w/ Rank DR4B w/ Rank Tray Rank DR4B w/ Rank


conveyor rollers stacker claw &
door
Pick up Yes 4 Yes 4 Yes 4 Yes 4
cubes?
Let the No. 1 No 1 Yes 4 Yes. 4
cubes
out easy
Score/de Definitely 4 Definitely 4 Definitely 4 Maybe a 3
-score little
towers difficult
Stack on Maybe a 3 Maybe a 3 No 1 Yes 4
existing little little
stacks difficult difficult
Grab pre- Maybe a 3 Maybe a 3 No 1 Yes 4
built little little
stacks. difficult difficult
How 5-6 3 5-6 3 7-8 4 5-6 3
many
cubes?
Total 18 18 18 24
DR4B with claw and door is the winner!
Robot Specs:
Motors (V5):
 4 motor drive
 2 motor DR4B
 1 motor claw
 1 motor door
14

Approximate metal distribution:


*=Aluminum, H=Hole
 Drive
o 2 35H and 2 35H* C-channels front to back.
o 1* 35H L-channel and 1 35H X 5H C-channel for cross-bars.
 DR4B
o 2 25H L-channels for the towers
o 4 35H* C-channels for the 1st four-bar.
o 2 35H* L-channels, 2 25H C-channels, and 2 25H* C-channels for the
middle section.
o 4 25H* C-channels for the 2nd four-bar.
 Intake
o 4 25H L-channels for the non-extending part.
o 4 25H Interlocking C-channels for the extenders.
o 3 35H* L-channels and 1 35H X 5H plate for the extension.

7-22-19 (Design/Planning)
Today we discussed possible strategies with our robot, and also took apart the old
robot. Next week, we will start building
Driver control (matches): This game is going to have a lot of strategies involved.
We know that towers will play a huge role in who wins a match. We will probably
want to try to monopolize and use one or two colors. But what order should we
use?
 We could stack during the first minute or so of the match, and then do
towers.
 We could get a jump start on towers, and then try to do cubes after.
 We could stack and our partner could stack (or vice versa)
It definitely depends on who our partner is, but we both think that the 3 rd option
would be the best strategy.
15

Driver skills: We think that we should spend the first 20-30 seconds getting
towers, hopefully at least five. Since all cubes are the same color (RSC1). Then we
can score as many cubes in zones as possible.
Autonomous/Prog Skills: The simplest thing to do, at least at the beginning would
be to create some programs that drive forward and pick up the pre-built stacks.
We could make four of these programs, one for each stack, as shown in the
diagram.

7-29-19 (First Build)


Today, we began building the robot, starting with the base. In the past,
we’ve had problems with the front motors running into the lift, so we didn’t put
motors on the front wheels. Our plan is to try to put the motors on the towers
and then gear them to the wheels.

8-11-19 (First Build)


We started working on the double reverse four bar today. We finished the
towers and the first set of four bars. Since the tower was bending a lot, we added
20-hole C-channels to make a right triangle. We used a 3-4-5 Pythagorean triangle
to figure out what size to make the triangle:
A2+B2=C2
32+42=52
122+162=202
So the “tower” leg will be 16 holes, and the “base” leg will be 12 holes. Adding the
bar made the tower a lot more stable.
16
17

8-18-19 (First Build)


Today we started building our double reverse four-bar. Originally, we
thought that the motor could go between the lower two four-bars, but there
wasn’t enough room. We inserted an idler gear on the lower bar axle so that the
motor could be mounted on the bottom. Then we attached the double reverse
four-bar to the robot. It was clear that the lift would sit on the wheels, so we
added a bar across the wheels for the lift to sit on.

8-25-19 (First Build)


Today we started building our cube tube. The gears for the claw are
attached to the back of the tube. The doors were very hard to get exactly right.
The hinges were very loose and as a result, the cube tube wouldn’t stay straight.
To fix this, we added more hinges and support bars to the doors

9-8-19 (First Build)


Today we attempted to attach the cube tube on to the double reverse four-
bar. We realized that the whole mechanism is way too heavy and even with
rubber bands, the lift would never be able to support the tube. Thomas had the
idea of making the tube itself and the door attached to the base and just having
the claw on the DR4B. We got the back of the tube and the claw on today.

9-15-19 (First Build)


We added the door to the robot today. However, it was nearly impossible
to find a way to power the door that didn’t get in the way. To make matters
worse, we realized the claw wouldn’t move up and down and hit the top of the
tube. The DR4B was also impossible to keep square. Eventually, we decided it was
time for a redesign.
18
19

9-30-19 (Second Build)


Today we went back to the drawing board and looked at our previous
brainstormed ideas. We agreed that we wanted to avoid a double reverse four-
bar this time so we decided to go with the tray stacker. We kept the base; I
worked on the lift and Thomas worked on the tilting tray mechanism. By the end
of today, the towers and arms were done and we were ready to start on the tray.

10-5-19 (Second Build)


To start, I worked on the rollers, while Thomas built the tray. We only have
included one segment for now. We plan on adding more after the Groton
tournament. We slightly modified the original idea, in that the two rollers each
have a motor and they are pushed apart by the tray when it comes forward. The
robot should be complete by the end of the next meeting.
20

The tray is angled, rollers grab the The tray comes forward, rollers let go
cubes. of the cubes.

10-10-19 (Second Build)


We had a lot of issues with the bot today. To start,
the rollers kept getting stuck on the tray because the lift
was too far down. To solve this, we added standoffs to
prevent the lift from going down to far, and to prevent
the tray from going back too far. The intake also had
some tension issues, where it wouldn’t hold a cube, but
those were solved by adding more rubber bands.
21

10-15-19 (Second Build)


We went out to Harrisburg to practice today. Apart from getting some
driver practice in, we also noticed a problem with the tray. When it came forward,
the bottom would catch on the scoring zone bump. To solve this, we moved it up
three holes. Other than that, the robot performed very well, especially when
scoring in towers.

Win-Loss Chart-Groton 10-19-19


(Improvements)
Losses
25%

Wins
75%

The tournament in Groton this weekend went very well. When we first
arrived, we hastily coded an autonomous program that pushed a cube into a
zone. We went 5-1 in qualifying matches placing us in 3rd and allied with 6844B.
We then made it to the semi-finals before losing to the #2 seed alliance. We also
won skills with a programming score of 1 and a driver score of 16.
The robot performed very well at the beginning, however towards the end
of the tournament the intakes really started to lose their compression. By the
final few matches, there were some times the intakes wouldn’t even have enough
compression to grab a cube. They also had trouble folding out one match. Also,
we felt that only being able to stack three cubes gave us a slight disadvantage.
So in short, the things we want to improve are:
 Tension on the intakes
 More consistent folding out of the intakes
22

 Cube capacity of the tray


23

10-27-19 (Improvements)
Today we focused on two of the issues we identified on Saturday: Intake
compression and folding out. Both of which we thought could be solved by
making the intakes fold down instead of out. One small problem we faced was
that now the intakes would not spread apart when the tray tilted forward, so the
bottom cube would catch on the rollers.
To solve this, we coded a macro on Thomas’ controller that moved the
intake back and the robot back very slowly at the same time. This way we could
let the cube go without the stack tipping over

11-3-19 (Improvements)
Today we built a second stage for our tray, in the hopes that it could hold
6-7. Finding a way to be able to fold the tray into 18 inches and still be able to flip
out was very challenging. The solution was a very complicated process where the
intakes spit the tray out.

11-7-19 (Improvements)
We practiced at Harrisburg’s field today. When we
first tried stacking, the rollers only had enough
compression to lift 3 cubes, so we put on the longer flaps.
We also added spacers to the intake joints to push them
closer together. After these modifications, the intakes are
easily able to stack 6 cubes.
24
25

11-10-19 (Improvements)

Win-Loss Chart-Mitchell
Ties
11%

Losses Wins
33% 56%

The tournament this weekend in Mitchell went very well. We went 4-2-1 in
qualification, placing us in 7th. We allied with 9050A as the 4 seed. We beat the 4
seed, and then lost by three to the #1 seed. We didn’t do as well in skills, getting
only 10 and placing us in 5th place. We also received the judges award.
The robot performed well in towers but stacking large numbers of cubes
didn’t work very well. We found that a lot of times when trying to stack, the 2 nd
cube would sometimes get caught on the rollers while stacking and knock the
stack over. Also, even though the intakes were flipping down, they still bent
outward quite a bit due to the screws bending. One other issue we had was
sometimes the fast roller out-take button made the cubes fall out when scoring
towers and the slow out-take was too slow.
To-do:
 Fix our intakes so they don’t get caught as much
 Decrease slop of the intakes
 Make a medium-out-take button
26
27

11-24-19 (Improvements)
Today we started working on the issue of the intakes getting caught on the
nd
2 cube. We needed to decrase friction of the intakes, while maintaining the
compression. The intakes were made of mixed tread, some of wich was made to
be very grippy.
We decided to try to take off the tread and replace it with normal chain.
We also replaced the long flaps with medium flaps. This greatly reduced the
amount of friction on the 2nd cube, however, we are going to need to fix the slop
issue on the intakes as they need more compression.
28

Old intakes New


intakes

12-1-19 (Improvements)
Today we faced the issue of slop in the intakes. Our first solution was to try
adding a 1-hole strip to support the intakes, however, the stips got in the way of
the intakes when they flipped down. We ended up moving the strips back,
however that lessened their effectiveness. The screw sticking out
We ended up using a
screw as a locking mechanism.
The screw sticks out from the
side of the joint and slides into
a bearing flat, reducing the
side-to-side movement. This
greatly increased our intake
tension, and we could easily pick up cubes again.
29

12-15-19 (Improvements)
Today we added a line to the code that makes the intakes spin outwards at
50% when I press the “B” button. This will make scoring in towers much easier.
We spent the rest of practice driving.

1-5-20 (Improvements)
Since it is legal to have an external non-functional power source this year,
out late Christmas Present to ourselves were some LED light strips. We put these
on our robot and it looks very cool! We also got some good driving practice in.

Win-Loss Chart-Canton

Losses
22%

1-12-20 Wins
78%

(Improvements)

The tournament in canton was very successful. When we got there we


found our robot could only intake 5 cubes, but we were 5-1 in qualifying matches,
placing us in 2nd. We allied with 6844B and made it all the way to the finals where
we lost to 77000X and 7686C. We also got a skills score of 21 (20 Driver, 1 Prog)
30

by stacking 5 cubes and scoring in 3 towers, placing us 3 rd in skills. The only thing
that could really improve the robot now would be increasing cube capacity, and
possibly making the robot be able to intake faster.

1-17-20 (Improvements)
Today we addressed the issue of cube capacity. The issue was that the
intakes, once the tray held 6 cubes, would begin to slip.
What we ended up doing was changing the rear gear from a 24-tooth
sprocket to a 30-tooth sprocket. This increased the speed of the intakes (because
there was a larger driver gear) and increased the compression towards the back
of the intakes. Although we couldn’t fully test it out, the intakes could easily
intake 3 with no signs of stopping. One small drawback to this solution is that the
tray has a little trouble sliding through the bigger gears, however, it can still fold
and unfold so we will use these sprockets in Groton.

1-25-20 (Improvements) Win-Loss Chart-Groton


The tournament in Groton
went quite well overall. We had a
Losses
tough match schedule for 42%
qualifying matches, so our record Wins
th 58%
was 4-5-0, placing us in 12 . In
playoffs, however, we were
selected by team 77000X and
together we made it to the finals
and won. Our skills runs were also rough, our chain broke once and we had an
issue with a wire, so our score was only 11, (1 Prog, 10 Driver).
The robot did very well at scoring in towers, however, the stacking was very
rough. The wide 30T sprockets made it hard to rotate the bottom cube, and
sometimes while driving away the sprockets were caught on the tray, causing the
stack to collapse. Also, the robot’s wide base made it somewhat hard to
maneuver and the arm cross-bracing often hit the tray, meaning we had to push
the tray forward every time we scored in towers which was annoying
To-do:
31

 Make the base thinner


 Make it easier to release the stack
 Fix the arm-tray collision issue

2-2-20 (Improvements)
Today we worked on making the base thinner. We changed all of the
external bracings from 35 holes to 25 holes, and the interior bracing from 25
holes to 15 holes. This made the robot more maneuverable making it easier to
stack while parallel to the field wall and also made to robot lighter.

2-3-20 (Improvements)
Now that we have made the base better, we turned our attention to the
intakes. We want to make it easier to stack, but not decrease compression or
reduce our ability to score in towers. Tried to flip the intakes out (parallel to the
arms), and that didn’t work. So our plan was to try to make the intakes be able to
bend up from the arm.
To do this we mounted the intakes on hinges instead of directly to the flip-
down bar and used lots of rubber bands to tension them. This allows the intakes
to get out of the way while stacking, but have tension enough to intake 6-7 cubes
and pick them up to do towers.

Another thing we did was mount the intakes on top of the arms, rather
than on the bottom. This makes them more parallel to the tray so the intakes
aren’t jamming cubes into the tray, but rather forcing them up the tray more. This
puts less stress on the motors allowing the intakes to be stronger.
32
33

2-4-20 (Improvements)
Today we had a few hours to practice on Harrisburg’s field. We found that
the robot could easily intake 6-7 cubes and stacking was very easy; we just push
the tray forward and drive back. We no longer have to spin the intakes slowly
which allows us to stack with incredible speed.
We also addressed an issue we had discovered at Groton: The tray had to
be pushed forward in order to raise the arms. We coded a simple macro that
moved the tray to the forward position whenever the arms are raised, that way
we don’t have to worry about that during a match.

2-9-20 (Improvements)

Win-Loss Chart-Harrisburg
Losses
14%

Wins
86%

The tournament in Harrisburg was very successful. We went a perfect 6-0 in


qualifying rounds, including a major win over 770000X, placing us in 2 nd going into
the playoffs. We were going to choose 7686C, however, they dropped the alliance
so we went with 2770X. We then lost in the 1st round of the playoffs to 7686C and
7686A. In skills, we had a 19 (18 driver, 1 prog), placing us in 5 th for that category.
At the end of the day, we also received the Judges Award.
The robot performed excellent except for one small issue: When the arms
were lifted, the intakes would flip backward because of their weight. As a result,
we could not score well in the medium towers. We also would like to try to code
an autonomous before the state championship in 3 weeks.
34

2-16-20 (Improvements)
Today we confronted the issue of the intakes flipping back on the arms
while raised. Our original idea was to add a rubber band pulling the intakes down,
however, we found that it was nearly impossible to fold the intakes up without
them falling out of 18.”
To solve this, we mounted zip-ties on the tray of the robot to keep the
intakes held up while folded. We also discovered that pushing the rubber bands
up the arms resulted in less force. Once unfolded, the rubber bands would slide
back down the arms to a position of greater downward force on the intakes.
35

Without rubber bands With rubber bands


The zip-tie holds the intake until the The rubber bands slide down in the
intake deploys. direction of the arrow until the
stopper

2-18-20 (Improvements)
Today we went out to Harrisburg’s field to practice. We had 3 practice
scrimmages with them, with a record of 2-1. We also tried to do some
autonomous coding that picks up 3 cubes and stacks them in the thick zone,
however, we didn’t have nearly enough time as we wanted, so the code is still off
by a little bit. We plan on attempting to complete the code in Mitchell during the

State Championship.

Our Code:
//CODE FOR LOL66_4.4. CREATED BY TEAM 99707K, THE ROBO CHICKENS
#include "vex.h"
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// LeftFrontDrive motor 9
// RightFrontDrive motor 10
// LeftBackDrive motor 8
// RightBackDrive motor 7
// Lift motor 4
// Tray motor 1
// Controller1 controller
36

// Controller2 controller
// LeftIntake motor 3
// RightIntake motor 2
// ---- END VEXCODE CONFIGURED DEVICES ----
using namespace vex;
vex::competition Competition;
void pre_auton( void ) {
//Draw our logo on the brain screen for added coolness
Brain.Screen.drawImageFromFile("RoboChickens.png",0,0);
//Make the intakes hold cubes
motor_group intake(LeftIntake,RightIntake);
intake.setStopping(hold);
}
Autonomous code #1 (Driving Backwards, 1 point)
void autonomous( void ) {
//Define motor groups
motor_group rightDrive(RightBackDrive,RightFrontDrive);
motor_group leftDrive(LeftBackDrive,LeftFrontDrive);
motor_group intake(LeftIntake,RightIntake);
drivetrain drive( leftDrive, rightDrive, 12.56, 10, 16, distanceUnits::in );
//Set timeout so the robot doesn't stall the program

drive.setTimeout(2,seconds);
intake.setVelocity(50, percent);
intake.setTimeout(2,seconds);
//Deploy the tray
intake.spinFor(reverse, 1080, deg);
//Drive backward, then forward
drive.driveFor(-32, inches);
drive.driveFor(30, inches);
}
Autonomous code #2 (Collect pre-load and 2 other cubes, and
stack them in the thick zone, 1-3 points, not fully tested)
//Define motor groups
motor_group rightDrive(RightBackDrive,RightFrontDrive);
motor_group leftDrive(LeftBackDrive,LeftFrontDrive);
motor_group intake(LeftIntake,RightIntake);
drivetrain drive( leftDrive, rightDrive, 12.56, 10, 16, distanceUnits::in );
//Set timeouts so the robot doesn't stall the program
drive.setTimeout(2,seconds);
intake.setVelocity(50, percent);
intake.setTimeout(2,seconds);
//Hold the tray motor so the tray doesn't move while deploying
Tray.stop(hold);
//Deploy the tray
37

intake.spinFor(reverse, 1080, deg);


wait(.5, seconds);
//Start the intakes spinning
intake.setVelocity(100, percent);
intake.spin(forward);
//Drive forward, collecting the pre load and 1 other cube
drive.setDriveVelocity(25, percent);
drive.driveFor(12, inches);
//Turn 90 degrees left
leftDrive.spin(reverse);
rightDrive.spinFor(220, degrees);
leftDrive.stop();
//Drive forward, collecting 1 other cube
drive.driveFor(24, inches);
//Stop the inkates
intake.stop();
//Turn 90 degrees left
leftDrive.spin(reverse);
rightDrive.spinFor(220, degrees);
leftDrive.stop();
//Drive forward into the zone
drive.driveFor(16, inches);
//Spin the intakes out slightly to lower the cubes
intake.setVelocity(15, percent);
intake.spinFor(-180, degrees);
//Raise the tray
Tray.setTimeout(2,seconds);
Tray.setVelocity(50,percent);
Tray.spinFor(forward, 260, deg);
//Drive backwards
drive.driveFor(-20, inches);
//Lower the tray
Tray.spinFor(reverse, 240, deg);
}
Driver control code
void usercontrol( void ) {
while (1)
{
//Define motor groups
motor_group rightDrive(RightBackDrive,RightFrontDrive);
motor_group leftDrive(LeftBackDrive,LeftFrontDrive);
motor_group intake(LeftIntake,RightIntake);
drivetrain drive( leftDrive, rightDrive, 12.56, 16, 16, distanceUnits::in );
//Drive control (Speed is reduced by 25% for more precise handling)
leftDrive.spin(forward);
38

leftDrive.setVelocity(Controller2.Axis3.position()*.75 ,percent);
rightDrive.spin(forward);
rightDrive.setVelocity(Controller2.Axis2.position()*.75 ,percent);
//Lift control
Lift.spin(forward);
Lift.setVelocity(Controller1.Axis3.position() ,percent);
//Tray tilter control
Tray.spin(forward);
Tray.setVelocity(Controller1.Axis2.position() , percent);
//Intakes control-full speed intake cubes
if(Controller1.ButtonL1.pressing())
{
intake.spin(forward,100,percent);
}
//Intake control-full speed outtake cubes (for quickly disposing of unwanted
cubes)
else if(Controller1.ButtonL2.pressing())
{
intake.spin(reverse,100,percent);
}
else if(Controller1.ButtonR2.pressing())
{
intake.spin(reverse,8,percent);
}
//Intake control-40% outtake for scoring in towers
else if(Controller1.ButtonB.pressing())
{
intake.spin(reverse,40,percent);
}
//Intake control-25% intake for adjusting cubes slightly while stacking
else if(Controller1.ButtonX.pressing())
{
intake.spin(forward,25,percent);
}
//Intake control-stopper
else
intake.stop(brake);
//Lift control-hold button (allows the arms to stay up while scoring in towers)
if(Controller1.ButtonR1.pressing())
{
Lift.setStopping(hold);
Lift.stop();
}
//Lift control-stopper
else
39

Lift.setStopping(coast);
//Lift/Tray anti collision system (Move the tray if the lift arms are raising up)
if(Lift.position(deg)>90)
{
Tray.setVelocity(100, percent);
Tray.spinToPosition(180, degrees, false);
}
//Prevent wasted resources
wait(.1,seconds);
}
}
//Main code
int main() {
vexcodeInit();
Competition.autonomous( autonomous );
Competition.drivercontrol( usercontrol );
pre_auton();
while(1) {
vex::task::sleep(100);
}}

You might also like