Laser Cutter Build Night: Almost Complete!

Tonight was an extremely productive and satisfying build night.  After the success of last night, I absolutely had to see this project through.  I did quite a few things:

First, I fixed the sticking problem, hopefully once and for all.  I took apart the entire XY table sled assemble and cleaned everything with rags, water, and a toothbrush.  Then, I generously slathered everything in mineral oil.  Quite generously, actually.  The parts were so slippery they nearly jumped out of my hand.  After putting everything back together, the problems dissolved and haven't reared their ugly heads since.  I am quite happy about this, since the X axis had become unusable due to its sticking problem.

I also added anti-backlash code.  To do this, I set a variable to keep track of the direction the motor moved last.  If the new direction for the motor to move is opposite its last direction, the motor moves a few hundred extra microsteps in the new direction to counteract the backlash.  It does not update its position variable, because the actual axis has not moved relative the the laser beam.  I was able to use this new functionality quite effectively to eradicate all backlash on my X and Y axes.

Finally, I did some test code.  The axes never stuck and my circles came out perfectly circular.  I also figured out how to do complicated drawings using Inkscape and the laser cutter extension, so I had my machine do an amazing job of drawing its name (click the picture for a bigger view):









That engraving of the name "PiKnife" represents so much - the culmination of hours and hours of work.  It means so a lot to me to finally have a beautiful piece of proof that this actually does stuff.  I was truly amazed when I saw such fine, curving lines meeting up perfectly.  I look forward to a lot of future use of this machine.

My next goals will be to add in the limit switches and look into the timing issues.  However, neither of these affected the engraving above, so I am currently a very happy engineer.

Experiment 29: Lost Foam Casting a Slingshot

After seeing some cool videos on lost foam casting and also becoming addicted to Joerg Sprave's videos on YouTube, I decided that I had to try this method of metal casting.  I used some StyroFoam as my foam material to carve into a slingshot and then put it in sand for casting.  After pouring, it turned out quite well!  It has a few pits and imperfections, but it looks pretty awesome otherwise.  Although its rubber doesn't perform very well in the wintry cold, it should be powerful enough for squirrel hunting in the spring and summer.  I look forward to blasting some stuff to tiny bits as soon as it warms up!

Also, check out its Instructable for more detailed information!  If you want to watch the pour, check out this video and this ingot casting video on my YouTube channel.  I have included a few pictures of the casting session (I also cast a few nice-looking ingots in the same session):


Laser Cutter Build Night: It Works!!!!

After many unproductive and dissatisfying hours of trying to modify the code I downloaded off of here, I finally gave up, realized that the code was never going to work with my setup, and began to completely rewrite two of the files I downloaded.  If you look at the code, you will see that there are three files: Bipolar_Stepper_Motor_Class, Motor_control, and Gcode_executer.  I totally rewrote the first two.  Bascially, my code uses threaded programming in Python to make both axes move at the same time.  This is what makes diagonal lines instead of just a bunch of "staircase" lines imitating a diagonal line (these happen if you only drive one motor at once).  I will be posting my code very shortly; however, it isn't done yet, so I will wait on that.

Rewriting the code and testing it to debug it wasn't as hard as I thought.  I found that typing up a document in a text editor outlining what my code would do helped a lot.  It kept me on track and gave me some room to think about what the code actually had to do before jumping in.  I only had a few bugs to fix - division by zero (added an if statement to catch that case) and syntax errors.

When I tried the code, I was amazed to see that it actually worked!  It successfully drew the circle I told it to draw using G-code and even cut it at a reasonable pace instead of super-slowly!  Elated by my long-awaited success, I drew a sort of ninja star in a box using Inkscape and then converted it to G-code using the instructions provided here.  Amazingly, it worked!  Mostly, that is.  For some odd reason, the center circle of the ninja star and one of its arms were about an inch away from the real center of the ninja star.  I theorize that this could have been because of one axis getting stuck, because when the program went to the home position, it actually stopped about an inch away from the limit switches (still have to code those in).  What this means is that the code thought that the stepper was moving when in reality it wasn't; thus, when it told the motor to move x steps to go home, it didn't reach home because it the motor was farther from home than the software thought it was.

There are a few minor bugs to work out (besides fixing the sticking problem, or whatever else caused the ninja star misplacement).  I noticed that my circles I cut had flattish parts on them along one axis of movement.  I think that this is caused by the minor backlash issue I have - when one axis has reached the "vertex" of the circle along its axis of movement, it should turn around and start moving the other way.  Backlash causes it to go straight for a few hundred steps as the motor is rotating in its backlash.  Adding some simple code to detect change in direction should fix this.

Timing is another issue.  It was probably the biggest issue with the ready-made code, and it is possibly still a minor issue with mine.  Sometimes one axis will finish its movement to a point before the other finishes its movement to a point.  Additionally, when doing very small, detailed movements, the laser seems to move more slowly than when it is doing a "line drive" by moving a large distance in one move command.  I believe that this these issues are caused by minor mishaps in timing and tiny bits of lost time here and there in the thousands of start and stop movements required for fine detail.  I'll have to see if I can alleviate this issue; it may not be entirely correctable.

Experiment 28: DIY scientific ampoules!

In the near future, I plan to make elemental iodine for my element collection.  To effectively store iodine long-term, a hermetic (airtight, perfect) seal is recommended.  Scientific glass ampoules then, are perfect for storing iodine for years and years, like in a periodic table display.

In this experiment I made two glass ampoules myself from miniature test tubes.  I held the test tube by its bottom end with gloves and then torched the tube about 1cm from its mouth.  A propane blowtorch works well for this purpose.  I rotated the tube a few times to evenly distribute the heat in a band around the tube and in about 30 seconds, the tube softened.  I then used pliers to pull the mouth of the tube away from the rest of the tube by a few centimeters.  Then, I slowly removed the test tube from the flame, letting it gradually get cooler.  The end result was absolutely spectacular given the easiness of the experiment:









When the tubes are filled with crystal iodine (I will pour it down the thin neck of the ampoule), I will hit the narrow neck of the ampoule with the hottest part of the torch flame to rapidly melt it without heating up the iodine.  Then, I will use pliers to pull the neck of the ampoule completely off, thus sealing the iodine inside.  I am quite pleased to have such an easy way of making ampoules for chemistry stuff!

Experiment 27: Key Duplicating by Casting

I have always wanted to give key copying a go like the secret agents do in spy movies, so I tried it using my house key.  Before you freak out and say that key copying is illegal, note that I used my house key, which I own.  Do not copy other people's keys.  That is probably illegal and could be a felony.
Anyhow, I used some creative methods to quickly copy the key and cast it in zinc.  After a bit of touching up, the casting actually worked!  Check out the Instructable for pictures and more information!  Also, if you don't believe me, watch this video of the test in my door:

Update to YouTube Account Suspension

Bleh.  YouTube has not contacted me once about why my account was suspended, nor have they given the ScienceWithScreens channel back.  I am thouroughly disappointed with how they have handled this issue.  It should have been corrected months ago, since I never did anything wrong.

What I find strange is that using my normal email address (which I used for the ScienceWithScreens channel) I am still able to get into YouTube, just not into my old channel.  Odd.  Apparently, YouTube doesn't hate me enough to completely ban me. :)

This means that I will be uploading more science videos to the new channel YouTube gave me under the same email, located at this address:

I am super happy, and I hope you are, too!  Look forward to some really cool projects I have up my sleeve.  I will also fix all those "broken" videos that now exist on my blog.

Laser Cutter Build Night: It's a Fixer-Upper...

So my grand plans of spending this coming Saturday laser cutting amazingly complex and smooth curves, swirls, text, and other shapes isn't exactly going to work out.  The code I modified works, but it is a real fixer-upper.  At first, after a few edits of syntax errors, it did technically move the stepper motors... I would have been dead and gone by the time it actually finished.  I had to place a finger on the motor rotor to feel if it was spinning or not.  It was simply too slow to even notice with the human eye.

After a bit more modification, I "successfully" cut some ovals into some paper using Inkscape and a laser engraving extension to generate gcode.  The Python I modified did make ovals, they just didn't close off and looked more or less scribbled by a toddler.  In addition, the extremes I had to go to to make it work made the movement extremely jittery, although not by the stepper's fault.  I would have taken pictures but it is 11:14 PM and I'd better be off to bed sometime soon.

I will be working to try to salvage this code and if it doesn't work I suppose I will have to think something up.  This is going to get interesting...

Laser Cutter Build Night: Code (Hopefully) Completed!

Tonight I looked over the code and in basically one sitting modified it to a point where I think it should work.  The task was really quite easy, actually!  The man who wrote it was nice enough to leave extensive comments that were helpful in elucidating the meaning of the complex variable names and mathematical equations.  I still don't understand the stuff for drawing circles, but I don't need to modify that code, so who cares?  All I really had to do was change the bipolar stepper motor class to use pulses and direction high/low logic rather than using four inputs to manually step through the motor sequence.  I also deleted the unhold() function that released the holding power on the motors because I didn't have a way to port that to my EasyDriver setup easily and didn't see it as necessary.

A word of warning - I haven't actually tested this code yet!  It is late at night and I have other business to attend to.  Hopefully, I can get the code tested soon.  I noticed that it doesn't use limit switches at all, so I might be able to improve by adding support for those and potentially also for PWM laser modulation to set the intensity of the laser rather than just going faster/slower to engrave/cut.  I didn't bother to post my modded code because it is untested.  However, once I test it, I will post some download links.

Lastly, I sacrificed a black foam food container to the hungry red beam of my laser cutter.  I made five of drawMrSmiley() cut all the way through the foam.  They were pretty sweet looking, but I gave them away to inquisitive people before I photographed them.  This foam cut like butter - even more quickly than the craft foam - I almost couldn't go fast enough to prevent a full cut.  PWM should help!

Laser Cutter Build Night: Hardware Finished!

Tonight I completed all the hardware for the laser cutter and confirmed that everything is working!  I fixed the little issue with the X axis by cutting off the offending portion of the platform support and then retaping the entire platform back on to the moving sled.  Also, just for fun, I engraved drawMrSmiley() on the bottom of one of the MDF supports.  It engraved quite nicely.

I also made some workpiece holders out of small neodymium magnets and hardware nuts.  I saw this idea somewhere online - it wasn't my invention.  These will hold nicely on to the sheet metal platform and hold down the workpiece so it doesn't squirm under the intense heat of the laser. :)









As you can see, the magnets work quite well.  On the right are the seven drawMrSmiley() pieces of cardboard I engraved as a sort of stress test.  They all came out quite well and none of the electronics got too hot.  I ended up giving them to friends.  With the cardboard engraving, I noticed that if I set the speed to be too fast, the laser would sort of "skip" parts of lines because it didn't have enough time to fully burn the path.

I also made a really awesome looking bookmark by cutting (rather than engraving) blue craft paper.  I used some "for" loops to iterate through the area of the bookmark.  The laser cutter ended up making 900 holes.  Heh heh heh.  I like this machine.  :)
I am sure glad I didn't cut those by hand!  Even so, it took a few hours to complete.  However, I like that my laser cutter can cut all the way through the paper.  I'd like to point out that I programmed the code to cut squares, but it ended up making rectangles.  This was because of the slight backlash issue.  Basically, the backlash caused on side of the square to be cut shorter than the other, which affected another side, causing the square to squish just a bit.  Not a big issue, though.  Software to the rescue!

So, all the laser cutter hardware is complete.  I am extremely happy with how it turned out!  I also am looking forward to further enjoying its surprising cutting capabilities.  The tiny laser packs a punch!  Looking into the future, I will be starting to modify the downloaded code that reads gcode and moves the motors.  It shouldn't be a very hard task.

Laser Cutter Build Night: Electronics Attached, Hardware Ready to Go

Tonight was a very productive night!  After the encouraging cutting results of last night, I attached the Raspberry Pi, EasyDriver, and laser driver boards to the laser cutter plywood base.  I used screws and nylon tubing standoffs for the Raspberry Pi and hot glue for the laser driver.  However, since I blindly followed this guide for assembling the EasyDriver pin headers, I had pin headers on the top and bottom of these boards.  This made attachment complicated, because I had wires below the circuit board.  To get around this problem, I raised the EasyDrivers off of the base by sliding their mounting holes over sharpened chopsticks and securing them with hot glue.  I did the same thing for the computer fan that cools these electronics.  I decided not to use an enclosure because of the hassle of managing all the wires inside such a small space and also because of the difficulty of preventing large stresses on the connections.



Looks pretty sweet!  I like how the fan is aligned diagonally to the other boards.  Additionally, I noticed that the LM317 on the laser driver was painfully hot during its tests with the dummy load (this simulates the laser; read the previous post for details), so I used the failed laser diode heatsink to cool it.  I also used a bit of zinc oxide baby cream to stand in for thermal compound.  I believe I read somewhere that this is a good substitute because zinc oxide is the main ingredient in commercial thermal pastes.

As you can see in the pictures, I am using a ribbon cable to attach the control system electronics to the Raspberry Pi.  This will enable me to semi-easily remove and replace the Raspberry Pi if I need it for other projects.  A cheaper controller would have been nicer because then I could just leave it on the laser cutter forever.  However, since I spent upwards of $50 on the Pi and all its extra peripherals and power accessories (and since I only have one), I don't really want to leave it there forever.

I also epoxied the power switch to the edge of the base so it is nicely accessible and stable.

After I completed all these tasks, I looked into the X axis stalling issue.  After a cursory debugging run-through, I found the problem.  The base of the moving platform was running into the Y axix stepper motor when the X axis got to a certain position.  Stupid me.  *Sigh*

Finally, I coded a test function to ascertain the engraving/cutting capabilities of my laser cutter on different materials.  I called it "drawMrSmiley()".  Using this, I can set a cutting speed and an engraving speed and see if it works on different materials and colors of materials.  The square is cut and the face is engraved.  The laser also engraves wood!  I am quite exuberant at these impressive results!









From top to bottom left to right are offwhite paper (engraving speed was too fast), green fabric, green craft foam, and black craft foam.  I also did a cool zipper/zigzag design on wood.  I love this laser cutter!