Vex Automation Projects
Design for Automation
This unit is their first unit that explores the concept of autonomous agents through the exploration of multiple seemingly independent robotics being programmed to work collaboratively to solve a range of unforeseen and directed challenges. Whilst the vex environment does not allow for the brains to collaborate autonomously we can mimic this process by programming each machine to respond to a dynamic environment that includes robots. Each robot can therefore react to the presence and actions of other robots for the completion of a shared goal.
Rotary Turntable Claw Machine
This is one of the bespoke models in which the students use. The objective of this machine is for the claw to pick up a given object and move it to a specific point using the claw mechanism and the turntable at the base of the device. This would be akin to a robot found in a production line manufacture structure.
The objective would be to determine whether we could ensure that multiple variations of similar type robots could work in union to get the object further than what is possible via a single machine.
Views
To the left are different views of the same device. The far left shows a front angle view of the device whereas the second image shows a close up the design for the rotation.
Early Prototyping
In order to fully engage with the turntable, we review this concept independent from the claw. This allows us to really investigate the various methods of rotating the rotary motor. We do this so we can analyse how the machine determines its direction or rotational point at any given time. The students experiment with absolute and relative values whilst experimenting with the inertial sensor onboard of the brain. The objective here is to determine how we control the rotation and forecast potential uses. The python programs below are exemplars to the types of concepts covered.
Exploration of Python .spin_for
# Library imports
from vex import *
# Begin project code
# Take the current position of the Claw as zero
claw_motor.set_position(0, DEGREES)
# Set the Claw's timeout
claw_motor.set_timeout(2, SECONDS)
# Open up the Claw and hold the position for two seconds
claw_motor.spin_for(REVERSE, 60, DEGREES)
wait(2, SECONDS)
# Close the Claw slightly and hold that position for two seconds
claw_motor.spin_for(FORWARD, 25, DEGREES)
wait(2, SECONDS)
# Return the Claw to its original position
claw_motor.spin_to_position(0, DEGREES)
Measuring Change
The concept of measuring the degree at which someone turns or rotates is constantly revisited along side the idea of understanding the absolute starting point of the rotation. The program below was an earlier task that required students to navigate an unforeseen environment and as such needed to change direction due to a given condition.
# Library imports
from vex import *
# Begin project code
# Calibrate the Inertial Sensor and reset the heading to zero
brain_inertial.calibrate()
while brain_inertial.is_calibrating():
wait(50, MSEC)
brain_inertial.set_heading(0, DEGREES)
# Set motor velocities to 20% so heading values can be more
# accurately checked as the robot turns
left_motor.set_velocity(20, PERCENT)
right_motor.set_velocity(20, PERCENT)
# Start both left and right motors to turn to the right
left_motor.spin(FORWARD)
right_motor.spin(REVERSE)
wait(0.25, SECONDS)
# Wait while the Inertial Sensor's heading is
# less than 50 degrees before stopping the motors
while brain_inertial.heading() < 50:
wait(20, MSEC)
left_motor.stop()
right_motor.stop()
# Print the Inertial Sensor's current heading to the robot brain's screen
brain.screen.print(brain_inertial.heading())
brain.screen.next_row()
wait(1, SECONDS)
# Start both the left and right motors to turn to the left
left_motor.spin(REVERSE)
right_motor.spin(FORWARD)
wait(0.25, SECONDS)
# Ensure that the robot turns past the 0 degree heading
while brain_inertial.heading() < 60:
wait(20, MSEC)
# Wait while the Inertial Sensor's heading is
# greater than 180 degrees before stopping the motors
while brain_inertial.heading() < 180:
wait(20, MSEC)
left_motor.stop()
right_motor.stop()
# Print the final heading from the Inertial Sensor
brain.screen.print(brain_inertial.heading())
Rotor Challenges
1. Robot calibrates the brain inertial sensor. It then spins slowly and prints its position continuously. Forever. Use the linked sample code for this. It can serve to start many of your next codes.
2. The Robot spins slowly for 1 second and then quickly backwards for 2 seconds. It does this 3 times and stops. The code uses a for loop and a sequential list actions within the loop.
3. The robot spins slowly to 180 degrees and then changes direction, and slowly back to zero. It does this forever. The robot uses the embedded brain inertial sensor.
4. Robot uses a variable to increase its speed continuously until it reaches top speed. Then it decreases its speed from 100 to 0. then the whole thing repeats forever. This would be akin to an amusement ride that slows reaches a peak before returning to the base value.
5. Install a pushbutton. The robot waits goes into a state of waiting for the button to be pressed. If pushed, it spins for 2 seconds. This happens forever.