Tuesday, May 12, 2015

Final Project, Phase 4; Final Post

Project description: Our project guides people through the handwashing process. It uses measured delays to ensure that there is proper time between each step in the handwashing visual. An indicator, attached to a chain, moves across the top of the visual, stopping in the middle of each picture to guide people through the procedure. The chain is attached to lego gears, one of which is attached to a gear train with a ratio of 1:5. This gear train allows a servo motor’s 180 degree range of rotational movement to translate to linear movement.
            We chose this project because our target audience would benefit from handwashing correctly, but often does not remember steps or spend adequate amounts of time. Our project is also flexible in utility: the visual can be replaced and the code can be slightly changed to alter the lesson of the device.

Video:
In the video, we first see that the LED lights up when a reading of < 30 is detected. After 4.5 seconds, there is nothing there, so the program does not run. The second time, a reading of < 30 is detected, and 4.5s after another reading of < 30 is taken, cueing the process to begin.










Team handwash:
Presenting our project was very rewarding and it was amazing seeing what all of our classmates accomplished in their final projects as well!

~

Reflections:
            We had initially wanted to create a “flowering tree” visual to accompany this task. However, I don’t believe that we could have accomplished so much with that type of visual: our project is more effective and appropriate for our target audience now, and we learned a great deal more about the design process while we turned our idealized initial idea into something tangible and developed.

Unlike our previous assignments, this project’s design process did not require one or two minor corrections. Instead, it called for multiple visits to the CSC, observation of our target audience, and multiple structural and electronic changes to our design. This project did not serve to simply function; it was designed with specific people in mind and with the purpose to educate.

Our design process included many discussions about the impact of our decisions on the efficacy of our product, but it also required us to figure out the best way to achieve our goal. We used a range of materials, mechanisms, and programs. We created a gear train and brainstormed about how to attach it to an indicator and whether a gear-chain system was the best approach. We asked about the best visual representation for our audience, received an answer, and changed our code to be consistent with our decision. We designed a box in solidworks, only to realize that it was not conducive to the way we wanted our visual to be mounted – and we had to fix that as well. We thought about the potential issues our project might face, and resolved the most salient one by installing a LED light and program.

In the beginning, we had ambitious and unrealistic ideas. The initial stages of our design process saw us realizing the complications in our ideas only when they were right in front of our faces. But as we became more comfortable with our project, more anticipatory, we were able to preclude some challenges and make more complex changes in an educated fashion. Although the design process demanded more complex changes, it helped our project address more goals and potential issues.

If we had more time, I would definitely have tried to improve a few things on the device and a couple of things about the design process.

For the device, I would have liked to increase the aesthetics. Although we were advised to keep visual distractions to a minimum, I believe that there could have been some subtle way of eliminating the starkness of the white Delrin box against the visual which would not detract from attention to the visual. I would also have liked to find a better way of encasing the sides than plastic wrap. If I could have found suitable glass or clear materials, the sides would be sturdier, more streamlined, waterproof and would allow for easier visual access by curious audience members.

For the design process, I really liked how we approached designing at the end of the process. We were more anticipatory at that time. At the same time, I’m glad that we had to learn to get to that point. If I could go back and change our decisions during design process, I would be more anticipatory. One issue I would have liked to realize sooner was how we would attach the visual to the box. We laser cut the box out first, and only after we put it together realized how we would want the visual to be in front of the gear train and touching the front face of the box bottom (we later moved the peg holes 2cm inward to resolve this). Thinking about the visual sooner would have helped us save materials and time. The other change I would have made would be thinking about how we would want to attach the box to the wall sooner. Although it is unlikely that the CSC would want to put nails in the bathroom wall, nails would be the sturdiest way for the box to hang on the wall. We thought about this after we had heatstaked the box together. We considered using the drill press to bore two holes in the back, but given that the pressure would most likely fracture the Delrin with support only at the edges of the piece, we decided against it. If we had more time, we could have reconstructed the box, but bored the two holes into the back before heatstaking.

I am very happy with our final product. I think it can really benefit the CSC and I liked how we were able to make it very user-friendly and mechanically accessible. It looks neat and I especially liked how we figured out how to use servo’s limited motion to move the indicator across the pictures very exactly.

I couldn’t have asked for a better partner in this than Xi Xi. It was great to get to know her by sharing ideas and talking about other things while working side-by-side in the lab. We definitely played to our strengths, and kept up good communications.

Thank you to Professor Banzaert, Larry, the CSC, and our classmates! You all helped us so much in very different ways. We both appreciate it J

Final Project, Phase 3

A recap of previous phases:

In phase 1, we:
            Decided on the layout of the visual
            Visited the CSC to learn about the handwashing process and the best method of approaching                      our targeted group of people
            Creation of a gear train that would translate servo’s 180° rotational movement into linear                            movement spanning 14” of visual (1:5 lego gear train ratio)
            Attaching the input gear to servo (change from piano wire to glue)
            Brainstorming the position of the ultrasonic sensor(s)

In phase 2, we:
            Created an Arduino program that would rotate our servo motor with different time delays to                       correspond with the different steps in the handwashing procedure: filled with placeholder                     values and designed for 8 steps.
            Designing a working circuit to make sure all components function and integrate correctly
            Changing the position of the ultrasonic sensor to rest below the visual
            Creation of the box – front piece (which was also printed again for the back piece) and the                         bottom piece
            Creation of a new, heatstaked indicator

Now, in phase 3, we completed our final project.

To fully complete our project we had to:
1.     Change the box dimensions due to some complications
2.     Visit the CSC for concrete values and to watch the actual handwashing process performed by a number of people in our targeted audience
3.     Finalize the information in our visual
4.     Fine tune our program with correct values
5.     Add an indicating LED light to the circuit and program
6.     Assemble the components of our project and adjust due to some minor issues
7.     Affix the visual and provide the means of attaching our project to the wall
8.     Present our project!

At the beginning of the week, we printed out our original solidworks pieces for the front of the box (x2) and the base of the box. We realized we had to make some changes in order for the box to be eligible for heatstaking and also to enable the visual to rest properly against the front edge of the base.

Our first correction was to lengthen the pegs on the front piece slightly. Although we had measured correctly given the thickness of our piece of Delrin, we decided we needed slightly more material to work with in order to properly heat stake the pieces together. Extending the pegs gave us more material protruding from the holes in the base to work with.





Our second correction was based upon how we thought about the visual’s orientation. We wanted the visual to rest behind the indicator, but in front of the gear train and be out of the way of the chain as well. Giving this some thought, we thought that if we positioned the top of the visual accordingly, the bottom would have to be vertically in line with the top. This meant that the visual had to be affixed to the base at a point beyond the gear train (and therefore, beyond the front wall of the delrin). We needed to move the pegs in by 2cm to create the proper distance (needed for the gear train) between the front edge of the base (in line with the visual) and the front wall of the box.

                            


Our next objective was to revisit the CSC and witness the handwashing process as well as measure accurate values integral to our Arduino program.

We watched and timed more than 10 people engaged in the handwashing process. We noticed that some skipped steps, and there was variance in the time spent on each step of the process. We decided that because there are regulation times for rubbing and rinsing hands, we would focus on getting an accurate sense of how long our delays should be for turning on/off the water or grabbing soap. Over the course of 10+ trials, we agreed on time intervals that we thought best for the process. These values allowed for more time, which could help slow the process or allow people who may be behind to catch up.

Next, we measured the distance between the ultrasonic sensor and the edge of the sink, with the intention of going back to the lab and using the sensor at the same distance from an object to see the relevant readings. However, we were able to download Arduino software in time to take the readings on-site.

If a child is flush with the sink’s edge, the reading is approximately 25. Given a little more space of about 10 cm (a reasonable buffer zone), the reading is approximately 30. We decided that a reading of less than 30 would be consistent with every attempt to wash one’s hands.

While we were at the CSC, we also asked a director about her preferences for our project’s visual. We had constructed two choices, one with 7 and one with 8 steps.

Our first idea for the visual (seen in the foam core prototype in phase 1) had the steps:
            Roll up sleeves/wet hands/turn off water/get soap/rub hands/rinse hands/turn off water/dry hands.

Our second option removed the first turn off water command.

Although there was an interest in not wasting water, the director advised us to pursue the second option to simplify the process for the audience.

We designed the 7 remaining steps in the visual by using pictures from the actual bathroom the handwashing is conducted, which made the images the most concrete. Each image became 2” wide, for the visual to span 14,” fitting in nicely between the axles of the gear-pulley system.
 The electronic design


Our next steps in the lab were to complete the visual and tweak the code.
We printed out and laminated the steps we would use, and taped them together into a single strip. We formed bold black lines between the steps to effectively differentiate them. We also colored the indicator black to track its progress more easily. We also made a rectangular cut at the plastic bottom of the visual, in the middle where the ultrasonic sensor was positioned. This removed interference with the sensor by the visual.






 Printed visual & its placement








While in the process of tweaking the code, we thought about whether the people would know if the process had started or not. Before, when our code took a reading below 30, it would check back in 5 seconds to see if the reading was still below 30. This would confirm that a person was indeed before the sink, and also would give that person time to roll up their sleeves before moving to the next step. But wouldn’t people want to know if the sensor registered them the first time, and not have to catch up if they thought that it didn’t?

We thought that an LED would help resolve this problem. We added to our code some commands that would tell the LED to light up at certain times, which would inform the participant that the program was running.

When the sensor reads a value of less than 30, the LED will turn on for .5 seconds. If, after 4.5 more seconds, the person is still there, the LED will turn on and remain on for the rest of the process (which starts after the initial 5 seconds if both readings < 30). It will shut off when the program resets. If the second reading is greater than 30, the process will not proceed.

The initial blink will tell people that the sensor “recognized” that a person is in front of it, and that if the person remains there for 5 seconds, the process would start. The audience can be taught that when the light blinks the first time, then is the time to roll up their sleeves before the next step begins.

Addition of a red LED bulb, adhered with electrical tape

Lit LED bulb while program is running

LED circuit: orange and yellow connect the components to the voltage and ground terminals. Green and yellow go to the LED, where green is positive. There is a 10kOhm resistor.


To get the final program:
We added the LED program into our existing code.
We changed the delay values based on the timings we gathered from the CSC trials
We had to change the program to accommodate 7 steps instead of 8. This meant that we needed to partially rotate the servo motor 6 times, with a turn of ~25 degrees per rotation.

 Final code


~

Assembly:

We next had to assemble all the components of our project together.

Having cut out our box components, we heatstaked the pegs to the box base.

We installed the gear train into the axle holes in the box walls. We decided to file down the posterior ends of the axles to allow the back of the box to be more flush with the wall.


We hot glued the servo motor in place after dropping it down the shaft. We needed to file the shaft down to ensure that the servo fit correctly; it ended up needing slightly more width than we had measured.


We left the battery pack unattached but nested in the box for easy battery removal. It is also a distance away from the Arduino board to allow the Arduino cable to easily connect with the board without dislodging the battery pack.


We screwed the Arduino board into two legos (one of which was filed down to avoid interfering with important components on the bottom of the board) attached to Velcro, with corresponding velcro pieces on the bottom of the box. This prevents permanent damage to the Arduino board.



















We placed the breadboard to the right of the Arduino board so that the leads to the ultrasonic sensor were long enough to reach the middle of the box underneath. This is a picture that shows the relative orientation of the internal position of the components (looking in from the right side):

The ultrasonic sensor fastens to a lego which attaches to the underside of the box with Velcro. The front face of the sensor is flush with the front face of the box base.

We covered the ends of the box with plastic wrap. While we were at the CSC, a few members from our targeted audience were interested in seeing the inside of our project. The see-through quality of plastic wrap enables this exploration without touching while providing a layer of water protection.


The final step in assembling our project was to secure the visual on to the box with Velcro. This allows for the strip to be removed and replaced by other visuals. The flexibility of this feature lends itself to the uses our project could have. Slight changes in the Arduino program, in combination with a new visual, could succeed in guiding people through new tasks and procedures.












Completed project:
Front

Back

Thursday, April 30, 2015

Final Project Phase 2, Sciborg

We completed a number of tasks this previous week. Our objectives were:

1.     To install a 40 tooth lego gear onto the servo motor
2.     To create an appropriate program and set up the feedback and control input method
3.     To set up a protoboard that connects servo, sensor, and Arduino
4.     To design the indicator component in Solidworks
5.     To design the box in Solidworks

We also ordered a battery holder and created the sciborg line-following proportional control program.

We began the week by revising our method of attaching the lego gear to the servo motor. Previously, we used piano wire. We decided that glue was a better option, as it did not inhibit the range of motion nor did it allow the lego to “wiggle” upon the rotating disk.


Next, we worked to:
1. create an Arduino program to move the indicator across the visual
2. design a box to hold the electronic components and keep the gear train and visual steady.

The Arduino program incorporates the servo program and uses the servo to move the indicator across the visual via the gear train. In the program, the servo is activated while the ultrasonic sensor reads certain values, and maps its position. Delays are added to the servo’s movements to give different waiting periods for specific steps to be fulfilled.
 
We began with a while loop: as long as no one is in front of the sink (ultrasonic sensor reading > 400), the sensor will keep sensing until the condition is fulfilled.

Our next while loop occurs when the ultrasonic sensor reads less than 400, not satisfying the previous while command. Now, the sensor reads a value and waits 5 seconds before reading it again. If the value is still less than 400, this means a person is most likely standing in front of the sink waiting for the program to begin instead of just passing by. This also provides the change to roll up sleeves.

As we have 8 steps to our hand washing process, we needed the servo to move seven times. Knowing that the range of the servo’s motion is limited to ~180 degrees, we chose 175 degrees of total rotation to make the math easier. Now, each step required the servo to turn 25 degrees. The result helped us to further refine the size of our visual. Each step will have a picture 1.75” wide.
With a rotation of 25 degrees for each step, our program was repetitive in nature. We structured every step to delay for a certain amount of time (specific to the step in question), rotated the servo 25 degrees in positive 1 degree increments and updated its position, with a delay of 15ms to keep the servo motor from moving too fast. The variable delays were decided upon by taking the time adults would take to complete the step and multiplying by 2.

The final steps included the servo returning to its original position of pos = 0 from pos = 175 with negative 1 degree increments. The position was updated, and the ultrasonic sensor reading was also reset.

We ordered a small protoboard to connect the circuit:



 We used the A0 and 9 output pins, as well as the 5V and ground terminals.










Our circuit and its electronic components

~

We had previously hoped to create a sub-system of feedback and control which would check to see if the water was turned off at certain points in the process. Due to time and feasibility, we decided to focus our attention on the ultrasonic sensor and viable program.

Alongside this program development, we also brainstormed how our box would look like. This box is intended to have a back, bottom, and front. In front of the front of the box, we will position our lego train and visual. One of the sides of the box will feature the battery pack for easy access, and both the front and back faces of the box will have holes to position the axles of the gear train and hold them steady. The electronic components will fill in the space between the front and back walls, with the exception of servo and the sensor. Servo will be dropped into position via a shaft to hold it in place with the first gear in the train. The ultrasonic sensor will rest beneath the visual.


Using our gear train and visual prototype as a model, we began to construct measurements integral to the box’s function. The axles about which the gears were fastened were 0.7cm in diameter, which helped us create the right sized holes in the delrin a correct distance apart.


We made this piece 4.3 inches high and 45 cm long, to provide enough space for the axle holes and enough length to exceed that of the visual. To this length, we added four small tabs. We then decided to use 1/8” thickness of Delrin. This caused our tabs to be .2” in height and 0.6cm in length. We measured the diameter of the heat-stake to be ~9cm, so we chose 0.6cm so the tab wouldn’t be incompatible with the machine.

To this front piece, we incorporated a 0.6cm channel directly above one of the axle holes. This allows us to lower the servo into place above the first gear in the gear train. The distance between the center of the axle and where the servo meets the Delrin was found to be .94.”


We decided that rather than create another Delrin part to form the back of the box, we would instead use the Solidworks design for the front for the back of the box as well. This decision allowed us to design the bottom of the box.

The bottom of the box features holes in positions and widths that exactly match that of the front/back piece. We plan to insert the 8 tabs into the 8 slots and heat-stake them.




We designed an indicator which deviated from our prototype. Originally, we were using foam core and used vertical cuts to hold the two parts (parallel and perpendicular) of the indicator together. We then thought about how Delrin has low friction, and that it would be more feasible to actually create a tab-in-slot form that we could then heat-stake.
  





We printed these parts out and heat-staked them.


To attach this indicator to the gear system, we glued the piece onto a single lego chain link, which we then incorporated into the entire chain on the gear train system.


Next, we will print out the visual, put the box and electronic components together, and try to get it working!

~~~

Finally, we rewrote our line-following bang-bang control code into one using proportional control

Bang-bang from before:

     

Here, we looked at the bang-bang control program and translated those values into the proportional control program in a form consistent with proportional control.

We used our values of -40 and 220 from the bang-bang control to set our gain for motor 1. By using the minimum and maximum values read by the sensor (540 and 620, respectively), we were able to write linear functions to determine this gain. For example, we started with 620K+B = 220; and 540K+B = -40. Eliminating B, 80K=260, and the gain factor was 3.25 for this motor. Going back to find B yielded 1795, which makes sense because the reading does not start with a value of 0 (why there is a y intercept).

For motor 2, our bang-bang program assigned it one of two values: -48.5 or 228.5. We followed the same process as above and found a gain of 3.4625 and a B value of 1641.25.

With our calculated gains and B values, we were able to assign motor 1 a proportional control method of "reading*3.25-1795" and motor 2 "reading*3.4625-1641.25."