← back

Vex Robotics - 2023

4 min read ·

VEX Robotics is a global competition where teams design, build and program robots to compete in team-based engineering challenges. Each season features a new game that tests strategy, innovation, and collaboration, encouraging creativity and real-world problem-solving through STEM.

Isometric Field

This season’s challenge is called Spin Up, which is played on a 12’x12’ square field. Two Alliances of two compete in matches consisting of a Autonomous Period, followed by Driver Controlled Period. The objective of the game is to attain a higher score than the opposing Alliance by Scoring Discs in Goals, Owning Rollers, and Covering field tiles at the end of the Match.

I had an interest in Vex Robotics for a while as I saw High Schoolers participate. This year I decided to found the first middle school team of Vietnam. We started later in the season than most teams but we quickly adapted and learned the fundamentals of robot design and strategy.

Version 1 (Nationals)

One key tool I learnt was Computer-Aided Design (CAD); It is a digital method of planning and designing the robot, by creating 3D models, we can visualize how different parts fit together and ensure proper functionality. I designed our first robot throughout my winter break using Autodesk Inventor as it has lots of documentation for how to use Vex parts with it. I made multiple different 3d designs based on some paper skeches. For my first robot, I decided to go simple with just a drivetrain and roller as I knew I didn’t have much time to build and I don’t have much experience.

Nationals RenderNationals Bot

For the code, we used C++ as it is better documented than python for VEX. The code isn’t very complicated as I wanted to test if the robot works first, and I can learn about more advance algorithms later. The autonomous moves forward by 200mm which places it in between 4 tiles, which gives me an easy 12 points.

cpp
void move() {
double vs = Controller1.Axis2.position(), hs = Controller1.Axis4.position() * 0.9, ls, rs;
if (hs < 0) {ls = vs, rs = vs + fabs(hs);} else if (hs > 0) {rs = vs, ls = vs + fabs(hs);} else {ls = vs, rs = vs;}
if (ls > 100) {rs -= (ls - 100),ls -= (ls - 100);} else if (rs > 100) {ls -= (rs - 100),rs -= (rs - 100);};
mgr.setVelocity(ls,percent);
mgl.setVelocity(rs,percent);
}
void roller() {
if (Controller1.ButtonR2.pressing()) { Motor7.spinFor(forward, 180, degrees); }
if (Controller1.ButtonL2.pressing()) { Motor7.spinFor(reverse, 180, degrees); }
}
void move(double left, double right) {
mgl.spinFor(forward, left/319.186, turns, false);
mgr.spinFor(forward, right/319.186, turns, false);
}
void autonomous(void) {
move(200,200);
}
void usercontrol(void) {
while (true) {
move();
roller();
wait(5, msec);
}
}
cpp
void move() {
double vs = Controller1.Axis2.position(), hs = Controller1.Axis4.position() * 0.9, ls, rs;
if (hs < 0) {ls = vs, rs = vs + fabs(hs);} else if (hs > 0) {rs = vs, ls = vs + fabs(hs);} else {ls = vs, rs = vs;}
if (ls > 100) {rs -= (ls - 100),ls -= (ls - 100);} else if (rs > 100) {ls -= (rs - 100),rs -= (rs - 100);};
mgr.setVelocity(ls,percent);
mgl.setVelocity(rs,percent);
}
void roller() {
if (Controller1.ButtonR2.pressing()) { Motor7.spinFor(forward, 180, degrees); }
if (Controller1.ButtonL2.pressing()) { Motor7.spinFor(reverse, 180, degrees); }
}
void move(double left, double right) {
mgl.spinFor(forward, left/319.186, turns, false);
mgr.spinFor(forward, right/319.186, turns, false);
}
void autonomous(void) {
move(200,200);
}
void usercontrol(void) {
while (true) {
move();
roller();
wait(5, msec);
}
}

At nationals, I was the only team with 6 motors for my drivetrain, with most only having 4, which gave me the advantage of pushing power. My strategy of the event was to focus on scoring on the rollers and protecting that area. In the evening in elimination matches, I chose to alliance with a good offensive bot that also compliments my strategy and we got to semi-finals.

For this event I got the Excellence Award which qualifies my to World Championships. The award considers performance in the event, our engineering notebook, and our interview.

Version 2 (Skills)

Following nationals, we wanted to focus on making a shooter to score on the high goal. We 3d-designed than started building. Our school had a skills challenge where we try to score as much points as we can in a minute without an opponent on the field. My autonomous only scored the 12 points and my driver control scored 52 points. I could have gotten much higher if I had a shooter but we didn’t finish building it in time.

Skills RenderSkills Bot

Version 3 (Worlds)

After the skills challenge, we focused on completing the shooter, adding an indexer so the robot can shoot the rings one at a time, and a string based expansion mechanism. We also added a ABS skirt which protects the side of the robot and is also for decoration.

ShootIndexerRenderWorlds Bot

For the programming, our biggest challenge was aiming the shooter accurately during autonomous control. We solved this by calculating projectile motion using this Google Colaboratory.

World didn’t go very well as we encountered multiple challenges. Our drivetrain fell apart often as the collar lock design we used wasn’t very secure and required often retightening. We also got stuck on disks multiple times, our expansion got stuck multiple times, and the indexer broke multiple times. Overall it didn’t go as planned however it was a good learning lesson for future events.

Worlds DomeWorlds Team

Next year, I will focus on reliability of my robot. I will test a lot before my competition and I will learn new building techniques to ensure structural integrity and reliability.

Virtual Programming Skills

Throughout the season, I also partook in a Virtual Challenge where we have to program a virtual robot to score as many point as possible in a minute.

322 Points

After many attempts and improvements to my code over a couple weeks, I was able to reach 322 points which is the theoretical maximum for this challenge. The main things that helped me save was by barely picking a disc up while also using gps (game position system) to ensure consistency.

world standing