Difference between revisions of "Cheers!"

From ESE205 Wiki
Jump to navigation Jump to search
m (Protected "Cheers!" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(103 intermediate revisions by one other user not shown)
Line 8: Line 8:
  
 
== Objectives==
 
== Objectives==
[[File:HX1.jpeg|right|500px|Figure 1]]
+
[[File:Cpic10.jpeg|right|400px|thumb|System Drawing]]
 
+
[[File:CDemopic.png|right|400px|thumb|Demo Picture]]
# Replicate the project found on [https://www.youtube.com/watch?v=tyv5rVPUGLU&t=21s youtube] but replace the beer bottle with a soda glass bottle and appropriately sized glassware. There will also be no bottle rotating mechanism. The control for the tilting mechanism will be changed to a pulley rope system outlined in Figure 1. The glassware will be kept on the table instead of swinging.
+
# Replicate the project found on [https://www.youtube.com/watch?v=tyv5rVPUGLU&t=21s youtube] but replace the beer bottle with a soda glass bottle and appropriately sized glassware. There will also be no bottle rotating mechanism. The control for the tilting mechanism will be changed to a pulley rope system outlined on the right figure. The glassware will be kept on the table instead of swinging.
 
# Print a sturdy mechanical frame and a stable soda and bottle holder so that they do not misalign while pouring.
 
# Print a sturdy mechanical frame and a stable soda and bottle holder so that they do not misalign while pouring.
 +
# System should be able to handle different size and height of glassware with few restrictions.
 
# Soda should be poured into glassware smoothly and without spilling.  
 
# Soda should be poured into glassware smoothly and without spilling.  
# Create an algorithm which lets the weight sensor approximate the height of liquid in the glassware and then determine the stopping point for the tilt mechanism of the soda bottle.  
+
# Create an algorithm which lets the measures the distance of the liquid in glassware and adjust the speed of servo motor accordingly.  
# If possible, conduct the same experiment, but change the Mexican glass soda bottle to a generic soda can.
+
# If possible, conduct the same experiment, but change the Mexican glass soda bottle to a generic soda can or plastic soda bottle.
  
 
==Steps required to complete project==
 
==Steps required to complete project==
# Glassware can have two positions. Position 1 is perpendicular to the table (Figure 2) and position 2 is tilted by an angle to the horizon. The angle will be determined through experimentation so that, if the glassware were tilted to that angle, the poured liquid will take up approximately 2/3 of the total volume of glass.
+
# There will be one pouring mechanism. The bottle should tilt fast when no liquid is coming out from the bottle and then poured slowly until the glassware is full or liquid in bottle has been used up.
# Soda bottle should be able to maintain 3 positions, each of which is shown in Figures 2, 3 and 4 respectively. The latter two angles will be determined through experimentation. Position 2 will be when the first drop of soda occurs and position 3 is when all the soda in the bottle can be poured out
+
# Distance sensor will be used to estimate the height of liquid in glassware, and they adjust motor speed accordingly.
# There will be one pouring mechanism so that the glassware and soda bottles both tilt fast from position 1 (Figure 2) to position 2 (Figure 3) (and reach this position at the same time). Glassware is kept at position 2 and the soda bottle is tilted very slowly from position 2 to position 3 to pour the soda slowly into the glassware. When the liquid in the glassware reaches approximately 3 cm to its top, it will tilt back slowly to position 1 while the soda is still pouring. The glassware reaching position 1 and the soda bottle reaching position 3 should happen at the same time. This is when the pouring mechanism ends, after which the soda bottle will return quickly to position 1.  
+
# Start of the program is initiated by a toggle switch.
# Weight sensor will be used to estimate the amount of liquid in the glassware and thus control the tilting mechanism.  
+
# All electronics (Arduino, motor and toggle switch) will be held on top of the mechanical system by constructing a wooden stage.  
# Start of the program is initiated through pressing a push button.
 
# Wooden protective cover will be used to on top of the Arduino, motors and spools. Four pulleys will be used as shown in Figure 1 to eliminate the chances of electric shock.  The wires to connect the weight sensor to the Arduino board will be inside the support stands (Figure 1).  
 
 
# The four pulley system cuts the torque needed from the motor to 1/4 its original value.  
 
# The four pulley system cuts the torque needed from the motor to 1/4 its original value.  
 
# Fishing line with 65 lbs limit will be used to prevent the rope from breaking.
 
# Fishing line with 65 lbs limit will be used to prevent the rope from breaking.
# All the soda from the bottle should be poured into the glassware, which would fill it 3 cm to the tip.
 
 
# The demo will include a demonstration of pouring soda using the completely assembled model.
 
# The demo will include a demonstration of pouring soda using the completely assembled model.
# If time permits, we will try to modify the same mechanism for a soda can to increase the utility of the product.
+
# If time permits, we will try to modify the same mechanism for a soda can or plastic soda bottle to increase the utility of the product.
 
 
 
 
 
 
<gallery mode=packed heights=300px style="text-align:left">
 
File:HX2.jpeg| Figure 2: Both in position 1         
 
File:HX3.jpeg| Figure 3: Both in position 2
 
File:HX4.jpeg| Figure 4: Glassware in position 1, soda bottle in position 3
 
</gallery>
 
Note: Pulley system not drawn here
 
  
 
== Challenges ==
 
== Challenges ==
 
# 3D printing
 
# 3D printing
#* learn solidworks
+
#* Learn Solidworks.
#* design specific dimensions of soda bottle, glassware holder and frame (we will have to print two parts of the frame and connect them together as 3D printing can only print a height of 6 inches)
+
#* Design specific dimensions of soda bottle, glassware holder etc. (For large parts, we will have to split into two as each print has a maximum dimensions of 8 inches)
#* design two spools that could fit onto the stepper motor to control the rope length and four pulleys.
+
#* Design base to hold the motor in place.  
#* build models using Solidworks and 3D print them.
+
#* Build models using Solidworks and 3D print them.
 
# Arduino
 
# Arduino
 
#* Learn Arduino programming language.
 
#* Learn Arduino programming language.
#* Implementing the Arduino code with weight sensor and servo motor.
+
#* Implementing the Arduino code with distance sensor and servo motor and toggle switch.
#* Debugging code and and adjusting parameters to control the tilting mechanism.  
+
#* Debugging code and adjusting parameters to control the tilting mechanism.  
 
# Hardware
 
# Hardware
#* Servo motor should keep control system stable during tilting mechanism and not go too fast/slow
+
#* Servo motor should keep control system stable during tilting mechanism and not go too fast/slow.
#* Design a circuit that connects the servo motor, push button, laser sensor to the Arduino.
+
#* Design a circuit that connects the servo motor, push button and weight sensor to the Arduino.
#* Find the various tilt angles outlined in the objectives section by conducting experiments (use tap water instead of soda).  
+
#* Find the various servo motor rotation speeds outlined in the objectives section by conducting experiments (use tap water instead of soda).  
#* Determine the rpm value on the servo motor as the spool pulls the fishing line, controlling the tilt angle.  
+
#* Determine the rpm value on the servo motor as it pulls the fishing line, controlling the tilt angle.  
 
#* The soda bottle should be able to tilt at an angle more than 90 degrees (position 3) from its original position.
 
#* The soda bottle should be able to tilt at an angle more than 90 degrees (position 3) from its original position.
 
# Safety
 
# Safety
#* Electricity hazard when circuit interacts with liquid: cover electronic circuit with a wooden protective cover and do not place the circuit directly beneath the mechanical pouring mechanism to mitigate the risk of wetting the electronics
+
#* Electricity hazard when circuit interacts with liquid: elevate the electronic circuit above the mechanical system level to mitigate the risk of wetting the electronics.
#* Rope might break: use appropriately weight-rated fishing line
+
#* Rope might break: use appropriately weight-rated fishing line.
  
 
== Budget ==
 
== Budget ==
# [http://www.phidgets.com/products.php?product_id=3212 Continuous Rotation Servo Motor] x 3: $54 (+$5.50 shipping)
+
# [http://www.phidgets.com/products.php?product_id=3212 Continuous Rotation Servo Motor] x 2: $36 (+$5.50 shipping)
# [https://www.sparkfun.com/products/13879 Load Cell Amplifier HX-711]: $9.95 + $5.72 shipping
+
# [https://www.sparkfun.com/products/9276 Toggle switch]: $1.95 (+$5.72 shipping)
# [https://www.sparkfun.com/products/13329 Load Cell, straight bar 10kg]: $6.95
+
# [http://www.microcenter.com/product/425628/Solder_PC_Bread_Board_-_1-1-2_x_1-3-4 Solder bread board]: $1.49
# [https://www.sparkfun.com/products/10288 Female AC/DC power adaptor]: $2.95
 
# [http://www.microcenter.com/product/425626/PC_Breadboard_-_Solder Solder bread board]: $1.99
 
# [http://www.homedepot.com/p/1-2-in-x-8-in-Copper-Air-Chamber-10632532/204508494 1/2''x8'' copper air chamber](serve as horizontal axis): $4.15
 
 
# [http://www.ebay.com/itm/12-Pack-of-NEW-5cm-50mm-Double-Sheave-Educational-Pulley-All-Metal-Block-/222341497714?hash=item33c4960372:g:3CMAAOSw-zxWmvHV Double pulley (12-pack)]: $21.98
 
# [http://www.ebay.com/itm/12-Pack-of-NEW-5cm-50mm-Double-Sheave-Educational-Pulley-All-Metal-Block-/222341497714?hash=item33c4960372:g:3CMAAOSw-zxWmvHV Double pulley (12-pack)]: $21.98
# [https://www.amazon.com/SMAKN-Switching-Supply-Adapter-100-240/dp/B00P5P6ZBS/ref=sr_1_1?ie=UTF8&qid=1487541381&sr=8-1&keywords=6V+3A AC/DC Switch Power Supply]: $7.68
+
# [https://www.amazon.com/Arduino-power-supply-adapter-110V/dp/B018OLREG4/ref=sr_1_4?ie=UTF8&qid=1488525676&sr=8-4&keywords=9v+1a+power+supply AC/DC Switch Power Supply]: $6.29
# [http://www.homedepot.com/p/Gorilla-7-8-fl-oz-General-Purpose-Epoxy-42001/100670610 Epoxy Glue]: $5.47
+
# [http://www.homedepot.com/p/Maple-Board-Common-1-in-x-2-in-x-Random-Length-Actual-3-4-in-x-1-1-2-in-x-Random-Length-1041218/207098645?keyword=098945072954 Maple Board] x10 feet:$14.00
# [http://www.microcenter.com/product/427684/Tactile_Button_Assortment Tactile Switch Push Button]: $4.49
+
# [http://www.homedepot.com/p/1-2-in-2-ft-x-2-ft-Medium-Density-Fiber-Board-1508107/205881911?keyword=099167229645 Medium Density Fiber Board]=:$5.95
 +
# [http://www.homedepot.com/p/1-4-in-x-2-in-x-3-ft-S4S-Poplar-Board-27355/207058966 Poplar board] x2: $2.90
 +
# [http://www.homedepot.com/p/Everbilt-332-3-8-in-x-3-1-16-in-x-4-3-16-in-Coarse-Zinc-Plated-U-Bolt-806856/204273758 U-bolt] x 2= $5.16
 +
# [https://www.walmart.com/ip/Great-Value-5-Oz-Plastic-Clear-Cup-80ct/11028036 Clear Plastic Cups, 80 Ct]: $2.63
 
#  [https://www.walmart.com/ip/Coca-Cola-Cola-355mL/16940377 Coca-Cola Mexican Glass Bottle, 355 mL] x 6: $5.98 (purchase in Walmart store)
 
#  [https://www.walmart.com/ip/Coca-Cola-Cola-355mL/16940377 Coca-Cola Mexican Glass Bottle, 355 mL] x 6: $5.98 (purchase in Walmart store)
#  [https://www.walmart.com/ip/Coca-Cola-Classic-Cola-2-l/14940705 Coca-Cola 2L] x 2 = $2.00 (purchase in Walmart store)
+
#  [https://www.amazon.com/Mountain-Dew-DEWshine-Glass-Bottles/dp/B00X6M5KH2 Mountain Dew Mexican Bottle (12 oz)] x 4:$4.49 (purchase in Walmart store)
 +
#  [https://www.walmart.com/ip/Fitzs-Fitz-s-4-Pack-Soda/156818893 Fitzs Fitz's 4 Pack Soda]:$4.57(purchase in Schnucks store)
 +
# [http://www.ebay.com/itm/4x-4-Alloy-Steel-Lab-Lift-Lifting-Platforms-Stand-Rack-Scissor-Lab-JL-206-/112296330003?hash=item1a25620313:g:lDEAAOSw9GhYmnON Lifting platform]:$14.49
 +
#[https://www.amazon.com/SainSmart-HC-SR04-Ranging-Detector-Distance/dp/B004U8TOE6/ref=sr_1_7?ie=UTF8&qid=1493005641&sr=8-7&keywords=Ultrasonic+Sensor Ultrasonic Distance Sensor]: provided
 
# Arduino UNO board: provided
 
# Arduino UNO board: provided
 
# 3D printing: provided
 
# 3D printing: provided
 
# Nut and bolts: provided
 
# Nut and bolts: provided
# Wooden base and wooden protection cover - scrap wood from machine shop, already found
 
 
# Power Pro Fishing Braided line – 65 lbs limit: owned
 
# Power Pro Fishing Braided line – 65 lbs limit: owned
# Magnet Screw Driver tool kit - owned
+
# Magnet Screw Driver tool kit: owned
 
# Extension Cord - owned
 
# Extension Cord - owned
 
# Glassware: owned
 
# Glassware: owned
Total: $ 138.81
+
# Dremel rotary tool: owned
 +
# Super glue: owned
 +
# Double Coated tape: owned
 +
Total: $132.63
  
 
== Gantt Chart ==
 
== Gantt Chart ==
  [[File:Gratt JSHX.png|caption | 880px]]
+
  [[File:CGanttF.png|caption | 950px]]
 +
 
 +
==Design and Solutions==
 +
Tutorials for how to use the [http://classes.engineering.wustl.edu/ese205/Controlling_HC-SR04_Ultrasonic_distance_sensor_with_Arduino Ultrasonic Distance Sensor] or the [http://classes.engineering.wustl.edu/ese205/Controlling_Continuous_Rotation_Servo_Motor_using_Arduino Servo Motor] can be found following the links.
 +
 
 +
===System Framework===
 +
In order to monitor the liquid + fizz height in glassware, it is reasonable for us to implement either a distance sensor or a liquid level sensor. The latter could require us to put the sensor directly into the liquid so we eliminated the possibility as most users would not wish to drink soda that was dipped by a sensor.
 +
 
 +
Our initial design of the system includes the both the bottle and the glassware tilting towards each other for the pour. However, it is very hard to add the distance sensor into the system as the glassware will tilt and the possibility of liquid getting into the sensor in case of an emergency should be minimized. We then modified the design in which we kept the glassware stationary and only tilt the bottle. The pulley system was added so that it can reduce the required torque on the motor to 1/4.
 +
 
 +
The wooden frame was designed so that the electric system is elevated above the mechanical system to minimize chances of electric shock when liquid gets on the electronics.
 +
====Design Evolution====
 +
<gallery mode=packed heights=250px style="text-align:left">
 +
File:Fig1.jpeg | Edition 1   
 +
File:!HX1.jpg| Edition 2
 +
File:HX1.jpeg| Edition 3
 +
File:Cheers New.jpeg| Edition 4
 +
File:Cpic10.jpeg| Edition 5
 +
File:Cpic100.jpeg| Edition 6
 +
</gallery>
 +
 
 +
===Mechanical System (3D Design)===
 +
 
 +
The very first problem with the SolidWorks design that we encountered for the mechanical system design is how to make stable posts and axis system so that it will not fall apart or misalign during the program. In addition, the Ultimaker 2 Extended printer in our lab can only print a maximum length of 8 inch for each dimension, so it is crucial that we can affix two parts well that it does not break.
 +
 
 +
*In order to have stable posts, we decided design holes and use nut and bolts to affix them to the wooden frame so that it is sturdy and can be taken off easily. Our initial design of the posts includes holes for the nut and bolts to affix the two part of the base together. We changed our posts design from the 1st to the 2nd because it could be more stable if the two parts have a large amount of overlap and not just screwed together.
 +
 
 +
<gallery mode=packed heights=100px style="text-align:left">
 +
File:Cpic1.PNG | Base Edition 1
 +
File:Cpic7.PNG | Base Edition 2
 +
File:Cpic50.PNG | Upper part for Base edition 2
 +
</gallery>
 +
 
 +
* We have to keep the horizontal axis stationary and not turning while the bottle is tilting because friction between it and the posts would more likely lead wobbling of the system during the pour. We added an a concave and convex part onto the two 3D designs to fix this problem.
 +
 
 +
<gallery mode=packed heights=100px style="text-align:left">
 +
File:Cpic3.PNG| Base upper with concave part
 +
File:Cpic6.PNG| Horizontal rotation axis with convex part
 +
File:Cpic51.jpeg | Prints
 +
</gallery>
 +
 
 +
 
 +
* Motor holder and pulley holder was designed to stabilize the motor and pulley onto the wooden frame respectively. Toggle switch is added for safer user interface as it hides the wire openings and soldering parts that goes onto the toggle switch. Spool for the fishing line was designed so that it can be glued onto one of the accessories bought with the motor.
 +
<gallery mode=packed heights=150px style="text-align:left">
 +
File:Cpic52.jpeg| Motor Holder
 +
File:13.jpeg | Pulley Stabilizer
 +
File:11.jpeg | Toggle switch holder
 +
File:14.jpeg | Spool
 +
</gallery>
 +
 
 +
* Distance sensor suspension system and holder was designed so that the sensor can be suspended to a desired height that can measure the height of liquid in glassware without receiving interference signals caused by the Mexican bottle neck. In addition, the wires that goes onto the distance sensor can be hidden in the print to minimize chances of electric shock.
 +
<gallery mode=packed heights=100px style="text-align:left">
 +
File:Cpic14.png | Lower half of distance sensor suspension system
 +
File:Sensor holder.PNG | Ultrasonic distance sensor holder
 +
</gallery>
 +
 
 +
===Code and Electrical System===
 +
Code can be found [https://bitbucket.org/jessieshi97/cheers/ here].
 +
* In order to accurately measure the height of liquid in glassware, the choice of distance sensor is important. The infrared is good in a way that the bottle neck will have a lower chance of interference with the reading. However, it does not deal good with liquids, so we decided to use the ultrasonic distance sensor.
 +
 
 +
* There are fluctuations in the sensor readings so we decided that for each distance reading used in the code would be an average of 40 values. We coded a function that takes the average of the 40 measurements so that we can use it conveniently throughout our final algorithm.
 +
 
 +
*The bottle should be tilted slowly when liquid starts coming out of it but it should not be at that same slow speed while it is on the way up (no liquid out yet). We decided to hardcode two speed settings (98 and 95 respectively, magnitude of values explained [http://classes.engineering.wustl.edu/ese205/Controlling_Continuous_Rotation_Servo_Motor_using_Arduino  here]) on the servo motor (determined experimentally) that can serve as the fast and slow modes. When distance sensor does not sense a difference (less than 2cm, value determined experimentally) between the initial distance reading (no liquid) and the current one, then it will uses the fast speed. If the difference is larger than 2cm (liquid pouring out), then it is switched to slow speed.
 +
 
 +
* The bottle should be able to return to its original position. We use the millis() function to measure the time for both fast and slow mode. The servo will operate at the same two speeds as when the bottle is tilting up, but in a different direction (hardcoded values of 82 and 85) with their respective time using the delay(ms) function. More information behind the choice of those speed values found [http://classes.engineering.wustl.edu/ese205/Controlling_Continuous_Rotation_Servo_Motor_using_Arduino here].
 +
 
 +
* The code have to account for various situations
 +
** Liquid in bottle is more than the volume in glassware: Because each glassware is adjusted so that the height of its tip aligns with the height of two posts, so we manually measured that distance between the sensor and the desired final liquid level(when glassware is filled) to be 6cm and hardcoded onto the Arduino.
 +
** Liquid in bottle is less than the volume in glassware: The code tracks the two previous readings(average of 40 readings) from the distance sensor. If the average difference between the current reading and previous 2 readings is less than 0.075 cm (determined through experiment), then the bottle will tilt back to its original location.
 +
====Circuit====
 +
[[File:CFCCC.png|400px]]
 +
 
 +
====Elaborated Flow Chart====
 +
<gallery mode=packed heights=600px style="text-align:left">
 +
File:CF1.png| Flow Chart 1   
 +
File:CF4.png| Flow Chart 2 
 +
File:CF3.png|  Flow Chart 3 
 +
</gallery>
 +
 
 +
===Mexican Bottle and Glassware===
 +
We wish that our system was able to accommodate different kinds of 355 mL (12oz) Mexican bottle as they differ in height, girth, and curvature across various soda brands. In order to do so, we decided to drill 5 sets of holes on the bottle holder for the U-bolts so that we can choose the most appropriate ones to use for each brand.
 +
 
 +
<gallery mode=packed heights=150px style="text-align:left">
 +
File:Cpic16.png | Bottle holder base
 +
File:Cpic17.png | Bottle holder swing
 +
File:Cpic60.jpeg | Printed our version
 +
</gallery>
 +
 
 +
The system would be nearly useless if we have to use the same glassware for each trial, so we decided to implement an elevating system using lifting platform to accommodate various glassware heights. By conducting various experiments, we found the limitation on height of glassware to be 7cm - 17cm. In order to make the code more versatile, the user have to manually adjust the height of glassware to align with the height of two posts before starting the program. The standardization height was chosen for convenience because it would be absurd if the user had to use a ruler and measure the height before each trial. A restriction on the diameter of the tip of the glassware was determined empirically to be 7cm as it must have enough room to fit both the ultrasonic distance sensor and the Mexican bottle neck. In addition, the system was also able to be poured into plastic party cups as long as it meets the same requirements.
 +
 
 +
<gallery mode=packed heights=150px style="text-align:left">
 +
File:Cpic61.jpeg | 7 cm tall glassware
 +
File:Cpic62.jpeg | 17 cm tall glassware
 +
</gallery>
 +
 
 +
==Results and Next Steps==
 +
Our system was very successful at pouring soda into a glassware without spilling under given restrictions (outlined in demo poster).
 +
 
 +
===Mechanical Design===
 +
*The wooden frame worked very well with providing a reaction torque for the motor without falling apart. The 3D printings were very sturdy that no misalignings happened during the pour.
 +
* The restriction on the height of glassware is very reasonable as most commercially available glassware or party plastic cups are with that height range.
 +
* The restriction on the minimum diameter of the glassware was set to be 7cm, but we found commercially available party plastics cups that do not satisfy that limit. We experimentally chose 7cm as the limit because the glassware opening have to leave space for both the ultrasonic distance sensor and the Mexican bottle neck. The dimensions of the distance sensor is 2 inch * 1 inch, which takes up the same amount of the space as the bottle neck in the glassware opening. If we can find a distance sensor that is smaller in size and also works with liquids, we can lower the value for minimum diameter.
 +
 
 +
===Code and Electric System===
 +
* Our code was able to successfully pour soda from a Mexican glass bottle into a glassware without spilling. Only this one code is needed to deal with situations where the liquid in bottle is less than the volume of the glassware and those in which there is more liquid in the bottle. Theoretically, we do not need to use the connect out laptop to the Arduino during the demo, but we chose to do so in case emergency happens that we have to quickly tilt the bottle down to stop soda from spilling.
 +
 
 +
* We spend a large amount of time using the IR distance sensor to measure the water level height. The readings were very accurate at first but then it experienced extremely large fluctuations. After the second evaluation and some researching, we realized that infrared does not work well with liquids that we then decided to switch to Ultrasonic distance sensor instead. This meant that we only had less than 3 weeks before the demo to work with the ultrasonic distance sensor.
 +
 
 +
* The restriction on the minimum amount of liquid in the glassware is set to be 50mL. This value is fairly reasonable as people can just pour liquid less than this volume themselves. If we had more time, we can try to deal with situation with liquid less than 50 mL or even empty bottle in the code to make the system more versatile.
 +
 
 +
===Videos for 3 typical senarios===
 +
* Liquid in bottle is more than the volume in glassware, minimum height of glassware (7 cm)
 +
[[File:Cvideo3.mp4|200px]]
 +
* Liquid in bottle is less than the volume in glassware, maximum height glassware (17cm)
 +
[[File:Cvideo2.mp4|200px]]
 +
* Liquid in bottle is more than the volume in glassware, minimum diameter glassware (7cm)
 +
[[File:Cvideo5.mp4|200px]]
 +
 
 +
===Demo===
 +
Our demo was very successful. We bought 10 bottles of soda and they were all out!
 +
====Poster====
 +
[[File:12345.png|600px]]
 +
 
 +
====Video====
 +
 
 +
[[File:Cvideo4.mp4|500px]]
 +
 
 +
===Future Considerations===
 +
# We can try to accommodating various kinds of bottles on the system, including 500mL plastic soda bottle and soda cans. The reason that we chose to start the project with Mexican glass bottle was that it has a very narrow neck which decrease its chance of interfering with the ultrasonic sensor during the pour. We attempted to use this same program on the 500mL coca cola plastic bottle and it was able to work just like the Mexican bottle, but time was not enough to complete more experiments.
 +
# Our system require the user to manually adjust the height of glassware using the lifting platform so that the tip of the glassware aligns with the height of the two posts. It would be nice if our system can do that itself. We can 3D print parts that fit a motor well on the knob of the lifting platform and add a laser sensor that detects interference on the highest point of the two posts. We can use the laser as sensor to control how the motor turns, which then will be able to control the height of the lifting platform and thus the height of the glassware.
  
 +
==Repositories==
 +
===Code===
 +
https://bitbucket.org/jessieshi97/cheers/
 +
===SolidWorks files===
 +
http://www.thingiverse.com/thing:2289931
  
 
[[Category:Projects]]
 
[[Category:Projects]]
 
[[Category:Spring 2017 Projects]]
 
[[Category:Spring 2017 Projects]]

Latest revision as of 16:07, 3 May 2017

Overview

Have you ever felt frustrated that soda always rises higher than you expect and spills all over your table? We are here to help. 'Cheers' is a automated soda pouring machine that takes a bottled soda and pours it into glassware without spilling the fizz. It utilizes 3D printing techniques for constructing the mechanical framework and an Arduino to control the system. 'Cheers' tilts your soda bottle and glass to an angle towards each other to minimize the fizzing and the tilting mechanism stops after the soda height reaches your desired level and voila, Cheers!

Team Members

  • Jessie Shi (Tianjiao): Chemical Engineering, System Engineering ’18
  • Haixiang Ren: System Engineering ’18
  • Natalie Ng: TA

Objectives

System Drawing
Demo Picture
  1. Replicate the project found on youtube but replace the beer bottle with a soda glass bottle and appropriately sized glassware. There will also be no bottle rotating mechanism. The control for the tilting mechanism will be changed to a pulley rope system outlined on the right figure. The glassware will be kept on the table instead of swinging.
  2. Print a sturdy mechanical frame and a stable soda and bottle holder so that they do not misalign while pouring.
  3. System should be able to handle different size and height of glassware with few restrictions.
  4. Soda should be poured into glassware smoothly and without spilling.
  5. Create an algorithm which lets the measures the distance of the liquid in glassware and adjust the speed of servo motor accordingly.
  6. If possible, conduct the same experiment, but change the Mexican glass soda bottle to a generic soda can or plastic soda bottle.

Steps required to complete project

  1. There will be one pouring mechanism. The bottle should tilt fast when no liquid is coming out from the bottle and then poured slowly until the glassware is full or liquid in bottle has been used up.
  2. Distance sensor will be used to estimate the height of liquid in glassware, and they adjust motor speed accordingly.
  3. Start of the program is initiated by a toggle switch.
  4. All electronics (Arduino, motor and toggle switch) will be held on top of the mechanical system by constructing a wooden stage.
  5. The four pulley system cuts the torque needed from the motor to 1/4 its original value.
  6. Fishing line with 65 lbs limit will be used to prevent the rope from breaking.
  7. The demo will include a demonstration of pouring soda using the completely assembled model.
  8. If time permits, we will try to modify the same mechanism for a soda can or plastic soda bottle to increase the utility of the product.

Challenges

  1. 3D printing
    • Learn Solidworks.
    • Design specific dimensions of soda bottle, glassware holder etc. (For large parts, we will have to split into two as each print has a maximum dimensions of 8 inches)
    • Design base to hold the motor in place.
    • Build models using Solidworks and 3D print them.
  2. Arduino
    • Learn Arduino programming language.
    • Implementing the Arduino code with distance sensor and servo motor and toggle switch.
    • Debugging code and adjusting parameters to control the tilting mechanism.
  3. Hardware
    • Servo motor should keep control system stable during tilting mechanism and not go too fast/slow.
    • Design a circuit that connects the servo motor, push button and weight sensor to the Arduino.
    • Find the various servo motor rotation speeds outlined in the objectives section by conducting experiments (use tap water instead of soda).
    • Determine the rpm value on the servo motor as it pulls the fishing line, controlling the tilt angle.
    • The soda bottle should be able to tilt at an angle more than 90 degrees (position 3) from its original position.
  4. Safety
    • Electricity hazard when circuit interacts with liquid: elevate the electronic circuit above the mechanical system level to mitigate the risk of wetting the electronics.
    • Rope might break: use appropriately weight-rated fishing line.

Budget

  1. Continuous Rotation Servo Motor x 2: $36 (+$5.50 shipping)
  2. Toggle switch: $1.95 (+$5.72 shipping)
  3. Solder bread board: $1.49
  4. Double pulley (12-pack): $21.98
  5. AC/DC Switch Power Supply: $6.29
  6. Maple Board x10 feet:$14.00
  7. Medium Density Fiber Board=:$5.95
  8. Poplar board x2: $2.90
  9. U-bolt x 2= $5.16
  10. Clear Plastic Cups, 80 Ct: $2.63
  11. Coca-Cola Mexican Glass Bottle, 355 mL x 6: $5.98 (purchase in Walmart store)
  12. Mountain Dew Mexican Bottle (12 oz) x 4:$4.49 (purchase in Walmart store)
  13. Fitzs Fitz's 4 Pack Soda:$4.57(purchase in Schnucks store)
  14. Lifting platform:$14.49
  15. Ultrasonic Distance Sensor: provided
  16. Arduino UNO board: provided
  17. 3D printing: provided
  18. Nut and bolts: provided
  19. Power Pro Fishing Braided line – 65 lbs limit: owned
  20. Magnet Screw Driver tool kit: owned
  21. Extension Cord - owned
  22. Glassware: owned
  23. Dremel rotary tool: owned
  24. Super glue: owned
  25. Double Coated tape: owned

Total: $132.63

Gantt Chart

caption

Design and Solutions

Tutorials for how to use the Ultrasonic Distance Sensor or the Servo Motor can be found following the links.

System Framework

In order to monitor the liquid + fizz height in glassware, it is reasonable for us to implement either a distance sensor or a liquid level sensor. The latter could require us to put the sensor directly into the liquid so we eliminated the possibility as most users would not wish to drink soda that was dipped by a sensor.

Our initial design of the system includes the both the bottle and the glassware tilting towards each other for the pour. However, it is very hard to add the distance sensor into the system as the glassware will tilt and the possibility of liquid getting into the sensor in case of an emergency should be minimized. We then modified the design in which we kept the glassware stationary and only tilt the bottle. The pulley system was added so that it can reduce the required torque on the motor to 1/4.

The wooden frame was designed so that the electric system is elevated above the mechanical system to minimize chances of electric shock when liquid gets on the electronics.

Design Evolution

Mechanical System (3D Design)

The very first problem with the SolidWorks design that we encountered for the mechanical system design is how to make stable posts and axis system so that it will not fall apart or misalign during the program. In addition, the Ultimaker 2 Extended printer in our lab can only print a maximum length of 8 inch for each dimension, so it is crucial that we can affix two parts well that it does not break.

  • In order to have stable posts, we decided design holes and use nut and bolts to affix them to the wooden frame so that it is sturdy and can be taken off easily. Our initial design of the posts includes holes for the nut and bolts to affix the two part of the base together. We changed our posts design from the 1st to the 2nd because it could be more stable if the two parts have a large amount of overlap and not just screwed together.
  • We have to keep the horizontal axis stationary and not turning while the bottle is tilting because friction between it and the posts would more likely lead wobbling of the system during the pour. We added an a concave and convex part onto the two 3D designs to fix this problem.


  • Motor holder and pulley holder was designed to stabilize the motor and pulley onto the wooden frame respectively. Toggle switch is added for safer user interface as it hides the wire openings and soldering parts that goes onto the toggle switch. Spool for the fishing line was designed so that it can be glued onto one of the accessories bought with the motor.
  • Distance sensor suspension system and holder was designed so that the sensor can be suspended to a desired height that can measure the height of liquid in glassware without receiving interference signals caused by the Mexican bottle neck. In addition, the wires that goes onto the distance sensor can be hidden in the print to minimize chances of electric shock.

Code and Electrical System

Code can be found here.

  • In order to accurately measure the height of liquid in glassware, the choice of distance sensor is important. The infrared is good in a way that the bottle neck will have a lower chance of interference with the reading. However, it does not deal good with liquids, so we decided to use the ultrasonic distance sensor.
  • There are fluctuations in the sensor readings so we decided that for each distance reading used in the code would be an average of 40 values. We coded a function that takes the average of the 40 measurements so that we can use it conveniently throughout our final algorithm.
  • The bottle should be tilted slowly when liquid starts coming out of it but it should not be at that same slow speed while it is on the way up (no liquid out yet). We decided to hardcode two speed settings (98 and 95 respectively, magnitude of values explained here) on the servo motor (determined experimentally) that can serve as the fast and slow modes. When distance sensor does not sense a difference (less than 2cm, value determined experimentally) between the initial distance reading (no liquid) and the current one, then it will uses the fast speed. If the difference is larger than 2cm (liquid pouring out), then it is switched to slow speed.
  • The bottle should be able to return to its original position. We use the millis() function to measure the time for both fast and slow mode. The servo will operate at the same two speeds as when the bottle is tilting up, but in a different direction (hardcoded values of 82 and 85) with their respective time using the delay(ms) function. More information behind the choice of those speed values found here.
  • The code have to account for various situations
    • Liquid in bottle is more than the volume in glassware: Because each glassware is adjusted so that the height of its tip aligns with the height of two posts, so we manually measured that distance between the sensor and the desired final liquid level(when glassware is filled) to be 6cm and hardcoded onto the Arduino.
    • Liquid in bottle is less than the volume in glassware: The code tracks the two previous readings(average of 40 readings) from the distance sensor. If the average difference between the current reading and previous 2 readings is less than 0.075 cm (determined through experiment), then the bottle will tilt back to its original location.

Circuit

CFCCC.png

Elaborated Flow Chart

Mexican Bottle and Glassware

We wish that our system was able to accommodate different kinds of 355 mL (12oz) Mexican bottle as they differ in height, girth, and curvature across various soda brands. In order to do so, we decided to drill 5 sets of holes on the bottle holder for the U-bolts so that we can choose the most appropriate ones to use for each brand.

The system would be nearly useless if we have to use the same glassware for each trial, so we decided to implement an elevating system using lifting platform to accommodate various glassware heights. By conducting various experiments, we found the limitation on height of glassware to be 7cm - 17cm. In order to make the code more versatile, the user have to manually adjust the height of glassware to align with the height of two posts before starting the program. The standardization height was chosen for convenience because it would be absurd if the user had to use a ruler and measure the height before each trial. A restriction on the diameter of the tip of the glassware was determined empirically to be 7cm as it must have enough room to fit both the ultrasonic distance sensor and the Mexican bottle neck. In addition, the system was also able to be poured into plastic party cups as long as it meets the same requirements.

Results and Next Steps

Our system was very successful at pouring soda into a glassware without spilling under given restrictions (outlined in demo poster).

Mechanical Design

  • The wooden frame worked very well with providing a reaction torque for the motor without falling apart. The 3D printings were very sturdy that no misalignings happened during the pour.
  • The restriction on the height of glassware is very reasonable as most commercially available glassware or party plastic cups are with that height range.
  • The restriction on the minimum diameter of the glassware was set to be 7cm, but we found commercially available party plastics cups that do not satisfy that limit. We experimentally chose 7cm as the limit because the glassware opening have to leave space for both the ultrasonic distance sensor and the Mexican bottle neck. The dimensions of the distance sensor is 2 inch * 1 inch, which takes up the same amount of the space as the bottle neck in the glassware opening. If we can find a distance sensor that is smaller in size and also works with liquids, we can lower the value for minimum diameter.

Code and Electric System

  • Our code was able to successfully pour soda from a Mexican glass bottle into a glassware without spilling. Only this one code is needed to deal with situations where the liquid in bottle is less than the volume of the glassware and those in which there is more liquid in the bottle. Theoretically, we do not need to use the connect out laptop to the Arduino during the demo, but we chose to do so in case emergency happens that we have to quickly tilt the bottle down to stop soda from spilling.
  • We spend a large amount of time using the IR distance sensor to measure the water level height. The readings were very accurate at first but then it experienced extremely large fluctuations. After the second evaluation and some researching, we realized that infrared does not work well with liquids that we then decided to switch to Ultrasonic distance sensor instead. This meant that we only had less than 3 weeks before the demo to work with the ultrasonic distance sensor.
  • The restriction on the minimum amount of liquid in the glassware is set to be 50mL. This value is fairly reasonable as people can just pour liquid less than this volume themselves. If we had more time, we can try to deal with situation with liquid less than 50 mL or even empty bottle in the code to make the system more versatile.

Videos for 3 typical senarios

  • Liquid in bottle is more than the volume in glassware, minimum height of glassware (7 cm)

  • Liquid in bottle is less than the volume in glassware, maximum height glassware (17cm)

  • Liquid in bottle is more than the volume in glassware, minimum diameter glassware (7cm)

Demo

Our demo was very successful. We bought 10 bottles of soda and they were all out!

Poster

12345.png

Video

Future Considerations

  1. We can try to accommodating various kinds of bottles on the system, including 500mL plastic soda bottle and soda cans. The reason that we chose to start the project with Mexican glass bottle was that it has a very narrow neck which decrease its chance of interfering with the ultrasonic sensor during the pour. We attempted to use this same program on the 500mL coca cola plastic bottle and it was able to work just like the Mexican bottle, but time was not enough to complete more experiments.
  2. Our system require the user to manually adjust the height of glassware using the lifting platform so that the tip of the glassware aligns with the height of the two posts. It would be nice if our system can do that itself. We can 3D print parts that fit a motor well on the knob of the lifting platform and add a laser sensor that detects interference on the highest point of the two posts. We can use the laser as sensor to control how the motor turns, which then will be able to control the height of the lifting platform and thus the height of the glassware.

Repositories

Code

https://bitbucket.org/jessieshi97/cheers/

SolidWorks files

http://www.thingiverse.com/thing:2289931