Sunday, 4 November 2018

Bed levelling, attempt #1

The one remaining annoyance on my printer is that it's not level. Over time, one Z axis goes a bit higher, which eventually makes enough of a difference that the print head will go too high and print into thin air - better than crashing into the bed, but still not good. Until now, I have started each printing session with manually measuring what the Z offset should be, occasionally adjusting one Z axis enough that the two sides are at the same height (the bed itself bulges by about 0.1mm). But I have printed a holder for a proximity sensor, and it's time to mount it!

I have an LJ12a3-4-Z/BX sensor, which will sense up to 4mm away. Trying it out with a voltage regulator (7805CT) gives me a nice constant voltage - of 2.5V. Wut? I see a number of people have problems with some probes, but also that not all probes are created equal. I also see that there is such a thing as an 8mm-sensing probe, and a probe that runs on 5V (LJ18A3-8-Z/BX 5V), but the latter might just be an underpowered 6-36V-capable sensor.

I was getting quite confused about this, until I read this article of somebody else being confused. They go into a goodly amount of detail of how they figured out the resistance setup and what they did to deal with a floating pin. This comment on another similar thread also makes sense: The output is either 0V (when something is close) or floating (otherwise).

Mine does have a nice little diagram on it, showing that Brown is +, Black is out, and Blue is Ground, with the sensor switch being between Brown and Black. It's also an NPN. The resistance between black and blue in mine was not a standard 10K, but a constantly changing amount in the mOhm range. There's no connection between the other wires. Also noteworthy is that my sensor has an orange tip, where most of the ones talked about have a blue one.

Feeding in 16V (because that's how much the 12V power supply I grabbed actually gives, unless my multimeter is borken), I see 13.6V on the sensor output when the sensor is open. If I add a 10K resistor between output and ground, it drops to 8V, with 20K it drops to 5.5V, so a 22K resistor ought to do it. Unfortunately, the sensor doesn't sense anything anymore, the LED doesn't light up, and the voltage doesn't drop. Only if I wire it wrongly does the LED light up, and then permanently.

Wait... now the voltage supply is giving nearly 18V. And the multimeter is showing a little battery sign. Maybe the battery... let's try the battery tester... shows nothing at all. Surely a battery can't be that dead, no, then the multimeter would have done nothing. Testing with some other batteries, yes, the battery tester is also dead. Why is everything broken?!? Oh, I can scavenge one from the smoke alarm in the kitchen (we recently got fancy smoke alarms in all rooms for free anyway) - nope, that one is also dead.

Total body count from today's exercise:

1 proximity sensor
2 9V batteries
1 cheap battery tester
Any progress today on getting the proximity sensor installed
1 12V power supply possibly injured
1 multimeter temporarily out

I suppose if I get an 8mm one as a replacement, I could put the copper tape I got from Ric under the glass. I'm doubtful that a 4mm sensor would do well enough there. Then I could even have a full grid level. OTOH, that would not measure the actual glass surface. I should also an NC probe though, for failsafe.

I'm not going to replace the mechanical endstop with the probe, for one thing they're at opposite ends, for another I don't really trust the probe as much.

All in all, I give today's results a big

Sunday, 21 January 2018

Valuable prints

OctoPrint is still being weird. It thinks the print time left is either 2 hours or 6 hours, depending on when I look at it, out of a total print time of... an hour. I guess when they say "approximate", they really mean it.

For a friend in the US, I printed a holder for a set of Euro coins. It came out pretty well. I didn't include any fudge factor for the holes, but with my perimeter adjustment set to 65%, it was so close that applying a rubber mallet was enough to get the coins in.

Perfectly fitting holes

I painted the legends with a silver Sharpie, the only pen I found that would stick properly. I like how the €2 coin seems to glow from within.
I'm also printing more fan mounts for my project of adding some air movement around our radiators. I've lasercut enough boards for it that I can start running tests soon. I wish I had some more temperature loggers, but I haven't been able to find any below about €50. Since I want to have several of them around for various purposes, I don't want them that expensive. It's not like the hardware is costly.

I've upgraded to Slic3r PE, which is under a lot more development than regular Slic3r. Also, it includes an interesting feature: You can adjust the layer height before slicing. Not only does this allow for slightly faster printing on simple verticals, it can also make slight inclines look nicer.

Sunday, 14 January 2018

Lots of calibration prints

Ran across a couple of calibration pieces by +Jeff Parish  which include instructions on what to adjust if they don't come out right. Since I haven't had things fit just right together, I thought I'd give them a shot.

First the simple U-pieces. Initial print was with 2.85mm diameter (white PLA from DasFilament) at 220ยบ. Fit together slightly loosely, increasing the nominal diameter to 2.90, then 2.95, then 3.0, before realizing that I should decrease the diameter. At 2.5, they could only barely be squeezed together, at 2.7 they fit only with a slight looseness.

A curious blip on the temperature graph:

Notice during the first of these two prints, at about -22 minutes, the temperature drops by about 10 degrees, stays there for maybe a minute, then goes back up. This didn't happen on the next print of the same piece. Weird.

Since holes are one of the hardest things to get right, I decided to make my own piece, with blackjack and hookers pegs and holes. To be able to test them against something independent, I made one hole+peg combination be 3.5mm, so a standard headphone jack should match, and the other 1/4" hexagon to match a screw bit.

I printed this piece with a 2.6mm nominal filament diameter, only to find that they fit even tighter than the original piece at 2.5mm. Unsurprisingly, none of the holes or pegs matched anything. Trying again at 2.7mm, they still don't fit, despite the pegless ones fitting at this calibration. At 2.85, they fit very tightly together, roughly as easily as the 2.5mm one with the original piece. That is a huge difference in material - overextrusion is clearly visible on the top of the 2.5mm pieces, and the corners are sloppy. Why they fit well I cannot tell.

 Now to try to get the pegs to work. I have a few knobs to tweak for this. I can change the number of perimeter layers - I currently have 2. I can change the extrusion speed of perimeters, small perimeters, and external perimeters, which are currently set to 60 mm/s, 15 mm/s, and 50% (i.e. 30 mm/s) respectively, the defaults. I can also set the perimeter width manually (in mm or %). That last one is promising.

To start out drastic, I set the perimeter width to 75% - and it was almost perfect! The hex bit fits tightly in the hex hole, the hex peg goes into the hex screwdriver easily, the headphone jack almost goes into the 3.5mm hole, and the headphone peg almost fits its hole. The notch fit is still rather tight, but fitting. At 65%, there is no appreciable difference.

In other news, I printed an art piece as a gift for a friend (that I won't show here lest they see it). The full piece at 0.2mm layer height took about 7 hours to print. When doing a test with 0.1mm layer height, printing roughly 1/10th of it was estimated to take 16 days. Wut? OctoPrint can't agree with itself how long it takes. It was actually only 3 hours.

Also heard about Slic3r PE, the variable layer height is a nice idea, and it's good to have somebody actively working on Slic3r. I have an idea for better support structures that I'll get back to in another post. I tested it out with the same peg piece, seeing little difference, then tried the CtrlV complex test print. Better than ever, except for the overhangs.

Nice roundings and a pyramid free of clutter, unlike the blue version
The text never came out this nice on previous prints
The overhangs are a bit sloppier than with the red filament test, but that might be a filament difference.

Thursday, 4 January 2018

Various prints, and thoughts on Z offsets

As I've been printing this and that, my Z offset has gradually increased to over 2mm. I have two remaining hypotheses for what causes this: Either the nuts holding up the X axis move slightly over time, or the two Z axis rods get slightly out of sync. The first hypothesis seems like it should change Z the other way, but when I did a check of Z offset on the left and right side, there was a huge difference. Adjusting the right side down to match the left side brought my Z offset back down to 1mm.

I still have a distance probe to add, but even after that I should keep an eye on the unevenness, since print quality undoubtedly will be better if the Z axis doesn't have to move when printing a layer.

Other things I've printed recently:

A properly rescaled AAA battery organizer (on the left without the fan duct active since the plug had fallen out):

Notice how the corners one the left one look melted. Fan support saves corners!

A McBenchy for my new red filament. Slightly weak on the brow, but overall good quality:

One-and-a-half McBenchy for my blue filament, done without fan by accident. Total brow failure:

Painter's stands for holding painting projects up:

A funnel sized to make it easy to fill our peanut container:

Thursday, 28 December 2017

Basic LED strip control with ATtiny

Since my printer is currently in a good shape and simply printing useful things (and some less useful), I've thrown myself at another project I've had hanging around: Getting some LED strips up for lighting in the kitchen and living room. I have some bog-standard 5050 strips, unfortunately the colors that can be set with the standard controllers are god-awful. People, there are millions of colors available on these strips, how did you manage to pick all the worst ones?

Anyway, Arduino to the rescue. I set up a little breadboard to check that it works, using some IRLB8721 transistors to control power (following the nice Adafruit tutorial). In my limited knowledge, I initially tried using trimpots to control the light, which of course had limited success. Once I set up control via the Arduino using its PWM outputs, lights were fading happily in and out. Except for the red channel, which behaved a bit weirdly. But never mind that, I moved on to my real target: Using an ATtiny85 for controller.

I have this cute little USB-stick programmer for the ATtiny from Sparkfun, and a cheap CPU sounds like the right thing for controlling a bunch of LEDs in various places. So I hooked it up, and found the lights were being somewhat odd. After swapping out the transistor for the red channel, it behaved nicely, but blue was just going on/off. I tried swapping out all the parts to no avail, blue was simple bi-level. What was up?

Back to the ATtiny descriptions, and I see that only ports 0 and 1 are PWM. Oh noes! What's a poor programmer to do? Program, of course! Turns out there is while the usual delay() function uses millisecond delays, there is a delayMicroseconds function that has finer resolution, at the cost of not doing an actual sleep. When in doubt, add more power! I spent about half an hour figuring out how to get this to work, seeing some rather strange behaviours until I realized that both digitalWrite and delayMicroseconds each take several microseconds to execute. Annoying, but surmountable.

It should be noted here that one of the swap-outs I had tried earlier was moving blue output from pin 2 to pin 3. As I was investigating how long they actually took and reading some related pages, I ran across one forum where they said the ATtiny has 3 PWM outputs. Wut? That's not what SparkFun told me! Turns out there are two PWM timers, they can't fully interconnect, so there are three PWM outputs: Pins 0, 1, and - you guessed it - 4. If I had only happened to use pin 4 instead of pin 3 when swapping out, this would have worked yesterday.

So now my little ATtiny85 is lazily fading colors in and out, next step is to make a proper PCB instead of a breadboard and also use my camera to figure out what the right values for good daylight/warm white lights are.

Morale: WTF SparkFun? Also: When testing things, keep the tests as simple as possible - my initial test program faded the different RGB channels in over each other, making it harder to understand what went wrong. Here is my final program, modified from the Adafruit tutorial code:

// color swirl! connect an RGB LED to the PWM pins as indicated
// in the #defines
// public domain, enjoy!

#define REDPIN 0
#define GREENPIN 1
#define BLUEPIN 4  // Poorly documented third PWM pin

#define FADESPEED 1  // make this higher to slow down

int blue;

void setup() {
  pinMode(REDPIN, OUTPUT);

void setrgb(int r, int g, int b) {
    analogWrite(REDPIN, r);
    analogWrite(GREENPIN, g);
    analogWrite(BLUEPIN, b);

void blink(int times) {
  for (int i = 0; i < times; i++) {
    setrgb(50, 50, 50);

void loop() {
  // Fade red in and out
  for (int r = 0; r < 256; r++) {
  for (int r = 255; r > 0; r--) { 
  // Fade green in and out
  for (int g = 0; g < 256; g++) { 
  for (int g = 255; g > 0; g--) { 
  // Fade blue in and out
  for (int b = 0; b < 256; b++) { 
  for (int b = 255; b > 0; b--) { 

Saturday, 25 November 2017

Support Support Survey

With winter approaching on icicly feet, it's time to get back to the project of increasing radiator air flow tube. I have a design for the corner piece, but it's tricky to print - it's even somewhat slow to work with for having a large number of facets on the rounded pieces. Trick: add a variable indicating the "coarseness" of circles, multiply that according to the size of the circle, then increase it only when making the final piece.

I printed the top part to see how the overhang would work. It was surprisingly good, but at the flattest part there was enough hang that there were cracks and that there was dangling filament. I tried having Slic3r create support, but that added a huge amount of extra filament usage, and in previous trials with Slic3r support I've found it quite difficult to remove. This means either I need to handcraft some support, which is annoying for such an irregular piece, or find other software that can do better support.

Upside-down view of top part.
Last time I looked at the options for slicers, most options were blocked by security software. This time around, I'll also look at using my home computer, so should be able to try out more. Consider this my

Better Support Support Survey 2017
The contenders:

CraftWare 1.14Installed, blocked by security on laptop. Requires a serial connection to even install a printer. It has an X/Y offset feature, which would overcome my Y offset problem. It also has manual support generation, which could be highly useful. Its supports appear to go into the shape itself, which doesn't seem like a good thing. What I don't see is a Z offset setting, which makes it useless for me.

Cura (Ultimaker) 3.0.4Installed, blocked by security on laptop. The UI is somewhat rough - I can't believe their "settings" menu includes settings for which settings to show. They sure have all the settings there, except I can't find the Z offset that I need.

Cura Lulzbot Edition 21.08: Installed, blocked by security on laptop.  Works nicely on my iMac. Has nicely tunable support as well as the main features I need. It can do more reasonable support inside screw holes and printed well.

Print with support still on (upside down). Screw hole supports are just little pieces inside the holes, and the rest is fairly light.
The support came off nicely, also in the screw holes. The interior is a bit messy, but not horribly so

KISSlicer 1.6.2: Supposedly going to be available for Raspberry, which is nice. Installed, blocked by security on laptop. The UI is really old-style but has all the options I need. Doesn't show support until you click "Slice", but then the support is there. As is a strange purple object to the right that I can't seem to get rid of - looks like that's the equivalent of a skirt. What I first thought of as gaps in the slicing is apparently half-height layers, an interesting idea. The file is also a factor 5 larger than either Cura or Slic3r's. 

MatterControl 1.7.1: Installed, blocked by security on laptop. Works on desktop. Interestingly, the overhang setting is in percent of extrusion width rather than angle, and for this piece it ends up with extremely dense support even at 150%.

Meshmixer 3.3: Free from Autodesk, a giant in CAD. Installed, blocked by security on laptop. On desktop, doesn't seem to be able to export GCODE nor have appropriate settings. It apparently just calls out to something else for slicing.

Repetier: The Mac version is quite a bit behind the Windows/Linux versions. I don't want software that's been abandoned.

Simplify3D 4.0: It's not free, but at €149 isn't not outrageous. They give a two-week money-back warranty, so I'd want to have some good tests lined up.

Slic3r 1.2.9/1.3.0-dev: At least I know this, and it integrates with OctoPrint, which I am looking at switching to for running print control on a Raspberry Pi.

Printed piece with support still on it (upside down). Notice the little bit of extra support on the interior edge, and the heavy-duty support for the screw holes. 

It was really difficult to get the interior support off, would have been nigh impossible if this had been in its intended interior position.

Lulzbot Cura wins this hands down, I will use that if I need better support for a complex piece. Right now, I redesigned the piece to not require support. It might not draw air quite as well, but it's a lot easier to print.

I still want to try Simplify3D at some point where I have time for proper testing.

Another print: For the dark season, I want to finally totally organize the cables on the big light therapy lamp. So I printed another 10 of the clamps I designed long time ago. Interestingly, the two closest to the Y minimum position didn't stick, while the rest was fine. 

Wednesday, 1 November 2017

Scary prints

For Halloween, I'm printing various things downloaded from Thingiverse. Mainly spiders:

These print flat, but you can always heat the legs (or other parts) to pose them. They print really easily with my black flexible PLA, though getting them off the bed has been a smidgen tricky. So now, since I need more spiders, I'm doing prints at increasing Z offset, and once I see what offset is the highest they can still hold on to, I'll go back and do my calibration routine. At 1.1mm Z offset, they printed somewhat tightly on the bed. At 1.2mm there was some filament visible on the bottom, which is fine. At 1.3mm the legs started coming apart from lack of bed adhesion. Calibration (the day after) had only a bit of resistance at 1.1mm, not the full stoppage I usually go for.

Attempting next to print a large box, I ran into dimensional trouble - my print surface wasn't quite big enough for the full size I wanted. Testing the size, I ran the fan into the clips holding on the glass on the bed. I was able to improve this a bit by having the clips clip onto the cardboard insulation under the bed, making them flatter. But even so, I cannot currently print larger than 17x20 cm. I could possibly squeeze out about 1/2 - 1 cm by adjusting the Y direction a bit, it prints a bit towards the back. However, the point is moot, since when starting a reduced-size print, it turned out it would have taken multiple days to print, and I don't want that running in my bed room. Also, the bed isn't quite flat out at the edges - I had it calibrated a bit low, and the middle parts got too low, leading to stripping. On the upside, it made for a pretty feather-like structure:

Fixing the strippedness showed two interesting things: 

Firstly, the pulled filament was rather dark. This could be carbon build-up over being heated to full temperature for several minutes, but more likely it's a bit of the flexible PLA left over. A couple of minutes of heating shouldn't do this much carbon buildup.

Second, the stripped material on the hobbed bolt is fairly loose, which is different from the grey material on my first bolt. I'm not sure if it's the bolt design or the PLA, but in either case it's possible to just brush away the filament rather than having to take out the bolt and pry it out with a needle. I should possibly invest in a small stiff brush for the purpose.

The hobbed bolt after simply brushing it with a standard small pain brush
After cleaning, and with measuring Z height only to where the paper starts having a bit of traction (1.7mm), I ended up with a nigh-perfect test cube (#69). It's curious that it moved up so far - maybe each time I pull the filament out I pull the Z axis bolts a little further into their sockets. If the sockets aren't perfect near the top, it may take some pulling to get them all the way in.