For this project, we were tasked with building a Lego robot which we would then have to go on a design a code for to complete certain task. Among those tasks were specified tasked that were required. The required tasked included the following:
Moving 6 feet
Moving in a 4ft-by-4ft cube
Sensing and following a black line
Sensing and stopping in front of a wall
There was also a special tasked that we had to code in order to make our robot unique and stand apart from the rest. Following the completion of these task, our robot had to compete in a bulldozer event. In this bulldozer event, the robot was put up against an opponent (another robot) and both were sat on a black line. The robot had to stay on the black line while successfully pushing the other robot off the line and therefore winning the event. This was also another aspect that we had to create a coding for.
Going into the project we decided to name our robot Nova Drake. When building Nova my group decided to go with the basic design layout because we though that would be an easy design that we could manipulate to complete the needed task along with our special task. We were able to utilize aspects such as the touch and light sensors when making the special task. In the beginning stages of Nova's build, she had a sensor, and the stylus was placed on the left of the touch sensor, and she didn't have her "wings." Also, she only contained one light senor on her right side. Nova's final design included two light sensors that allowed her to move straight on a line when she was running through her coding. We also added a stylus to the middle of the front of Nova so that she could touch a phone screen easier which was needed for her to complete the special task that we coded her for. We also took off the middle sensor as it was unneeded. The "wings" we added at this stage too, which was for style purposes.
For the coding aspect of the projected we created two different codes that weren't involved with the required tasks. We created a code the special task and a code for the bulldozer event.
For the special task we had the coding start when the center console was pressed rather than when the start button was clicked. We than had a repeat forever block until the touch sensor which would then have Nova rely of the light sensors. Under the repeat block is a switch or an "if, then, else," block. In this block we have the code set to if the light sensor in port 4 reads a light intensity less than 10% then it will start to move motor B and a speed of 35 and motor C at a speed of 36. This means if Nova starts to move to the right and pucks up a black line she will make a slight left and straighten back out. In the else section, is another switch block that reads if the light sensor in port 2 reads a light intensity of less than 10% it will make motor B move at a speed of 36 and motor C move at a speed of 35. This will have the opposite effect of the previous coding and will cause Nova to move to the right if she reads the black line that was laid out for her. Then within the else section of the second switch block it says that if Nova doesn't read the black line on either sensor, both motors will move at the same speed, so she will be going in a straight line. The entirety of the code I just explained basically means that if Nova ever strays from the path, she takes to start the TikTok she will shift back on track because of the very slight changes in speed she will undergo. After the switch block, when the touch sensor is touched, Nova will stop moving, then she will move backward 3.598 rotations or 2 feet. After completing this step, she will have motor B moving counterclockwise and motor C will be stopped. This will cause Nova to move in a circle or "dance" for her TikTok and she will repeat this movement 10 times.
For the bulldozer event Nova and another robot will be placed opposing her on a black line. The beginning line of the code is a switch block that says if Nova senses the black line on her port 4 sensor, she will forever move 1 rotation with both motors set at 50% speed. If Nova senses that something has come within 15 cm of her, she will sense the black line and more backward for 1 rotation, which will be repeated 3 times. Then she will stop moving and sense the black line. At this time both her motor swill, be set at 100% speed and she will rush her opponent in an attempt to thrown them off balance with her sudden change of speeds.
For our special task, we decided to have Nova try to become a TikTok influencer. To make TikTok's, we would have to code Nova to allow her to move towards the phone and press the screen to start the video. She would then proceed to “dance” or spin in circles. To make this work we had to attach a stylus to Nova’s touch sensor so that she could start the video and the next part of the code.
In the beginning of the project Nova was working properly with little problems but as time went on, her motors were starting to die. One motor was constantly moving faster than the other causing Nova to just spin in circles the entire course of her code. We tried to kind of trick the program by creating a slight turn when we wanted her to go straight to try and throw off the spin the wheels were giving her, but this didn't work because the difference in speed was too great. Then with the gracious donation of a motor from one of our classmates we were able to replace Nova's old and broken motor, but she was still spinning in circles. We later learned that that was because we were using an old coding that was making her spin. After changing that coding, she was back on track to making her TikTok. Another problem that we had was that the cord we were trying to use to download Nova's code was broke, so we had to get a replacement which was a fairly easy fix. Finally, the last problem we had was that, when we had tried to get Nova to follow a black lie up to the phone in order to start her TikTok video, she wasn't following the line. We later found the reason to be because Nova was reading the line as brown rather than black. We were able to fix this by just having her sensor a certain light intensity rather than a color so she wouldn't pick up the wrong color anymore.
Although Nova was able to complete her task, she could only do so about half the time. She would need multiple trials to complete her task which was not what the aim of the project was. We wanted to be able to make her complete her task every time she was set to run but that didn't work as planned because the stylus and the touch sensor weren't working together when they were hitting their specified objects. Their timing was off a lot which led to the repeated failing of her making the TikTok, but Nova's TikTok page was able to gain followers to support her on her journey of repeated failures.
This project could relate to math because throughout the coding process, we had to be able to calculate the measurement for how many feet/inches that Nova would move for each rotation of her wheels. This involves conversions and multiplication throughout the coding piece of this project which took up a majority of our time.
Throughout the course of this project, our group was repeatedly forced to problem solve and create innovative methods to get Nova to work, as she had so many problems. This was heavily related to STEM because in the STEM field there is a lot of trial and error and having to create new ideas and new ways to make something work. Because Gwen was so problematic a lot of our project consisted of these innovations and the coding itself was a series of trial and error.