ESP8266 NodeMCU and sensors!

ESP8266 boards seem to be all the rage nowadays… so I figured I’d get into it! Saw a project by someone where they had tied a DHT11 sensor to the ESP, and there are even libraries to make reading it easy. This gave me the idea to make a bunch of temperature modules that I could spread around the house, collect data, send it to a central server and only have to change batteries out twice a year.

So I ordered up a Nodemcuv2 device. It has an integrated USB chip and a 3.3v regulator, and a ESP8266 module piggypacked  making it convenient and easy to do development with. NodeMCU firmware also has an IDE called ESPlorer which makes it very easy to write LUA code using their libraries, and upload it to the chip for testing or deployment.


Got the ESP in and started fiddling with it, wrote some code to play around and got it running. There are some serious limitations to using the NodeMCU firmware, and I may switch to writing code in C for the final version.

The NodeMCU as I said before, has a 3.3v regulator and a USB chip onboard. These together make up a decent amount of current draw when the device is in sleep mode (11mA). The ESP8266 only uses something on the order of 80uA in sleep mode… so I’m definitely going to have to get a bare module for the final revision, otherwise I’m going to be replacing batteries every week.

IMG_0526 IMG_0524 IMG_0523 IMG_0527 IMG_0525

Here’s the test setup I have now. It is running off battery power, sleeping for 60 seconds, then waking up and sending the temp/humidity/voltage to the server as a http post of JSON. The server then stores this in a CSV file, and also displays it in a table. After transmitting, it goes back to sleep.

We’ll see how long the set of 3 C batteries last… that will be a good indicator of how much I need to trim things down!

CNC Mill

So, in addition to the lathe… I just had to get a mill!

Almost a year ago, I chanced into a Clausing Kondia FV-1 CNC Knee mill sitting outside at a guys house on a pallet, under a tarp. I was there checking out some metal stock and other assorted parts he had for sale, and I asked him what was up with the mill. He gave me the run down about it, basically he converted it for a friend, the friend wound up not using it and used it as payment for other services back to the guy I got it from.

image002image036 image004 image005 image008 image017 image018 image025 image027 image028

So I asked him if he wanted to get rid of it, and he said he was going to be scrapping it pretty soon! He had tried to sell it several times before, but people always came up with reasons or excuses for not showing up, etc etc. So he told me he would get about $350 for scrap, so I could have it for that. I jumped on it, and told him I would get it ASAP. Couple of weeks later (he was away), I rented a hydraulic lift trailer and drove down to his house. Among the amazing things that made this easier… was a 70’s era crane!

image003 image001

That thing was bad ass, and after spending an hour getting it out of the sunken wet dirt hole it was in… we used it to load the mill. It made the whole process significantly easier, and I’m absolutly amazed by how heavy 3000lb really is.

image026 image004 image014image015 image016 image022image023


It was quite… interesting lifting that thing up. It lifted up the rear of the crane a couple inches off the ground. I don’t have any pictures of loading it on the trailer, I’ll have to get those photos from my father who was taking pictures while we were working. We wound up having to remove the ram from the mill to load it, just to make it balance a bit better, and to lower the center of gravity for ease of offloading. When we got it home… simply lowered the back of the hydraulic lift trailer and pushed it off. Went really smooth! Here are some of after I got it home and started cleaning it up

image033 image027 image029

DSCN1974 DSCN1972 DSCN1973

In the end it turned out pretty nice. Most of the rust was purely on the surface and a liberal application of Evaporust and some elbow grease with some steel wool cleaned it right up.

DSCN1982 DSCN1983 DSCN1978 DSCN1981

I’ll post up some more pictures and details of the retrofit I did to convert it from servo drive to stepper next.

More Turning

Holy hell, two updates in a week! The end of the world is nigh!

Cleaned up the lathe, oiled down all the metal surfaces and took it for a spin. It cuts *really* smooth. I’m going to do a rod/hole combo, and see how smooth I can make the interference, but before getting into anything that serious I need to do a full oiling and maintenance, including replacing the main drive belt. It’s all kinds of tattered.

Once I got the lathe in place, I tried to stick my tool holder on it (since I prefer the quick swap height adjustable to the old style).

IMG_0126 IMG_0122 IMG_0123

That’s a bit of a problem! I wedged the tiny square in there and it held…. but that’s hardly proper. So! I got to play with my dads CNC mill! I would have loved to knock this out on mine…. but that’s still a Mesa board away from being operational.

IMG_0108 IMG_0112 IMG_0113 IMG_0116 IMG_0118 IMG_0119

Good times, all in all it took us about 3-4 hours of actual working time. Discovered the joys of using scrap material laying around: We ruined one of the inserts on my dads large facing tool… apparently the piece of scrap we found was some kind of ultra hardened steel. Found a much softer piece and got it finished. It wasn’t a complicated thing to do; face the 6 sides to the correct dimensions, then cut the two slots, drill and tap the hole in the middle. No CNC tapping, manual mode for that!

It turned out absolutely beautiful, and fits snug, but not tight enough to bind. It’s a bit longer than it needs to be, but that doesn’t actually hurt anything so I’m inclined to leave it how it is. You can see the slightly rough finish from the broken facing tool.

IMG_0128 IMG_0130 IMG_0132 IMG_0133

And the tool holder installed:

IMG_0135 IMG_0136


Looking good! Ran a few quick cuts just to see how it does, thing cuts a very smooth shiny surface. MUCH easier to get a tool centered with an adjustable height holder. I didn’t have enough of th right size spacers to actually center the tool before.

IMG_0139 IMG_0142 IMG_0143


Now to clean up, re-oil, and do maintenance before any serious projects.



Lathe Time!

Recently I had the opportunity to purchase a 1930’s era Southbend 9″ lathe. It was a pretty awesome deal from a good friend of mine who was moving out of town and couldn’t take it with him. So I started fiddling with metalworking in the rotating variety. Didn’t really make anything significant to speak of… just fiddling around.

Fast forward, and I recently participated in a very poorly advertised online auction for a semi-local small electronics factory that was going out of business. Got a bunch of random furniture for super cheap, and my father picked up a Central Precision 12″ Lathe. I think his intention was to replace his larger lathe with this, which would give him more space… but instead he turned around and sold it to me for what he paid for it. Enter, my new lathe! Random picture dump below, but I’ve finally got it set up and powered… ready to really start learning how to do cool stuff!


Win32 Rsync via cygwin

So rsync is It is amazing.

It came to my attention a while ago when I was looking for rsync solutions for windows, that the defacto “standard” rsync for windows cwrsync was no longer available free and open source.

They were offering a much older version (2009) of rsync, but to get the latest you had to purchase their software. While this is a completly viable business model and I can not fault them for this,
I disagree with it, and since it is within my resources to provide a win32 installer for rsync,  thus came into existance w32Rsync.

w32Rsync is Rsync 3.1.0 and ssh, compiled with cygwin, and packaged with NSIS to make it easy to use.

It adds itself to the users PATH so it can be used from any command line window (cmd.exe)

Soon after creating this, I noticed that I was using the standard build of NSIS, which can screw up PATH variables if your PATH is over a certain size. I have since updated the executable to fix this with the long PATH NSIS build per the warning here

w32Rsync is available for download


CNC Router Drive System

Done some more work over the last week or so on the CNC router design:




A couple big differences, the rails now allow for 4’x10′ motion (with the capability to handle 5×10 standard sheets of wood). I’ve also designed the bottom supporting structure, and revamped the gantry to rail tie-ins. Also of note, is the new drive system:



This system relies on the belt being meshable with itself, and the bottom half being glued or otherwise secured down to the table. Along with a 5:1 reduction between the stepper and drive it should allow all the precision and power that I need, without greatly sacraficing speed. It is also significantly cheaper than going ballscrews but not quite as precise and rigid. I believe it is still well within what I need in terms of strength.


This drive system is based off the work of some guys on cnczone, who came up with the idea of gluing the belt down and meshing them together for strength. There is a commercial system that uses this method, and lists it as “patent pending”, so I’m sure I can’t sell it… but it would be great to use as an alternative to screws or belts. The only thing I’ve yet to figure out: how to keep dust and chips away from the belt and rails. I’ll likely be working on that next.

CNC Router

So I lied. My next post is not going to be about more 3d printing and other microcontroller cnc control platforms… I’ll have to get back to that a bit later.

I got the idea in my head that I needed a CNC router. This would let me make, among other things, cabinet doors, bracketry and other misc attachments for other machines, and anything else really I can think of.

Started discussing the idea with my father, who is a mechanical engineer (Some of his exploits at and by chance he happened to have a bit of a problem buying good deals on linear actuators and rails on ebay. He managed to get a pair of 1560mm Schneeberger 35mm linear roller rails (rollers instead of balls inside the carriages), and a pair of 920mm THK 30mm regular rails. These sizes happen to line up perfectly to do a 2’x4′ (610mmx1220mm)router with about 300mm of carriage on each. We started researching into the rails, and figured out that if we built the frame sufficiently robust, such a machine should be able to do aluminum, and maybe even steel!

Enter my own 3d CAD experiences. I’ve fiddled around with cad in the past, but I’ve always been a software/electronics kinda guy. I decided this would be a good thing to play around with modeling, so I started drawing things up. Wound up with this:


a 2×4 router, with 300mm of Z. The design is centered around 4″x4″ square tubing, which is available for fairly cheap from local vendors. These would be bolted and pinned together to avoid any movement, and then self-leveling epoxy would be poured on top to give a flat surface and allow both rails to be parallel at least on the surface.

This seemed all good and well… but then I started to price out the materials, and thought to myself… if 2×4 is good, then 4×8 would be even better?

I managed across a pair of 2680mm THK 30mm rails (identical to the 920’s) for fairly cheap… the documentation states that I can butt the rails against each other, giving me 3600mm total length one way, and 1560mm the other. Easily a 4x10ft router, with room for a tool changer and a hefty carriage. Thus was born the second design:


Remarkably similar to the first… but the flat sheet in the middle is 4’x8′, and it weighs twice as much. The self-leveling epoxy idea would still work here, just require a lot more epoxy. I’ll have to call around to a couple of places and find out recommended practices and procedures for this sort of thing.

The design still needs more work, I’m going to make the gantry significantly beefier, make a table underneath (whole thing weighs in at around 1400lbs so far… needs quite a table!) and design the motion system (I have some really cool ideas!) but I think that this will be quite the interesting project, and hopefully at the end I’ll have the equivalent to a $25,000 router, for about tenth of the price.

More Printing, Linux style!

So I wrote this post with the intention to post it quite a few months ago… and never actually got around to finishing it up for posting. Oops. Quite a lot has been going on since then, so I’ll hopefully make another post soon after this one with more information.

My last printer post I mentioned I had gotten a to play around with, and in the past few months I’ve gotten it up and running on my BeagleBoneblack. I ran into a couple of issues and gotchas that I had to work through, which I’ll hopefully be able to detail out in this post to help others that are interested in running the 432 with their printer.

The board itself seems to be well laid out, it breaks everything out to the sides, and leaves room for accessing the BBB ports. It does not have any mosfets/relays, but the I/O has enough current to run any mosfet or SSR that you would want.

It has two 26pin IDC connectors for hooking to your standard IDC to DB25 parallel port connector, which I do, and plug directly into a G540.

It also conveniently has 4 analog inputs, preset with 4.7k resistors which allow it to be easily used with the standard 100k 3dprinter thermistors. The 4.7kohm resistor is replaceable without soldering if a different resistance is required, but 4.7kohm worked fine for me.

Let’s talk a little about the I/O. I’ve added the PMDX-432 I/O in the beagleboneblack-pinmux document here, and this details what GPIO numbers match to what pins on the PMDX-432

The step/direction for all 4 steppers run out the J1 connector, and are set up such that you can plug the DB25 directly into a G540 and be pinned correctly for step/direction. I’ve not used the extra I/O on the G540, but rather am running my solid state relays direct off the PMDX-432.

I have two DC solid state relays running my heatbed and hotend, both at 24v rather than the normal 12v. This lets me pwm 60-70%, and get more power out of the heaters. The bed and hotend both heat up significantly faster now than they did running on a 12v system.

To run the temperature control, I use the BeBoPr++’s file, and point it to the proper analog inputs for the PMDX-432. Pipe that into a PID for the hotend, and one for the bed, outputting direct into the pwmgen for each. I’ve set the pwmgen to only run at 5hz, since the solid state relays are a bit slow to turn on and off, and really I don’t need super high frequency pwm. Thus far I’ve not worked out how to tie M commands into the HAL file, so I have to manually set the temperature with halcmd each time I want to print, and then turn it off once the print is finished.

To slice my STL’s, I use simplify3d, which is an amazing piece of software. It turns out much higher quality prints than slicing with either slic3r or kisslicer. It’s a bit costly, but well worth the money. The one downside is that I do have to do some post processing on the gcode. I convert the E’s to A’s, remove all M commands, and add a G64 P0.150 to set my path following tolerance (the key benefit that made me switch to LinuxCNC).

All in all it prints amazing, however I’ve been going back and forth about continuing to use LinuxCNC to run the printer. It’s really not *intended* to run a printer so it doesn’t quite do proper extruder control which leads to some odd print artifacts. I’ve started playing with a few other options, including Smoothie, GRBL, and TinyG, which run on a couple different microcontroller platforms. I’ll detail that out in the next post.

Qt and cross compiling

So for a while now I’ve been cross compiling Qt from Linux, for Windows. I use this on my build server to allow me to build binaries of several applications I develop. Every time I go to set up a new build server, or upgrade Qt libraries I always run into an issue ( which has since been closed as a duplicate, however the replacement issue is not the same. The error I would get is “No target to build mocinclude.tmp” Edit: The error may actually be “No rule to make target mocinclude.tmp”, I may have mis-remembered. Regardless, it’s a very vauge error, but after some searching I discovered a bit more about mocinclude.tmp.

The whole purpose behind mocinclude.tmp is a fix for Windows XP and before, where the command line had a rather small limit to how long a single command could be. This means if you had a large number of include paths (40+) then you would not be able to fit it all on a single command. Qt’s solution to this, was to stick all the includes inside a mocinclude.tmp file, and include that file on the command line. This is all good and well, but if you actually trigger it, it does not work! (It hasn’t since Qt 4.6, and as of Qt 5.2 it still does not). As I keep stumbling across this issue, and keep having to fix it, I figured I would document it here so I don’t have to frantically google whenever it happens and I’ve conveniently forgotten the fix since the last time.

Inside the moc.prf file (Which by default is at QTDIR/mkspecs/features/moc.prf) is the logic for generating mocinclude.tmp. Partway down the file is a chunk that looks sort of like this:

build_pass|isEmpty(BUILDS) { = $$INCLUDETEMP
mocinclude.commands = $$RET

This tells the makefile to create a dependancy for $$INCLUDETEMP (which is the absolute path to the mocinclude.tmp file). The problem being, all the other includes use RELATIVE paths to the mocinclude.tmp file, so make is unable to find the dependancy. Simply adding a relative_path to that, is enough to fix it:

build_pass|isEmpty(BUILDS) { = $$relative_path($$INCLUDETEMP,.)
mocinclude.commands = $$RET

This lets the dependency be named by the relative path, which is the same name that other files link to. Problem solved, it’s a shame that this same issue has been closed several times ( as unable to reproduce.

At least I’m up and running now, hopefully this can help someone else with the same issue.

3D Printing, Rev 2

So I was using my 3d printer for about a year, and I decided that I wanted to print parts in ABS. One of the key differences that ABS has, is its higher glass transition temperature. This means it doesn’t start to get soft (and deform under pressure) until it reaches a much higher temperature than PLA, 100C+ vs 60C.

So to improve the chances of a successful 3d print using ABS, I wrapped my printer in cardboard in order to emulate a heated enclosure. In this case, the enclosure is heated by the waste heat from the heated bed. This went decent for a print or two, until I noticed I started to have some axis creep, where the head was slowly moving in one direction. As the prints progressed I found out it was doing this because the x carriage was starting to melt! A couple more prints later, and both the X Carriage and the extruder had destroyed themselves and were no longer usable.


My father, in the meantime had been building a XYZ table for a drag engraver. He was using really nice linear rails that he had purchased off ebay. He found himself another small CNC machine that made his XYZ table obsolete, and I managed to convince him to donate the table to the cause, and thus my ABS printer was born!


DSCN1338 DSCN1336 DSCN1500 DSCN1494

The X and Z axis are 6mm pitch ballscrews, powered by NEMA17 style steppers. They have encoders on the back, but I am not using the encoders at this time.

The Y axis (table), is a 10mm pitch ballscrew, powered by a NEMA23. I was initially driving all three steppers from the Sanguinololu board with pololu stepper drivers.

After everything was installed and wired up, I fired it up and got started running some simple movement tests. Figured out that 600mm/s^2 is a decent acceleration, it’s not super quick, but running the pololu’s at 1 amp it keeps it from skipping steps. I can likely crank this up once I get more power for them.

Doing speed tests, I was able to get up over 100mm/second running back and forth, but I quickly noticed I was having some odd resonance issues with the X axis. Around 60, and again at 80mm/second, it made some quite loud noises, and would occasionally stall for a moment.I did some digging and research, and found out that they DO make stepper drivers to prevent this, but the $10 pololu’s won’t. For the time being, I limited my speed to 40mm/second.

Tried a few test prints and I was having extruder jamming issues, very weird issues. Fiddled around for a few more hours and discovered some…. issues with the extruder itself. Tore it apart, widened some of the the holes, put in a j-head slot plate and put it all back together. No more jamming filament, no more slipping hotend!


At this point, I was up and running! I had my ABS printer, it did alright for smaller prints. For larger prints, I started having delamination issues from the lack of a heated environment, as you can see below. This is really a major issue on large parts, but shows up as corner warping on smaller parts.


So I made an attempt at a heated enclosure….

DSCN1343 DSCN1344 DSCN1345

More on my experiments with that, including a proper frame later :)

I started noticing that certain prints would cause missed steps during rapid small infill. Lowering my acceleration values didn’t have any effect at all, so I started looking into exactly what parameters managed this. Turns out it was something that reprap calls “JERK”. Anyone familiar with motion control knows what jerk is, but in this case it is entirely literal. Jerk is the maximum velocity change the printer is willing to do instantaneously. Sure, instantaneous acceleration isn’t possible but it tries really hard to do it anyway. If I disable this feature, then the printer goes from point to point, acceleration and deceleration, coming to a stop between points. Totally unusable.

So my options were, turn down the speed REALLY far for the whole print so it’s not an issue, or live with it. I chose to find a different controller.

Enter; LinuxCNC. My dad had a spare G540 stepper driver that he said I could play with so I put LinuxCNC on a liveCD, loaded it on a spare CarPC that I had laying around which happened to have a parallel port. I had to cut all the connections to the stepper connectors I had, and solder them into some DB9 connectors to plug into the G540, but I got all that finished fairly quickly. I plugged it in, started linuxCNC, and got fiddling with GCode to get it to work.

DSCN1506 DSCN1505 DSCN1504

A couple key differences between Reprap and LinuxCNC gcode. Reprap is primarily G1 commands for movement, with M commands interspersed for extruder/bed temperature and the like. Simply commenting out all M codes, and changing all E references for extruder to A for the 4th LinuxCNC axis is all that needs to be done for the GCode file to be loadable by LinuxCNC.

Because I don’t yet have a way to run the bed/hotend from LinuxCNC, I kept them hooked up to the Sanguinololu, and used my own utility to turn them on and off, but I do need to have that controlled by LinuxCNC at some point,

Once I was able to load the GCode, I set my home positions, got the hotend and hotbed hot, and then hit Go. It printed magnificantly! Way more smooth, way quieter with the G540 stepper drivers, able to go faster due to the anti-resonance characteristics of the G540. I was limited however to only 70mm/second, since the PC I was using wasn’t great in terms of jitter, but it prints at 60mm/second beautifully with no issues.

DSCN1350 DSCN1349 DSCN1348 DSCN1347 DSCN1346

So right now I have a spare CarPC connected to a loaned G540 plugged into my stepper drivers, with a Sanguinololu connected to my hotend/hotbed. It’s quite a contraption as you can see below but it is a very good proof of concept!

DSCN1503 DSCN1502 DSCN1501 DSCN1496 DSCN1494

Next step will be to figure out what stepper driver I want to go with (G540, or as an alternative MX3660 would work as well), and figure out how I will be getting a faster step clock. My PC is running with a 33uS step clock, which is only fast enough to get up to 70mm/second with the G540 10 microstepping. The 3660 would allow me to drop to 1/4 microstepping, increasing my maximum speed to 140mm/second, and switching to a beaglebone would reduce my step clock to <10uS, increasing my potential speed well beyond what I am looking for.

Just a couple of weeks ago I got my hands on a PMDX-432 (, which allows me to truly do a standalone beaglebone/linuxcnc based solution. More on that in the next post…