Sunday, October 1, 2017

Note Taking in School (and Illustrating a Blog)

When I started this blog I did so because it was becoming too cumbersome for me to update my web site.  I don't like spending my time that way, and wanted to do something that would allow much faster updating and be more portable.  After a web search and comparing a few different options I decided on Blogspot.

So far I'm happy with it.  I can update the blog quickly, from anywhere I have computer access and it's much easier to do things in bite-size chunks that are more likely to get posted, as opposed to the huge effort it took to build my web site and maintain it.  I don't know how many hundreds of pages of stuff I produced that never got posted because of the difficulty in getting all the links working, etc.

One of the things I wanted was to be able to post pictures and diagrams of things because they are usually a lot faster than typing (two fingers- I'm from that generation before computers when girls learned to type and boys took shop class) and editing a lot of text.  I considered many ways to get diagrams into my posts including drawing on a whiteboard or paper and taking pictures of the drawings.

Then I remembered how I got through dental school.  I had two years of didactic classes which consisted primarily of PowerPoint presentations.  The instructors would make the presentation available and we'd all follow along and make notes on our computers.  Then I saw something really incredible.  It was called a Livescribe Smartpen that recorded whatever you wrote and put a copy on your computer.  Not only that, it recorded audio (binaural!) and linked the audio to the text.

The audio recording quality is good, but when you use the binaural mic, it's great!  Recording lectures can be tricky.  You could hear and understand everything being said, but for some reason recordings usually come out echoey and difficult to decipher.  The binaural mic records audio exactly as you hear it because the microphone capsules are almost in your ears.  If you could understand what the lecturer said during the lecture, you'll be able to hear it exactly the same way when you record it with the binaural mic.

Whenever the instructor said "this is going to be on the test", I'd write the word "test" in my notebook.  When it was time to study, I played back the audio recording of the lecture and tapped the pen on the word "test" the audio would jump right to what was said when I wrote that word.  It made my studying extremely efficient and effective.  My notes primarily consisted of slide numbers -when they changed a slide, I mark the number down, creating a link in the audio recording- and occasional keywords like "test" "final", etc.  If I was going through the PowerPoint presentation and didn't understand something on a slide, I'd tap the pen on that slide number in my notebook and the audio would immediately jump to the lecture at that slide.  By minimizing my note taking that way I was able to pay more attention to the lectures than my note taking and I think I learned more of the presented material.  My pen had 1 GB of storage which was enough to store an entire month's worth of audio lecture recordings and written notes. If you are in school, or have a kid or grandkid in school, I can't recommend the Livescribe pens highly enough.

My 1st generation Livescribe Smartpen's battery had long since died (it was only 10 years old).  After a futile attempt to get the thing apart so I could try to find a replacement battery, I gave up and bought a second generation of the pen, a 2GB Livescribe Echo.  The Livescribe smartpens use special paper that has a dot pattern that allows the pen to know exactly where it is on the page.  Don't worry, the notebooks are cheap, especially considering the utility that the system provides.  There are plenty of other paper options, too.

If you've read any of my blog posts, chances are you've run into some of my handwritten notes and drawings that look like scans from a lined notebook.  Those were made using the Echo Smartpen.  I draw/write the note, connect the pen to my computer and transfer the notes, then export the note page as a png file.  I open the png file and crop it then save as a jpg file and upload it to the blog.  The whole process takes only a minute or two.

 There's an interesting paper that describes the technology of the whole system here.

Here's a photo of a note I made using the Echo pen and notebook:

And here's what shows up on the computer when you connect the pen via USB cable:


I've misplaced the earphones/binaural mic that came with my original SmartPen or I'd link to an audio recording made with it.  

Anyway, for me it was great in school and now it's a very portable way to make notes and diagrams to put into this blog.  If you have a kid in school, I can't recommend this pen highly enough.

Saturday, September 30, 2017

This is What You Can Do With a 3D Printer, No. 2

UMMD was built to print decorative objects like large vases and lamps.  A couple failed test prints, including this one at the Milwaukee Maker Faire:

Looks great, doesn't it?

It's too bad the back side wasn't so great.

taught me a lesson: you can't print a single-walled, ABS vase with 0.4 mm line width and 0.2 mm layers that is 500 mm tall.  Between the cooling plastic shrinking and the weight of the print distorting its shape, the nozzle will eventually miss the previous layer and the print will fail.

I switched to a larger nozzle, adjusted the slicing parameters a bit and produced this:

This one made it all the way to 500 mm with only a couple minor issues.

This was made using transparent ABS which looks like frosted glass when it prints, and transmits light very nicely.  I used a 0.6 mm nozzle on the extruder, printed in 0.3 mm layers, 0.6 mm line widths, and printed with 3 shells/perimeters, all at 60 mm/sec.  It's 500 mm tall, took about 39 hours to print and used 781 g of filament.

466 mm, on its way to 500 from Mark Rehorst on Vimeo.

I'm not sure why the slicer has the extruder going all over the place like that, so there may be more tweaking to do, but this one is definitely a success.

I still have to mount it on some sort of base, and add a light source, but here's what it looks like with an LED flashlight lighting it up from the inside:

Unlike a single walled vase, this thing can be handled with worrying about it breaking apart.

When the vase was removed from the print bed, the bottom layer had a couple small cracks, possibly because the 95C bed temperature was a little higher than it should have been for almost 40 hours.  I'll drop the bed temperature a little more for the next one.

There are a couple small layer separations on the back side which may have been because the temperature inside the printer was a bit too cool for ABS.  ABS is usually OK with 45-50C but during this print the temperature in the enclosure was only about 38C.  When I drop the bed temperature, it's going to be even cooler inside the enclosure, so I'll be adding a heater to make it a little warmer in there.

This could be printed with PLA and the layer separation issues would probably go away, but I have to make sure that the print is never subjected to heat, either from a light source or from being transported and left in a hot vehicle.

How I created the model

I started with a program called ChaosPro to generate a Julia set fractal.  After tweaking the parameters for a while I found a shape that I liked, then created an image series that varied one of the parameters of the fractal over a specified range of values.  That left me with 500 or so images.

Next, I opened ImageJ and used it to stack the images to make a solid object from them, then exported the STL file of that solid.

It's all explained in step by step detail here.

I liked the rough texture that resulted from the process, so I skipped the smoothing that the guy did using Blender.

I have tried to print this model using Slic3r's spiral vase mode but it seems to choke on the STL file (maybe the surface is too rough in some places and slic3r can't follow it) and does strange things that wreck the print.  I've been using Cura to slice it, and Cura applies some sort of minor smoothing that leaves most of the rough texture intact but fixes the problems that trip Slic3r.

Thursday, September 28, 2017

This Is What Can You Do With a 3D Printer, No. 1

Here's a project I did about 11 years ago, years before I built my first 3D printer.  It's a Van De Graaff generator (VDG) that produces about 400 kV (that's enough to thrown painful sparks about 300 mm in dry air!).

I never liked the look of the wood box on the bottom, and it was all a little heavy, so a few months ago I decided to update the design.

I redesigned the base and rollers to be 3D printable and found a small DC motor that could be mounted on the base without the big wood box.  The rollers use bearings pulled from hard disk drives.  I printed the parts using PLA.

Full details and CAD and STL files are available on Instructables.

I took it to the Milwaukee Maker Faire last week just to show what can be done with a 3D printer, and after it sat unnoticed for a few hours, decided to move it closer to foot traffic and plug it in.  If you ever want to attract kids to a booth at a product show or Maker Faire, just bring along a VDG!  As these people demonstrated a Van De Graaff generator can be a lot of fun!

I suspect this was Kylee's favorite thing at the Maker Faire.  She spent a lot of time with us!

The fun isn't just for kids-  Gordon had a blast!

3D Printed VDG Hurting My Fist from Mark Rehorst on Vimeo.

 In the photos below I used a 30" exposure time and high ISO, then boosted the brightness and contrast to get what you see.  The photos don't quite capture the blue glow that accompanies each big spark.  The big sparks usually look like a thin, bright line surrounded by a pale blue cloud.

Photographing the sparks is a little tricky.  I prefocused the camera with the lights on, then shut off the lights and opened the shutter for 30 seconds.  IRIC, the camera was set to ISO 3200 and f4.  While the shutter was open I walked over to the generator and moved my hand around near it and got the sparks to jump.  That faint purple glow you can see surrounding some of the bigger sparks in the picture is there with every spark.  It just doesn't show up very well in the photos.

Tuesday, September 19, 2017

Comparing Gates LL2MR09 and Chinese 2 mm Pitch Glass Core Belts

I recently saw a couple pictures someone posted of two identical prints, made on the same machine with the same gcode file, one using very inexpensive Chinese import glass core GT2 belt and the other using a more expensive Gates belt.  I was impressed by the reduced ringing in the print made using the Gates belt, so I decided to try this experiment for myself.  Unfortunately, I've lost track of the link to those pictures.

I located a source and ordered 50 feet (the minimum quantity that Gates distributors will sell) of the Gates LL2MR09 belt (about $2 per ft. shipped).

One of the things that has always bother me about the Chinese belt was that there are exposed glass fibers along its edges.  Well, the Gates belt has that, too.  Both belts are neoprene with fiberglass core, both 2 mm pitch, and both 9 mm wide.

Part NumberLL2MR09
Pitch2 mm
Top Belt Width per strand (mm)9
Tensile CordFiberglass
Core MaterialChloroprene
Fabric CoverNylon
RMA Oil and Heat ResistantYes
Min Order Qty50 ft
Max Cont Length (feet)300 ft
Product Number93960052

The Gates belt has nylon facing on the teeth which Gates says decreases wear and increases the life of the belt (and pulley?).  Gates also specifies an operating temperature range of -54 to +85 C, so it should be fine inside a heated enclosure for printing ABS.  I was unable to locate any operating temperature range spec for the Chinese belt.

The Chinese belt doesn't seem to have a nylon facing on the teeth, but I can see what appear to be the ends of threads embedded along the tooth surface under a microscope.

Gates belt specs

In the following photos the Gates belt is on the bottom and the generic Chinese belt in on the top.

The chinese belt, top, appears to have fibers embedded in the tooth surface, and the teeth look slightly larger than the Gates belt teeth.  Glass fibers (brown) are visible on the edges of both belts.

Notice there are 17 glass cords in the chinese belt, top, and 20 in the Gates belt, bottom.  Cord diameters appear to be about the same, spacing between the cords doesn't appear to be well controlled in either of them.
One minor difference is that the slicing of the Chinese belt doesn't seem to be particularly accurate.  If you watch the edges of the belt as it moves on the printer, they seem to move up and down as if the top and bottom edges aren't parallel everywhere.  The Gates belt doesn't do that.

I ran some print tests and there didn't appear to be any difference in print quality.  Maybe the parts I printed weren't good for showing the differences.  I'll be trying more prints and if I run into anything that reveals a big difference I'll post it here.  It was enough effort to swap the belts that I don't expect to be doing it again without a really compelling reason.

This video shows one of the test prints- I turned up junction deviation to 0.2 (from 0.05) to induce ringing, and made the straight runs long enough to allow a peak speed of 250 mm/sec.  I used the same gcode with the only difference between the prints being the belts in the XY stage.  To my critical and microscope assisted eye, the prints are essentially identical.  The ringing looks the same, the layer registration at the corners looks the same.  Meh.

UMMD printing ABS at 250 mm/s from Mark Rehorst on Vimeo.

In the short term, these belts seem to perform pretty much the same, but print quality isn't the only criteria by which to judge a belt.  If one belt outlasts the other and the drive pulleys used with one or the other last longer, one belt or the other might be better.

Friday, August 25, 2017

UMMD 3D Printer LED Lighting

Some people like to dress their printers up with 24 bit RGB variable color LED lighting that they can control from a phone.  Meh.  I just wanted plenty of light in UMMD so I could see what is happening and to make it easier to do maintenance and repairs, if they're ever needed, and to photograph prints.  To that end I installed two 8W cool white LED strips on either side of the lower front opening of the printer, and two smaller 3W strips on the underside of the top cover.  Together they provide plenty of light.

Plenty of white light!

I have taken Son of MegaMax to the Milwaukee Maker Faire for the last couple years and will be taking UMMD this year.  One of the more popular events at the Maker Faire is the Dark Room where we set up things that look impressive in the dark.  There are always lots of interesting displays done with projectors, LEDs, blacklights, etc.  Here's one that's very popular...

Knight in Armor vs Big Tesla Coil from Mark Rehorst on Vimeo.

This year I'm planning to have UMMD in the Dark Room for one day of the Faire, so I'm installing UV LEDs and will print something interesting with fluorescent filament.  I initially bought some UV LED strips via ebay that worked OK, but weren't as bright as I wanted.  So I did some more shopping.

SoM has a 400 nm UV light bar that does a pretty good job, but I always felt it produced too much visible, pale blue light along with the deeper purple that causes the fluorescence.  So I looked for shorter wavelength LEDs, hoping they would produce less of the pale blue light.  I bought a bunch of 1W 360 nm LEDs on 16 mm diameter aluminum circuit boards and wired some of them to test.  I found that 360 nm LEDs cost about 4-5X what 400 nm LEDs cost and both produce about the same pale blue light, and both cause the same fluorescence, so there's no point in buying the more expensive, shorter wavelength LEDs.  I also realized that it's a PITA to mount all those round PCBs and then wire them all together.

The UV light bar in SoM is mounted at the top, front of the printer's frame using printed snap-in brackets.

The UV light has a very nice effect when you use fluorescent filament.

1W LEDs usually use 350 mA.  UV LEDs typically drop 3.4-3.8V each at that current.  The easiest way to power LEDs is to connect them to the printer's 24V power supply.  24/3.4 = 7.06 and 24/3.8=6.3, so I needed to find a narrow circuit board that would allow me to connect 6 or 7 LEDs in series, and allow easy coupling to a heatsink.  I searched ebay and some of the Chinese sites and found some 300 x 10mm aluminum circuit boards designed to wire 6 LEDs in series.  I ordered a 5 pack for $6.

Next I looked for 1W UV LEDs without any circuit boards.  I found a pretty good deal on some 400 nm LEDs so I bought 30 of them for $15.

Finally, LEDs, like other semiconductors tend to drop less voltage as they heat up, which is another way to say that if you operate them from a constant voltage supply, they will take more current.  That leads to more heating, which leads to more current, and pretty soon you have a condition known as thermal runaway and your LEDs burn up.

The best way to avoid thermal runaway is to power LEDs with a constant current source.  You set the current to 350 mA for a string of 1W LEDs and they all get 350 mA and it doesn't matter if the LEDs heat up a little, the current source automatically adjusts its output voltage to maintain the set 350 mA.  They also maintain constant brightness when you use a constant current source.

This works great for a few LEDs, but if you're trying to run 30 UV LEDs at 350 mA, you need a current source that can deliver up to 30 x 3.8V = 114V.  That's a problem if you only have a 24V power supply.  You can probably find an expensive boost converter that will provide a constant current, high voltage output, but there are other ways.

Since UMMD has 24V available (I'd prefer not to run another 117 VAC supply), I can drive up to 6 LEDs in series (6 x 3.4V = 20.4V).  I have 5 circuit boards with 6 LEDs in series on each, so all I have to do is wire the circuit boards in parallel.  Since each board needs 350 mA, I could use a constant current supply that delivers 350 mA x 5 =1750 mA.  But what happens if an LED dies?  Now there are 4 boards sharing 1750 mA- they all get brighter for a while, then they probably burn up.  So constant current isn't the best way to power LEDs wired in series-parallel.

Powering LEDs from a constant voltage isn't ideal, but it is easy/cheap when you're using a low voltage power supply.  I found a 35W buck converter that will take the 24V input and convert it to a voltage/current limited output for $8.  This device can be operated as a constant current source by setting the voltage output to maximum and then adjusting the current limit pot for whatever current you want up to 3A.  Or, it can operate as a constant voltage source by turning the current limit all the way up and setting the output voltage you want up to about 22V.  Or you can operate it in between, and set both voltage and current limits.

I had my LEDs, and my power source, now I just had to mount them.  I used some 3/4" x 3/4" aluminum L stock.  It was rigid and could be mounted easily, and serves as a light guide that blocks the direct view of the LEDs when looking at the printer from the front.  I mounted the PCBs on the aluminum L using some printed ABS clips.  They snap on and hold the aluminum PCB in tight contact with the L stock, transferring heat away from the LEDs.

Aluminum LED PCB mounted on 3/4" x 3/4" aluminum L as a heatsink/mounting bracket/light guide, using printed ABS clips.  The clips hold the PCB tightly against the L to ensure efficient heat transfer.

One of the printed ABS PCB clips.  It snaps on tightly, ensuring heat transfer from the PCB to the L heatsink.

One of two 12 x 1W UV LED light bars that will be mounted vertically on the front of the printer.  The bright green objects are the brackets that snap into the t-slot frame of the printer.  The white LED bars will be mounted alongside the UV strips.

I found that the heatsink got pretty warm if I operated the LEDs at full power, so I dropped the voltage a bit and gave up just a little of the brightness in exchange for much cooler operation.  I set the buck converter for about 19.6V output and limited the current to 1.3A.  The voltage setting limits the current through the LEDs initially to just over 1A.  If the LEDs heat up because they are inside a warm printer enclosure, they'll try to suck more current from the buck converter, and when it reaches the set limit, the converter will operate in constant current mode and that will prevent thermal runaway.

Here's a short video of the printer putting down some fluorescent yellow filament with the lighting switched between the white and UV LEDs.

UMMD 3D Printer White and UV Lighting from Mark Rehorst on Vimeo.

Here's a still photo in which I tried to tweak the exposure to match what the eye sees when the UV lights are lighting up a fluorescent yellow print.  The photo just doesn't do it justice- in real life it's almost painful to look at the print because it glows so brightly.

Tuesday, August 15, 2017

Thermal Performance of UMMD's Print Bed

UMMD, my recently built coreXY 3D printer, has been at the Milwaukee MakerSpace for the last week while I put the finishing touches on it before it's public debut at the Milwaukee Maker Faire at the end of September.  One of the members, John Olson, brought his FLIR camera to the makerspace meeting tonight and we were able to make a couple images of the bed with it.

In case you haven't seen UMMD's bed design, you can read all about it here.  The bed is a piece of 300 x 300 x 8mm, MIC6 cast aluminum tooling plate with a 0.7 mm layer of PEI on top and a 750W line powered heater on the bottom.

In the images below, I set the bed temperature in the controller and left it for a few minutes to stabilize.  The controller uses PID temperature regulation and drives an SSR that switches power through the bed heater.

In the first image, the controller was set to 70C, typical for printing PLA.  You can see there is some offset between the controller reading and the FLIR temperature reading.  But more important than absolute temperature, you can see that there is only about 3C variation in temperature across the bed surface, with some droop at the corners and edges, as expected.  There appears to be a hot spot at the front edge of the bed- that's actually just a reflection of the hot-end.

In the next image, the controller was set to 105C, a temperature typical for printing ABS.  Again, the bed temperature is a few degrees lower than the controller thinks.  This time there's about 5C  variation in temperature across the bed surface, expected because the higher temperature will cause more convection that cools the edges and corners of the bed.  

It's hard to beat cast aluminum plate for even heat distribution.  Between the flatness,  even heating, and PEI print surface, I have very few problems with prints releasing from the bed before they are finished.

Saturday, August 5, 2017

Setting Up a CoreXY Printer's Origin and EndStops

In this explanation, I'm going to use SmoothieWare as an example for the config file entries, but there are similar entries for whatever firmware you are using.  Look them up!

I will refer to the motor that connects to the X or alpha output on the controller as the alpha motor, and the motor connecting to the Y or beta output as the beta motor.  The Z axis motor connects to the Z or gamma output.  I will largely ignore the Z axis because it's pretty straightforward- you're going to have an endstop at the Z=0 position at the top of the Z axis.

CoreXY motion can be a little confusing when trying to set up endstops and motor direction in firmware.  The printer's firmware needs to know:
  1. That a corexy mechanism is being used
  2. The locations of the printer's endstop switches and origin
  3. The length of each axis
  4. The direction to spin each motor

Step by step CoreXY firmware setup

  1. Build your printer, and mount the motors and limit switches.
  2. Choose origin location, either left-front or right-rear
  3. Set home_to direction for each axis, plug in the endstops
  4. Assign ordinate values for each axis
  5. Set motor rotation direction for both motors

Mounting Motors and Switches

You can mount the motors either pulley-up or pulley-down or one up and one down - it doesn't matter.  You can put limit switches at either end of either axis, but you have to make appropriate assignments in the firmware and plug the switches into the appropriate inputs on the controller board.  We'll get to that in a minute.

Example corexy layout , viewed from the top of the printer, that will be used to illustrate firmware configuration.  Motors are at the front of the machine, origin is at the left-front (L-F) corner, X axis endstop is at the right (bright green box), Y axis endstop is at the rear (red box).

First things first: you have to tell the controller that your printer uses a corexy mechanism.  You do that in SmoothieWare by using this line in the config file:

arm_solution corexy

Origin Location

The printer's origin (0,0,0) has to be located at the left-front (L-F) corner or the right-rear (R-R) corner in order to match the right-hand-rule coordinate space used in CAD and slicing software, otherwise your prints will come out mirrored.  Slicers commonly default to showing the origin at the left-front, and the jog controls in Pronterface assume a left-front origin, so you can save yourself some mental gymnastics by doing the same.  There is no explicit statement in the config file that tells the controller where the origin is.  Its location is implied by the homing directions and endstops used.

Setting "home_to" Direction for Each Axis

If the switch is at the origin end of its axis, you'll set that axis for home_to_min.  If it's at the far end, set that axis for home_to_max.  

X axis
Y axis
endstop location
alpha home-to
endstop location
beta home-to

Let's say that the origin is at the L-F and the switches are located at the right and rear.  In SmoothieWare, you'll have entries like this:

corexy_homing true
alpha_homing_direction home_to_max
beta_homing_direction home_to_max
gamma_homing_direction home_to_min
The alpha and beta endstop switches are both located at the maximum ends of the X and Y axes, so you have to plug the endstop switches into the Xmax and Ymax endstop inputs on the controller board.  The Z endstop should plug into the Zmin endstop input.

Set Ordinate Values for Each Axis

Measure the length of the X axis by manually moving the extruder carriage from the far left to the far right.  Do the same for the Y axis by measuring the distance the extruder nozzle moves from the front to the back of the machine.  And, of course, measure the usable Z range of motion.

Let's say the X axis range of motion is 380 mm, the Y axis is 340 mm, and the Z axis is 400 mm.  In SmoothieWare you'll have entries like this:

alpha_min 0
alpha_max 380
beta_min 0
beta_max 340
gamma_min 0
gamma_max 400

Setting Direction of Rotation

Setting direction of rotation is done either by reversing the connectors at the motors or controller board (only with power off or you may destroy the motor driver chip!), or by inverting the direction logic via the firmware.  

Here is how the mechanism works, ignoring any of the electrical stuff (rotation of the drive pulleys, viewed from above, motors at the front of the mechanism):

Left Motor
Right Motor
Extruder Motion

Remember, when homing the mechanism, the location of the switches are important, not the location of the origin.  Homing should always send the extruder carriage toward the switches.  Using the table above, just the top four entries, notice that if the switches are at the
  • left and front, the alpha motor must turn CW.  
  • left and rear, the beta motor must turn CW.
  • right and front, the beta motor turns CCW
  • right and rear, the alpha motor turns CCW
In Smoothieware, the motor rotation direction is set by these lines in the config file:

alpha_dir_pin 0.5 
beta_dir_pin 0.11
gamma_dir_pin 0.20
We can use the table to easily set the motor rotation directions.  For example, if the switches are located at the right and rear, manually push the extruder carriage to the center of the build area, tell the controller to home all axes, and watch the rotation of the alpha motor.  It should turn CCW.  If it doesn't, reverse its direction either by shutting off power and reversing the cable connection to the motor, or by appending a "!" in the config file, like this:

alpha_dir_pin 0.5!

Once the alpha motor is turning the right way, push the extruder carriage to the center of the XY space, send another home-all-axes command, and watch the mechanism.  If it moves toward both switches, both motors are turning in the right directions.  If not, reverse the beta motor direction like this:
beta_dir_pin 0.11!

Endstop wiring

If you are using simple, reliable, snap-action switches for the endstops, they can be wired either normally open (NO) or normally closed (NC).  For safety, it is best to wire them NC.  That way, if a wire breaks or becomes disconnected the controller will interpret that as a switch closure and it will quickly become apparent that something is wrong.

The smoothieboard config file defaults to NC.  If you wire any of the switch(es) NO, you have to invert their inputs in the config file.  Refer to the SmoothieWare endstop configuration documentation here.

If you don't have a smoothieboard, look up the endstop wiring in your controller's documentation.

Wednesday, August 2, 2017

UMMD 3D Printer Electronics

Major components of the electronics in UMMD are:

In a 3D printer, the extruder requires the most operator input for maintenance and repairs.  The electronics comes in a close second.  Most people building coreXY printers put the electronics in the bottom of the printer, utilizing some of the "dead space" under the bed.  That can be convenient if the printer sits on a table, but UMMD is tall and stands on the floor, just like me.  Putting electronics in the bottom would mean getting down on the floor every time I had to access the electronics.  I also intended to use an LCD control panel to print from SD cards, and LCD panels generally don't work with long cable runs, so the LCD panel has to be kept close to the electronics.

I wanted to keep the electronics easily accessible, and outside of the heated enclosure, and I hate bending over, so I planned to put the electronics on top of the printer from the start.  Most of the electrical connections to the printer have to be made on the XY stage, so keeping the electronics close by keeps cable runs shorter.  The electronics are mounted on the left side of the top of the printer, under a plastic basket used as a protective cover (it's ugly- I'm working on it!).

There are two buck converters in the system.  One provides a source of 12V to power some fans and some of the white LEDs used to light up the printer.  The other is used strictly for powering the UV LEDs.  It would have been less complicated if I didn't have the 12V parts in the system, but it is easier to find 12V LED light bars, and I already had a couple 12V fans, so I used a buck converter.

The other buck converter is used to power the UV LEDs, something not absolutely necessary but aesthetically pleasing when printing fluorescent filament.

You can see more details about the LED lighting in UMMD here.

UMMD has three electrical fuses, one for the main power supply (which probably has its own internal fuse), one for the bed heater circuit, and a spare that is going to be used for an enclosure heater circuit, not yet installed.  Electrical fuses protect against fires caused by wiring or electronic failures.

The bed heater is powered via an SSR that is driven by the controller board.  When SSRs fail, they fail shorted - i.e. on.  The controller normally keeps the bed temperature regulated, but if the controller fails, or the SSR fails, the bed heater could get dangerously hot, and possibly cause a fire.  I added a thermal cutoff (TCO) to the bed plate to protect against that possibility.  It would actually be better to have the TCO mounted on the heater because the heater is attached to the bed plate with adhesive which could let go.  I will probably move the TCO to the heater itself by cementing it with high temperature silicone.  That way if the heater comes off the bed plate, the TCO can still do its job.  Details of the bed and support here.

TCO clamped to the rear edge of the bed plate.

I used a TCO with a operating temperature of 184°C.  That allows the bed to operate normally up to about 160°C (for printing high temperature materials) without opening the TCO.

The rest of the wiring to motors, etc., is standard stuff you can see in the Smoothieboard documentation.

Tuesday, August 1, 2017

Setting Up a 3D Printer's Origins in Firmware and Slicers

If you build your own 3D printer design, one of the confusing things about configuring its firmware is the limit switches on each axis, homing the printer, and setting up the printer description in slicing software.

One of the first things you need to do when you finish building your printer is measure it limits of motion.  Move each axis as far as it can go and physically measure how far it went.  Write down the numbers.

Three main considerations for homing and slicing:
  1. The printer's origin and limits
  2. The bed's dimensions
  3. The bed's origin

The Printer's Origin:

First principle: the home position - i.e. the place the extruder ends up when you (or the gcode) issues a home-all-axes command - is not necessarily the printer's origin.  If you read through the material below this will make sense.

Simplifying assumptions:

  • CAD software and slicing software use right-hand-rule coordinate space.  Your printer should, too, or your prints will come out mirrored. For FDM printers, that means that the printer's origin, the (0,0,0) point, must be located at the left-front or right-rear corner of the printer with the extruder nozzle at bed level.
  • The Z axis limit switch is almost always placed at the Z=0 position at the bottom of the Z axis if the extruder moves up, like in a Prusa i3, or at the top of the Z axis if the bed moves down.  For the discussion below I'll assume that the Z axis switch is located at Z=0 and we'll simply ignore the Z axis.
Right hand rule says origin must be at left-front or right-rear corner of printer.  Note- they are equivalent- one is just a rotation of the other.
Slicer's and host software have default views of the print bed that they present to the user.  Slic3r, Cura, and Pronterface all default to show the printer's origin at the left-front corner of the bed.  If you set your printer up that way, the view presented in the slicer and host will match what you see when you look at your printer.  If the printer's origin is at the right-rear of the printer, the slicer view will show the view of the bed from the back of the printer.

Setting up the printer's origin involves multiple settings in the controller's firmware.  You can control the motor rotation direction for each axis, whether the motor is to move toward maximum or minimum when executing a home instruction, and finally, the ordinate value to set for each axis after a home instruction has been executed.

3D printers typically have one limit switch on each of the 3 axes, though you can have two on each, one for minimum and one for maximum.  The Z axis limit switch is almost always set at Z=0, so we'll ignore it for now.  Everything that applies to the X and Y axes also applies to the Z axis.  For simplicity, we'll assume there's one limit switch for each axis.

Basic rules and sequence for establishing printer origin in the controller's firmware:
  1. Mount your limit switches at whichever end of each axis is most convenient
  2. Set the motor rotation direction to drive the mechanism toward the limit switches when a home command is executed.
  3. Set home to min or max depending on where you put the switches and where you want the printer's origin to be (see the table)
  4. Assign the ordinate values for X and Y after a homing instruction depending on where you want the printer's origin to be.
  5. Make sure you plug the limit switches into the appropriate inputs on the controller board. 

When the printer is ordered to home the extruder via the gcode or via a command from a host computer, the motors should drive the mechanism toward the limit switches in each axis.  If the mechanism moves away from the switches in any axis, you have to reverse that motor's direction of rotation either by changing a firmware definition or by powering down the printer and physically reversing the connector on the motor or the controller board.

Once the motors are all turning in the right directions, you can assign ordinate values.  Assuming the most common configuration in which there is one limit switch per axis, you may put the switches at either end of each axis, depending on where it is most convenient.  You might want to keep cables short, or have other specific reasons for placing switches at one end or the other.  It doesn't matter.  The Z axis limit switch is normally put at the Z=0 position and we'll assume that for the examples, below.

Here are a few examples of different set-ups to illustrate how to configure the firmware.  In all examples, we'll assume that the printer's limits of motion are 310 mm x 248 mm x 215 mm measured by jogging or manually pushing the extruder carriage, Y, and Z axis as far as they will go and measuring the distances traveled.

Consult your firmware documentation for the exact syntax required to set motor rotation direction, home to min/max, and ordinate values.

Example:  bed moves in Y, origin is at left-front of printer

If you put a limit switch at the left end of the X axis, you must plug the limit switch into the Xmin limit switch input, set the motor to move the extruder carriage toward the switch, and specify that the X axis homes to minimum in the firmware configuration, and assign an ordinate value of 0 to X after homing.

If you put a limit switch at the right end of the X axis, you must plug the switch into the Xmax limit switch input, tell the firmware to rotate the motor in the right direction- i.e. the extruder carriage should move toward the switch, and tell it to "home to max" in X, then once it has done so, assign an ordinate value of 310 mm to X.

If you put the Y axis limit switch at the back of the printer, you plug the limit switch into the Ymin input, tell the firmware to spin the motor to move the bed toward the switch, and set the Y axis as "home to min" in the configuration file, (because the switch will be activated when the extruder is near the front edge of the bed), and set Y=0 when the bed bumps the limit switch.

Example 2: bed moves in Z (extruder moves in X and Y), origin is at left-front of printer

Using the same limits of motion for the printer, and the left-front of the printer as the origin, placing the switches at the left end of the X axis and at the back of the machine for Y, will require setting firmware to "home to min" in X and "home to max" in Y, then assign ordinate values of 0 for X and 248 for Y.  The limit switches will plug into the Xmin and Ymax inputs on the controller board.

Example 3: bed moves in Z, origin is at right-rear of printer

Placing the X axis limit switch on the left side of the X axis and the Y limit switch at the front of the printer will require that both axes "home to max" and you'll assign ordinate values of 310 to X and 248 to Y.  You will plug the switches into the Xmax and Y max inputs on the controller board.

This table summarizes all the possibilities for FDM printers (using the 310 x 248 mm limits from the examples, above):

Homing Switch

Motion Printer’s Switch Location Home Ordinate Limit Switch
Axis Origin Axis on Axis to: Value Input

Y Left-Front X Left min 0 Xmin
Y Left-Front X Right max 310 Xmax
Y Left-Front Y Front max 248 Ymax
Y Left-Front Y Rear min 0 Ymin

Y Right-Rear X Left max 310 Xmax
Y Right-Rear X Right min 0 Xmin
Y Right-Rear Y Front min 0 Ymin
Y Right-Rear Y Rear max 248 Ymax

Z Left-Front X Left min 0 Xmin
Z Left-Front X Right max 310 Xmax
Z Left-Front Y Front min 0 Ymin
Z Left-Front Y Rear max 248 Ymax

Z Right-Rear X Left max 310 Xmax
Z Right-Rear X Right min 0 Xmin
Z Right-Rear Y Front max 248 Ymax
Z Right-Rear Y Rear min 0 Ymin

Slicer setup - the print bed's dimensions

Your printer's bed is all that matters to the slicer.  It doesn't know or care about the limits of the printer's motion, except as they may limit the printable area of the bed.  The slicer needs to know two things: the printable size of the bed and the bed's offset from the printer's origin.

When you enter the print bed size in the slicer, you want to enter the printable dimensions which are not necessarily the same as the physical dimensions of the bed.  If the nozzle can't go there, it can't print there, so you don't want to tell the slicer it can.  By entering the printable dimensions and the offset from the printer's origin, the slicer will be able to set prints at the center of the printable area.

In the examples below, we'll use the X and Y travel limits above (310 x 248 mm) with a bed plate that is 200 x 200 mm and is shown with the printer in the home position.

Just 4 of infinite possible variations, example A being the most common.
Example A is the most common situation where the entire bed surface is within the printer's limits of motion.  In this example, you would tell the slicer that the bed size is 200 x 200 mm.

Example B would only be printable over 180 x 175 mm, so those are the dimensions you set in the slicer.

Example C is printable over 165 x 170 mm, so those are the dimensions you set in the slicer.

Example D is printable over 200 x 180 mm, so those are the dimensions you set in the slicer.

If the bed is larger than the printer's limits of motion, you simply tell the slicer the bed dimensions are the same as the printer's limits.

Slicer setup - the print bed's origin

Slicers default to dropping the your print at the center of the print bed.  This is a good thing for several reasons.  Even if you have an unflat, unlevel, unevenly heated bed, the center is where prints are most likely to stick.  If you're printing multiple parts that are going to use a large portion of the printer's bed, having them centered makes it less likely that any of them are going to end up outside the printable area.

The slicer uses XY coordinates on the bed, and the bed's origin is normally the closest point on the bed to the printer's origin.  The bed occupies the first quadrant of the coordinate space, so the printer's origin is in the 3rd quadrant of the bed's coordinate space and the offsets are 0 or negative.  So when you enter the offset in the slicer, the values entered are normally zero or negative.

The slicer's view of the bed's origin.  The origin is left-front, but it could just as well be right-rear.

In example A, above, the printer's origin is at bed coordinates (-50, -30), so that's the offset you enter in the slicer.

Example B shows a situation with no offset, so you enter (0,0).

Example C shows an offset of (-145,-78).

Example D shows an offset in only the X axis, so the offset is (-50,0).

If you are trying to use the center of the bed for the origin, just use the appropriate offsets, and be sure to tell the slicer that the origin is at the center of the bed.  Of course, you want to specify the center of the printable area, which may not be the same as the dimensions of the bed plate.

What about Cura?

Cura is a little different.  It assumes that the home position puts the nozzle on the bed.  If that isn't true in your printer you have to play some tricks with custom gcode when you set up the printer in Cura.

When you set up the custom printer description in Cura, you tell it the size of the printable area of the bed.  In my printer, UMMD, I tell Cura that the bed is 298 x 300 x 695 mm.  The machine homes to max in both X and Y, landing at extruder nozzle at coordinates (300,330,0) as set by the controller's firmware.  The printer's origin is at (2, -27, 0).  I get Cura to place prints on the center of the bed by using custom gcode.  After homing the printer, which takes it to (300, 330, 0), I drop the bed 15 mm, then use a G92 command to set the coordinates at (300,330,15), then send the extruder to (2,27,15), then use the G92 command to reset the printer's coordinate system to (0,0,15) at that point.  Now the print will be placed in the same position that Cura set it when it was sliced.  The first G92 command ensures that the printer coordinates are correct if I run a second print after the first without resetting the controller.

Here's the start gcode for UMMD:
G28    ;Home
G0 Z15 F1200   ; drop bed 15 mm
G92 X300 Y330 Z15  ; set printer's coordinates to (300, 330, 15)
G0 X2 Y27 F12000; go to left-front corner of bed
G92 X0 Y0 Z15 ; set printer's coordinates to (0,0,15)
G92 E0   ; set extruder to 0


  • The home position is not necessarily the printer's origin.
  • Limit switches can be placed at either end of the X and Y axes.
  • The firmware needs to turn the motors to move the mechanism toward the limit switch in each axis.
  • The firmware needs to know where the origin of the printer is (left-front or right-rear corner).
  • The firmware needs to know the machine's limits of motion in each axis.
  • The slicer needs to know the printable dimensions of the bed, which are not necessarily the physical dimensions of the bed plate.
  • The slicer needs to know the offset of the printer's origin from the bed plate's origin.
  • With proper setup, the slicer will arrange prints around the center of the printable area of the bed plate.