Computer Science/Engineering in Robotics.

"Computer Science is the operating system for all innovation" -Steve Ballmer

Overview

This week, using kits, we made two robots; the Redbot and the Tamiya bot. Additionally, we coded for the robots to be able to successfully navigate itself and others out of a building in times of disaster. The Redbot is able to sense the brightness of what is below, while the Tamiya bot is able to sense obstacles and avoid them. Together, they are able to be heroes in disastrous situations.

Computer Science

The study of principles, theories, and practices related to computers and computational systems. It encompasses a wide range of topics, including algorithms, data structures, programming languages, software development, artificial intelligence, computer graphics, cryptography, and more. Computer scientists explore the fundamental concepts and theories underlying computer systems and develop practical solutions to complex problems using computational techniques.

Computer Engineering

A discipline that combines elements of computer science and electrical engineering. It focuses on the design, development, and integration of computer hardware and software systems. Computer engineers work on various aspects of computer systems, including microprocessors, digital logic design, computer architecture, embedded systems, networking, and computer peripherals. They often deal with the physical components of computers, such as circuits, processors, memory devices, and input/output interfaces.

Robotics

An interdisciplinary field that involves the design, development, programming, and application of robots. It combines principles from computer science, mechanical engineering, electrical engineering, and other related fields. Robotics encompasses the study of robot hardware, such as sensors, actuators, and control systems, as well as the software algorithms and programming techniques used to control and operate machines. Robotics has diverse applications, including industrial automation, medical robots, autonomous vehicles, space exploration, and more. It explores the interaction between machines and the physical world, enabling robots to perceive, understand, and interact with their environment.

Design Process

Assembling the Robots

The first step was to assemble both of the robots. The group members with less experience in Arduino and coding began by practicing in the Inventor's kit black box, and building both the Tamiya bot and the Redbot, while the others began working on the code for the robots. The Tamiya bot originally had a single motor, which only moves forward and backward. However, we decided to separately make a double motor to attach to the bot instead so that the bot can turn. While assembling the double motor, we saw a problem with the gears, as the gears were too loose which negatively affected the transmission of the gears, which therefore affected the ability of the robot to successfully move. To fix the problem, we changed the design of the gearbox to the second design on the manual, which in the end was successful, and our bot was able to successfully move. On the other hand, the assembling of the Redbot was a lot more successful with just the minor challenge of the wire connections. In the end, we were able to assemble two functioning robots that were ready to be coded. 

Adding the Redboards

After the basis of the robots were assembled, we had to add the sensors and the redboards to the robots. The redboard reads the code from Arduino, and the robot will move accordingly to what the sensor reads. For example, if the code indicates for the robot to avoid obstacles, the redboard receives that code, and the sensor will sense an obstacle in front, and be able to avoid it. Both of our robots have redboards and are therefore able to apply the code and move accordingly. 

Coding

As both of the robots were assembled with the redboards and sensors connected as well, we then had to start on the code. For the code we used Arduino, which is connected to the redboards that we placed on our robots. We started by coding for the Redbot. The entire coding process was challenging and we faced many rounds of trial and error before we were able to code exactly what we wanted for our robot. 

Sparkfun Inventor's Kit for Redbot:

The Sparkfun Inventor's Kit for RedBot is a robotics kit designed to help beginners during their first few times with robotics and programming. It is based on the RedBot platform, which is a small mobile robot with motor controllers, sensors, and an Arduino-compatible microcontroller.

Tamiya Vehicle Kit:

The Tamiya vehicle chassis kit is a DIY mechanics kit manufactured by Tamiya. The kit includes all the necessary parts to make a tank tread RC vehicle which can move forwards and backwards.

Arduino:

Arduino is an open-source electronics platform that consists of hardware and software components designed for creating interactive projects and prototypes. It provides a simple and accessible way for people, including hobbyists, artists, and professionals, to develop and control various electronic devices and systems.

Redbot

To the left is what our redbot looks like. The sensor in the front detects the brightness and the reflection of what is below, which is why the bot follows the black tape on the ground. 

Redbot Code

The image below is the code for the redbot. 

Our code for the robot starts off by initializing hte motors and declares the LINETHRESHOLD. It then initializes the motors and then starts off by going forward. This robot will move forward as long as it detects a line along the middle sensor. If the middle sensor does not detect a line, then the robot will turn in the direction of the last detected line. We input a ultrasonic sensor in our robot so that if the robot senses an object then all the code will stop and reverse and turn until the sensor senses an open direction with a line along the way.



IMG_8244.MOV

Video

Here is the video of our redbot 

Tamiya Bot

To the right is what our Tamiya bot looks like. The sensor in the front also is able to follow the black tape on the ground like the redbot, however it has the additional factor of the ability to detect objects to prevent running into them while escaping.  

Tamiya Code

Below is our code for the Tamiya bot

In our code, we initialized and associated the necessary pins with the corresponding inputs (left and right motor, ultrasonic sensor, etc.). We created helper methods (behaviors) to move the robot correspondingly. For example, our move forward method will start both motors to advance forward and in all of our methods, they will check the distance often in order to stop the robot if the ultrasonic sensor detects an object within 10 inches of it. In that case, we have the robot stopping and turning right until the robot senses that there is a clear line for the robot to move along. We left comments in our code to allow for transparency and ease of understanding.   

Video

Here is the video of our Tamiya bot.

IMG_8280.MOV