Posts Tagged MPCNC
I set up an orthotic shoe insert on the MPCNC and unleashed the Z-Axis height probe on it:
In principle, the grid keeps the object aligned with the machine axes and the blocks put the upper surface more-or-less parallel with the platform. The XY origin, at the G28 location I’ve been using for tool changes, is on the midline of the sole, with Z touched off by probing the platform beside the sole.
The only interesting part of the orthotic is the rigid white plastic plate, which extends about 20 mm into a pocket in the black foam, so the probe area excludes the bendy part.
I’m abusing the bCNC Auto-level probe routine to get the height map, because it produces a tidy file of XYZ coordinates with three header lines describing the overall probe area:
-50 140 39 -50 50 21 -2 35 500 -50 -50 0.11 -45 -50 0.06 -40 -50 0.005
The first two lines give the X and Y coordinate ranges and number of samples. The third line is the Z axis range and probe speed (?). After that, it’s just probed XYZ coordinates, all the way down.
Meshlab can import ASC files consisting of XYZ coordinates, with the ability to skip a specific number of header lines:
If you don’t skip those three lines, then you get three additional points, far off in XYZ space, that will confuse the next step.
Checking the Grid Triangulation box (the default) produces a nicely lofted sheet:
It is, however, a single-sided sheet, not a manifold 3D object. After a few days of screwing around, I’m unable to find any (automatic, reliable, non-manual) way to solidify the thing in Meshlab, so just save it as a PLY file in ASCII format:
Import it into Meshmixer, Ctrl-A to select the whole thing, click (Select →) Edit → Extrude, pick Y-Axis and Flat EndType, then extrude a convenient base in the negative direction:
For whatever reason, some 3D programs show machine-tool coordinates with Z pointing upward and others aim the Z axis at your face. Both must have made sense at the time, because Meshmixer defaults to swapping the Y and Z coordinates on import / export.
The Density slider controls the number of generated faces in the extruded section, so tune for best results.
I have no idea what Harden does.
Accept the result and you have a solid object suitable for further modeling.
A slight modification to the MPCNC LM12UU collet pen holder turns it into a long-reach Z-Axis Height Probe:
A flange on the top plate holds a Makerbot-style endstop switch:
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:
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:
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:
Which Meshlab turns into a solid model:
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:
I’m sure I’ll do this again some time …
Focus the camera at whatever distance needed to clear the longest tooling you’ll use or, at least, some convenient distance from the platform. You must touch off Z=0 at the surface before using bCNC’s probe camera alignment, because it will move the camera to the preset focus distance.
Align the camera’s optical axis perpendicular to the table by making it stare into a mirror flat on the platform, then tweaking the camera angles until the crosshair centers on the reflected lens image. This isn’t dead centered, but it’s pretty close:
The camera will be focused on the mirror, not the reflection, as you can tell by the in-focus crud on the mirror. Whenever you focus the lens, you’ll probably move the optical axis, so do the best you can with the fuzzy image.
You can adjust small misalignments with the Haircross (seems backwards to me) Offset values.
A cheap camera’s lens barrel may not be aligned with its optical axis, giving the lens a jaunty tilt when it’s correctly set up:
With the camera focus set correctly, calibrate the camera Offset from the tool (a.k.a. Spindle) axis:
- Put a pointy tool at XY=0
- Touch off Z=0 on a stack of masking tape
- Put a dent in the tape with the bit
- Move to the camera’s focused Z level
- Make the dent more conspicuous with a Sharpie, as needed
- Register the spindle location
- Jog to center the crosshair on the dent
- Register the camera location
Calibrate the Crosshair ring diameter thusly:
- Put an object with a known size on the platform
- Touch off Z=0 at its surface
- Move to the camera’s focused Z level
- Set the Crosshair diameter equal to the known object size
- Adjust the Scale value to make the Crosshair overlay reality
For example, calibrating the diameter to 10 mm against a shop scale:
At 10 mm above the CD, setting the camera’s resolution to 11.5 pixel/mm:
Makes the outer circle exactly 15.0 mm in diameter to match the CD hub ring ID:
I doubt anybody can find the pixel/mm value from first principles, so you must work backwards from an object’s actual size.
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:
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:
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:
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:
The CNC 3018-Pro router arrived with GRBL 1.1f installed on the Camtool V3.3 board and ran well enough, although it accelerated very slowly. After installing Home switches, figuring out the travel limits, and trying different speeds & accelerations, it runs much better:
Configuration values to remember for next time:
$1=100 turns off the stepper motor drivers after 100 ms of inactivity:
There’s no force worth mentioning on a diamond scribe when the motors stop, so there’s no reason to keep them energized, and the DRV8825 chips resume from the same microstep when re-enabled.
$3=5 reverses the X and Z motor rotation, so you can use the same type of cable on all three axes and have them move the way you’d expect.
$20=1 turns on Soft Limits, thereby producing an error when you (or the G-Code) tries to move beyond the machine’s limits, as defined by the
$120 $121 $122 values relative to the Home switch positions.
$21=0 leaves Hard Limits off, because I didn’t see much point in switches on both ends of all the axes for this little bitty machine.
$22=1 enables the Home cycle, after which you must start each session by homing the machine.
$27=1.000 sets the Pull-off distance from all three Home positions, so the machine ends up at absolute XYZ = -1.000 mm relative to the switch trip points after homing. This depends on the mechanics of the limit switches, but seems OK with the MBI-style switches I used:
$100 $101 $102 = 1600 set the XYZ step/mm, which requires knowing the 3018-Pro uses two-start leadscrews with a 2 mm pitch = 4 mm lead:
The Camtool V3.3 board hardwires the DRV8825 stepper controllers into 32 microstep mode, so:
1600 step/mm = (200 full step/rev) × (32 microstep/full step) / (4 mm/rev)
$110 $111 $112 = 1100 set the maximum speed along the XYZ axes in mm/min. Note the hard upper limit set by the maximum microcontroller interrupt rate of about 40 k/s:
1500 mm/min = 25 mm/s = (40×10³ step/s) / (1600 step/mm)
I’ll have more to say about speed limits, stepper current, torque, and similar topics.
$120 $121 $122 = 3000 set the acceleration along the XYZ axes in mm/sec². These are two orders of magnitude higher than the default acceleration, which accounts for the as-received sluggish acceleration.
$130=299.000 $131=179.000 $132=44.000 set the XYZ travel limits relative to the Home switch trip points, which feed into the
$20=1 Soft Limits. You could probably eke out another millimeter along each axis, but this is what I came up with.
With all those in place, the
G54 coordinate system puts the XY origin dead in the middle of the platform and the Z origin a little bit below its upper travel limit. Set them thusly:
G10 L2 P1 X-147 Y-90.6 Z-1.5
The original and tweaked GRBL configuration settings as a GitHub Gist:
The as-shipped configuration is mostly for reference, but ya never know when it might come in handy.
The Raspberry Pi running the MPCNC recently seized up with baffling symptoms, which generally indicates the poor little MicroSD card serving as a “hard disk” has failed:
I managed to open a terminal emulator, whereupon all of the non-built-in shell commands couldn’t be found.
Proceed as before: binary-copy the entire MicroSD card to another one, pop it in the RPi, and it’s all good again.
For the record, the new card is an unused Samsung Evo Plus. I do not understand the difference between the “Evo Plus” and “Evo+” branding, other than to suspect one of being a very good fake.
In round numbers, MicroSD cards seem to last a year under what seems like not-too-demanding service; I’m not running the MPCNC all day, every day.
My collection of old USB cameras emitted a Logitech Quickcam for Notebooks Deluxe, with a tag giving a cryptic M/N of V-UGB35. Given Logitech’s penchant for overlapping names, its USB identifiers may be more useful for positive ID:
ID 046d:08d8 Logitech, Inc. QuickCam for Notebook Deluxe
It works fine as a simple V4L camera and its 640×480 optical resolution may suffice for simple purposes, even if it’s not up to contemporary community standards.
The key disassembly step turned out to be simply pulling the pivoting base off, then recovering an errant spring clip from the Laboratory Floor:
The clips have a beveled side and fit into their recesses in only one orientation; there’s no need for brute force.
Removing the two obvious case screws reveals the innards:
Three more screws secure the PCB:
The ribbed focus knob around the lens makes it more useful than a nominally fixed-focus camera.
Reassembly is in reverse order.
I miss having obvious case screws …