Loop, There it is!
Using Loops to Repeat Robotic Actions
Robots and computers are very good at consistency when performing actions multiple times. Computers use repetition to perform millions of calculations per second with incredible consistency. Since robots are built to interact with their environment and perform tasks precisely, they can be effectively used to repeat behaviors.
Behaviors to be repeated are grouped in programming structures called loops. The number of times and how fast they repeat depend on many factors that the programmer can specify.
Here are some examples of where repetition can be useful:
Behaviors to be repeated are grouped in programming structures called loops. The number of times and how fast they repeat depend on many factors that the programmer can specify.
Here are some examples of where repetition can be useful:
- Performing routine tasks multiple times
- Checking certain conditions multiple times to check for changes
1. Programming Loops
Squared Loops Challenge
Factory Robots
Factories first began using modern industrial robots in the early 1960’s. These robots could do the dirty, dull, and dangerous jobs that were previously completed by humans. Since then, factories all over the world have invested millions of dollars to develop and build robots that can manufacture their products quickly and efficiently.
Factory robots are always being improved upon as new technology is expanded. New metals and materials allow robots to be used in high pressure or high temperature environments. Usually separated to keep human workers safe in case of an accident, factory robots are being made from new “softer” materials. These materials, such as rubber and plastic, can help reduce injuries in a robot/human collision. With the introduction of artificial intelligence and sensors, factory robots can be “taught” new ways of delivering these products overnight and adapt their movements in real time. This allows more productivity and precision.
Factory robots are used in the production of many products, but the top three robotic jobs in manufacturing are:
Factory robots are always being improved upon as new technology is expanded. New metals and materials allow robots to be used in high pressure or high temperature environments. Usually separated to keep human workers safe in case of an accident, factory robots are being made from new “softer” materials. These materials, such as rubber and plastic, can help reduce injuries in a robot/human collision. With the introduction of artificial intelligence and sensors, factory robots can be “taught” new ways of delivering these products overnight and adapt their movements in real time. This allows more productivity and precision.
Factory robots are used in the production of many products, but the top three robotic jobs in manufacturing are:
- Drilling
- Welding
- Painting and Sealing
Controllers and Loops
In competitions, teams must manipulate their robots wirelessly with controllers. The controller is programmed to update the robot based on input from the user. Loops are used in the project so that the robot repeatedly checks for updated input information. Loops allow the project to rapidly check which buttons have been pressed, or how far joysticks have been pushed. Once checked, this information is quickly relayed to the robot so that it responds quickly to the controller's instructions.
The image above shows the Tank Drive example project from VEXcode V5 Blocks. The forever loop in this project checks the positions of Axes 2 and 3 forever in order to set the velocity of the motors.
Loops are important even for autonomous programming without a controller. A loop helps to simplify and organize repeated commands within a project.
The image above shows the Tank Drive example project from VEXcode V5 Blocks. The forever loop in this project checks the positions of Axes 2 and 3 forever in order to set the velocity of the motors.
Loops are important even for autonomous programming without a controller. A loop helps to simplify and organize repeated commands within a project.
2. Groove Machine Challenge
In this challenge, you will program your robot to go through a dance routine using your knowledge of loops. Make sure you follow the rules below. Before you begin programming, add your pseudocode of your program to the Google Doc "Loop, There it is!", located on Google Classroom. When finished, screenshot your code and paste it into the Google Doc "Loop, There it is!".