Posts Tagged MPCNC
$$ command (in the first line) produces output in exactly the format it will accept as input, so just pour the captured file into GRBL’s snout. I used
ascii-xfr with a 250 ms line delay:
ascii-xfr -s -v -l 250 MPCNC-GRBL.cfg > /dev/ttyACM0
Now, to be fair, the MPCNC hasn’t yet done any useful work, but it moves.
$22=1 requires home switches to be installed and working, with
$23=7 putting them on the negative end of the axes, which may not work well in practice. In particular, having the Z axis homing downward is just plain dumb.
The step/mm values in
$10 require 1/16 microstepping with 2 mm belts on 16 tooth motor pulleys. The MPCNC’s Marlin config uses 1/32 microstepping, which doubles the step frequencies and (IMO) doesn’t provide any tangible benefit.
The speeds in
$11=6000 seem aggressive, although they actually work so far.
The accelerations in
$12 may push the motors too hard with anything installed in the toolholder.
The travel limits in
$13 depend on the rail lengths you used.
The Protoneer Arduino CNC shield (*) has a row of 2-pin headers for bare endstop switches. Being a big fan of LED Blinkiness, I have a stock of 3-pin Makerbot-style mechanical endstops that require a +5 V connection in addition to ground and the output.
A crude-but-effective adapter consists of half a dozen header pins soldered to a length of stout copper wire, with a pigtail to a +5 V pin elsewhere on the board:
A closer look:
The pins get trimmed on the other side of the bus wire, because they don’t go through the PCB.
Installed on the board, it doesn’t look like much:
Looks like it needs either Kapton tape or epoxy, doesn’t it?
Three more endstops at the far end of the MPCNC rails (for hard limits) will fill the unused header pins.
(*) It’s significantly more expensive than the Chinese knockoffs, but in this case I cheerfully pay to support the guy: good stuff, direct from the source.
Being a big fan of having a CNC machine know where it is, adding endstops (pronounded “home switches” in CNC parlance) to the Mostly Printed CNC axes seemed like a good idea:
All the mounts I could find fit bare microswitches of various sizes or seemed overly complex & bulky for what they accomplished. Rather than fiddle with screws and nut traps / inserts, a simple cable tie works just fine and makes the whole affair much smaller. Should you think cable ties aren’t secure enough, a strip of double stick tape will assuage your doubts.
A snippet of aluminum sheet moves the switch trip point out beyond the roller’s ball bearing:
I’m not convinced homing the Z axis at the bottom of its travel is the right thing to do, but it’s a start:
Unlike the stationary X and Y axes, the MPCNC’s Z axis rails move vertically in the middle block assembly; the switch moves downward on the rail until the actuator hits the block.
Perforce, the tooling mounted on the Z axis must stick out below the bottom of the tool carrier, which means the tool will hit the table before the switch hits the block. There should also be a probe input to support tool height setting.
The first mount fit perfectly, so I printed four more in one pass:
All three endstops plug into the RAMPS board, leaving the maximum endstop connections vacant:
Obviously, bare PCBs attached to the rails in mid-air aren’t compatible with milling metal, which I won’t be doing for quite a while. The electronic parts long to be inside enclosures with ventilation and maybe dust filtering, but …
The switches operate in normally open mode, closing when tripped. That’s backwards, of course, and defined to be completely irrelevant in the current context.
Seen from a high level, these switches set the absolute “machine coordinate system” origin, so the firmware travel limits can take effect. Marlin knows nothing about coordinate systems, but GRBL does: it can touch off to a fixture origin and generally do the right thing.
The OpenSCAD source code as a GitHub Gist:
The MPCNC kit includes five Automation Technology KL17H248-15-4A stepper motors:
If link rot should set in, a direct rip from the website:
NEMA 17 BIPOLAR STEPPER MOTOR, KL17H248-15-4A, 76 oz-in
Shaft: 5mm diameter with flat
Current Per Phase: 1.5A
Holding Torque: 5.5Kg.cm (76 oz-in)
Rated Voltage: 4.2V
NO.of Phase: 2
Step Angle: 1.8° ± 5%
Resistance Per Phase: 2.8Ω± 10%
Inductance Per Phase: 4.8mH± 20%
Insulation Class: Class B
Dielectric Strength: 100Mohm
Operation Temp Range: -20 ~ +40° C
Lead Wire: 22AWG / 750mm with connector to stepper motor driver
A nice torque curve:
The present MPCNC design wires the motors on each end of X / Y axes in series. Each motor has 2.8 Ω of DC resistance = 5.6 Ω total and, given the small wire gauge (allegedly 22 AWG on the motors and unspecified for any eBay cables) and six (!) teeny header pins in series along the wires for each winding, a total series resistance of 6 Ω seems reasonable and is, in fact, what I measure with an ohmmeter.
The stepper drivers arrived preset for 1 A peak:
The vertical scale is 500 mA/div. The waveform comes from a 10 mm move at 5000 mm/min = 83 mm/s, which is absurdly fast for such a machine, particularly seeing as how the default firmware limits it to 190 mm/min = 3 mm/s. Cutting speeds will be much lower than either of those.
The default DRV8825 current-setting pot setting was 600 mV, for a nominal current motor current of 1.2 A peak. That’s reasonably close to the measurement, all things considered.
However, because the motors run from a 12 V supply at 1 A, the winding and wiring losses mean they operate at a bit over 8 V: much much less than the nominal 24 and 32 V plotted in the torque curve. More voltage = faster response to microstep current changes = higher top speed. At sensible speeds, this surely does not matter.
The default DRV8825 stepper driver module jumpers select 32 microsteps = 6400 step/rev, a factor of four higher than the chart.
Part of the tweakage will be to sort that out; a 24 V supply may be in order. Driving each motor separately (as required for automatic de-racking homing) at 1.5 A/phase would require
3 1.5×√2 A/motor × 5 motors = 15 10.5 A, which seems excessive even to me, particularly in light of sending it across a RAMPS board. At 1 A/phase, you need 10 7 A, which falls within the realm of reason and would be kinder to the PLA motor mounts. It’s not clear boosting the motor voltage will produce any real benefit, although giving the drivers more headroom seems reasonable.
The GT2 drive belts have 2 mm pitch, so the 16 tooth drive pulleys move 32 mm/rev and require 200 step/mm, which seems high to me. At a nice round 100 mm/s, the steppers must tick along at 20 k step/s, half of Marlin’s top speed, which may explain some of the roughness around 80 mm/s.
The torque curve suggests the motors want to run under 200 RPM = 3.3 rev/s = 100 mm/s with the stock 16 tooth pulley. No problem with those numbers!
Using 16:1 microstepping would produce 3200 step/rev, 100 step/mm, thus half the step rate at any speed. Reducing the driver step frequency can’t possibly be a Bad Thing for Marlin.
To the end of documenting colors, connectors, and connections for the MPCNC stepper motors …
At the stepper motors:
The plug for the stepper at the end of the harness:
I opted to match the “pin 1” marks on the connectors, because that’s easy to remember, although it puts the pin latches on opposite sides:
Some obligatory Kapton tape holds the two connectors together.
The joint at the middle of the harness, with the near-end stepper cable on the upper left:
At the RAMPS driver end of the cable:
The Z-axis extension cable, with the stepper cable on the right:
I plugged the cables into the RAMPS board with the “pin 1” mark at the A1A2 end of the connectors.
With all the wires in place (and the GT2 drive belt still in its bag), I stuck masking tape tabs on the motor shafts, connected the RAMPS board, and verified the directions:
Although the Y axis needed reversing, both pairs of motors turned in the same direction!
Being that type of guy, I reversed the Y axis direction in the firmware configuration, because it’s easier for me to make all the physical connections look the same than (try to) remember to flip the Y axis connector whenever I must reconnect the cable to the driver.
A Mostly Printed CNC machine from Vicious1 provides an easily configured platform for low-force CNC activities like plotting, vinyl cutting, PCB milling, and maybe wood / plastic / wax routing with a suitable dust vacuum / downdraft table / enclosure. Despite many videos, the notion of open-air laser cutting remains a non-starter around here.
I opted for the Parts Bundle (all the “vitamins” required, from RAMPS controller to locknuts, to assemble the machine) and the Printed Parts Bundle (all the printed components), then picked up four 10 foot lengths of 3/4 inch ID = 23.5 mm OD galvanized steel conduit locally. Yes, I have a 3D printer, but the notion of feeding two spools of plastic through it over the course of 100++ printing hours, plus figuring out how to get the tolerances right, convinced me to regard this as a kit project, not a design-and-build project.
The first trial assembly atop a new workbench went reasonably smoothly:
I missed the step where you must put the high rails parallel to the X axis, which I want along the length of the table, and had to disassemble and rebuilt the frame to rotate the Middle Assembly a quarter turn clockwise. It’s always easier the second (or third) time and, if you regard the first few passes as dry runs / learning experiences, the process can be soothing, rather than annoying.
A laser rangefinder dramatically simplifies squaring and de-skewing the rails:
I wanted 24+ inches along the X axis and 18+ inches along the Y, so as to handle stock sizes with hard-inch measurements.The current MPCNC design adds about 11 inches to each axis outside the work area, which makes the footprint 35 × 29 (-ish) inches overall. The bench measures 30 inches front-to-back, I allowed an inch along the front to recess the moving parts, and the final frame measures 37+ × 30+ inches to the outside of all the gadgetry.
Within that footprint, the laser says the rails are 845 × 674 mm = 33 × 26+ inch apart, giving a work area of 640 × 475 mm = 25+ × 19- inch.
After some careful surveying, I marked / punched / drilled holes for each mounting foot, then counterdrilled brass inserts on the bottom for that nice clean look:
The screws came out flush when mounted atop washers:
My “careful surveying” produced a 1 mm error over the internal 1 meter diagonal, but a bit of judicious hole filing let me squash the long diagonal and stretch the short one by Just Enough to make the answer come out right, at least according to the laser rangefinder.
Setting the rail height goes more easily with a height gauge:
Stipulated: the absurdity of a height gauge on a plywood tabletop. On the other paw, the corner posts rest on that same plywood, so it actually works pretty well. I slowly pried the three lowest caps upward with the Big Screwdriver, levered on a wood block, to set all the rails to the same height as the highest one.
The X axis rails may need mid-rail supports, although I don’t see any meaningful deflection right now.
One could mount a T-nut atop the table inside each foot (and the center brace, as needed), with a long-ish bolt (head below the table) pushing the corner joint upward, which might be more stable than the current plastic-on-steel compression grip.
The steppers mount on rollers gripping the rail with six bearings, plus two more bending the GT2 drive belt (not installed yet) upward to the motor drive pulley:
I devoted a few quiet hours to threading four-wire cables through 6 mm PET braided sleeves, in hope of protecting the PVC insulation from the usual abrasion & bending stresses. I have some drag chains which may come in handy, although they seem overly klunky for the purpose.
I’m not entirely convinced a PLA stepper mount is a Good Thing, given the warmth of steppers and PLA’s 60 °C glass transition temperature. We’ll see how it goes; obviously, one should not leave PLA parts in one’s car during a hot summer afternoon, either.
The neatly sheathed stepper cable vanishes into the center rail held firmly by the stepper mount. An identical stepper mount grips the other end of the rail, with the motors wired in series. The conduits provide a tidy way to pass wires along the length and width of the frame.
After you install and tension the belts, tweak the pulley location so the 6 mm belt tracks more-or-less in the middle of the 9 mm tooth width:
The hulking Middle Assembly grips the X and Y cross bars:
It has six printed parts, three each in two matching pairs, 24 bearings in eight triples, and plenty of 5/16 inch bolts + locknuts holding it together: all the metal bits make it weigh a lot more than you’d expect.
The Z axis rails fit into the two pairs of three bearings facing you:
You’ll note the correct Middle Assembly orientation, after I rearranged the frame with the high rails along the X axis. Home switches will eventually fit neatly on the untraveled rail sections near the front-left corner post.
I left the work height at the default 4 inches, which specifies a minimum 7 inch = 175 mm leadscrew. The actual leadscrew is 300 mm = 8 inch, which completely explains the situation. I’ll rebuilt the Z axis with longer rails, but this suffices for now.
The concave silvery part joining the Z axis struts is the tool mount, to which you screw a tool holder:
That’s the Official Drag Knife / Pen Holder, generally seen with a Sharpie ziptied in place, but I have Real Plotter Pens, dammit, and I’m going to use them! The holder has one hole dangling to put the pen nib below the end of the leadscrew.
All in all, I like it …