Bafang Battery Charge Port: Whoopsie

The Bafang mid-drive e-bike kits I installed on Mary’s Tour Easy recumbent and a friend’s Terry Symmetry used the “Ultra-Slim Shark” lithium battery, a rectangular lump with a tapered snout:

Bafang BBS02 - Terry Symmetry full assembly
Bafang BBS02 – Terry Symmetry full assembly

The battery has a key lock on its left side:

Bafang battery - lock
Bafang battery – lock

The lock might deter casual thievery, but really prevents the battery from bouncing out of its mounting plate while riding.

The right side has a charge port closed with a rubber plug:

Bafang battery - charge port - closed
Bafang battery – charge port – closed

The cover protects a coaxial jack with a 5.5 mm OD and a 2.1 mm center pin:

Bafang battery - charge port
Bafang battery – charge port

My friend in Raleigh generally removes the battery before hoisting the bike into the back of her car to haul it to a friend’s house for their companionable rides: not lifting an additional seven pounds is a Good Idea™.

A momentary distraction in the middle of that process caused her to insert the brass key into the charging port, rather than the lock. The key put a very short circuit between the coaxial jack’s side contact and the center pin, melting the key tip and welding a brass nugget onto the side of the pin:

Bafang battery - damaged charge port
Bafang battery – damaged charge port

The charger plug normally sits almost flush to the port’s surface:

Bafang battery - charge plug
Bafang battery – charge plug

The nugget keeps the plug out the damaged port, preventing the plug from making electrical contact:

Bafang battery - damaged port - plug
Bafang battery – damaged port – plug

She owned the problem and immediately bought another battery, which tells you the value she places on riding her e-bike.

Verily it is written: let someone who is without whoopsie cast the first shade.

Any takers? Yeah, the way I see it, someone who says they’ve never done anything quite like that is either not doing anything or not telling the complete truth. For sure, I’ve done plenty of inadvertent damage!

Here’s the problem:

  • The damaged battery is the better part of 600 miles away from my shop
  • Civilians cannot ship 560 W·hr lithium batteries through any parcel delivery service
  • Civilians cannot fly or take the train with such a battery, either
  • Driving 1200 miles twice is out of the question for either of us

How would you proceed?

More to come …

For reference:

Basically, it is possible to ship lithium batteries up to 100 W·h.

Raymond Avenue Road Furniture Graveyard

Apparently the traffic calming features along Raymond Avenue sacrifice the road furniture:

Smashed Raymond Avenue Road Furniture
Smashed Raymond Avenue Road Furniture

I hadn’t realized the “standards compliant” road design caused the death of so many street lights, but the dead bollard population is definitely under-represented. In round numbers, every traffic circle (“intersection”) always has at least one smashed bollard in addition to the vestigial stumps of those removed rather than being replaced.

The upright bollard is a relic of the earliest installations, back before they realized a bollard with an eye-level light glaring into drivers’ eyes weren’t an effective design, particularly along a road lined with dead-black / non-reflective posts.

Spotted in the Town of Poughkeepsie Highway Department compound.

DIY e-Bike Conversions & Solid Modeling: Presentation

I’ll be talking about e-bikes and the solid modeling required to hang a Bafang motor and battery on your favorite bike for the Poughkeepsie Chapter of the ACM at 1930 EDT this evening:

Bafang Battery Mount - Show view
Bafang Battery Mount – Show view

It’s a Zoom meeting, so (in the unlikely event you have nothing better to do) you could actually “attend”. The ACM meeting description and the Meetup announcement will get you there.

A PDF of the presentation slides (remember slides?) includes copious linkies to sources / blog posts / distractions:

If you’re only in it for the geometry, the OpenSCAD source code lives slumbers in a pair of GitHub Gists:

Tour Easy

Terry Symmetry

Enjoy …

Bafang Headlight Circuit Current Limit

Having just replaced Rev 1 of the amber running light with Rev 3 (about which, more later) on Mary’s Tour Easy, both the front and rear lights began blinking erratically. Given that they have completely independent circuitry, this strongly suggests a power problem.

Herewith, the headlight circuit voltage:

Bafang headlight voltage - two 1 W running lights
Bafang headlight voltage – two 1 W running lights

The voltage should be a constant 6 or 6.3 V, depending on which description you most recently read. That is the case with only one light attached, so the problem occurs only when running both lights.

The four pulses come from the amber LED’s Morse code “b” (dah-dit-dit-dit) with a 85 ms dits; the first dah pulse should be three times longer than the dits and definitely isn’t. The rear light’s red LED stays on continuously, except for two dark dits, so it draws a constant current and does not produce any changes in this trace.

Both lights have 2.0 Ω sense resistors setting the LED current to 400 mA, which corresponds to 250 mA each from the Bafang controller’s 6.3 V headlight circuit. The headlight circuit’s total of 500 mA should work fine, although the “spec” seems to be basically whatever the OEM headlight requires.

The Rev 1 amber light ran the LED at 360 mA with a supply current around 450 mA. That light and the rear light on the back ran fine, so the supply seems to have a hard maximum current limit at (a bit less than?) 500 mA.

The least-awful solution seems to be backing off both LED currents to 360 mA to keep the total supply current well under 500 mA.

Running Light Waveforms: A Closer Look

A test setup on the bench allows a bit more room for probes:

1 W Amber LED - MP1584 pulse setup
1 W Amber LED – MP1584 pulse setup

Some heatsink tape holds the LED to the far side of that oversize heatsink.

The input signal (top trace) arrives from a function generator set to blip the MP1584 regulator’s Enable input at 4 Hz with a 7 ms pulse:

Amber 1 w LED - pulse 200 mA-div
Amber 1 w LED – pulse 200 mA-div

The purple trace is the voltage across the 2 Ω sense resistor. The MP1584 datasheet says the regulator soft-starts for (typically) 1.5 ms, during which the output ramps upward at 600 mV/ms to 800 mV , whereupon the actual regulation commences. The amber LED forward drop adds 2.5 V to the sense voltage, so the regulator produces 3.3 V from the 6.3 V bench supply input.

The cyan trace is the output current through the LED and sense resistor, also ramping up to 800 mV/2 Ω = 400 mA to drive the LED at 1 W.

The furry section shows when the regulator is actively regulating, with the output voltage rising and falling over a small range to maintain the average current (via the sense voltage). Successive Enable pulses may have longer, shorter, or completely missing fur, with no predictable pattern. Increasing the duty cycle doesn’t affect the results, with the fur sometimes extending for the entire pulse and sometimes being completely missing.

I think the regulator can settle in one of two metastable states. The best case has a constant voltage producing a constant LED current, with the sense voltage remaining within whatever deadband keeps the error amplifier happy. When something knocks the sense voltage out of the deadband, the error amp starts the usual regulation cycle, which will stop when the minimum or maximum voltage of a cycle remains within the deadband:

Amber 1 w LED - pulse - detail - 200 mA-div
Amber 1 w LED – pulse – detail – 200 mA-div

The ripple shows the regulator running at three cycles per 20 µs division = 150 kHz, far lower then the MP1584 datasheet’s maximum 1.5 MHz and the typical 500 kHz in the test circuits. Perhaps a low frequency lets the designers use a cheap PCB and not worry about pesky EMI issues.

In any event, during this pulse the ripple amplitude gradually decreased as the output voltage settled at the point where the error voltage variation stayed within the deadband. The typical amp gain is only 200 V/V, so it’s definitely less fussy than something build around an op amp.

For whatever it’s worth, a 7 ms flash from a 1 W amber LED at 4 Hz is way attention-getting in a dim Basement Laboratory. You wouldn’t need an Arduino to produce that signal, even though I like the Morse capability.

Another Snapper

An approaching cyclist warned to watch out for the snapping turtle:

Snapping Turtle - DCRT near Page Park - front - 2021-09-24
Snapping Turtle – DCRT near Page Park – front – 2021-09-24

This one claims the pond near Page Industrial Park along the Dutchess Rail Trail:

Snapping Turtle - DCRT near Page Park - rear - 2021-09-24
Snapping Turtle – DCRT near Page Park – rear – 2021-09-24

We’ll not dispute any snapper’s territory!

I’m hauling PYO apples from Prospect Hill Orchards in the hills on the west side of the Hudson; it was a lovely fall day for a 25 mile ride!

BatMax NP-BX1 Status

The Sony HDR-AX30V helmet camera puts far more demands on its battery than the Planet Bike Superflash:

Batmax NP-BX1 - 2021-09 vs 2020-03
Batmax NP-BX1 – 2021-09 vs 2020-03

The four traces on the right show the BatMax NP-BX1 lithium batteries (cells, really) originally stored about 3 W·h when they arrived in March 2020. The four solid traces to their left show the capacity dropped to a little over 2 W·h after two riding seasons. Batteries B and C started out above average and are now below, for whatever that means.

The red dotted trace shows the effect of not using the NP-BX1 test holder for that length of time; those homebrew contact pins apparently needed some exercise.