Posts Tagged CNC
I’ve been using YAGV (Yet Another G-Code Viewer) as a quick command-line Guilloché visualizer, even though it’s really intended for 3D printing previews:
Oddly (for a command-line program), it (seems to) lack any obvious keyboard shortcut to bail out; none of my usual finger macros work.
A quick hack to the main
/usr/share/yagv/yagv file makes Ctrl-Q bail out, thusly:
diff yagv /usr/share/yagv/yagv 18a19 > import sys 364a366,367 > if symbol==pyglet.window.key.Q and modifiers & pyglet.window.key.MOD_CTRL: > sys.exit()
I tacked the code onto an existing issue, but yagv may be a defunct project. Tweaking the source works for me.
The Ubuntu 18.04 LTS repo has what claims to be version 0.4, but the yagv GitHub repository (also claiming to be 0.4) includes code ignoring G-Code comments. Best to build the files from source (which, being Python, they already are), then add my Ctrl-Q hack, because my GCMC Guilloché generator adds plenty of comments.
Flushed with success from engraving a hard drive platter for the 21HB5A tube, I bandsawed an acrylic square from a scrap sheet and unleashed the diamond drag bit on it:
That’s side-lit against a dark blue background. The long scratch and assorted dirt come from its protracted stay in the scrap pile.
If you look closely, you’ll see a few slightly wider loops, which came from a false start at Z=-0.1 mm.
Engraving at -0.5 mm looked pretty good:
Despite an angular resolution of 2°, the curves came out entirely smooth enough. The gritty scratchiness resulted in a pile of chaff covering the engraved area; perhaps some oil or lube or whatever would help.
Rescaling the pattern to fit a CD platter worked fine, too:
Polycarbonate seems to deform slightly, rather than scratch, leaving the final product with no chaff at all:
In this case, the doubled lines come from the reflection off the aluminized lower surface holding all the data.
That CD should be unreadable by now …
[Update: It seems I interchanged “em” and “de” throughout this post. ]
Up to this point, I’ve been labeling printed parts with
emdebossed legends that look OK on the solid model:
Alas, the recessed letters become lost in their perimeter threads:
Raising the legend above the surface (“
deembossing”) works reasonably well, but raised letters would interfere with sliding the battery into the holder and tend to get lost amid the surface infill pattern.
The blindingly obvious solution, after far too long, raises the letters above a frame embossed into the surface:
Which looks OK in the real world, too:
The frame is one thread deep and the legend is one thread tall, putting the letters flush with the surrounding surface and allowing the battery to slide smoothly.
The legend on the bottom surface shows even more improvement:
An OpenSCAD program can’t get the size of a rendered text string, so the fixed-size frame must surround the largest possible text, which isn’t much of a problem for my simple needs.
Adapting the NP-BX1 battery holder to use SMT pogo pins worked well:
The next step is to add sockets for those 14 AWG wires:
Start by reaming / hand-drilling all the holes to their nominal size and cleaning out the pogo pin pocket.
Solder wires to the pogo pins and thread them through the holder and lid:
That’s nice, floppy silicone-insulated 24 AWG wire, which may be a bit too thick for this purpose.
The pogo pins will, ideally, seat with the end of the body flush at the holder wall. Make it so:
Dress the wires neatly into their pocket:
Butter the bottom of the lid with epoxy, clamp in place, set it up for curing, then fill the recess:
While it’s curing, make a soldering fixture for the 14 AWG wires:
The holes are on 5 mm centers, in the expectation other battery holders will need different spacing.
Solder it up and stick the wires into the base:
Jam a battery in and It Just Works™:
- Green = supply current at 20 mA/div
- Yellow = LED driver transistor base voltage
- Purple = other transistor collector voltage
- White = base – collector voltage = capacitor voltage
The measurement setup was a bit of a hairball:
For completeness, here’s the schematic-and-layout diagram behind the circuitry:
I love it when a plan comes together!
The OpenSCAD source code as a GitHub Gist:
The pips are 100 mm apart at (-50,-50) and (+50,50). Astonishingly, the laser aligner batteries are in fine shape.
I should have protected the platter before drilling all those holes:
All’s well that ends well:
It looks even better in the dark, although you’d never know it from this picture:
I wish I could engrave those patterns on already-drilled platters, but dragging a diamond point into a hole can’t possibly end well. I could deploy the Tiny Sandblaster with a vinyl mask, if I had enough artistic eptitude to lay out a good-looking mask.
The old Atom running LinuxCNC for the Sherline finally stopped booting, so I popped the Optiplex 760 off the stack and did a live-USB trial run. The latency / jitter worked out around 25 µs, slightly worse than before, but still Good Enough, and the StepConf utility coerced the motors into working OK.
What didn’t work was the old Eagle-to-HAL code defining the Logitch Gamepad as a Joggy Thing to allow smooth joystick jog control. Well, stuff changes over the course of eight years, but, in this case, the fix turned out to be a one-liner: the
probe_parport module isn’t needed nowadays.
With that out of the way, it runs fine:
The INI and HAL files defining the Sherline configuration as a GitHub Gist:
Unlike the keypads on my streaming radio players, this one requires no configuration at all, because bCNC regards it as just another keyboard input. The catch: you must select any screen element other than a text entry field to have bCNC recognize the keystrokes as “not text”.
You would get the same results from the numeric keys on the right side of a full-size / 104-key plank. I’m using a small “tenkeyless” keyboard, which means I can put the keypad wherever it’s easiest to reach while tweaking the MPCNC.
The ÷10 and ×10 keys along the top row alter the step size by factors of ten, which is pretty much what you need: jog to within a big step of the target, drop to the next lower decade, jog a few more times, maybe drop another decade, jog once, and you’re as close as you need to be with an MPCNC. The -1 and +1 keys aren’t as useful, at least to me: changing from 5 mm to 4 mm or 6 mm doesn’t make much difference.
GRBL and bCNC don’t do smooth jogging and the discrete steps aren’t as nifty as the Joggy Thing with LinuxCNC, but it gets the job done.