Robotics Final Project

Overview/Inspiration

At COSMOS and in college, students have to learn to do their own laundry and fold their own clothes. I often have trouble folding my t-shirts in a clean way that are no wrinkles on them when I wear them. As it turns out, fellow students also have this issue. To solve this issue, my partner and I came up with the idea of building a robot that can fold t-shirts for the user with the only user input being placing the t-shirt on the robot and pressing a button. 

Brainstorming

Our team started off by thinking of ideas of how to build this robot and parts we would use. We drew an outline of how the robot will look and work, as well as a diagram of the wiring and what each wire would be connected to. We plan to base our robot off of this diagram and replicate it as well as possible. 


How It Will Work

Brainstorm Description 

Prototype 1: The Sleeves: July 27, 2022

Overview

Once our brainstorming was complete, we continued to building our first prototype. For this protoytype, all we wanted to do was create the arms that would fold the sleeves. We wanted to confirm that our idea would work how we wanted it to, as our entire design depended on the sleeves folding in properly. 

Design

I knew that our design had to be lightweight so that the motors would be capable of taking on the weight of the shirt without having to be geared for torque. Therefore, we decided to use 15-hole straight pieces and connect their using 4-hole pieces on the top and bottom. We then used 7-hole L pieces and attached more 15-hole channels in order to hold the sleeves of the shirt up. Then, we simply conneted these pieces to the motor and EV3 brain, and coded the robot to just spin the motor. 

Code

I already have experience with coding through being a coder on my school's robotics team. The Lego EV3 is coded in RobotC, which I am very comfortable with. Therefore, I became the primary coder for the project. 

In order to code the arms, I first had to define which port had which motor in it. Then, I opted to use the setMotorTarget function of RobotC to spin the two motors to a specific degree. I deduced that this would be the most consistent and accurate function to fold, as when I tried the other functions, such as setMotorSpeed, the two motors didn't spin the same amount. Jerry told us this was likely due to some motors being older than others, causing them to slightly vary from one another. Using the setMotorTarget function would always make the motors spin to the specified degrees. Then, I brought the motors back to their original positions. When I ran this code, we noticed that the sleeves folded in and out very quickly. This exerted the motors and also would likely cause the sleeves to mess up when folding. To resolve this, I thought of the idea to use the sleep function to have a little pause between the two steps. This solution worked perfectly. We also noticed that when we ran the code twice in a row without exiting the program on the EV3, the sleeves didn't fold correctly. I assumed that this was because the encoders were getting messed up by the different setMotorTarget functions. In order to resolve this, I used the resetMotorEncoder function on both the rightArm motor and the leftArm motor. This would fix the issue by completely resetting all the encoders every time the code was run. 

Testing

After coding an designing, we tested the arms. They worked perfectly, but there was a little bit of tuning to do on how much the motor spun. If it spun too much, that entire portion of the robot would be lifted up. If it spun too little or too slow, then the sleeve would not properly land how we wanted it to. To test this, we will be bringing a t-shirt to use on the robot tomorrow. 

Defining the arm motors

Resetting the arm motor encoders

Spinning the arms in then out

Prototype 2: The Folding Base: July 28, 2022 - July 29, 2022

Overview

Yesterday, we came back to test the robot with a t-shirt, as mentioned earlier. It seemed to work fine with the existing code, although we couldn't know for sure until the base was built. Therefore, we decided to continue on and design the base. 

Design

The base would be where the torso portion of the t-shirt would be placed. Due to that, it needed to cover a large surface area, but also be light enough such that the two motors would be able to flip it with the heavy t-shirt on top. We decided to use rectangular shaped pieces that would create a flat surface with large holes in the middle so the surface was light but large. Next, we created a flat platform made of 15-hole dark gray and light gray pieces. This part of the robot needed to be strong and sturdy, as the entire weight of the shirt would end up here. Therefore, we did not try to make this light through the use of rectangular channels, but rather heavy and durable. 

We noticed that the base could not be placed flat on the ground as the motors for the sleeves were placed facing down, and therefore caused the robot to be tilted down if we laid it flat. To solve this issue, we added stands for support on the end of the platform made of rectangle pieces as well as to the solid platform to which all 4 motors were attached (see 2nd and 3rd pictures). 

We then connected all the wires to the EV3 brain and created the code to completely fold the t-shirt as we want. 

Code

After coding the arm motors, I already knew what I had to do for these motors. I first began by defining the 2 platform motors at the beginning of the code under the spot where I defined the two sleeve motors. Next I used the resetMotorEncoder function on both of these motors so that every time the code is run the encoders completely reset, ensuring all runs are the same. Then I again used the setMotorTarget function. I toyed around with the degrees and speed of the motor to ensure that the two mtoors would be able to turn the platform. I ended up on 200 degrees spin and a speed of 50 units. Although, this speed was not enough to spin the platform with the shirt on it, which I elaborate on in the Testing section. After spinning the platform 200 degrees, I again used the sleep function to have a little pause before flipping the platform back to the original position. 

Defining the platform motors

Resetting the platform motor encoders

Flipping the platform and then bringing it back to resting position

Testing 

We tested this with an actual t-shirt as our final product. The first issue we encountered was that  there was not enough force coming from the two motors to flip the entire t-shirt and the base. This was very concerning, as it meant that we would need to gear our base for torque, making the design much more complex. We didn't have time to fix this issue as class had ended, so we went to our dorms to prepare for dinner. The moment I stepped foot in my dorm, I figured out a solution to our problem. I remembered Professor Dad-del was showing us how the internals of the motor we were given worked. There were different gears for the different speeds that were set in the code. This meant that if I toyed around with the speed values, I may be able to be able to flip the shirt. I discussed this idea with my partner at dinner and we tried it the next day. As I had predicted, it worked. Now, our robot folded a range of shirts, from very heavy ones to lightweight ones. 

Another issue that we came across was that at times, the sleeves didn't fold in properly. They would either fold in too much or too little, which caused the end product to look weird and large. Our team tried a variety of different ideas, tinkering with the arms, base, and motor speeds, yet none of these ideas seemed to have any effect. Sometimes, the shirts would be able to fold perfectly, while at other times they would end up looking crumpled. 

Jerry told us that later today we will be reviewing eachothers designs and getting feedback on possible improvements and solutions to issues, so our team hopes that we will find the solution to our issue during this exercise.  

Feedback - July 29, 2022

Today's feedback was truly very useful to our design process. Our peers were able to think of so many different ways to fix our issue as well as provided us with some input on issues that we had overlooked. 

The "Things to improve" section had the most useful input. For all 3 of our primary reviewers, we had a good 5-10 minute discussion about our issue. This allowed us to explain all of the ideas that we have already tried and what further steps we could take. Leo reccommended that we try adding gray studs to the bottom of the arms. This would allow for us to keep the surface of our robot flat and level. Currently, our arms and under the level of the folding base area. This idea seems very promising, since having a level surface means that we can likely fold the t-shirt the same way very consistently. Theo noted that our arms were very flimsy. Since the motor has to spin the entire long, heavy arm with no support at the other end, the end of the arm not attached to the motor tends to bend down, causing it to be flimsy. This flimsiness could be another cause of the issue and inconsistency. Jerry also told us to add support to the other side of our arm motors to make it easier on the arm motor to spin the sleeve. 

Another part of the discussion that stood out to us was that we could easily make this robot work on a long sleeve shirt as well. The only difference was that a long sleeve shirt had-obviously-longer sleeves. All we would need to do was add more 15-hole pieces to the other side of the motor and it would be able to fold the long sleeve just as well as the short sleeve. 

Next class, we plan on carrying our Leo's gray studs idea and then adding the stability frame to the motors. We are confident that these two idea combined can make our robot work perfectly. If we have time, we can also add the long sleeve shirt component. 

Fixing the Arms - August 1st, 2022

Overview

As outlined in the previous entry, we planned on fixing the issues with our sleeves not being able to consistently fold today. We came up with some solutions while discussing with our peers last class, and hope to successfully implement them today. 

Design

We began by adding gray studs underneath each of the white 15-hole pieces on the arms. This would allow for us to create a level surface for the sleeves to rest on. Witha level surface, the sleeves would likely be able to fold more consistently. We decided to use the same rectangular pieces that we had used on our middle base area. These pieces are both lightweight and very easy to implement. All we had to do to attach them was connect the holes on them with the 15-hole pieces using a technic pin. 

The next thing that we did was add support to the ends of the arms that weren't connected to the motor. This support would hold the arms up on the same level as the motors as well as make it easier on the motors to fold the sleeves as the arms aren't being dragged down. Designing this support was pretty tough, as we knew it had to be attached to an unmoving component of the robot. If they were attached to something moving, then the supports themselves would move, causing more issues and defeating their purpose. There were no spots on the robot that did not move at all other than the unmoving base made of light and dark gray 15-hole pieces. Therefore, we had to use a variety of different sized pieces and connecters that went from this unmoving base all the way to the other end of robot. Then, we developed the support and attached it to these pieces, creating a strong, stationary component that would be able to support the arms from the other end. This entire component is white and can be seen at the top of the picture to the right. It is connected to the sleeves via a red L piece, which has a frictionless technic pin going through it. 

Another benefit of the pieces that were attached to the unmoving base is that they provided overall structural integrity to the bot, as we could now lift the bot by these pieces. 

Testing

These 2 improvements made our bot significantly better. It was now able to fold t-shirt exactly how we wanted it to very consistently. There was nothing that I had to fix or change in the code, so that was also done. Next class, we plan on attaching more sleeve pieces under both of the arm motors so that we can also fold long sleeve shirts. We also still have a minor issue that whenever we fold flimsy t-shirts such as atheltic ones, they do not end up coming out clean. They are folded, but in a way which causes them to still look messy. 

Adding Long Sleeve Functionality - August 2nd, 2022

Overview

Today, we planned to add 2 more 15-hole white pieces underneath each of our sleeve motors so that our robot could also fold long sleeve shirts. We assumed that this wouldn't be too hard, and would only take a couple minutes.

Design

We did this the same way that we did the normal sleeves. We just used a 15-hole gray piece and attached 2 15-hole white pieces to it. There were also the same rectangular pieces underneath the white pieces so that the surface was level. We built two of these components (for both sides) and then attached them to the 2 motors. 

Testing

Witrhout changing anything in the code, our design worked just as expected. We were able to fold a long sleeve shirt just as well as a short sleeve t-shirt. 

Adding Button and Integrating EV3 Brain- August 2nd, 2022

Overview

This task was primarily to make our robot look clean and be simple to use. We would integrate the EV3 brain into our unmoving dark and light gray platform, as well as connect it to a button. When the button was pushed, the code would run. This way, the user would not have to carry around the EV3 brain seperately and would have a much more satisfying, easy way to run the code as compared to having to use the EV3. 

Designing

We had known that we wanted to integrate the EV3 into the platform since the beginning of the project. This is why we had nothing on the unmoving platform. We simply used technic pins to connect the sides of the EV3 to the platform. Coincidentally, the EV3 height was the exact same as our robot, so the EV3 was able to rest flat on the ground. 

To attach the button, all we had to do was connect a wire from the EV3 to a bumper switch. When this bumper switch is pressed, the code will be executed. 

While we were attaching the EV3 of the platform, I thought to attach more rectangular pieces to the middlke of our robot. I thought that these would help us with the issue of flimsy t-shirts not folding properly. Since there were large gaps between the arms and the middle folding base, part of the shirts would fall down into that area, which messed up the entire folding process. Therefore, filling these gaps with rectangular pieces should help with the issue. 

Code

To code the bumper switch, all I had to do was add an if statement that checks whether the bumper switch has been pressed. If it is pressed, all the code so far would execute. Otherwise, nothing would happen. 

Testing

As expected, everything worked well on the robot. My idea of adding rectangular pieces helped significantly with folding active shirts and they were able to fold just as well as normal shirts. The bumper switch idea also worked and the EV3 integrated into the platform didn't cause any issues with folding. 

Defining the bumper switch in the code

The if statement that checks whether the button has been pressed and executes the code if it has. 

Adding Another Fold - August 3rd

Overview

Since our robot was finsihed and we still had 2 days left, we asked Dr. Ded-del what else we can add to the bot. He was very impressed by our design and that we had completed it in such little time. He recommended that we could add another fold to our machine. Our machine currently only folded the torso portion of the shirt once, which takes up a lot of space in clothing drawers. He told us to try to add another fold to after our current design so that the end product is half the size of what it currently is. 

Design

This was likely the hardest challenge we faced thus far. The EV3 brain can only handle 4 motors as it only has 4 motor ports. We were already using 4 motors (2 for arms, 2 for the folding base), so we did not have any more space on our current brain to add another motor to fold the t-shirt. My partner and I took some time to think on our own. After about 10 minutes, I had an idea. 

My idea was to use a second EV3 brain. Even though EV3 brains can not communicate with one another directly, I had thought of a way to create a chain reaction that would cause the second brain to initiate the motors. The second brain would have a button connected to it. When this button was hit, the second brain would spin the motor, leading to the second fold. Since it would be annoying for the user to have to press the button every time they wanted a second fold, I thought of a way to have the second fold occur autonomously. When the large, main platform folds, it goes very far down to ensure that the shirt folds completely. I used this to my advantage and decided that I could strategically place the second button in a location such that when the main platform folds down, it hits the button. This would then lead to a chain reaction, causing the last fold to occur. 

This idea was my greatest accomplishment during this project. Nobody was able to think of an idea that had a good chance of being successful, and therefore I am very proud of this idea. 

I told my partner this idea and he immediately agreed that it would be best to use. We first began by creating the second folding platform. This would only be powered by one motor as we didn't deem it necessary to use two since there is not too much weight to carry. This second platform was very similar in design to our first one, with the rectangular pieces to reduce weight. Although, we only had the rectangular pieces in the first row. We determined that we could use the 15-hole pieces for the rest of the structure as they would be stronger and provide a flat surface for the folded shirt. If we used rectangular pieces, the shirt could get stuck between the holes of the pieces, causing the last fold to be messy. 

In our first iteration, we just added a couple pieces to ensure that one motor would have enough power to lift up the weight. It seemed to be fine, so we moved on to creating a full flat platform in the second iteration. Although we could have also finished the robot without the full platform, it would not have looked as neat and clean. 

Code

For the code for the second brain, all I had to do was use the same if statement from the first EV3 and then inside the if statement spin the motor 170 degrees. I put some delay time before spinning the motor so that the large platform would be able to fold back to its original position.  

Testing 

This was our final product, so we had to ensure that it was perfect for our presentation. We knew that everything was working as expected until the second fold through previous tests, so we mainly tested the second fold. The main thing that we tested was that the button attached to the second EV3 would be hit by the first fold. We tried shirts with varying thickness to ensure that no matter what, the button would be hit and the second fold would occur. 

The code for the second brain. Motor/sensor are defined at the top, and then the logic is similar to the first brain. 

First Iteration

Final Iteration

Final Demonstration

46AC5B63-470B-40F9-90F2-F9EF9E127EC4.mov

Tri-Fold Presentation

Important Links

Link to Github Codebase


Brain 1 (Primary Brain):

PDF Link

Downloadable Code Link


Brain 2 (Secondary Brain used for last fold)

PDF Link

Downloadable Code Link


Slides Presentation

Presentation Link