automated folding board

28
Automated Folding Board December 10, 2012 Michael Tran Jonathan Dee Randall Morioka Floyd Linayao San Jose State University Department of Mechanical & Aerospace Engineering ME 106 Fundamentals of Mechatronics

Upload: michael-tran

Post on 17-Jul-2016

13 views

Category:

Documents


0 download

DESCRIPTION

San Jose State UniversityAutomated Folding BoardTerm ProjectME106

TRANSCRIPT

Page 1: Automated Folding Board

Automated Folding Board

December 10, 2012

Michael TranJonathan Dee

Randall MoriokaFloyd Linayao

San Jose State UniversityDepartment of Mechanical & Aerospace Engineering

ME 106 Fundamentals of Mechatronics

Page 2: Automated Folding Board

Table of Contents

Summary ............................................................................................................................1

Introduction ......................................................................................................................2

Design Specifications ....................................................................................................... 3

Design Details ...................................................................................................................3

Procedure ..........................................................................................................................9

Final Thoughts .................................................................................................................10

Appendix

A1 – Drawings ..................................................................................................12

A2 – Code .........................................................................................................14

A3 – Data Sheets ..............................................................................................19

A4 –Bill of Materials .......................................................................................20

Peer Evaluation

Page 3: Automated Folding Board

Summary

Our project was to create an automated folding board for clothing. The board will be able to discern which article of clothing is resting on the board and fold them accordingly. The final product will be useful for industries that require human interaction and for homes with people who have trouble completing the motions.

To complete this, we used both electrical components from the lab and mechanical components. The electrical components consisted of an Arduino connected to motor driver boards, stepper motor, and photo-resistors. The mechanical components consisted of acrylic linkages, gears, and a folding board. When assembled correctly, the working model would be able to operate with no human interaction except for loading the clothes.

During our development process, we figured that the links would require a gear set to increase the torque to raise the panels. The stepper motors allowed us to maintain control over the rotation of these gears and linkages. All the stepper motors responded to the sensors located on the folding board. However, one panel was unable to operate correctly due the incorrect gearing.

Overall, the outcome of this project was successful. Our decision to create an automated system became a huge undertaking; the implication of multiple components required every piece to function correctly. In Figure1, the model was completed and operational for the design expo. During our presentation, the folding board was able to fold a pair of shorts.

Figure 1. Automated Folding board. This picture shows our completed working model.

1

Page 4: Automated Folding Board

Introduction

Simple everyday tasks can become very repetitive over long periods of time. Many tasks can become easier with the right design. With things being automated, people would have extra time to complete other tasks while the machine operates independently. Also, automation can increase production in the long run because it will not be relied on human intervention. If designed correctly, the machine can run for longer periods than a person and will not experience fatigue.

We wanted to create a product that would help assist or eliminate an everyday task. For our project we decided to automate the action of folding clothes. We used a clothing folder board as the basis of our design for the project. The board was invented to make folding clothes easier and more uniform, however it required a human to operate it. Using what we had learned in class, we wanted to simulate the actions of folding the panels on the board.

In order to do so, we needed to create a system that would be able to lift the panel with linkages and motors. A set of linkages would be required to raise the panel from a flat position to a folded position to fold each portion of the coding. A motor with a high torque would be essential in lifting heavy articles of clothing.

Sensors would be implemented to check if a piece of clothing has been loaded onto the board. We want to design these sensors to recognize the shapes of different articles of clothing. This would allow the board to become versatile, folding shirts, pants, or shorts. To determine the shape of clothing on the board we will need to install some photo-resistors onto the board itself. A photo-resistor is a resistor that changes its resistivity depending on the amount of light that is emitted on it.

Once it determines or recognizes the type of clothing, the Arduino board will be able to power the motor. From the motor it will then be able to turn the gears and links in order to lift the panels and then return to its original position. In Figure 2, a photo is displayed where the motor lifted one of the side panels.

Figure 2. Raised Clothes Board Panel. In this picture we demonstrate that our design works conceptually.

2

Page 5: Automated Folding Board

Design Specifications

In order for this project to be successful, we need to establish a set of goals that the model should be able to complete. These goals must show the qualities of an automated system. By setting the parameters, we would be able to see if our design is developing into an automated system.

A fully developed automated system should not require any human interaction. An Arduino board will be used to do all the “thinking” of the system. We would want the Arduino board to make the decisions based on the sensors. The Arduino board should then act on these decisions to operate the correct components to complete the process.

We came up with three main design specifications for our project.

The Arduino should be able distinguish the article of clothing through the sensors. The Arduino should be able to actuate the motors to fold the specified clothing.

The motors should be able to turn the gears and links to lift the panels, and then retract to the original position

Design Details

Linkages

The width of the left and right flaps measured approximately 9in. We decided to attach the mechanism in the middle of each flap (4.5in from the center base hinge). Although the bottom flap measures a length of about 11in, we also decided to connect it 4.5in from the base hinge to keep everything consistent. We wanted the flaps to sweep from 0o (flat) to about 120o in Figure 4 and Figure 5.

Figure 3. Board Front View

3

Page 6: Automated Folding Board

Figure 4. Board Bottom View

Figure 5. Board Bottom View

Figure 6. Starting and Ending Positions of the linkages. A 180o rotation of the dyad (blue) will make the flaps (gray) sweep from 0o (flat) to 120o.

4

Page 7: Automated Folding Board

Gears

When we first put of mechanism to use, our stepper motors did not have enough torque to turn the dyad and lift the flaps. To increase our torque output, we added in a worm drive. The drive consists of a worm gear (brown) and a spur gear (green). Our dyad is connected directly to the spur gear. For every rotation of the worm, the spur gear advances by one tooth. Our spur gear has 52 teeth. This gives us a 52:1 torque ratio. With the added torque, our stepper motors are now able to lift the flaps.

Figure 7. Worm gear and spur gear assembly.

Stepper motor and the EasyDriver

For our application, we decided to use stepper motors because we can control the speed and the amount of rotations from the motor. The stepper motors we are using are the 175H150H-01A, which are rated at 4V and the current at 1.2A. It is a six-wire unipolar motor. However, with stepper motors, it would have required us to use two H-bridges and would have needed to use 4 digital pins on the microcontroller. Since we were using three stepper motors, we would not have enough pins on the Arduino for all three. So, we decided to use the EasyDriver V4.4 by Sparkfun to control our stepper motors.

5

Page 8: Automated Folding Board

Figure 8. Stepper Motor and the EasyDriver

Several advantages in using the EasyDriver includes: the ability to easily switch between micro stepping, quarter stepping, half stepping, and full stepping; the ability to adjust the current from 150 mA to 750 mA directly from the board using a potentiometer; an increased supply voltage rated between 7V-30V; an integrated H-bridge; and having to uses only two pins on the Arduino. For our use, the last advantage mentioned proved to be most helpful since with the three stepper motors would use 6 pins altogether. Furthermore, even though our motors are rated for only 4V, the EasyDriver can handle more if needed. We would like to note that on our EasyDrivers, the labels for the MAX and MIN for the current are switched. So if we were to turn the potentiometer toward MAX, it would actually be allowing the minimum current, and vice versa.

As shown in Figure 9, the EasyDriver requires external power sources, which for our project have chosen to use 9V. To connect the motor to the EasyDriver, connect the leads from the motor. There are two connections that would need to be made from each EasyDriver to the digital pins on the microcontroller, which can be seen in Figure 10. The pin labeled STEP will be used to control how many steps the motor will take, and the pin labeled DIR will control which direction the motor will turn. Please note that there are two pins that must be connected to ground on the EasyDriver.

6

Page 9: Automated Folding Board

Figure 9. Connecting the stepper motor to the EasyDriver

Figure 10. EasyDriver V4.4

Interfacing with the Arduino Microcontroller

As mentioned earlier, through the use of the EasyDriver, each motor will use 2 digital pins on the Arduino. On our case, we have chosen to use the pins D2-D7, as shown in figure 11. Looking at the same diagram, we have four different photoresistor’s (one for each panel) powered by 5V, (from the Arduino) each in series with a 10kΩ that is connected to ground. The photoresistors are connected to analog pins A0-A3 on the Arduino.

7

Page 10: Automated Folding Board

Figure 11. Schematic of the circuit diagram

We wanted each panel to rotate approximately 120O from its flat position. Since we are using gears, we would have to calculate how many steps needed to attain that angle. Additionally, in our set up, our links are actually set approximately -10O from the panels starting position, which means in order for our panel to rotate our target angle of 120O, our links would have to rotate approximately 130O. Our spur gears have 52 teeth, which means that it would take 52 revolutions from the motor to turn the gear a full 360O. Our calculations below are used to figure out how many revolutions there are in 130O:

52revolutions360O

= r130O

r=18.77 revolutions

Since the EasyDriver defaulted to use micro stepping, to calculate how many steps needed to rotate 18.77 revolutions, our work is shown below:

1 revolution=1600 steps

18.77 revolutions∗1600 steps1 revolution

=30,044≈30,000 steps

One of our EasyDrivers became faulty, and no longer was able to perform micro stepping. It instead defaulted to quarter stepping. The calculations to find the needed amount of steps are shown below:

8

Page 11: Automated Folding Board

1 revolution=800 steps

18.77 revolutions∗800 steps1 revolution

=15,022≈15,000 steps

The values of 30,000 and 15,000 are used in the sketch uploaded to the Arduino, and can be found in the Appendix.

Procedure

To begin this project, we would need to first sketch a code that will function with our electronic components. The code should be able to take readings from four different sensors and send three different signals to the stepper motors. Figure 12 can be used as a simple system block diagram of how many components there are and how they should be hooked up.

Figure 12. System Block Diagram

The each of the sensors will be consisted of a photoresistor and 10kΩ resistor. The photoresistor should be connected to a 5V source, which can come from the Arduino board, and to an analog input, into the Arduino board. The photoresistor must be connected to the 10kΩ resistor and into a ground to avoid overloading the Arduino board. The Arduino will be able to read the voltage change into the analog input based on the amount of light into the photoresistor. The photoresistor is designed to increase its resistance when more light is shined onto it.

These readings will be our threshold for an open sensor and a covered resistor. Next, the stepper motor must be connected to the EasyDriver. The stepper motor has 6 wires, however, using the EasyDriver, only four will be connected. In Figure 13, the red and blue wires will be connected to A while the black and green wires will be connected to B. From the EasyDriver, the STEP and DIR pins will be connected into the Arduino inputs.

9

Page 12: Automated Folding Board

Figure 13. Stepper Motor to EasyDriver connection

If coded correctly, the stepper motors should be able to rotate forward and reverse depending on which sensors are covered. Figure 18 in Appendix B can be used as a reference for programming the Arduino board.

Final Thoughts

Initially, our group wanted to use DC motors and linkages only from the start. However, we had difficulty trying to control the direction and speed of the motor. After building on our first and second design, w we decided to use stepper motors instead of DC motors. We got into the problem in how to best address the problem of not having enough pins on the Arduino. By using the stepper motor drivers we were able to decrease the number of pins used on the microcontroller board. Implementing a gear setup would have been more difficult to control the number of revolutions needed to get the board in the same position each time.

Through this project we learned several things. First, always create more designs for the linkages as you never know how many designs will eventually fail. For us we went through about three different linkage designs before finally settling on the worm gear and linkage combination. When we first tried out the linkage only design, we found out that the torque given off by the linkages were greater than the torque we could put out on the motor. When we tried using the worm gears in conjunction with a spur gear, we were able to get more than enough torque from the stepper motor. The worm gear also had a natural locking mechanism so that the linkages would not fall on themselves. This would be a mechanical safety measure for the board if the Arduino were to lose power.

Another thing we learned was to always purchase spare parts because anything can fail. We had leads breaking off of the smaller electrical components. To solder and mount the

10

Page 13: Automated Folding Board

components back onto the system took a lot of extra time away from continuing the project. Since each component needed to be working, we could not test our model when things broke down.

If given more time for the project, we would like to fine tune all the motors to run smoothly. In order to do so we would also need to find another worm gear that would work with the other gears. In regards to the motor, we also would like try to get it so that it would run faster so that the process would not take so long. We’d also try to redo the links so that it would be able to turn 120°-150° instead of 90° or 100°.

We would also try to get the mounting brackets for the gears to be a constructed better. As we kept testing the model, we noticed that the motor would push the gear shaft against the mounting brackets. This is a serious safety issue and can fail over periods of continuous use. Also, electronic safeties such as lever switches should be employed near the linkages. These lever switches will shut the power off to the motor if it goes too far.

Overall, we are content with the outcome of our project. According to our design specifications, we feel that we had reached two of the three goals we have set for this project. The model only operated two of the three panels of the folding board. We enjoyed constructing our own circuits and programming the Arduino for our own purposes. Although there were multiple failures in the linkage design, we understand that is part of the design process. Being able to see our concepts on paper turn into a working model showed us the successes of a mechanical engineer.

11

Page 14: Automated Folding Board

Appendix

A1 – Designs

Link Design 1:

Lengths of links:p = 3.5”q = 2.0”l = 4.5”s = 1.5”

This design did not give us enough range of movement for the panel to fold all the way.

Figure 14. Link Design 1

Link Design 2:

This design required a greater amount of torque than our stepper motor can put out due to the long link.

Lengths of links:p = 4.5” q = 4.5” l = 8.0” s = 3.5”

12

Page 15: Automated Folding Board

Figure 15. Link Design 2

Link Design 3:

This is the design we decided on. The worm gear and the wheel gear create a greater torque compared to Design 2.

Figure 16. Link Design 3

13

Page 16: Automated Folding Board

Figure 17. Link Design 3 Measurements

A2 – Code

/*NOTE: The EasyDriver used for the left motor and the right motor defaults to using micro stepping [1600 steps = 1 Full Rotation]The EasyDriver used for the bottom motor is faulty, and is defaulted to using quarter stepping, which is why the number of rotations are different [800 steps = 1 Full Rotation]*/

#define DIR_PIN_R 2 //For the right motor#define STEP_PIN_R 3

#define DIR_PIN_B 6 //For the bottom motor#define STEP_PIN_B 7

#define DIR_PIN_L 8 //For the left motor#define STEP_PIN_L 9

void setup() pinMode(DIR_PIN_L, OUTPUT); //Set pins on all three motors as outputs pinMode(STEP_PIN_L, OUTPUT); pinMode(DIR_PIN_R, OUTPUT); pinMode(STEP_PIN_R, OUTPUT); pinMode(DIR_PIN_B, OUTPUT);

14

Page 17: Automated Folding Board

pinMode(STEP_PIN_B, OUTPUT);

void loop() intmiddleSensor = analogRead(A4); //Takes a reading from the middle sensor intbottomSensor = analogRead(A2); //Takes a reading from the bottom sensor intrightSensor = analogRead(A3); //Takes a reading from the right sensor intleftSensor = analogRead(A1); //Takes a reading from the left sensor

if(middleSensor<= 800 &&bottomSensor<= 800) //Checks if middle and bottom sensor are covered delay(1000); if(rightSensor<=600 &&leftSensor<=500) //Checks if left and right sensors are covered. If TRUE, perform shirt pattern /* Fold Left Flap and retract to original position Fold Right Flap and retract to original position Fold Bottom Flap and retract to original position */

//Left motor beginsrotate_L(30000); //Engages the motor to raise the left panel in the up position (130 degrees)delay(1000); rotate_L(-30000); //Engages the motor to retract the left panel to the starting positiondelay(1000); //Left motor ends

//Right motor begins rotate_R(30000); //Engages the motor to raise the right panel in the up position (130 degrees)delay(1000); rotate_R(-30000); //Engages the motor to retract the right panel to the starting positiondelay(1000);//Right motor ends

//Bottom motor beginsrotate_B(15000); // Engages the motor to raise the bottom panel in the up position (130 degrees)delay(1000); rotate_B(-15000); // Engages the motor to retract the bottom panel to the starting positiondelay(1000);//Bottom motor ends

15

Page 18: Automated Folding Board

else if(rightSensor<=600 &&leftSensor>500) //Checks if the right sensor is covered, and the left sensor left open. If TRUE, perform pants pattern /*Fold Right Flap and retract to original positionFold Bottom Flap and retract to original position*/

//Right motor begins rotate_R(30000); //Engages the motor to raise the right panel in the up position (130 degrees)delay(1000); rotate_R(-30000); //Engages the motor to retract the right panel to the starting positiondelay(1000);//Right motor ends

//Bottom motor beginsrotate_B(15000); // Engages the motor to raise the bottom panel in the up position (130 degrees)delay(1000); rotate_B(-15000); // Engages the motor to retract the bottom panel to the starting positiondelay(1000);//Bottom motor ends

else if(rightSensor>600 &&leftSensor<=500) // Checks if the left sensor is covered, and the right sensor left open. If TRUE, perform pants pattern /*Fold Left Flap and retract to original positionFold Bottom Flap and retract to original position*/

//Left motor beginsrotate_L(30000); //Engages the motor to raise the left panel in the up position (130 degrees)delay(1000); rotate_L(-30000); //Engages the motor to retract the left panel to the starting positiondelay(1000); //Left motor ends

//Bottom motor beginsrotate_B(15000); // Engages the motor to raise the bottom panel in the up position (130 degrees)delay(1000); rotate_B(-15000); // Engages the motor to retract the bottom panel to the starting position

16

Page 19: Automated Folding Board

delay(1000);//Bottom motor ends

voidrotate_L(int steps)

if(steps>0) //Checks if steps is larger than 0. If TRUE, the motor will move to raise the panel intdir=HIGH; digitalWrite(DIR_PIN_L,dir);

if(steps<0) //Checks if steps is smaller than 0. If TRUE, the motor will move to retract the panel intdir=LOW; digitalWrite(DIR_PIN_L,dir);

steps = abs(steps);intusDelay=500;

for(inti=0; i< steps; i++) digitalWrite(STEP_PIN_L, HIGH); delayMicroseconds(usDelay);

digitalWrite(STEP_PIN_L, LOW); delayMicroseconds(usDelay);

voidrotate_B(int steps) if(steps>0) //Checks if steps is larger than 0. If TRUE, the motor will move to raise the panel intdir=HIGH; digitalWrite(DIR_PIN_B,dir);

if(steps<0) //Checks if steps is smaller than 0. If TRUE, the motor will move to retract the panel intdir=LOW; digitalWrite(DIR_PIN_B,dir);

17

Page 20: Automated Folding Board

steps = abs(steps);intusDelay(500);

for(inti=0; i< steps; i++) digitalWrite(STEP_PIN_B, HIGH); delayMicroseconds(usDelay);

digitalWrite(STEP_PIN_B, LOW); delayMicroseconds(usDelay);

voidrotate_R(int steps) if(steps>0) //Checks if steps is larger than 0. If TRUE, the motor will move to raise the panel intdir=HIGH; digitalWrite(DIR_PIN_R,dir);

if(steps<0) //Checks if steps is smaller than 0. If TRUE, the motor will move to retract the panel intdir=LOW; digitalWrite(DIR_PIN_R,dir);

steps = abs(steps); intusDelay=140;

for(inti=0; i< steps; i++) digitalWrite(STEP_PIN_R, HIGH); delayMicroseconds(usDelay);

digitalWrite(STEP_PIN_R, LOW); delayMicroseconds(usDelay);

18

Page 21: Automated Folding Board

Figure 18. Coding Flow Chart

A3 – Data Sheets

* See attached documents

19

Page 22: Automated Folding Board

A4 – Bill of Materials

Part Cost per Unit # Units Sub-TotalStepper Motor $ 9.95 3 $ 29.85 Photoresistor $ 1.65 4 $ 6.60 Motor Drivers $ 14.95 3 $ 44.85 Arcrylic $ 1.00 2 $ 2.00 Folding Board $ 14.95 1 $ 14.95 Gear Set $ 30.00 1 $ 30.00 Arduino Uno $ 29.95 1 $ 29.95

Total $ 158.20

20