Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

August 29, 2015

Transforming Birthday Cake - Animated Platform

Since uploading Transform Birthday Cake - Optimus Prime on You Tube I have heard from many people wanting to know how the "animated cake platform" works. I have used my fair share of open source software and hardware in my time so I am only too happy to share and give something back.

You can read on to see how I made the machine you see in the video or you can follow my build project where I am making an easy to build version so you can make your own.

Its worth pointing out I am not a mechanical engineer, I simply enjoy designing and making things for a hobby. Its important for me to say this because I don't want people (especially my kids) to dismiss an idea because they "arn't smart enough". The internet is jam packed with information on every subject, if it interested you got for it! Thats is what I did here: find out just enough information to make this idea become reality.

The Challenge

This idea came simply from my eldest son asking for a Transformers cake for his birthday, my wife makes our two boys cakes each year. My inner child immediately pictured a cake that actually transformed and that was it, I was hooked. I pondered the idea for a while and concluded that yes it could conceptually be done but I knew it couldn't just be a machine covered in icing, it needed to be first and for most an actual cake, the machine would need to work around the cake. Also I wanted to the final cake to have a sense of wonder about it, yep, wonder. I wanted it to be like a magic trick and fool the viewer (mostly 6 year old children) into thinking the cake was standing up by itself. So that was the challenge, make Optimus Prime come to life in an invisible way.

Design

The first few months of the project (of any of my projects) were all paper sketches and doodles, throwing ideas around in my head. As a parent I have very limited time between the kid,s myself and going to bed. So I have no time to waste in the evening. My way around this is to think, design and sketch before hand, I have a 45min train ride to work so this is the perfect time for me to do this. That way when I do step into the workshop it is 100% time on the tools.

I started sketching in January 2015 and by about March felt I was ready to start entering the design in a CAD package.

The whole design centers around the concept of using wire under tension, I don’t know the exact engineering term but I got the idea when I recalled an episode of Richard Hammonds Engineering Connections. (Though I can’t recall which episode) In it Richard holds up an old fashion toy man standing on a base. When he pushes a button on the bottom of the toys its arms, body and legs go limp, when he releases it the toy stand erect from the tension in the spring loaded wires. He did this to illustrate this properties of wire under tension.

The Skeleton

The skeleton has two modules: the legs (blue and grey parts) and the Cab (Red parts). 

The legs have 2 different types of lift connections, for sake of explanation let’s call them the shin connection (connecting the two blue blocks) and the thigh connection (connecting the middle block to the cab).

The cab has two L-shaped arms, and a center column holding the mechanism for simultaneously raising the head and opening the arms.

Wire

The blue and grey sections have steel fishing wire weaved through them in such a way that when the wire is pulled the connections want to climb (see this YouTube video), just like the toy man that inspired it. The wire is pulled by a gear-down stepper motor, more on that  later. Each corner that the wire threads around has a small v-grooved bearing (gotta love ebay) to make the transformation nice and smooth.

Not only is steel fishing wire strong, skinny and flexible, it also of course conducts electricity.

Shin connection

Notice in the picture to the right the shin connection has a motion range of 180deg. This is important because the middle blue block needs to swing around clear of the rear blue block when it transforms. Also the blue pieces need to remain parallel throughout the movement,.That is what the belt is for. I got the idea for the belt off this video from this amazing Channel via an article on Makezine.  
First try: "Bent Parallel Bar" 
My hope was that the belt would give me high strength and accurate movement, something I wasn't confident my first design would deliver. The down side to this approach were many: the 3D printed pulleys teeth didn’t quite align right (by the tinniest amount) so the belt teeth didn’t grip properly, so then it needed super tight (custom sized) belts to compensate, but the force of the tight belts caused the plastic to bend, which then required reinforcing the connecting rods and caused friction issues plus having to assemble and disassemble this fiddly mechanism over and over, it was all very frustrating.

Copy this particular design at the risk of your own sanity! Instead I hope you take inspiration and the principles used and make your own improvements on this design.
  
The belt design was actually my second design, In hindsight I should have tried to refine my original “bent parallel bar” design, see pic. (which I found after studying one of my boys transformer toys.)

Thigh connection

Fresh from the printer
This connection was simple 90deg hinges and probably because of that fact they worked just fine. The end of each wire attaches to the middle of lower connection. Many springs and elastic bands were used to assist the stepper motor and ensure the cab lifts before the legs. The elastic bands are used to pull and the springs to both pull and push. The cab did not naturally fall from vertical under its own weight as I had hoped it would. I improvised and over stretched the springs so by the time the connection is vertical the strings are actually applying a pushing force to help the cab fall when the cable slackens for the downward journey.

The Cab

This was the second most difficult part. It took many train rides to try and figure out a simple way to make it all work.  I originally wanted not only the head to lift and the arms to open but also the forearms to descend. I eventually had to concede that the forearm descend element was going too far and it was dropped in favor of the L-shaped arms.

Hiding under the cab is a geared dc motor attached to a lead screw that I stripped out of an old CD/DVD drive. The lead screw raised a small platform that the head sits on. To move the arms each one has a "curved triangle" piece that the platform pushes against with small bearings. Sort of like a cam-and-follower.

The rear door is also actioned by the upward motion of the platform. Note the curved profile on the door so it opens early in the movement clearing space for the head.

Elastic bands are used to pull the arms and the rear door closed when the platform is lowered.

The dc motor gets its power through the primary wires, sneaky huh :) Look on the side of the rear blue block and you will see black wires connected the rear most bearing. The power travels through the metal bearing, along the fishing wire through the connecting pin then up to the motor. Simple and ultra invisible.

3D printing

 Everything was designed with 3D printing and cake in mind. The printing was done via a local printer iprimin on 3Dhubs on his Ultimaker 2.  PLA was the material of choice because it is considered food safe. I actually got 3 batches of prints done: the first so I could get a feel for the PLA material and feed that back into the design before the other two batches for legs and cab.

The underbelly

The underbelly.
The winch system is simple enough: the stepper motor is gears down from a 20 tooth to a 32 tooth pulleys and additionally geared down by using a very small diameter on the spindles. The bearing and stepper mounts are 3d printed also.

An Arduino is used along with an easyDriver, 2amp DC motor driver and mp3 player module. The black cylinder is a portable music speaker and the 4 buttons (top right) are just for development purpose to move the stepper and head motors when I needed.

The based I had CNC cut at woodnnames.com.au (Who are always very helpful with my custom designs and reasonably priced )

The base is covered with metal look contact sheet bought from Kmart (Australia). Credit to my wife for that nice finishing touch.

Lowering

To lower the legs a secondary set of wires uses more elastic bands (see the underbelly pic) to pull when the primary wires slacken. Note in the picture that there are 2 groups of elastic bands, one connected to the rear of the base and the other to the middle. This is so I could control the amount of force and when it is applied. The middle mounted elastic bands work only for the first 5-6 downward centimeters to pull the shin connection over the initial lump. The second set of elastic bands is used to take up the slack for the rest of the downward movement.

Cake

mmmm cake. Plus a random cup cake.
The cake is where all very nearly came unstuck. I drastically under calculated (totally stuffed up actually) how much mud cake weighs. So the cab had some Styrofoam in it to help lighten the load a little.

The cake was chocolate mud cake covered Bakels Pettinice (Fondant) rolled as thinly as possible to reduce weight. Rolkem Super silver was used where a metal look was needed. 

Whilst I and a good portion of the internet think the cake looks great, my wife did have much grander plans for other icing based decorations which I vetoed as I was so worried it would fail to lift on the day. Yes it came that close to being overweight.

I had so much fun designing, problem solving, building and also having a project to share with my wife. We are thrilled with how it turned out and are totally overwhelmed with the positive responses it has received.

If you have any questions please feel free to ask in the comments. If this inspires you to make one of your own please let me know  I would love to hear about it. 

Birthday boy gets the first piece!
Thanks!

More pics:

Sketch 2
Sketch 3
Sketch 4
Sketch 5
Sketch 6
Sketch 7
Sketch 8
Screws, bearing, wire, glue
Cab close up
Cab close up 2




Parts List

Assembly------
M3 machine screws - various lengths - button head - allen socket
24x M3 10mm - countersunk - allen socket
49 stand fishing wire
Glue - Rapid Fix (CA)
Plastics screws - wide head various - taken from old kids toys and discarded computer printers
GT2 Belt 1meter for making shin connection belts
Base - MDF - 300x390x55mm

Cab ----
2x 3mm rod
Leadscrew from computer CD/DVD - cut to size
Universal joint - 3mm and 6mm ends to match leadscrew and cd motor shaft
6x Hinges - model aircraft

Drive-----
38mm Nema17 Stepper Motor
1x 240mm GT2 Belt

36 tooth pulley
20 tooth pulley
Tiny washers for bearing spacing
Elastic bands - various
2x Springs
10x V-Groove bearing - 12mm OD - 3mm ID
4x BallBbearing 10mm OD - 5mm ID
5mm rod
Grease - food grade

Electrical-----
12v 1 amp power supply (minimum)
Arduino Uno
2A DC motor controller - externally power
Ezy driver
38mm Nema17 stepper motor
DC motor with gear box 60-400 rpm range
Mp3 module
Portable speakers - battery powered, samplers, 3.5mm connector
Start switch

3D parts-----
Bearing mounts
Spindles
Steeper mount
Foot - base join
Foot - inner
Knee - inner
Knee - outer
Knee platforms
Shin - connecting rod
Shin - pulleys
Shin - caps
Thigh connections
Hips
Cab center column
Cab rear door
Cab head platform
Cab roof
Cab arms
Cab cam triangle's
Cab front

April 13, 2015

PunchBot - Post 2

Progress Made

The very moment I began attempting to get some data out of the PunchBot hardware it became clear that I had some refining to do.

New additions: US Digital Encoder,
Gas Strut and  much more weight.
The "catch pad" was the first to go. Not only did it do a terrible job of catching (it would spring back and whack you) but its long wobbly nature introduced a horrendous oscillation into the data. It has now been replaced with a gas strut that arrests the arm slowly. The strut is the smallest, cheapest unit I could find, normally used for overhead kitchen cupboards. An L-shaped piece of Aluminium on the lower arm acts as a catch.

I knew from day one that PunchBot would need a heavy platform to be stable during the delivery of a strike. I guesstimated that little extra weight would be needed, so I started at 15kg attached to the feet of the steal frame. However the frame continued to jump up a few millimeters with every strike. It wasn't until I added 50kg of weight that the base finally reminded stable. This led me to weld a weights bar in the fork of the base so there is plenty of room to add as much gym weight as is needed, which might be the case when I invite heavy and stronger people to give it a go. I opted for gym weights rather than sandbag or lead blocks because not only do they look nicer but any martial arts gym I visit is likely to have more on site if they are needed.

At one point i suspected that the aluminum neck was flexing under load. I wasn't entirely sure but I considered this enough justification to buy 20x3mm wound carbon fiber tube. Plus it looks great with the machined aluminium head.

Next I spent many months chasing a "saw tooth" noise in the optical rotary encoder. Convinced it was due to a cheap encoder I bought an expensive high resolution US Digital S5 Encoder unit only to find the issue reminded. Eventually the Arduino Forum users help me work out the saw tooth data problem wasn't really a problem just a misunderstanding on my part about the nature of the data output from an Optical rotary encoder. D'oh.

Fancy new machined face and
carbon fiber rod.
With the above problems resolved I was getting nice smooth data into my laptop and into Excel. I let some friends and family have a go and I was thrilled to see most people enjoying and engaging with it, ever if it was to just compare raw data graphs in Excel. Cutting and pasting into Excel got old fairly quickly so I began writing the Windows desktop application to manage the data from the device and make nice graphs of it.

We quickly found the next refinement: the head is too heavy. I had added small lead weights to give the pad some 'feel'. At 700g I thought it was a bit light but after 3+ full strikes it really began to sting my hand and make it ache. I had an aluminium head machined and ditched the lead weights so it comes in at about 500g which is just enough to give a good 'feel' without fracturing your finagles.

I have begun the physics study necessary to calculate and code power figures. More in the next blog entry.

November 12, 2013

PunchBot


I have been practising various Martial Arts styles for over 15 years and have always been curious about one particularly primitive part of my pugilist pastime: how hard I can punch? More than that I want to know "pound for pound' is it all about size or does the skill factor come into it? Put simply can a small guy with skill hit as hard or harder than an unskilled big guy?

This brought me to consider developing PunchBot a machine for accurately measure the power of a human punch.

I also thought this might be an interesting way to raise money for my favourite charity "Movember". After this build is complete I intend to start an online leader board and use it generate some charitable funds from a bit of health competitions between martial artists and their clubs.

Research

First I looked into using an accelerometer to measure force but soon discovered that they have a notable downside. A quick Google search showed me that humans can generate impressive forces from a punch. I initially considered the development of an accelerometer model with high G's of 120+. I soon realised that the higher the G rating the less sensitive and more "noisy" the accelerometer signal became.

I considered that a G force measurement is relative to the weight of the object being struck, so by making a punching bag heavier it reduced the accelerometer range requirements and increased sensitivity. So a punching bag could be made heavier BUT it raised the risk probability of breaking bones in the hand.

Therefore I ruled accelerometers out.

In my research I noticed there are many existing force testing pads, bags and gloves but most seem to use a scoring system, they use a number scale that is relative only to that device. As a point of differentiation (and personal principal) I wanted to create a device that has a close to scientific validity as I can get with affordably priced electronics.

My first two requirements we established: the safety of a light punching weight and repeatable accuracy.

Design

I finally decided to design a device that worked by measuring rotational force or Torque. In the top-most picture can be seen the thin black tube, which is a swing arm. The axis of the swing arm is connected to an optical rotary encoder, a device that can accurately measure angles on a shaft. 


The theory being that by knowing the Moment of Inertia (mass) of the swing arm, I can calculate its acceleration with the encoder and derive a power figure (Torque).

My future fund raising plans required some portability but with a heavy base for stability. Also the punching pad height had to be adjustable so it could be set to individuals shoulder heights.

I sketched out every aspect of this design in my notebook in the 90 minute journey to and from work. When I was happy with a design components sketch I added it to my CAD model.

Construction

The base is made out of 89mm square mild steel tube welded to 3mm plate feet. In the pictures you can see the vertical slit on the base that is used with a bicycle quick release to hold the neck very firmly in position.

All the aluminum is from capral.com.au. The neck is aluminium not steel so that it is easy to lift when adjusting the height.

With no access to a CNC I cut out everything out by hand using drill press, hack saw, files and taps. (I actually enjoy doing it by had but I wanted the CNC's accuracy.)

The neck was particularly tricky: to get some accuracy I printed out 2D plans of the neck in 1-to-1 scale and sticky taped then to the faces of the blank neck metal. By doing that I could measure and check that each sides holes were aligned before I centre punched.

Roller bearings and bolts are from hobbyparts.com.au. (fantastic product range, great service but their website needs some updating)

The white mounts for the rotary encoder were 3D printed at shapeways.com.

The 12mm axis shaft is from a defunct laser printer.

Electronics

In one picture you can see a blue shape with three spring contacts in wooden blocks. When the inter spring contact separates it tells the Arduino when to start logging data from the encoder.

The two outer springs are used to run power to a super-bright LED that sits atop the swing arm and is used for reaction-time measurements. I use spring contacts to power the LED because using wires would make the Moment Of Inertia calculations much harder or less accurate.

I will use my CAD model and super accurate scales to determine the Moment of Inertia figure of the swing arm.

The calculations are handled by an Arduino Uno which outputs the result to an LCD display. In future models I intend to upgrade to an Arduino Mega as the Uno can only count to the nearest 4 micro-seconds. This doesn't seem like much but the acceleration of an average punch lasts less than a few milliseconds, so processor speed is quite critical to accuracy.

Its painted only in primer and the pad doesn't yet have padding but after 11 months I have finally completed the prototype. I will now begin testing and writing the mathematical formulas. More on that in the Part 2.








September 18, 2012

WiFi Garage Door opener - Netdunio


With help from a Netduino I can now open my garage door with the web browser on my mobile device. This is very very handy and very 007.

They wanted $100 for a replacement garage door remote, a cheap PCB with some resistors and a 30c chip. Buh! I refused to pay it but I still need to open my garage door, even if it is old and dying.

What a great opportunity to play with the Arduino platform. I immediately bought a Netdunio Plus, a magically piece of technology allowing you to use a web browser and to interface with real world electronics.

I this case I connected my Netduino to my home wireless router, so my phone (or any device with wifi permission) can browse to the netdunio IP address and receive back a big button that says "Garage Door".

Push the button and it signals the Netdunio to open an output port, which signals a transistor, which triggers a relay which is connected to the garage door motor, which open the door. So simple!

Now the wife and family all have the ability to open the garage door if they need, it is like having an endless supply of free remote controls.

If i did it again I would probably connect the Netdunio to the last remaining remote control rather that hard wiring it all. Either way it works great.