Sunday, September 15, 2013

Metal Fabrication

When I made the Explorer Bot last summer, I wished at one point that I could have just welded the frame together.  But I didn't know how to weld at the time.  This summer, I enrolled in a metal fabrication class and learned several of the basic techniques used to manipulate steel.  I made several items, pictures of which are shown below.  I've labelled some of the pictures with the techniques that were used.
A spaula

Two hooks were made with blacksmithing techniques.  
A tripod holder for an iPhone.

Hardware makes the iPhone holder adjustable at each leg
of the tripod.  I used 1/4"-20 hardware, sandblasting the nuts
prior to MIG 

A piece of pipe tubing was welded onto the iPhone
holder using a MIG.
This corner was made with an
oxy-acetylene welder to put
together two pieces of 16 gauge
steel meeting at the corner.

Final pictures taken after patina and clearcoat:

Sunday, August 18, 2013

Bare Conductive Paint and Squishy Circuits

Update: 5/22/14

I redid this project with some students in a materials science class. They were able to make both the conductive and insulating dough fine.  The only variable I could figure out which was different was the type of cream of tartar used; the ones that worked were made with McCormick Gourmet Collection cream of tartar.  The ones that did not were made with a QFC generic brand.

In addition, I made some conductive dough from nshima, which is a corn based grain eaten in Zambia.  Here's a picture.  Insulating dough made only with nshima and distilled water was too conductive to be useful.

Original Post

I have spent a couple weeks this summer working to evaluate  fun and creative methods to teach conductivity and circuits.  I worked with both the Squishy Circuits and also with the Bare Conductive Paint.   This is a story of success and current failure.

Success Story:  The Bare Conductive Paint is an easy to use and very fun tool to lay down electrical wiring.  The prototype shown at right is a X-mas tree where one wire runs from the positive battery terminal, up the left side of the tree, and to the anode of the LED.  The other wire runs down the right side of the tree from the cathode of the LED to the negative terminal of the battery.  The paint is a graphite impregnated concoction (hence the black color), which can be painted on with a brush.  It is much thicker than normal paint.  My X-mas tree was made on sticky-back green felt which was then affixed to a card.  

The inspiration for the X-mas tree was this video from the Bare Conductive Paint website:   How to Cold Solder.

Here are a couple christmas presents made for Xmas 2014 for my niece and nephew.  I was particularly proud of the Despicable Minion since the battery made a cool eye, and the conductive paths were along the outside profile of the character and then under his overalls.

Two blobs of green conductive dough allow a circuit
to be made between
an LED and a 6V battery pack.

Less Successful Story:   I have been playing with making conductive and insulating dough using the Squishy Circuits recipes.  I really like the potential for creative application of very simple circuits, and in theory the technology is simple enough that I could work with this system in remote locations, such as Zambia where I have gone with a school group for three summers.   The doughs are just flour and water mixtures, with salt added for the conductive dough (along with cream of tartar or lemon juice as a stabilizing electrolyte), and sugar added for the insulating dough.  The conductive dough works great, as you can see from the picture at left.

With the brown insulating dough in the middle, the
LED turns off indicating a short between
the two conductive blobs.  Apparently the
insulating dough has lower resistance than the LED.

However, I've had real issues with the non-conductive dough, which seems to short the LED, suggesting that the dough has lower resistance than the LED.  I have tried using distilled water, deionized water, and two types of flour (normal bleached and an organic wheat flour), which no discernible differences in behavior.  The folks at Squishy Circuits have been really supportive, but can't seem to offer much help in terms of suggesting possible reasons for the issues with the insulating dough.  This has been a frustrating project.  I'm taking a break from it and will revisit later, possibly using some students in a chemistry class to help troubleshoot in conjunction with a unit on bonding (which relates to electrical conductivity).  Check out more on Squishy Circuits on their Facebook page.

Friday, August 16, 2013

Frostruder - XY Plotter Derivative

The XY Plotter now has a frosting extruder mounted in the place of the Sharpie as the "tool".  I used the Frostruder kit originally designed for the MakerBot, which uses two solenoids to control pressurized air to a syringe.  The syringe can be filled with frosting and the air pushes it out at a rate that depends upon the air pressure and the syringe tip size.

I connected the two solenoids through a series of relays to the Arduino microprocessor which is running the whole project.    Two pins control when pressure is applied to the syringe, and when pressure is vented to atmosphere.

The video below shows a proof of concept of the Frostruder in action.  The video is sped up 4x times.  There is still a lot of work to be done in terms of balancing variables to optimize the extrusion process; the variables include air pressure, time delay between when pressure is applied and when tool head motion begins, rate of tool head motion, and the nature of the frosting used.  Still I was very excited when this video was made because it represents a functional piece of equipment!

Unlike the original Frostruder, the syringe is separate from the electronics and solenoids which route the pressure.  Those are mounted to the frame of the 3D printer in a wooden box.  Tubing runs from the box to the syringe, which is mounted into a custom designed and 3D printed part.  The syringe can be easily removed with just an allen wrench.

SolidWorks and STL files for the carriage can be downloaded from the links below.  These parts were 3D printed using a Replicator using 20% fill and 3 shells. 

I have made two major improvements on the software side of the project as well.  I improved the Processing interface, and I took a major stab at correcting the slope change problem seen in the previous post.

Processing Interface Improvements:
  1. I calibrated the machine to determine the relationship between screen pixels in Processing, steps of the stepper motors, and XY distance traveled.    I changed the interface so that the grid shows inches now.  Unfortunately, the grid spacing doesn't work out very nicely.
  2. I added a clear button which removes the "lineLayer" PGraphic without having to restart the program.
  3. I added a slider based on the Control P5 library which controls the presence and size of a "cookie" in the center of the stage.  The cookie is to scale, making it easier to visualize.
  4. I added the ability to load an image which can serve as a template for drawing the lines on the Processing screen which correspond to the places where frosting will be laid down.  Making the template image is easy with the help of a screen shot tool.  Then the template file can be opened and edited in any image processing software, saved, and then loaded from within the Processing sketch window.  The video above was done with the help of a image file which had wordArt added using Powerpoint.

New and Improved Stepper Motor XY Interweave:
A previous post showed that my method to allow the X and Y stepper motors to move at the same time had a flaw.  The issue was essentially that slopes are often non-integer numbers when reduced to a reasonably small integer denominator, while stepper motors cannot take fractions of a step.  My previous algorithm was to reduce the decimal slope to the nearest smaller whole number, then calculate the remainder which was the additional number of steps required to go along the longer axis.  Those steps were taken at the beginning, effectively increasing the slope by 1 for as many iterations as it took to make up the extra steps.

For example, suppose that you wanted to take 28 steps in the Y direction and 23 steps in the X direction.  The slope, dY/dX is 1.217 which is not possible to do directly with stepper motors.  So instead, we have the motors run at slope 2 for five iterations, and then for slope 1 for 18 iterations, where each iterations corresponds to one step along the X axis.  The picture at left shows that this results in a tool path which substantially deviates from the ideal path, because all the remainder steps are taken at the beginning.

The solution is not hard; we need to space out when the remainder steps are taken instead of doing them all at the beginning.  One algorithm which is working for me is discussed below.  Note that this algorithm is not the most efficient, but it seems to be "good enough" in terms of actual performance on the device.

  1. Calculate the slope and round down, as before.  Also determine the number of leftover steps as before.
  2. Divide the number of iterations (equal to the lesser of dX or dY) by the number of leftover steps.  For example, in this case 23/5 = 4.6.  My algorithm rounds this number UP, because otherwise you could do too many steps.  This is the number of steps per iteration.
  3. Figure out how many steps are still leftover.  In this case, doing an extra step every 5th iteration means 4 steps will get done, so there is one more step to do.  This step is done at the beginning (in retrospect, it should be done at the end).  If there are more than two extra steps, the code repeats steps 2-3 one more time.
From the images below, we can see that the code works if it is somewhat convoluted.  I also setup an Excel spreadsheet which helped me to test the algorithm before actually writing the code for it.  I used the same spreadsheet to visualize the tool-path by having the Arduino printout the cumulative steps along both axes after each iteration, and then graphing these.
Two Method Comparison for dY = 40, dX = 25.
Two Method Comparison for dY = 41, dX = 21.
Actual results of both methods done by Arduino microprocessor and
plotted for four different dX,dY combinations.

One interesting note is that the second method is not always better than the first method.  The case where dX = 21 and dY = 41 results in 21 iterations with a leftover of 20 steps.  So if the original method is used, all but one iteration can be done with an extra step, resulting in the original method giving a better trace of the ideal path.  The code I wrote allows the program to chose the better method.

The code which implements the algorithm described above is shown below.

This is a simplified version of the actual code posted on GitHub, but is easier to understand.  The best way to understand the algorithm is to compare the color coding done in the pictures above with the comments written into the code.

Current code is available:
Processing Sketch
Arduino Sketch

Monday, June 3, 2013

XY Plotter

I constructed most of a 3D printer using the exceptional plans posted on Thingiverse based on the OpenBeam system.  The link for the plans is here:    The parts were printed on a Replicator 3D printer.  Timing belts were ordered from (T2.5 Standard Breco® Open Length Timing Belt, 6mm width, 2m length, Standard 590 White polyurethane, steel cables) as were timing gears (25 Tooth T2.5 Pulley, 5mm bore, 1off M3 Grubscrew Holes).   I purchased linear shafts from McMaster (10mm, part number 6112K47 and 8mm, part number 6112K46). Couplers for the z-axis were purchased from ebay, while acme screws were purchased from TechPaladin.  I installed limit switches on the front for the y-axis and on the right carriage for the x-axis.  

Currently the "tool" is simply a sharpie pen.
The electronics wires were soldered onto an Arduino breakout board fitting over a Dueminalove.  Power is provided by an old ATX power supply onto which I jury-rigged a power switch (ATX supplies are normally turned on/off by the motherboard of a computer).

I wrote a custom interface using the Processing language which allows me to move the pen between two points.  If the pen is down, the software connects the two points with a line to mimic what should be happening on a real piece of paper.  The video below shows the interface in action.

Link to Arduino Code
Link to Processing Code

A first demonstration of the 3D plotter can be seen in the picture shown at right.  The left shows the Processing interface, while the right shows the actual paper which was drawn.  The resemblance demonstrates a good proof of concept, although the interweave is apparent by kinks and changes in slope in what should be straight lines.  This is a bigger problem than I anticipated and one I will have to work to fix.

My longer term goal is to mount a frosting extruder in place of the pen and use the Processing interface to allow custom decoration of cookies or something similar which could be placed on the platform.

Friday, May 31, 2013

iRobot Solenoid Kicker

One of my coworkers is heavily interested in and quite adept at developing curriculum using the iRobot Create platform.  It's a wonderful platform with two wheels and multiple sensors including encoders, IR sensor, touch sensors on the front and sides, and the ability to detect an edge in front or when wheels dip.  It has bluetooth capability with an optional module, Arduino-esque capability with an optional module, and I believe there are wifi modules (a la Raspberry Pi) which are compatible with the iRobot Create.

My coworker and I ran a three day workshop on robotics with the goal of building and programming robots which could play soccer via remote control.  My coworker has done a huge amount of work on setting up an HTML -> Python -> iRobot platform so webpages can be written to control the robot.  He is also very interested in using them for remote teleoperated applications using readily available technologies like Skype to handle the remote viewing operation.

For this workshop, I spent a couple weeks working on a way to install a kicker on the iRobot.  I had a 12V solenoid, and thought that I could use it, driven through the iRobot's battery, to "kick" a ball.   I designed the kicker in SolidWorks to have a lever which pulls an arm forward when the solenoid is pulled in.  This is the "kick".  I wanted to do this when the solenoid is energized, because otherwise the robot battery will drain all the time except when you are kicking.

The setup for the lever is a good example of a third
class lever.  The pivot is at the end, with the effort in the middle and the load at the top.  The load is the force required to kick the ball.  Third class levers amplify the distance traveled and speed of the load relative to the effort, since the load is positioned further away from the pivot than the effort.  The trade-off is that the effort must be larger than the load, since the torque exerted by the effort must be greater than the torque created by the load, but the distance from the pivot to the effort is less than the distance from the pivot to the load.

I 3D printed the kicker and laser cut out a base platform, two side panels to mount the solenoid, the lever, and the pivot point.  I used a spring around the ram between the solenoid and the lever to provide a restoring force to move the kicker back into the robot when the solenoid electromagnet was released.   I designed a simple and compact electronics board to drive the solenoid based on a digital signal from the iRobot.  Four wires from the electronics board to the robot connect ground, battery power for the solenoid, +5V for a relay circuit, and a TTL signal to drive the relay.  I used a voltage regulator to step down the iRobot battery voltage to 12V for the solenoid.  I 3D printed a nice little box to hold all the electronics.

Electronics Board Files

The input and output pins for the iRobot Create can be accessed using a series of bytes sent (via bluetooth in this case) over a serial port to the iRobot microprocessor.  I played around with the bytes.  Check out the work in the two links below; the first is the manufacturers document which describes the available commands for hacking the iRobot.  The second is my notes to show what I was able to implement.

iRobot Create Interface
Practice Document