Why?

Ramblings in Rapid-Prototyping, Physical Computing and random creativity, featuring Arduino, Raspberry Pi and related technologies. Most of these projects are done for fun, on short sprints and near-zero budget, and they frequently share a remarkable lack of refinement.

Monday, September 7, 2015

A Telepresence Robot for the Grandparents



My wife and I had a baby recently, and my parents are oh-so eager to meet her. Since they are halfway around the world, though, they'll have to wait until we visit. In the meantime, I made a budget telepresence robot, so they can watch the baby while she's on her swing from any angle they want ( but from a hamster's point of view!). For telepresence, a videochat application running on the phone will technically do, but for the moment, it'll broadcast one-way using IPWebcam

While not as elaborate as OSCAR, by Google's Gus Class, my project was put together in a couple of days and cost next to nothing.

I used:

  1. The Arduino and Bluetooth module previously in the quadruped
  2. The old Android phone previously in the Headshot
  3. Python + Flask and some JavaScript for the web server application
  4. One El-Cheapo robot chassis off ebay.
  5. A single L293D motor driver.
Crude and basic, but it works.




The Robot in action

A couple of days before this post, Danish astronaut Andreas Mogensen controlled a robot from Low Earth Orbit from the ISS (altitude of 400 km) . It gave me certain satisfaction to see my robot move in Australia, while being controlled by my brother in South America! 

An Elaborate Joke

A while ago I was tempted by an awesome looking deal by Humble Bundle, that included Multimedia Fusion 2. To try it, I made a horribly crude game only intended as a joke to my group of friends . To my disappointment, however, the catch was that that version of the software only exports to the deprecated "Java Applet" format, and to export to HTML5, you had to buy the $200+ Fusion 2.5.

Luckily, I found the awesome GDevelop platform, that allows game programming through an intuitive GUI that saves you having to learn specific JavaScript conventions and syntax. I made this game in a weekend including a main screen, introduction and ending, using some of the included textures and sprites.

The game itself consists of a a short, one minute platform level, with humor that would make no sense to those outside my group of friends. Besides, it is rather inappropriate and uses stuff I grabbed of the web with no regard to copyright or credit, hence I'm not making it public. Here's two screenshots, though:



Sunday, August 16, 2015

My Ideal Bunkbed

I spent a moment the other morning drafting my ideal bunk bed. Ideal in the sense that some of the places where bunks are used could benefit from the suggested transformability, namely holiday homes and hostels.

  • A hostel could benefit from being able to more easily adjust the proportion of dorms vs double rooms according to demand
  • Holiday homes can typically be colonized by widely varying populations, ranging from scores of younger children to all couples. And couples do not like getting the bunks.

I have no idea if this has been done before, and it probably has, but it took me less to make this than it would have taken me to look for similar designs. If building myself, I'd go nautical and use rope and pulleys, but I'll let you imagine the specific mechanism.


Thursday, August 13, 2015

HeadShot



"...if I build a dresser, that's very useful but it doesn't get a lot of views, but one thing I've learned is that useless crap on Youtube, gets a lot of views" - Matthias Wandel

A while ago the carpenter at work was throwing out pile of plywood sheet offcuts. "It's good ply," he said, "but I can't keep storing offcuts, I'm out of space". Hence, I rescued as much as I could, and so far I've made quite a few things with it, mostly (functional) furniture. But after the robot arm project, I wanted to learn more about Computer Vision, and had seen a few Nerf and paintball sentry-gun projects online (Google'em). While most of those projects aim at shooting others (pun intended), shooting something tasty at self seemed like an interesting (and profoundly futile) endeavor

For this project, I used a RasPi 2 with OpenCV (Python bindings) and the ServoBlaster library.
The hardware is mostly, as you can imagine, salvaged plywood! Also, the winch servo from the StoveDJ , and normal servos from the now dismantled robot arm. An old droid phone with IPwebcam was the video source, since I didn't have a USB webcam or Pi camera module at hand, nor cared to buy any. 



Wednesday, April 22, 2015

QWOP bot

While making the robot arm, an idea crossed my mind. The more I learned about robotics, the clearer it became that autonomous walking systems are still a few years away from being a consumer reality. It is an extremely complex undertaking to a robot that is able to navigate uneven terrain, make sense of the surface, avoid obstacles and maintain balance, among other things.

So it crossed my mind: If humans have been able to use "analog" machinery to get around for a while, but only now we are able to make very timid autonomous cars or aircraft, why haven't we tried to make manually controlled walking robots, able to navigate terrain that wheeled vehicles cannot? In particular, I thought about a wheelchair case, in which a set of robotic legs could be handy. In theory, a skilled used could climb stairs or go over obstructions with the legs, to then resume the more efficient wheeled motion. In part I was inspired by playing QWOP, although good judgement suggested to avoid even trying to manually balance on two legs.

So I went on to make a four legged (a.k.a.quadruped) robot with some spare balsa wood from the robot arm project, and the cheapest servos I could get on Ebay.



Robot in Seating Position and Video

A powerful lesson awaited me: counterfeit of brands is widespread among some cheap items available on Ebay. Initially I ordered two TowerPro SG90 9 gram microservos, to implement a single leg model.  I developed a simple Python program and was able to control the two individual joints with a single finger each. That encouraged me to order more servos to complete four legs, but vendors offered servos as single units or in packs of 5 or 10. Because I needed 6 more, I ordered 5 from one vendor and a single more from another vendor. Supposedly the 8 servos are Towerpro SG90, but all three orders were noticeably different (all with a brand sticker though) in performance, quality, attachments, etc.

Note the stickers are different. Which one is counterfeit? Probably both.

Anyway, the servos moved, some nicely, others not so much, but moved, so I carried on making the robot. After sorting some electrical issues, I was able to make the thing walk, albeit very slowly, just by using 16 letters on the keyboard, two for each finger. Specifically, a Python script was used to interface with the Arduino over a Serial link. Learning to move the robot felt, as I had anticipated, like learning how to play a musical instrument. With eight simultaneous joints being controlled, the learning curve is quite slow, like learning how to play piano. But I would not be surprised that, with enough training, some people could make these things not walk but run.

Robot standing up.

Eventually I made the robot wireless, controlled via Bluetooth, which made playing with it much more fun.



The "Arduino" and the Bluetooth module at the back.

poV.R.ty

I ordered a pair of 45mm lenses from ebay for $2 and made a holder for them from an old box.

I already had used the Cardboard App on my phone just crossing my eyes (I got quite good at it in the 90's, when autostereograms were popular), but wanted to see if the lenses made the experience more immersive by stretching the field of vision. It turned out it does, although these lenses are not bi-convex as recommended, so the results are less than optimal. Also, the pixels in the screen become very noticeable (the screen in my phone has only average resolution and is badly cracked), so I didn't bother building the rest of the headset. 

Still, had fun playing with this.

poVRty: Probably the crudest Cardboard setup yet.

Wednesday, April 15, 2015

Robotics - A formal approach

Eventually, on 2014, I had the opportunity to take a Master's level elective Robotics class. Being such a fan of DIY, it is hard to admit that the drier, maths-heavy parts of robotics (e.g. the kinematics, the dynamics) are hardly the sort of thing that you would teach yourself over an internet tutorial (possible, but unlikely). The class's lectures covered the theoretical aspects that hobbyists would rather avoid, but it also involved the ambitious team project of building a six degree-of-freedom robot arm that would autonomously perform an architecture-related task. While us engineers would see the construction of the robot, architecture students would come up with the specific task for the robot to perform. 

I have to say that this was my favorite subject of my whole Master's degree, due to the abundant (and much wanted) tinkering it involved.

The robot we built performed quite well in comparison to the rest of the class. It was built using inexpensive Adafruit analog feedback servos , a servo shield (that we burned and eventually did without) and an Arduino Due. Our team 3D printed the body, while other teams opted for laser-cut acrylic or wood. For the interface, I originally developed a Python GUI using tkinter, just to make one all over again in Processing, because it was the programming language that the architecture kids were familiar with.

The amount of debugging necessary to get something like this running for the first time was, needless to say, colossal. And that is exactly why it was such a powerful learning experience.

The project originally involved using a Microsoft Kinect to provide visual feedback so a central computer could coordinate two arms (from different teams, with completely different architectures) to build a biologically inspired structure. 

Our 6 DOF robot arm on its calibration grid.

Let's put Arduino to good use...

Shortly after Warman I ordered my first Arduino board.
Although I'd love to get every gadget and new toy that comes out and experiment with them, it seems that without discipline, any hobby can turn into a bottomless money-pit rather quick.
While doing tutorials is a very effective form of learning, I've found that, at least in my case, solid motivation is necessary to continue learning and experimenting past the time when the novelty fades (anyone who ever became proficient at playing any musical instrument would certainly agree).

That motivation came, in my case, from almost burning my apartment down in early 2014.

No matter how safety conscious a person is, without proper safeguards and procedures, anyone can forget stuff and regret it forever. Some people fatally forget their infants in their car on hot days, and fellow paraglider pilots have fatally forgotten to re-buckle their harnesses after doing something else. In the latter case, a safety mechanism was developed eventually, but regarding the former, I haven't seen  bluetooth or NFC enabled child seats yet (someone has probably invented something already but I'm not aware of it, wouldn't be the the first time..or the thousandth).

My case was less dramatic, although few times in my life I felt such terror. I was a block away on my way back home when I got my wife's call. "You burned the apartment" I heard in disbelief. Later she realized It was just smoke, although enough to trigger an evacuation of the building and the presence of two fire trucks. All for forgetting to turn off the beans on the stove.

After much post-traumatic thinking, I learned the following:
-Renters (like me) won't really invest in better appliances when they are part of someone else's property.
-Landlords won't really invest in newer appliances, even if they have superior safety features, if the existing ones are working as they are supposed to.
-As literature shows, a vast majority of house fires originate in the kitchen, often from unattended cooking.
-There is a market of kitchen safety devices, aimed primarily at elderly people or sufferers of Alzheimer's. They are quite expensive and tricky to install.

This lead me to wonder why the ubiquitous lemon timer never evolved to something that could turn the knobs of gas stoves off. Aware of all the safety and regulatory aspects of fiddling with safety critical equipment such as gas appliances, I decided to come up with something with the Arduino that could turn the knobs of the the gas stove off after a certain time. Knob Jockey didn't sound acceptable, so I started calling the project "Stove DJ".

The (very crude) solution  was a 3D printed case for an Arduino/LCD shield combo, and a sailwinch servo mounted on a protruding arm. Sail-winch servos are among the few hobby servos that can both rotate continuously and track position at the same time (nicer servos such as Dynamixels or Herkulex don't really fit the bootstrapping philosophy, and at the time I didn't know about the OpenServo Project).
The housing was designed using FreeCAD, Overhanging features were deliberately avoided,
 in order to facilitate 3D printing 

Telling people about it, someone suggested adding intermediate programs, such as "cooking at full flame for 15 minutes and then simmer for 30 more". With such a flexible platform like Arduino, those things are easily incorporated. Even gas sensors for added safety were a possibility. However, I learned shortly after that the oven's timer could still be used while off, and I started using it to time the cooking on the stove. This, along with the safety concerns of fiddling with gas appliances, lead to abandoning the project, not without some serious learning experience, the true fundamental point of the whole thing.

Recently I saw a similar concept, the Meld, As the StoveDJ, the Meld, although much further developed, is a retrofit for existing kitchens, and brings programmable functionality that facilitates cooking many different recipes. As the excellent documentary "Everything is a Remix" illustrates, invention sprouts simultaneously in multiple instances, when the conditions are right, just like seeds waiting for the right weather.


In the beginning...

My first hands-on Arduino experience took place during the 2013 Warman Challenge for teams of engineering students from Australian Universities. That year, the mission was to produce a device capable of autonomously navigating a small obstacle course that included a big gap. The difficulty lived in doing so while complying with a set of very restrictive rules. My teammates, Mechatronics Engineering students (I was doing Mechanical Eng.), owned all the toys (i.e., boards, servos, sensors, etc.) and I was instantly fascinated by it. Since they were considerably younger than me and already knew a lot more, I felt that I had to catch up and learn as quick as I could.

I guess I've been doing so ever since.

BTW, our team's solution that year was to use a hybrid car/quad-copter to navigate the course. It eventually evolved into a "reptilian" quad-copter that just dragged over most of the course (the rules banned flying all over it). In terms of engagement of the audience, it was one of the most spectacular entrants to watch that year.

Build and Photo by J. Harms