Sunday, December 14, 2014

Post #11 - Final Blog Post

It's been an incredible ride... never in my dreams would I have thought that I, Neil Emeigh, would be capable of building robots that are as scalable as our design is. Industrial robots are not far fetched from our knowledge at this point, and that's something I still have to pinch myself for to remind myself it is real.

Our robot had many hiccups and headaches, but we finally achieved a final product that we set out for. During the initial build phase we have come across MANY design flaws that we plan on making more efficient in the future. This prototype is for demonstration and proof-of-concept that we are able to do such a thing.

Here is the robot in action:

[video]


Taylor and I both plan on continuing with the build of this robot in the future, as well as many other robotic designs we have already brainstormed up. This was such an incredible experience that I'll never forget. I owe my thanks to the CS department and Dr. Hastings for allowing us to do such a project and for believing in us throughout the journey.

Total hours: We slacked on keeping track of this as the time required for this project was too many and we were more concerned with getting a final product done than recording all the details with the steps we took. Our project was a stretch to complete in a semester's time, but we put the hours in to get it finished on time. If I were to estimate, it took us about 100-150 hours each from start to finish.

Friday, December 5, 2014

Post #10 - Motors Running!!!!

After a stressful week, we finally got the motors moving thanks to Dr. Trantham (Physics department). Although he suggested our power source was too strong, we determined that wasn't the case and saw that his wiring diagram suggested our wires weren't set up correctly. After switching the wires around our motor moved!! This was SUCH a relieving feeling and an incredible boost of motivation.

Throughout the week we played with stepper motor libraries and different settings. We attached the motor to our robot frame (found on Taylor's blog: tfcsis496.blogspot.com) and had it spinning as it should.

Next week, our final full week of working on it, will be spent hooking up the solenoid valves and hooking up the robot to UNK's internet to prepare for our live demonstration.

Tuesday, November 25, 2014

Post #9 - Hooking up the motors

This week was entirely spent trying to get a motor moving. We had to contact an outside source (Dr. Ron Tuttle from UNK) to give us some advice since Taylor and I have zero prior experience with electronics.

After meeting with him, we started plugging stuff in. Our current state with the robot is that our power source has power (good), the motor driver that controls the motor has a green light (good), however when we try sending power to the actual motor, the driver flashes red (bad). We are debugging and meeting with Dr. Tuttle again next week.

Total Time: 6 hours

Wednesday, November 19, 2014

Post #8 - Web Page Finished

We have decided to go with an online version of the ordering system. This online website can be accessed from anywhere in the world, allowing people to 'order' drinks wherever they are with their mobile phones. The Raspberry Pi will then read the database from this external server and handle the orders accordingly.

The webpage can be found here:

http://zonbandit.com/order.php

This page will be seen by the customer. It allows them to order a drink that goes into the queue.


http://zonbandit.com/admin.php

This page asks for all the liquids currently set up in the robot.


http://zonbandit.com/admin2.php

This page asks how they would make the drink by selecting the combination of liquids from the previous page.


Time spent: 12 hours (learning PHP and serverside coding)

Monday, November 17, 2014

Post #7 - WiFi Fixed (Finally) and Webpage Beginnings

After countless (15+) hours of trying to find a solution to the WiFi intermittent connection, I stumbled across an idea from someone - the Raspberry Pi wasn't able to give enough power to the WiFi adapter. Supposedly, these adapters take quite a bit of bower (over 500 mA), and the Pi can only give a max of 500 mA through its USB ports. This was all theory, but I as I researched I found similar recommendations.

Thus, my quest to find a powered USB hub was on. I tried finding a simple, cheap, one, but there were NO recommendations that I could find that were suited for the Pi (so that it didn't fry it). After searching long enough, I settled on a little more expensive solution - PiHub (http://shop.pimoroni.com/products/pihub).

Once I plugged the powered hub in, everything was working perfectly! WiFi was no longer dropping, and I could now power all my USB gadgets through this hub instead of the Pi. What a relief!

----

Next up this week was getting our database set up. We have decided that since the whole system must be connected to a WiFi network in order to be controlled via user's phones, then we had no reason to keep the database locally on the Pi. Therefore, we will be hosting the database and webpage on our own server which will allow people to access it from ANYWHERE, and off the WiFi network.

The beginnings of a great webpage:

http://roqetmarketing.com/drinkmixer/hey.php

Saturday, November 8, 2014

Post #6 - More Wifi Issues

Wifi is becoming a bit of a pain. It seems that when the internet/router goes down at my home, the DHCP is having troubles renewing the lease (even after I set the time to only 10 seconds to renew). Anyways, manually running some commands got it up and working for me (below). I suspect I may have to have some detection in the program that if the wifi is down, try to run these commands via a shell script.

Link to post that solved my issue:

http://www.raspberrypi.org/forums/viewtopic.php?t=72282&p=521088


1. sudo dhclient -v -r wlan0
2. ifconfig
3. sudo dhclient -v wlan0

Will update this post if I find another, simpler, way to get around this.

Update 1:

After hours and hours of research, this appears to not work. I finally came across a possible lead:

iwlist wlan0 scan

Returns my wifi connection sometimes, and sometimes not. This gave me some extra search terms to try and figure out a possible fix. After coming across a post about power issues, I have determined (for now) that the wifi adapter I am using requires too much power. The Raspberry Pi only outputs a certain amount of volts/amps, which wasn't enough, causing intermittent connection problems.

I have ordered a powered USB hub (http://shop.pimoroni.com/products/pihub) to ideally fix the issue.

Thursday, October 30, 2014

Post #5 - Raspberry Pi Setup

As I am the one working with the majority of the programming for this project, I have began setting up the Raspberry Pi.

Issues:

1.

WIFI!! - I got it connected originally using this article:

http://raspberrypihq.com/how-to-add-wifi-to-the-raspberry-pi/


Worked fine for a week solid. Then our router at home got reset and things got all messed up. After debugging for 2 hours I still had no resolve. The next day I checked up on it and it was working again. I BELIEVE the issue was caused by the DHCP lease not renewing (the default lease renewal is 36000 seconds, or 10 hours!), so I changed that to 600 seconds for any future problems. (see next post -- NOT WORKING)



Installations:

1. Arduino IDE

Followed this guide to install and connect Arduino:

http://razzpisampler.oreilly.com/ch10.html


2. Raspberry Pi to Arduino connection:

http://blog.oscarliang.net/connect-raspberry-pi-and-arduino-usb-cable/


3. MySql was needed (simple installation). All MySql is done locally right now. We may move to online servers later on.

4. Adafruit IDE - probably the best find of this entire project. I was having problems figuring out how to program efficiently, timely, and making sure it would work on the Pi. I tried setting up a similar environment on my Windows (tried a VMWare box, all on Windows, etc) and my first conclusion was to use TightVNC which is a remote controller to the Raspberry Pi. This allowed me to work on my PC that I was comfortable using, while working directly on the Pi. However, the Pi has minimal hardware so the speeds that I could program at were drastically reduced. ALSO, I couldn't find any Python IDE to work on the Pi, so I was just coding in a simple notepad file. Not good!

Then, I came across the wonderful Adafruit IDE. Wow is it incredible! This allows me to program on my desktop computer all via my BROWSER. The code I change in the browser is automatically pushed to a Bitbucket repository, which is then automatically pushed onto the Pi. Talk about cool!

http://raspberrypihq.com/how-to-add-wifi-to-the-raspberry-pi/

6. Apache and PHP5 installed


7. Other miscellaneous things were installed. Not much importance.


Edit: Through a lot of pain, I've found out that you should install the WebIDE LAST before anything else. It's caused a lot of problems with other installations and is done best when it's installed last.

Sunday, October 19, 2014

Post #4 - Parts Are In!

We received the parts this week! Seeing everything in our hands makes for a very exciting week ahead. It's like Christmas opening up all our gadgets and toys!

Once we received the parts Taylor immediately began discussing ideas for the build of the robot with his neighbor (who is in construction). I took home the Arduino and unpackaged my Raspberry Pi. The Pi is now setup to work on my TV, so the next steps for me will be to start getting some test scenarios setup with Python.

First test case: getting a connection between the Arduino and the Pi. I hope to string a small ethernet cord between the two mini-computers and use a LAN connection for getting messages sent to each other.

For example:

1. The Raspberyy Pi will see that there is a new drink order. It grabs the details.
2. It will send a command to the Arduino indicating what motor to spin and for how long. I.e. - if it needs to get to the bottom 180 degrees from the 'home' position, it would tell it to spin the motor for that long.
3. The Arduino will send a command back saying that it has moved there and has dispensed the liquid.
4. Raspberry Pi will send the next item (next liquid to be dispensed) in the queue to the Arduino.
5. Repeat.

Sunday, October 12, 2014

Post #3 - Initial Design Started

More formal sketches were hand-drawn this week. Other than that, we're just waiting for our parts to come in and doing more research on the best possible way to make it as efficient as possible.

One thing we came to the conclusion of is that we will have to rotate the bottom base, rather than the bottles up top. Two reasons:

1. Future considerations - if we ever refrigerate the top part, then the coils would twist
2. Solenoid Valves - The wires for the valves (that are attached to the opening of the bottles) would twist up since all our electrical will be sitting at the base.

Sunday, October 5, 2014

Post #2 - Materials Ordered

The link below details all the hardware we ordered from using our student fees for this class:

http://banditim.com/Supply%20list.xlsx

We will be purchasing the materials (the entire stand to hold everything and such) from our own pockets so that we can keep it after this semester. Everything will be trial and error, so having the student fees as a cushion really helps the wallet.

All items are expected to be in by October 31. Taylor and I have agreed to split up our two tasks to be completed by that date into:

Taylor: Build the entire functional stand
Neil (me) : Program Raspberry Pi and Arduino to work together and send 'theoretical' commands to make 'theoretical' motors move

Sunday, September 28, 2014

Post #1 - Change In Plans

We spent the first couple weeks going over ideas for our house automation idea that we previously wanted to do. After coming to the sad realization that we wouldn't be able to accomplish that without proper electrical knowledge, we began brainstorming other ideas. The conclusion is to go with a robotic drink mixer (explained in my first blog post).

Tentative required items:

- Raspberry Pi (will control all the programming aspects)
- Arduino (will control the hardware)
- Sheet of plywood for the base and top portions to hold the bottles
- Motor to spin the middle axis
- Some kind of bracing to hold the bottles upright
- Solenoid valves to hold the liquid in the bottles. Will open when the Arduino calls their motors to release the valve.
- Screws and misc. to build the station
- Metal pole (axis)
- Wiring

Initial Post - Robotic Drink Mixer

Team Members: Neil Emeigh (me) and Taylor Fleeman
Client: none
Semester Completed: Fall 2014


Our project originally was going to be some sort of house automation that utilized a Raspberry Pi to turn on/off lights and other appliances. However, after looking into the technical details of messing with wiring, it became clear that we would need a licensed electrician to accomplish what we wanted to do. So, we came up with a new, and in my opinion better, project: a robotic drink mixer!

This drink mixer will allow the user to set bottles of whatever drinks above the pouring station. The bottles will be inverted so the only force needed to pour the liquid out will be to open the valve. We plan on using solenoid valves to hold the contents inside, and through the programming of a Raspberry Pi and Arduino, we will open them up accordingly.

Below is an image of the prototype we invision. On the Side View picture, the pink box will be the cup that sits idle, the middle bar will be what moves the station on the top around, the orange is where all the hardware will sit, and the red lines represent the bottles.





The idea behind the pouring will be to move the top circle plate in circles and stop at the correct time when the correct bottle is over the cup. To order your drinks we hope to be able to make a server side web page that will allow you to order from your phones or computer. The Pi will constantly be checking the database for new orders, and when one is placed, it'll get the right ingredients and start its routine.