Archive for category Software

CNC 3018XL: Rotating the Axes

After extending the CNC 3018-Pro platform to 340 mm along the Y axis, I tweaked the Spirograph demo to work with 8-1/2×11 paper:

Spirograph - 3018XL Platform - Portrait Mode
Spirograph – 3018XL Platform – Portrait Mode

Yeah, a Portrait mode plot kinda squinches the annotations into the corners.

Rotating the coordinates to put the X axis along the length of the new platform is, of course, a simple matter of mathematics, but it’s just a whole lot easier to rearrange the hardware to make the answer come out right without fancy reprogramming.

The first step is to affix an MBI-style endstop switch to the left end of the gantry upright:

3018XL - endstop - left gantry
3018XL – endstop – left gantry

The gantry carriage sits at the 1 mm pulloff position, with the switch lever just kissing the (fixed) lower carriage plate. As before, good double-sticky foam tape holds everything in place.

The probe camera hovers just over the switch and the Pilot V5RT pen holder is ready for action.

Shut down the Raspberry Pi and turn off the power!

At the CAMtool V3.3 board:

  • Swap the X and Y motor cables
  • Move the former Y endstop switch to the X axis input
  • Plug the new endstop switch into the Y axis input, routing its cable across the top of the gantry
  • Abandon the former X axis switch and its cable in place

Modify the GRBL configuration:

  • $3=4 – +Y home @ gantry left, +X home @ frame front
  • $130=338 – X axis travel along new frame
  • $131=299 – Y axis travel across gantry

Tweak the bCNC config similarly, if that’s what you’re into.

Verify the new home position!

I reset the G54 coordinate system to put XY = 0 at the (new!) center of the platform, redefined G28 as the “park” position at the (new!) home pulloff position, and set G30 as the “tool change” position at the -X -Y (front right) corner of the platform, with bCNC icons to simplify moving to those points.

And then It Just Worked™:

3018XL - rotated axes
3018XL – rotated axes

The Spirograph patterns definitely look better in landscape mode:

Spirograph - 3018XL Platform - Landscape Mode
Spirograph – 3018XL Platform – Landscape Mode

I eventually turned the whole machine 90° clockwise to align the axes with the monitor, because I couldn’t handle having the X axis move front-to-back on the table and left-to-right on the screen.

,

Leave a comment

Raspberry Pi: Adding a PIXEL Desktop Launcher

The Raspberry Pi’s Raspbian PIXEL Desktop UI (not to be confused with the Google Pixel phone) descends from LXDE, with all the advantages & disadvantages that entails. One nuisance seems to be the inability to create a launcher for a non-standard program.

The stock task bar (or whatever it’s called) has a few useful launchers and you can add a launcher for a program installed through the usual Add/Remove Software function, as shown by the VLC icon:

LXDE launcher icons
LXDE launcher icons

Adding a bCNC launcher requires a bit of legerdemain, because it’s not found in the RPi repositories. Instead, install bCNC according to its directions:

… install various pre-requisites as needed …
pip2 install --upgrade git+https://github.com/vlachoudis/bCNC 

Which is also how you upgrade to the latest & greatest version, as needed.

You then launch bCNC from inside a terminal:

python2 -m bCNC

The installation includes all the bits & pieces required to create a launcher; they’re just not in the right places.

So put them there:

sudo cp ./.local/lib/python2.7/site-packages/bCNC/bCNC.png /usr/share/icons/
sudo cp .local/lib/python2.7/site-packages/bCNC/bCNC.desktop /usr/share/applications/bCNC.desktop

The bCNC.desktop file looks like this:

[Desktop Entry]
Version=1.0
Type=Application
Name=bCNC
Comment=bCNC Controller
Exec=bCNC
Icon=bCNC.png
Path=
Terminal=true
StartupNotify=false
Name[en_US]=bCNC

Set Terminal=false if you don’t want a separate terminal window and don’t care about any of the messages bCNC writes to the console during its execution. However, those messages may provide the only hint about happened as bCNC falls off the rails.

With all that in place, it turns out LXDE creates a user-specific panel configuration file only when you change the default system panel configuration. Add a VLC launcher to create the local ~/.config/lxpanel/LXDE-pi/panels/panel file.

With that ball rolled, then add the bCNC launcher:

nano .config/lxpanel/LXDE-pi/panels/panel
… add this stanza …
Plugin {
  type=launchbar
  Config {
    Button {
      id=bCNC.desktop
    }
  }
}

Log out, log back in again, and the bCNC icon should appear:

LXDE launcher icons - additions
LXDE launcher icons – additions

Click it and away you go:

bCNC - Running from LXDE Launcher
bCNC – Running from LXDE Launcher

At least you (and I) will start closer to the goal when something else changes …

, , ,

4 Comments

Drag Knife Cuttery: Entry & Exit Moves

The first pass at cutting laminated decks for the Homage Tektronix Circuit Computer left little uncut snippets at the starting point of the cut. The point of the drag knife blade trundles along behind the cutting edge and, when the ending point equals the starting point, leaves an un-cut sliver as it’s retracted vertically:

Drag Knife - LM12UU - knife blade detail
Drag Knife – LM12UU – knife blade detail

The knife blade isn’t aligned in any particular direction, so it can leave a nick on either side as it enters the deck vertically at the start of the cut.

Gradually entering the deck along the cut line gives the blade enough time to swivel around to the proper alignment before it gets down to serious cutting. Continuing the final cut past the starting point then allows the blade to recut anything remaining from the entry move.

The middle and top decks have windows exposing the scales:

Tek CC - radial text example
Tek CC – radial text example

The paths are basically two arcs connected by semicircular cuts, but with ramps on each end recutting the entry and exit paths:

Top Deck - Window Cut Path
Top Deck – Window Cut Path

The entry path in the upper left slants downward from the TravelZ level of 1.5 (-ish) mm to Z=0, with the nose of the blade holder flush against the surface and the blade sunk to its full length. The vertical path to Z=-2 (-ish) increases the cutting pressure from roughly the preload value to preload + 2*(spring rate), so the blade won’t ride up under the cutting forces.

The path then goes completely around the window at Z=-2, then ramps up to the TravelZ level again.

All of which produces a neat cutout that sticks to the Cricut mat when I peel the rest of the deck off:

Tek CC - MPCNC drag knife
Tek CC – MPCNC drag knife

That’s a middle deck before I started laminating them, but you get the general idea.

The GCMC code (extracted from the complete lump) looks like this:

  local WindowArc = 54deg;

  local ac = -17 * ScaleArc + ScaleRT/2;   // center of window arc
  local r0 = DeckRad - ScaleHeight;        // outer
  local r1 = DeckRad - 2 * ScaleHeight;    // inner

  local aw = WindowArc - to_deg(atan(ScaleHeight,(r0 + r1)/2));    // window arc minus endcaps

  p0 = r0 * [cos(ac + aw/2),sin(ac + aw/2),-];
  p1 = r0 * [cos(ac - aw/2),sin(ac - aw/2),-];
  local p2 = r1 * [cos(ac - aw/2),sin(ac - aw/2),-];
  local p3 = r1 * [cos(ac + aw/2),sin(ac + aw/2),-];

  goto(p3);
  arc_cw(p0 +| [-,-,0],ScaleHeight/2);    // blade enters surface
  move([-,-,KnifeZ]);                     // apply pressure

  arc_cw(p1,r0);                          // smallest arc
  arc_cw(p2,ScaleHeight/2);               // half a circle
  arc_ccw(p3,r1);
  arc_cw(p0,ScaleHeight/2);

  arc_cw(p1 +| [-,-,TravelZ],r0);         // exit from cut

  goto([0,0,-]);
  goto([-,-,SafeZ]);

Having measured the angular position of the window and its size on the original Tek CC, I compute the coordinates of the four points where the semicircular “end caps” meet the longer arcs, then connect the dots with arc_xx() functions to generate the G-Code commands. As always, using the proper radius signs requires trial & error.

While I was at it, I added entry & exit moves for the deck’s central pivot hole and outer perimeter.

I’m pretty sure the right CAM package would take care of that, but GCMC operates well below the CAM level.

, , ,

Leave a comment

Google Pixel 3a Microscope Adapter

Hand-holding my Google Pixel 3a phone over the microscope eyepiece worked well enough to justify building Yet Another Camera Adapter:

Pixel 3a Microscope Adapter - in action
Pixel 3a Microscope Adapter – in action

The solid model looks about like you’d expect:

Google Pixel 3a Zoom Microscope Mount - solid model - top
Google Pixel 3a Zoom Microscope Mount – solid model – top

The “camera” actually has the outside dimensions of a Spigen case, rather than the bare phone, because dropping a bare phone is never a good idea.

The base plate pretty much fills the M2’s platform:

Pixel 3a Microscope Adapter - M2 platform
Pixel 3a Microscope Adapter – M2 platform

I originally arranged the four corners around the plate to print everything in one go, but an estimated six hours of print time suggested doing the corners separately would maximize local happiness. Which it did, whew, even if the plate ran for a bit over 4-1/2 hours.

The snout is a loose fit around the 5× widefield microscope eyepiece, with the difference made up in a wrap of black tape; it’s much easier to adjust the fit upward than to bore out the snout. An overwrap of tape secures the snout to the eyepiece, which I’ve dedicated to the cause; the scope normally rocks 10× widefield glass.

The tapered hole exposes the phone’s fingerprint reader to simplify unlocking, should it shut down while I’m fiddling with something else.

The microscope doesn’t fully illuminate the camera’s entrance pupil at minimum zoom, with 4.5× filling the screen and (mostly) eliminating the vignette. The corner blocks have oversize holes to allow aligning the camera lens axis over the microscope optical axis. The solid model incorporates Lessons Learned from the version you see here, because you (well, I) can’t measure the camera axis with respect to the outside dimensions accurately enough:

Pixel 3a Microscope Adapter - installed - front
Pixel 3a Microscope Adapter – installed – front

Although it’s less unsteady than it looks, microscopy requires a gentle touch at the best of times. The adapter doesn’t add much wobble to the outcome:

Pixel 3a Microscope Adapter - installed - side
Pixel 3a Microscope Adapter – installed – side

The field is about 14×19 mm with the camera at 4.5× and the microscope at minimum zoom:

Pixel 3a Microscope Adapter - test image - min mag
Pixel 3a Microscope Adapter – test image – min mag

You can see a little darkening on the upper and lower right corners, so the phone’s still minutely leftward.

The field is about 1.5×2 mm at full throttle:

Pixel 3a Microscope Adapter - test image - max mag
Pixel 3a Microscope Adapter – test image – max mag

Color balance with the cold white LED ring isn’t the best, but it’s survivable. Mad props to OpenCamera for exposing All. The. Controls. you might possibly need.

The OpenSCAD source code as a GitHub Gist:

, ,

4 Comments

Homage Tektronix Circuit Computer: Pen Plotter Version

A reproduction circular slide rule from the mid-1960s may not be the cutting edge of consumer demand, but the pen version of a Tektronix Circuit Computer came out pretty well:

Homage Tektronix Circuit Computer - green on white laminated
Homage Tektronix Circuit Computer – green on white laminated

A Bash script compiles the GCMC code with eight different parameter combinations to produce pairs of G-Code files to draw (“engrave” being aspirational) and cut (“mill”, likewise) the three decks and the cursor.

The CNC 3018XL with a Pilot V5RT pen draws the deck scales on white paper:

Pilot V5RT holder - installed
Pilot V5RT holder – installed

Better paper definitely produces better results, so I must rummage through the Big Box o’ Paper to see what lies within. Laminating the decks improves their durability and matches the original Tek surface finish.

The MPCNC with a drag knife blade cuts through a laminated deck like butter:

Tek CC - MPCNC drag knife
Tek CC – MPCNC drag knife

Setting the XY origin to dead center on each deck requires carefully calibrating the USB video camera, with the end result accurate to maybe ±0.1 mm around the entire perimeter. Both machines move equal linear distances along both axes, which was definitely comforting.

Having made half a dozen cursors from various bits of acrylic, none of which look particularly good, demonstrates my engraving hand is too weak for a complete slide rule:

Tek Circuit Computer - cursor hairline
Tek Circuit Computer – cursor hairline

With logarithmic scales in hand, however, adapting the GCMC source code to produce general-purpose circular slide rules with only two decks and smaller diameters may be the way to improve my engraving-fu, as a full-scale Tektronix Circuit Computer would chew up three square-foot plastic sheets.

A general-purpose slide rule would need multi-color (well, at least bi-color) labels and digits for red “inverse” scales to remind you (well, me) they read backwards. Some slipsticks use left-slanting italics, left-pointing markers (“<2”), or other weirdness, but they’re all different.

An early small-scale version engraved on ABS came out OK, modulo poor ink fill:

Tek CC bottom - ABS 160g 2400mm-min
Tek CC bottom – ABS 160g 2400mm-min

Engraving the decks on hard drive platters doesn’t count:

Tek CC - bottom deck - scaled to HD platter
Tek CC – bottom deck – scaled to HD platter

All in all, it’s been an interesting exercise and, as you may have guessed, will become a Digital Machinist column.

The GCMC and Bash source code as a GitHub Gist:

, , , ,

2 Comments

CNC 3018XL: Pilot V5RT Pen Holder

It turns out my all-time favorite Pilot Precise V5 Extra Fine stick pen also comes in a clicky-top retractable version:

Pilot V5 and V5RT pens
Pilot V5 and V5RT pens

The cartridge is a nice 6 mm cylinder, eminently transformable into a plotter pen:

Pilot V5RT holder - installed
Pilot V5RT holder – installed

A few minutes with a caliper provides key measurements for a snout surrounding the business end:

Pilot V5RT Pen Holder - snout dimension doodle
Pilot V5RT Pen Holder – snout dimension doodle

The green letters & numbers give the nearest drill sizes. The “T” values along the bottom are the tailstock turns (at 1.5 mm/turn) required to poke the drills to the indicated depths, eyeballed when the body just enters the hole.

Having recently decomissioned the Thing-O-Matic and harvested its organs parts, I have a vast collection of 3/8 inch = 9.52 mm shafts and matching bronze bushings:

9.52 mm shaft and bushings
9.52 mm shaft and bushings

Bronze bushings have low stiction, at least when they’re co-axial, and are much shorter than linear ball bearings.

I chopped off a 70 mm length of shaft and faced the raw end:

Pilot V5RT holder - facing shaft
Pilot V5RT holder – facing shaft

The other end had a maker’s logo, but I don’t recognize it:

Pilot V5RT holder - center drill
Pilot V5RT holder – center drill

I really wanted an 8 mm bore around the snout, but it just didn’t work out. The ring around the 7.5 mm counterbore shows where the larger drill just … stopped:

Pilot V5RT holder - drilled shaft
Pilot V5RT holder – drilled shaft

A trial fit with the pen cartridge:

Pilot V5RT holder - pen in shaft
Pilot V5RT holder – pen in shaft

The top of the shaft gets a somewhat longer knurled ring for the 3 mm SHCS holding the cartridge in place:

Pilot V5RT holder - knurling pen clamp
Pilot V5RT holder – knurling pen clamp

The screw bears on a split collar turned and drilled from a Delrin rod:

Pilot V5RT holder - drilling Delrin clamp
Pilot V5RT holder – drilling Delrin clamp

The “split” came from a simple saw cut across one side and I milled a flat spot in the knurling to seat the screw. As usual, the knurled ring got epoxied to the shaft.

The snout started as a 3/8 inch aluminum rod, drilled as shown in the sketch, with a (scant) 7.5 mm section to fit the shaft. The carbide insert left a nicely rounded shoulder that required trimming to fit snugly into the shaft:

Pilot V5RT holder - shaping snout seat
Pilot V5RT holder – shaping snout seat

The compound can handle the shallow angle required to shape the snout:

Pilot V5RT holder - tapering snout
Pilot V5RT holder – tapering snout

A trial fit showed the snout was a bit too long for comfort:

Pilot V5RT holder - snout test fit
Pilot V5RT holder – snout test fit

Making something shorter doesn’t pose much of a challenge:

Pilot V5RT holder - trimming snout
Pilot V5RT holder – trimming snout

Another trial fit shows it’s spot on:

Pilot V5RT holder - shaft snout pen test fit
Pilot V5RT holder – shaft snout pen test fit

The critical part is having the snout support the plastic around the pen tip to prevent wobbulation.

Epoxy the whole thing together, add a suitable spring, tighten the screws & nuts for the reaction plate, and it’s all good. I write with about 50 g of force for these pens, so a light preload seemed in order:

Pilot V5RT Pen Holder - initial downforce measurement
Pilot V5RT Pen Holder – initial downforce measurement

If I’d weighed the full-up shaft + snout + collar + cartridge, I’d know if the Y intercept matches that weight. It seems a little lighter, but I’m not taking the thing apart to find out.

The first version of the 3D printed holder (shown above) is a straightforward modification of the LM12UU diamond drag bit holder, but, after building enough of these things, I realized the circular reaction plate should be triangular to get more clearance in front of the Z-axis stepper motor when installing & removing the holder:

Pilot V5RT Pen Holder - solid model - show view
Pilot V5RT Pen Holder – solid model – show view

It also has a recess for the serrated top of the bearing, to prevent the knurled collar from clicking annoyingly as the Z-axis rises at the end of each stroke.

Now, to see how well it draws!

The OpenSCAD source code as a GitHub Gist:

,

9 Comments

Huion H610Pro (V2) Tablet vs. Ubuntu 18.04

Given the hassle involved with getting my ancient Wacom Graphire3 tablet working with various Linux versions, I was unsurprised to find a Huion H610Pro (V2) tablet (*) didn’t quite work out of the box.

Good old lsusb showed the tablet’s USB info:

lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 248a:ff0f  
Bus 001 Device 007: ID 058f:9410 Alcor Micro Corp. Keyboard
Bus 001 Device 006: ID 047d:1020 Kensington Expert Mouse Trackball
Bus 001 Device 005: ID 046d:c508 Logitech, Inc. Cordless Trackball
Bus 001 Device 003: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 006: ID 05e3:0748 Genesys Logic, Inc. 
Bus 004 Device 005: ID 0480:a202 Toshiba America Inc Canvio Basics HDD
Bus 004 Device 004: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 004 Device 003: ID 0451:8041 Texas Instruments, Inc. 
Bus 004 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 256c:006d  
Bus 003 Device 004: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 003 Device 003: ID 0451:8043 Texas Instruments, Inc. 
Bus 003 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Yes, the space normally occupied by the product description is blank. The first blank description comes from a generic wireless keypad’s USB receiver; the 0x248a Vendor ID claims be Maxxter, a step down from the usual Logitech ID rip, and its 0xff0f Device ID looks bogus to me, too.

The 0x256c Vendor ID isn’t in the online databases yet, but some grepping found it in /lib/udev/rules.d/65-libwacom.rules:

# Huion H610 Pro
ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="256c", ENV{ID_MODEL_ID}=="006e",  ENV{ID_INPUT}="1", ENV{ID_INPUT_JOYSTICK}="", ENV{ID_INPUT_TABLET}="1"
ATTRS{name}=="* Pad", ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="256c", ENV{ID_MODEL_ID}=="006e",  ENV{ID_INPUT_TABLET_PAD}="1"
# Huion H610 Pro
ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="256c", ENV{ID_MODEL_ID}=="006e",  ENV{ID_INPUT}="1", ENV{ID_INPUT_JOYSTICK}="", ENV{ID_INPUT_TABLET}="1"
ATTRS{name}=="* Pad", ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="256c", ENV{ID_MODEL_ID}=="006e",  ENV{ID_INPUT_TABLET_PAD}="1"

Note, however, that the Device ID is 0x006e, where the upgraded V2 tablet is 0x006d; I have no idea why the number goes down as the version goes up. Change all instances of the former to the latter.

Even though the Wacom driver can apparently handle the older H610Pro, the V2 tablet’s buttons were missing in action.

The solution seems come from the Digimend project, although it also expects the 0x006e Device ID, and as is usually the case, installing the latest & greatest version, hot from GitHub, did the trick.

For this first pass, I didn’t use DKMS, which this post will remind me to do after the next kernel upgrade.

A reboot settled all the drivers into place, after which:

xsetwacom --list
HUION Huion Tablet Pen stylus   	id: 10	type: STYLUS    
HUION Huion Tablet Pad pad      	id: 11	type: PAD 

Yes, it’s “Tablet Pad pad” and capitalization is important.

For my simple needs, confining the stylus cursor to the landscape monitor makes sense. Adding this to ~/.config/startup.sh did the same thing as similar invocations for the Wacom:

xsetwacom --verbose set "HUION Huion Tablet Pen stylus" MapToOutput "DP-1"

The various buttons still need configuration, although that’s in the nature of fine tuning. The top three buttons are 1, 2, 3, with the rest tagging along at 8 through 12. They take trendy gray-on-black labeling to an absurd limit:

Huion H610Pro V2 - embedded gray-on-black buttons
Huion H610Pro V2 – embedded gray-on-black buttons

That’s with intense overhead lighting shining into the buttons and lighting up the lower-surface iconography. In normal light, they’re shiny black disks with invisible legends and, no, they’re not backlit.

The overall button-tweaking syntax:

xsetwacom set "HUION Huion Tablet Pad pad" button 12 key whatever

Where whatever comes from the list in /usr/include/X11/keysymdef.h, per the doc in man xsetwacom and a list of possibilities from:

xsetwacom --list modifiers  "HUION Huion Tablet Pad pad"

For example, this causes the bottom button to spit out a question mark:

xsetwacom set "HUION Huion Tablet Pad pad" button 12 key shift /

It’s not obvious changing the buttons from their default button numbers to anything else makes any sense; just tweaking individual programs to map those numbers into useful actions should work better.

(*) It has a “battery-free” stylus which, to my way of thinking, is a major selling point.

,

1 Comment