Archive for category Electronics Workbench

DRV8825 Stepper Driver: Forcing Fast Decay Mode in a (Likely) Counterfeit Chip

The DRV8825 stepper driver chip defaults to mixed decay mode, which TI defines thusly:

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:

3018 XY - Mixed Fast - 24V - 10mm-min 12V 1A-div
3018 XY – Mixed Fast – 24V – 10mm-min 12V 1A-div

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:

3018 X - ripple 1 step - 18V - A0 B-90 500mA-div
3018 X – ripple 1 step – 18V – A0 B-90 500mA-div

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:

DRV8825 pinout
DRV8825 pinout

Which sits on an inconveniently skinny little PCB pad, fifth from the left on the bottom:

DRV8825 PCB - open Decay pin
DRV8825 PCB – open Decay pin

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:

DRV8825 DECAY pin settings
DRV8825 DECAY pin settings

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:

DRV8825 PCB - Decay pin wired low
DRV8825 PCB – Decay pin wired low

On the scale of TSSOP packages, even 30 AWG Wire-Wrap wire looks like a bus bar!

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.


, , ,

Leave a comment

Raspberry Pi vs. MicroSD: Another One Bites the Dust

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:

Defunct Sandisk Ultra 32 GB MicroSD
Defunct Sandisk Ultra 32 GB MicroSD

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.

, ,


Alligator Clip Lead Refurbishing

So this happened when I grabbed an alligator clip lead:

Dual Alligator Clip Collection
Dual Alligator Clip Collection

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:

Alligator clips - bent wire
Alligator clips – bent wire

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:

Black Dual Alligator - as manufactured
Black Dual Alligator – as manufactured

The most obvious effect is high end-to-end resistance:

Black Dual Alligator - before - A
Black Dual Alligator – before – A

Yes, yes, 122 Ω in an alligator clip lead is high.

The test setup isn’t particularly intricate:

Black Dual Alligator - test setup
Black Dual Alligator – test setup

The lackadaisical crimps also have unstable resistances:

Black Dual Alligator - before - B
Black Dual Alligator – before – B

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:

Black Dual Alligator - soldered
Black Dual Alligator – soldered

I won’t win any soldering awards, but the resistance is way better than before:

Black Dual Alligator - after
Black Dual Alligator – after

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:

Copper-plated steel wire
Copper-plated steel 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.

I was mildly tempted to replace the wire with good silicone-insulated copper, but came to my senses; those “high voltage” silicone test leads will be Good Enough for higher-current connections.

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:

Crimped Alligator Clips - as manufactured
Crimped Alligator Clips – as manufactured

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:

Crimped Alligator Clips - soldered - Made In Japan
Crimped Alligator Clips – soldered – Made In Japan

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:

Crimped Alligator Clips - cut and soldered
Crimped Alligator Clips – cut and soldered

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!


Leave a comment

CNC 3018-Pro: CAMTool Modification for MBI-style Home Switches

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:

3018 CNC CAMTool - Endstop power mod
3018 CNC CAMTool – Endstop power mod

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:

3018 CNC CAMTool - Endstop power mod - alignment
3018 CNC CAMTool – Endstop power mod – alignment

Slobber on some epoxy and let it cure:

3018 CNC CAMTool - Endstop power mod - epoxy curing
3018 CNC CAMTool – Endstop power mod – epoxy curing

And then It Just Works™:

3018 CNC CAMTool - Endstop power mod - installed
3018 CNC CAMTool – Endstop power mod – installed

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.


1 Comment

Logitech “Quickcam for Notebooks Deluxe” USB Camera Disassembly

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:

Logitech V-UGB35 USB Camera - mount removed
Logitech V-UGB35 USB Camera – mount removed

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:

Logitech V-UGB35 USB Camera - PCB rear
Logitech V-UGB35 USB Camera – PCB rear

Three more screws secure the PCB:

Logitech V-UGB35 USB Camera - PCB front
Logitech V-UGB35 USB Camera – PCB front

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 …


1 Comment

Warm-White LED Strip: FAIL

The roll of warm-white LEDs I used for the first sewing machine lights has evidently aged out:

Failed warm-white LED strip
Failed warm-white LED strip

They’ve been wrapped on their original roll, tucked in an antistatic bag, for the last five years, so it’s not as if they’ve been constantly abused.

All the cool-white LEDs on an adjacent roll in the same bag still work perfectly, so you’re looking at inherent vice.

I harvested the three longest functional sections and dumped the remainder in the electronics recycling box.

COB LEDs provide much more light, if only because they run at higher power densities, and seem to be much better cost-performers:

Juki TL-2010Q COB LED - installed - rear view
Juki TL-2010Q COB LED – installed – rear view

Admittedly, I haven’t looked at the RGB LED strips in a while, either.


Leave a comment

Baofeng UV-5R Squelch Settings

The Baofeng UV-5R radios on our bikes seem absurdly sensitive to intermodulation interference, particularly on rides across the Walkway Over the Hudson, which has a glorious view of the repeaters and paging transmitters atop Illinois Mountain:

Walkway Over The Hudson - Illinois Mountain Antennas
Walkway Over The Hudson – Illinois Mountain Antennas

A better view of the assortment on the right:

Illinois Mountain - North Antennas
Illinois Mountain – North Antennas

And on the left:

Illinois Mountain - South Antennas
Illinois Mountain – South Antennas

Not shown: the Sheriff’s Office transmitter behind us on the left and the Vassar Brothers Hospital / MidHudson pagers on either side at eye level. There’s plenty of RFI boresighted on the Walkway.

Anyhow, none of the Baofeng squelch settings had any effect, which turned out to be a known problem. The default range VHF covered a whopping 6 dB and the UHF wasn’t much better at 18 dB, both at very low RF power levels.

We use the radios in simplex mode, generally within line of sight, so I changed the Service Settings to get really aggressive squelch:

Baofeng UV-5R - Improved Squelch Settings
Baofeng UV-5R – Improved Squelch Settings

I have no way to calibrate the new signal levels, but I’d previously cranked the squelch up to 9 (it doesn’t go any higher) and, left unchanged, the new level makes all the previous interference Go Away™. Another ride over the Walkway with the squelch set to 4 also passed in blissful silence.

If the BF-F9 levels mean anything on a UV-5R, that’s about -100 dBm, 20 dB over the previous -120 dBm at squelch = 9.

The new squelch levels may be too tight for any other use, which doesn’t matter for these radios. As of now, our rides are quiet.

[Update: Setting the squelch to 5 may be necessary for the Walkway, as we both heard a few squawks and bleeps while riding eastbound on a Monday afternoon. ]