Advertisements

Archive for category Software

3D Foot Scanning

The Poughkeepsie Library makes a 3DSystems Sense scanner (V1) available to patrons and, after a bit of to-and-fro, I managed to get a not-awful scan of Mary’s right leg:

Mary - R foot - complete
Mary – R foot – complete

This was accomplished under field conditions in a cramped room hosting a Spanish-language “introduction to computers” class. We propped her leg across the edge of a table with her sock as a cushion.

The depth image resolution seems to be 1 mm and the software attempts to stitch multiple views from different angles into a consistent 3D model. The scanner requires a steady hand and a steady model to successfully glue new data onto the existing model; what seem small misalignments derail the matching.

The software has several presets, of which “Head” produces the best results. I have no idea what the algorithm thinks of her foot; maybe it’s been trained on some truly ugly faces.

Exporting the solid model as either STL or PLY allows import into (Windows-only) Meshmixer, wherein I sawed off the pieces we won’t need:

Mary R foot trimmed
Mary R foot trimmed

If only I had a foot fetish …

The 3DSystems software requires a fairly specific Windows 8 (or 10, which is so not happening) + Intel hardware configuration, which recently arrived as a $250 off-lease Dell Latitude 7250 laptop. It works fine through VNC, so I can use it from the Comfy Desk.

However, using a 3D scanner in your own home isn’t actually private:

3DSystems Sense Scanner - EULA
3DSystems Sense Scanner – EULA

All your data are belong to them:

3D Systems may also automatically collect and report back to 3D Systems information about the Software and Licensee’s usage along with limited information about the Device, 3D Printer, and/or other third-party applications. If 3D Systems implements automated data collection practices then Licensee may opt out of providing such data if Licensee has a license that authorizes Commercial Use.

Oh, and then you must activate the software before using it. The library IT folks tell me I can install & activate the scanner on my system without derailing their setup. I have my doubts, but we’ll see how it goes.

I must get into photogrammetry, ideally from the sofware libre branch as described there. The openMVG repo seems promising.

Advertisements

Leave a comment

GCMC Platter Engraving

Engraving Spirograph / Guilloché patterns on scrap CDs and hard drive platters now works better than ever:

Spirograph - 674203941 - preview
Spirograph – 674203941 – preview

After, that is, I realized:

  • Any Rotor will work, as long as it’s smaller than the Stator
  • You must pick pen offset L so the pattern never crosses the stator center point
  • L ≥ 1 is perfectly fine
  • You must scale the resulting pattern to fit the actual space on the disk

One of my final doodles showing how the variables relate to each other, although the Wikipedia article may be useful for the underlying math and other posts have more pix on various machines:

Spirograph Scaling doodles
Spirograph Scaling doodles

Cheat sheet:

  • Stator has tooth count (∝ radius) R
  • Rotor has tooth count (∝ radius) r
  • K = r/R, so if you normalize R=1, K=r
  • Pen offset L puts it at radius rL in the rotor

Picking a suitable rotor requires iterating with random choices until one fits:

  RotorTeeth = Stators[-1];
  n = 0;
  while (RotorTeeth >= floor(0.95 * StatorTeeth) || RotorTeeth < 5) {
    RotorTeeth = (XORshift() & 0x007f);       // this is why Stator can't have more than 127 teeth
    n++;
  }
  comment("Rotor: ",RotorTeeth," in ",n," iterations");

The 5% buffer on the high end ensures there will be an L keeping a hole in the middle of the pattern. Requiring at least five teeth on the low end just seems like a Good Idea.

Given the stator & rotor tooth counts, iterate on random L values until one works:

  n = 0;
  do {
    L = (to_float((XORshift() & 0x1f) + 1) / 32.0) * (1.0/K - 1.0);   // allow L > 1.0
    n++;
  } while (L >= (1.0/K - 1.0) || L < 0.01);
}
comment("Offset L: ", L," in ",n," iterations");

With L chosen to leave a hole in the middle of the pattern, then the pattern traced by the pen in the rotor is centered at 1.0 – K (the normalized Stator radius minus the normalized Rotor radius) and varies by ±LK (the offset times the normalized Rotor radius) on either side:

RotorMin = 1.0 - 2*K;
comment("Rotor Min: ",RotorMin);

BandCtr = 1.0 - K;                      // band center radius
BandMin = BandCtr - L*K;                //  ... min radius
BandMax = BandCtr + L*K;                //  ... max radius

BandAmpl = BandMax - BandCtr;

comment("Band Min: ",BandMin," Ctr: ",BandCtr," Max: ",BandMax);

Knowing that, rescaling the pattern to fit the disk limits goes like this:

FillPath = {};

foreach (Path; pt) {

  a = atan_xy(pt);                      // recover angle to point
  r = length(pt);                       //  ... radius to point

  br = (r - BandCtr) / BandAmpl;        // remove center bias, rescale to 1.0 amplitude
  dr = br * (OuterRad - MidRad);        // rescale to fill disk
  pr = dr + MidRad;                     // set at disk centerline

  x = pr * cos(a);                      // find new XY coords
  y = pr * sin(a);

  FillPath += {[x,y]};
}

comment("Path has ",count(FillPath)," points");

The final step prunes coordinates so close together as to produce no useful motion, which I define to be 0.2 mm:

PointList = {FillPath[0]};                // must include first point

lp = FillPath[0];
n = 0;

foreach (FillPath; pt) {
  if (length(pt - lp) <= Snuggly) {       // discard too-snuggly point
    n++;
  }
  else {
    PointList += {pt};                    // otherwise, add it to output
    lp = pt;
  }
}

PointList += {FillPath[-1]};                // ensure closure at last point

comment("Pruned ",n," points, ",count(PointList)," remaining");

The top of the resulting G-Code file contains all the various settings for debugging:

(Disk type: CD)
(Outer Diameter: 117.000mm)
(        Radius: 58.500mm)
(Inner Diameter: 38.000mm)
(        Radius: 19.000mm)
(Mid Diameter: 77.500mm)
(      Radius: 38.750mm)
(Legend Diameter: 30.000mm)
(         Radius: 15.000mm)
(PRNG seed: 674203941)
(Stator 8: 71)
(Rotor: 12 in 1 iterations)
(Dia ratio K: 0.169 1/K: 5.917)
(GCD: 1)
(Lobes: 71)
(Turns: 12)
(Offset L: 3.227 in 1 iterations)
(Rotor Min: 0.662)
(Band Min: 0.286 Ctr: 0.831 Max: 1.376)
(Path has 43201 points)
(Pruned 14235 points, 28968 remaining)

The GCMC source code as a GitHub Gist:

, ,

1 Comment

CNC 3018-Pro: Hard Drive Platter Fixture

A variation on the CD fixture produces a 3.5 inch hard drive platter fixture:

Platter Fixtures - Hard Drive on 3018
Platter Fixtures – Hard Drive on 3018

Which needed just a touch of milling for a snug fit around the platter:

CNC 3018-Pro - HD platter fixture - test fit
CNC 3018-Pro – HD platter fixture – test fit

Tape it down on the 3018’s platform, set XY=0 at the center, and It Just Works™:

CNC 3018-Pro - HD platter fixture - 70 g
CNC 3018-Pro – HD platter fixture – 70 g

The rather faint line shows engraving at -1.0 mm = 70 g downforce isn’t quite enough. Another test with the same pattern at -3.0 mm = 140 g came out better:

CNC 3018-Pro - HD platter fixture - 140 g
CNC 3018-Pro – HD platter fixture – 140 g

It’s in the same OpenSCAD file as the CD fixture, in the unlikely event you need one.

, , ,

3 Comments

MPCNC: Z-Axis Height Probe

A slight modification to the MPCNC LM12UU collet pen holder turns it into a long-reach Z-Axis Height Probe:

CNC 3018-Pro - Z-Axis height probe - overview
CNC 3018-Pro – Z-Axis height probe – overview

A flange on the top plate holds a Makerbot-style endstop switch:

Collet Holder - LM12UU - switch plate - solid model
Collet Holder – LM12UU – switch plate – solid model

The brass probe rod sports a 3/32 inch ball epoxied on its tip, although for my simple needs I could probably use the bare rod:

CNC 3018-Pro - Z-Axis height probe - ball tip detail
CNC 3018-Pro – Z-Axis height probe – ball tip detail

I clamped the rod to extend a bit beyond the plate, where it can soak up most of the switch release travel, leaving just enough to reset the clickiness after each probe:

CNC 3018-Pro - Z-Axis height probe - detail
CNC 3018-Pro – Z-Axis height probe – detail

The probe responds only to Z motion, not tip deflection in XY, so it’s not particularly good for soft objects with sloped sides, like the insole shown above. It works fine for rigid objects and should suffice to figure the modeling workflow.

The bCNC Auto-Level probe routine scans a grid over a rectangular region:

Insole - bCNC AutoLevel Probe Map - detail
Insole – bCNC AutoLevel Probe Map – detail

Which Meshlab turns into a solid model:

Insole - Meshlab triangulation
Insole – Meshlab triangulation

That’s the bottom of the insole probed on a 5 mm grid, which takes something over an hour to accomplish.

The OpenSCAD code as a GitHub Gist:

, ,

Leave a comment

CNC 3018-Pro: Diamond Drag Engraving Test Disk

The smaller and more rigid CNC 3018-Pro should be able to engrave text faster than the larger and rather springy MPCNC, which could engrave text at about 50 mm/min. This test pattern pushes both cutting depth and engraving speed to absurd values:

Engraving Test Pattern - 2019-09-18
Engraving Test Pattern – 2019-09-18

Compile the GCMC source to generate G-Code, lash a CD / DVD to the platform (masking tape works fine), touch off the XY coordinates in the center, touch off Z=0 on the surface, then see what happens:

CNC 3018-Pro - Engraving test pattern - curved text
CNC 3018-Pro – Engraving test pattern – curved text

The “engraving depth” translates directly into the force applied to the diamond point, because the spring converts displacement into force. Knowing the Z depth, you can calculate or guesstimate the force.

Early results from the 3018 suggest it can engrave good-looking text about 20 times faster than the MPCNC:

CNC 3018-Pro - Engraving - speeds
CNC 3018-Pro – Engraving – speeds

You must trade off speed with accuracy on your very own machine, as your mileage will certainly differ!

The GCMC source code as a GitHub Gist:

, , ,

2 Comments

CNC 3018-Pro: Tape-Down Platter Fixture

Diamond drag engraving doesn’t put much sideways force on the platters, so taping the CD in place suffices to hold it:

CNC 3018-Pro - CD taped to platform
CNC 3018-Pro – CD taped to platform

Wrapping a flange around the screw-down platter fixture provides plenty of surface area for tape:

Platter Fixtures - CD on 3018 - tape flange
Platter Fixtures – CD on 3018 – tape flange

Which looks exactly as you think it would in real life:

CNC 3018-Pro - CD fixture - taped
CNC 3018-Pro – CD fixture – taped

Admittedly, masking tape doesn’t look professional, but it’s low-profile, cheap and works perfectly. Blue painter’s tape for the “permanent” hold-down strips on the platform would be a colorful upgrade.

It’s centered on the platform at the XY=0 origin in the middle of the XY travel limits, with edges aligned parallel to the axes. Homing the 3018 and moving to XY=0 puts the tool point directly over the center of the CD without any fussy alignment.

The blue-and-red rings around the center hole assist probe camera alignment, whenever that’s necessary.

The OpenSCAD source code as a GitHub Gist:

, ,

6 Comments

CNC 3018-Pro: LM6UU Linear-bearing Diamond Drag Bit Holder

The CNC 3018-Pro normally holds a small DC motor with a nicely cylindrical housing,so this was an easy adaptation of the MPCNC’s diamond drag bit holder:

CNC 3018-Pro - Diamond bit - overview
CNC 3018-Pro – Diamond bit – overview

The lip around the bottom part rests atop the tool clamp, with the spring reaction plate sized to clear the notch in the Z-axis stage.

The solid model looks about like you’d expect:

Diamond Scribe - Mount - solid model
Diamond Scribe – Mount – solid model

The New Thing compared to the MPCNC holder is wrapping LM6UU bearings around an actual 6 mm shaft, instead of using LM3UU bearings for the crappy diamond bit shank:

CNC 3018-Pro - Diamond bit - epoxy curing
CNC 3018-Pro – Diamond bit – epoxy curing

I cut the shank in two pieces, epoxied them into 3 mm holes drilled into the 6 mm shaft, then epoxied the knurled stop ring on the end. The ring is curing in the bench block to stay perpendicular to the 6 mm shaft.

The spring constant is 55 g/mm and it’s now set for 125 g preload:

CNC 3018-Pro - Diamond bit - force measurement
CNC 3018-Pro – Diamond bit – force measurement

A quick test says all the parts have begun flying in formation:

CNC 3018-Pro - Diamond bit - test CD
CNC 3018-Pro – Diamond bit – test CD

It’s definitely more rigid than the MPCNC!

The OpenSCAD source code as a GitHub Gist:

, ,

2 Comments