Posts Tagged Improvements
Mixed decay mode begins as fast decay, but at a fixed period of time (75% of the PWM cycle) switches to slow decay mode for the remainder of the fixed PWM period. This occurs only if the current through the winding is decreasing (per the indexer step table); if the current is increasing, then slow decay is used.
The 24 V supply on the CNC 3018-Pro provides too much voltage for the motors, because slow decay mode can’t handle those rising slopes:
Note that “rising” means the current increases with either polarity from 0 A at the midline. The DRV8825 uses a MOSFET H-bridge to drive winding current in either direction from the +24 V motor supply voltage.
Both traces show motor winding current at 1 A/div, with the XY axes creeping along at 10 mm/min (thus, 7.1 mm/min each). The upper trace is the X axis, with a stock DRV8825 module in mixed decay mode. The lower trace is the Y axis, with its DRV8825 hacked into fast decay mode.
The basic problem, about which more later, comes from the current rising too fast during each PWM cycle:
V = L di/dt di/dt = 24 V / 3 mH = 8 kA/s
The first 1:32 microstep away from 0 calls for 5% of max current = 50 mA at a 1 A peak. The DRV8825 datasheet says the PWM typically runs at 30 kHz = 33 µs/cycle, during which the current will change by 270 mA:
267 mA = 8 kA/s × 33.3 µs
Some preliminary measurements suggest these (probably counterfeit) DRV8825 chips actually run at 16 kHz = 66 µs/cycle:
During those cycles the current can increase by more than 500 mA. The first scope picture shows an abrupt increase to maybe 700 mA, so, yeah, that’s about right.
Having the wrong current in one winding means the motor isn’t positioned correctly during those microsteps. The 3018-Pro runs at (an absurd) 1600 µstep/mm, so being off by even a full step isn’t big deal in terms of positioning.
The real problem comes from running nearly 1 A through both windings. Those little motors run really hot: they’re dissipating twice what they should be.
Anyhow, the pin layout shows the DRV8825 DECAY mode selection on pin 19:
Which sits on an inconveniently skinny little PCB pad, fifth from the left on the bottom:
Memo to Self: Don’t make that mistake when you lay out a PCB. Always put a little pad or via on a disconnected pin, so as to have a hand-soldering target big enough to work with.
The objective is to pull the pin high:
Pin 15, in the lower left corner, provides the output of a 3.3 V linear regulator, with its PCB trace connected to the left side of the ceramic cap:
Those are two different PCBs. The crappy TI logos, not easily visible in those low-res pix, on both ICs suggest they’re by-now-typical counterfeits, so seeing a factor-of-two difference in PWM frequency isn’t surprising.
So this happened when I grabbed an alligator clip lead:
My coax cable and clip lead collection includes everything from “I’ve had it forever” to “Recent cheap crap”, including much of Mad Phil’s collection. Some of the recent crap included Chinese clip leads with what can charitably be described as marginal connections:
The insulation may provide some compliance in the crimp, but the alligator clip itself consists of cheap steel which won’t hold a crimp, even if it was crimped firmly to start with.
As a rule, the crimps aren’t particularly good:
The most obvious effect is high end-to-end resistance:
Yes, yes, 122 Ω in an alligator clip lead is high.
The test setup isn’t particularly intricate:
The lackadaisical crimps also have unstable resistances:
So I figured I may as well repair the lot of ’em.
I stripped the lead back to expose fresh copper, soldered it to the clip, then re-crimped the clip around the insulation for some token strain relief:
I won’t win any soldering awards, but the resistance is way better than before:
If more than half an ohm seems a tad high for a foot of copper wire, you’re right. My slightly magnetized bench screwdriver shows it’s not copper wire:
I’d say it’s copper-plated steel, wouldn’t you?
Those of long memory will recall the non-standard ribbon cable I used as a 60 kHz loop antenna. In this case, the Chinese manufacturer figured nobody would notice or, likely, care. Given the crappy overall quality of the end product, it’s a fair assumption.
While I was at it, I pulled apart my entire collection just to see what was inside and fix the ailing ones. These clips date back to the dawn of time, with what started as excellent crimps:
Alas, after I-don’t-know-how-many decades, they’re not longer gas-tight, so I soaked a dollop of solder into each one:
Chekkitout: “Made In Japan”.
Someone, perhaps me wearing a younger man’s clothes or, less likely, Mad Phil in a hurry, solved a similar problem with bigger blobs and no strain relief:
So, now I have a slightly better collection of crappy alligator clip leads. The copper-plated steel wires will eventually fail, but it should become obvious when they do.
Test your clip leads today!
The bathroom drain rod slipped out of the pop-up stopper, giving me the opportunity to see how well it’s surviving:
After not quite two years, it’s not obviously rotting away.
Life is good …
The CNC 3018-Pro doesn’t absolutely need home switches, but (in principle) they let you install a workholding fixture at a known position, home the axes, pick a preset coordinate system for the fixture, and not have to touch off the axes before making parts.
Having used Makerbot-style endstop switch PCBs for the MPCNC, this was straightforward:
The X and Z axis switches simply press against the appropriate moving parts:
The little tab stuck on the tool clamp provides a bit of clearance around the upper part of the X axis assembly.
The Y axis switch needed a slightly tapered tab to extend the bearing holder:
It’s made from a random scrap of clear plastic, hand-filed to suit, and stuck on the bearing to trigger the switch in exactly the right spot.
You can find elaborate switch mounts on Thingiverse, but I’ve become a big fan of genuine 3M outdoor-rated foam tape for this sort of thing: aggressive stickiness, no deterioration, possible-but-not-easy removal.
The switches need +5 V power, so add a small hack to the CAMTool V3.3 control board to let the connectors plug right in:
The solid models borrow their central depression around the switch terminals from the MPCNC blocks:
The OpenSCAD source code as a GitHub Gist:
The dimension doodles:
The Protonteer board I used on the MPCNC required a few additional pins for power to Makerbot-style home switches, so it’s no surprise the CAMTool V3.3 board on the CNC 3018-Pro gantry mill requires a similar hack:
The white jumper plugs into the single +5 V pin in the row and is soldered to a straight wire running along the entire row of header pins. I pushed the black plastic strip to the bottom, soldered the wire along the pins atop it, then clipped off the pins so they’re about the right height when flush against the PCB.
Use a two-row socket to hold the new row in alignment with the existing header:
Slobber on some epoxy and let it cure:
And then It Just Works™:
Well, after you install the switches and tell GRBL to use them …
Reminder: If you intend to put limit switches on both ends of the axis travel, you must clip the NC lead from both MBI switches. One switch per axis will work the way you expect and that’s how I’m using them here.
If you regard your new CNC 3018-Pro Router kit as a box of parts which could, with some adjustments and additional parts, become a small CNC router, you’re on the right track.
In my case, the aluminum extrusions arrived somewhat squashed inside their well-padded foam shipping carton, which leads me to believe the factory responsible for tapping the bolt holes in the ends must be a fairly nasty place. In any event, the hammerhead T-nuts for the gantry struts simply didn’t fit into some sections of the slots, although they worked fine elsewhere.
So, file a smidge off the rounded sides of a few nuts:
Which let them slide into place and rotate properly despite the bent channel:
The assembly instructions used a word I’d never encountered before:
Turns out ubiety is exactly correct, but … raise your hand if you’ve ever heard it in polite conversation. Thought so.
I’ve not noticed any harm from rounding off the position to 46 mm; just position both struts the same distance from the rear crossbar and it’s all good.
The struts behind the CAMTool CNC-V3.3 electronics board were also squashed, prompting a bit more filing:
The CAMTool board is basically an Arduino-class microcontroller preloaded with GRBL 1.1f and surrounded with spindle / stepper driver circuits.
As with the MPCNC, I’ll dribble G-Code into it from a Raspberry Pi. Alas, the struts behind the CAMTool board are on 75 mm centers, but the Pi cases on hand have feet on 72-ish mm centers. Pay no attention to the surroundings, just drill the holes in the right spots:
Add more T-nuts and short button head screws, with rubber pads between the case and the struts:
It’s coming together!
UseIPv6 off ServerName "PiHole" DefaultRoot /mnt/cameras RequireValidShell off
The cameras use the BusyBox
ftpput command to stash their images (with the hostname prepended), which requires a few changes to
motion.conf in the cameras:
ftp_snapshot=true ftp_host="192.168.1.2" ftp_port=21 ftp_username=$(/bin/hostname) ftp_password="make up your own" ftp_stills_dir=$(/bin/hostname)
The last line uses a separate directory for each camera, although they quickly ran into the FAT32 limit of 64 K files per directory; reformatting the USB stick with an
ext3 filesystem solved that problem.
Fortunately, nothing much ever happens around here …