Evolution of a Blog

This blog has evolved as I have as a maker. It starts at the beginning of my journey where I began to re-tread my tires in the useful lore of micro electronics and the open-source software that can drive them. While building solutions around micro-electronics are still an occasional topic my more recent focus has been on the 3D Printing side of making.

Monday, October 31, 2016

Laser Cutting Learnings re Fan and LED PWM

Here are a couple of of learnings / questions. My first configuration was to use the fan PWM to drive the laser via the M106 command.

From a hardware perspective you need to do two things, first you need to get the 24V fan power down to close to the 5V PWM input. Jay, at JTechPhotonics, said the following: "For the voltage on the fans, yes it would be better if they were put down to 5V (or even 12V). The input is isolated, so it should work fine, but it was designed with 5V in mind. I think the high end of the design is rated at 24volts. If you have a way to get it to 5V then I would recommend it, but you probably are fine at 24V. " I did a voltage divider and took it down to close to 5V. Second, I installed a switch so that I could toggle between the fans working or the laser working.

There is a slight issue on the firmware side though. At least with my printer there is a spike of voltage when the fan circuit activates. I am assuming this is to help the blades of a fan spin up but have not dug into the code to see. You can see the spike using a meter or just by watching, with glasses of course, the laser turn on. Not at all optimal to have a litle black spot everywhere the laser activates! Is this on all machines?  It turns out that this is a fan spin up feature and it can be disabled in the configuration.h file (courtesy of gr5 on the Ultimaker forum).

With the above being the case I decided to go the LED PWM route. This is not as clean due to the normal state of the LED being on but I decided to try it anyway. I chose not to use a voltage driver as the supply for the LEDs is under 12V. Same comment about it needing to be switched but this time there are no spikes! There was another problem though.  An LED PWM command, i.e. M42 S200, seems to get processed as soon as the firmware reads it without waiting for previous commands to be completed! You need to put an M400, wait for everything to be done, command just ahead of it (found that above in the comments on this thread).  Note that you do not need a pin number with the M42 as it will default to the LED ... but if you do use a pin number it is 8 for the UM2 and 15 for the UM.

Here is an update from GR5 on the Ultimaker User Forum in regards to the Fan PWM and the burst we see on starting the fan.   I have not done this yet but only because I dread messing with the motherboard again!
As long as you never set the fan to below 30%, getting rid of this feature won't hurt.  Plus it doesn't work very well anyway.  If I don't set the fan to 100% until 5mm and is printing .1mm layers that is 50 layers so fan is 2%, then 4% then 6%, etc.  When it hits 2% it powers 100% for 200ms then to 2% and fan stops.  When it goes to 4% it is already on and it doesn't do the special "power on" code.  So the code is kind of useless.  It should do full power everytime power is increased - not every time fan is turned on.
In Configuration_adv.h just set the time to 0 or minpwm to 255:
// When first starting the main fan, run it at full speed for the
// given number of milliseconds.  This gets the fan spinning reliably
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) 
Update of mid-November:  I could not get the LED PWM to work as well as the fan PWM was working so I have gone back to the fan after implementing the above change.

Friday, October 28, 2016

Yet More Laser Tuning

I am pretty confident that I am chasing a level of precision in cutting that might be well beyond what my new laser is capable of doing yet I continue to mess with it anyway!   I have gotten pretty good at finding a focal point anyway.

First step is to do the eyeball (behind safety glasses!) calibration with the laser running at 1% of power as adjusted on the front panel of my printer.  To aid this first focus I have found that using the camera on my smart phone helps as it has a macro focus that beats that of my eyes.

Once that is done I print the calibration lines seen below.  Low power so that the paper is only just scored.  The first test is done with 2mm build platform movements, then 1mm, then .5mm, and finally .25mm.  Can do another one at .1mm but not shown here.  Obviously the trick is to bracket each level from the previous test.

Having done the above, however, I am still not sure that I am getting the depth that I should be or not but more troubling is that I get two completely different depths of cut on the x-axis versus the y-axis!  As you can see in the below photos the cut that I get on the x-axis, side to side, is dramatically better than the one on the y-axis, front to back?  I am not seeing this when I print though I am going to further test this later today.  I have done the things on the printer that I would do if I thought that I had an issue but will recheck those adjustments as well (tension on the small belts, equalizing tension on the long belts, ensuring all set screws on the pulleys are tight, lubricating the axis rods).

Wednesday, October 26, 2016

Tuning a Laser

There are some distinct similarities between tuning a laser and tuning a 3D Printer.  I have been trying to get an optimal cut from the laser with three parameters to work with:
  1. Focus.  This is all important as the point where the laser beam is focused coming out of the lens is where precise cutting happens.  There are two ways to do this with both covered on the JTechPhotonics website.  The first is to adjust it under low power and the second is to cut some test lines.  I have been doing both as I have also been experimenting with different heights but I think the test lines approach delivers the best results.
  2. Temperature.  Obviously!  Different temperatures for different materials and for different tasks (cutting versus embossing)
  3. Speed.  The longer the laser dwells the more it will cut.   Also the more it will scar the surrounding material though.
It is all a balance!  Just like with 3D Printing where temperature and speed play such a key role.

Here is an example of some test cuts at different heights.  I am using some paper at very low power settings then final tuning on wood.

Here is an example of the level of detail that I would ideally like to be able to cut.  The squares on the cutting matt are 10mm!   I am not even sure this is possible with the larger size of my 3.8w laser.

Saturday, October 22, 2016

Laser Focusing and First Cut

Super high attention to focus is a mandatory requirement for a laser cutter.  It says so on the JTechPhotonics website and they do not lie!  The documentation for the laser suggests a low power method of focusing.   Namely using an onboard potentiometer to lower the output of the laser so you can adjust the focus by hand.  I think you need to do this to get a rough focus but I would not worry about the detail much and jump to focusing by BURNING (which they also document here).

So here are the results of my focusing efforts and my first cut of something other than paper...in this case 1mm MDF board.   You can see the pages that I used to focus the laser starting with movements of 1mm, then 0.5mm, and finally 0.25mm.

Once I had it narrowed in on paper I put a sheet of 1mm MDF under the laser and did another calibration test to confirm the focus...and then I did that first successful cut.   Note the words "first successful cut"...as there were a number of FAILS prior to me getting serious about getting the focus correct.

Next step is to understand how many passes are needed to cut various depths of various materials.  I am hoping there is something to this effect on the web to help but if need be I will do my own.

Laser Mounted, Connected, and Ready to Fire

Since I am mounting the laser on my 3D Printer the first thing that I would need is a mount.  I had already envisioned what I wanted from a mount so had it designed before I even got the laser (it was very helpful that JTechPhotonics had a model of the laser available for download).  So here is what I did available on Thingiverse.

My goal with this design was to have the laser be easily attached and detached from the printer, while being secure and stable, and allowing for a maximum of the build platform to be available. The mount slides under three of the four screws on the top of the extruder assembly for ease of attaching and detaching. I added connectors a foot or so above the mount so that the main part of the cabling for the laser and fan can stay attached to the printer between uses. I can change between printer and laser cutter in about a minute.

Here is the laser and fan mounted on the mount that I described above.  This version is printed in PLA.

Here is another copy of the mount printed using ColorFabb NGEN which has a higher melting point than does PLA.  Have it ready in case the PLA distorts.

This is a shot of the wiring for the laser.  I have connectors for the laser and fan so that I can remove the assembly easily.  The run back to the laser driver stays in place.

Here is the JTechPhonics High Power Laser Driver.  It is a nice piece of kit though my installation is not doing it any favors as I still have some wiring cleanup to do.

I am using the PWM controlled fan from my Ultimaker to drive the laser.  This posed a little bit of a challenge because there are two fans driven in parallel and if one is out of the circuit then you have no fans.  The driver effectively takes a fan out of the circuit so I needed to put a DPDT switch in place to swap between printer and laser.    The over challenge was that the Ultimaker 2 drives fans at 24V and the driver wants 5v.  A little voltage divider and that problem was solved and the voltage the driver sees is now about 6v maximum.

One last problem that will likely cause me to move to the LED PWM...when the fan is activated there is a spike of voltage!  Not sure why but it is enough to be noticeable when the laser fires and in the start of the burn.

In the next post I am going to talk about calibration and my first cut.

Friday, October 14, 2016

3D Printer to Laser Cutter

For no particularly good reason I have decided that I need a laser cutter.  I already have the basics that are needed in that I have a 3D Printer for the mechanicals so what I really need to add is the laser and some additional logic.

The laser kit that I have purchased is the JTechPhotonics - 2.8W Laser engraving & cutting Kit.  This comes with both a laser and the power supply with some control electronics.

My goal in driving this laser is to be able to use as much of my current workflow as possible (e.g. Sketchup and Simplify3D), without making any firmware changes on the printer, and with a minimum of hardware intrusion.

The first thing that this means is that I need a way of telling when the laser should be firing and then I need to be able to fire it from GCode.   Telling when the laser should be on and off is relatively easy assuming that I write a preprocessor that can scan and regurgitate GCode.

Driving the laser from GCode is a little harder.  This is where the power supply and control electronics come in from JTechPhotonics.  It can take as input either the LCD or the FAN PWM signal from the printer,  both of which are controllable via GCode, and use that signal for turning the laser on and off.

Sunday, October 9, 2016

Raspberry Pi Zero PoV Wireless Camera

This is one more project in the long list of projects that may not actually meet a need but was fun to build.
The "requirement" that this solution meets is to provide a wireless Point of View camera that can be used to photograph dioramas, model railroad layouts, or for Line of Sight previews when playing a tabletop game such as Flames of War.
The solution is a 3D Printed case that encloses a Raspberry Pi Zero that is attached to a Pi Camera. The Pi Camera is in a mount that can slide up and down a track to match a PoV elevation. The Pi supports a wireless dongle that can either attach to a network or provide one of its own (Adhoc or Otherwise). Power is supplied by a portable mini charger.
There are examples of each possible usage above. The first photo is showing a PoV looking down an N-Scale Drawbridge, the second two are showing a picture being taken of a small diorama, and the third is a representation of what a Flames of War usage might entail.

Saturday, October 1, 2016

Some Considerations for Building the Bascule Drawbridge

This is a bit of a catch-all post in support of a project to build my N-Scale Bascule Style Drawbridge.  The various model files are here and the instructables are here.


The smallest bridge is four sections with each section being 19 full scale feet or 37mm at scale.  I can also do five or six sections just as easily.  Clearance side to side is 28mm and from the road bed to the stringers is 40mm (which, with track laid, is too short for some cars).  The operating part of the bridge is 140mm long, 55mm wide, and stands 120mm high.  Below the table there is another 90mm needed for the motor assembly.

Power for the Bridge

The electronics stack needs 5v and the stepper motor needs 12v (though you can get one of the right form factor that will work with 5v).  You can also drive signal lights from a relay as part of the configuration and for my demo these were 12v.  In my demo configuration I took a single 12v supply and used a little voltage regulator to provide the 5v supply.  Decision Needed:  Provide both 5v and 12v to the bridge or just provide 12v.  If you just provide 12v there are a variety of voltage regulators that you can use.  If you want to trigger signal lights then you will need relays that can be actuated by the Arduino.

Options for Mounting the Electronics

My demo, as described above had the PCB, a relay that drove the signal lights, and a little voltage regulator all attached to a tray that was designed to hold the pcb and allow the other components to be tied down.  There was also another printed part for a control panel.  My assumption was that the tray would be secured somewhere with wire run to the bridge, the control panel, and to power.  The other option is a new one and that rendered the tray as a drawer that slides into two printed guides that would be mounted behind a cutout on the side of the frame the layout sits on.  The control panel becomes the front of this drawer.   What approach works best for your layout?

Configuration One
Configuration Two - Front and Parts

Configuration Two - Back

Stepper Motor Specifications

DC 5 or 12V 2 Phase 4 Wire 35mm Stepper Motor .  The under structure mount is designed for this specific motor (35mm deep).  The electronics would handle a lot of different motors but the mount would need rework (though the 42mm motor may fit).

Parts Needed for the PCB

Other Parts Needed

Final Note

You may have noticed that my links take you to eBay UK.  I live there so that makes sense!  Simply take the verbiage from the search box and plug it into eBay US (or wherever you live).