E-Bike Electrics 101

E-Bike Electrics 101

Motor, controller, display: what each one does, the three gates every swap has to pass, and why a self-learning controller can drive a motor it has never seen.

The Three Boxes: Hub Motor, Controller, and Display

Almost every e-bike drivetrain, regardless of brand, is the same three boxes wired together: the hub motor, the controller, and the display. Know what each box does — and what runs between them — and most "it doesn't work" symptoms stop being mysterious.

The hub motor

Nearly all e-bike hub motors are three-phase brushless DC motors (BLDC). Three thick wires (commonly yellow, blue, and green) carry the actual driving current to the stator's three coils. Inside the same shell sit three small Hall-effect sensors, 120 electrical degrees apart, whose five thin wires — red +5V, black ground, three signal lines — never carry drive current; they only report which of six possible rotor positions the motor is in right now. Many geared hub motors add a ninth thin wire (often white) for a wheel-speed or temperature signal, bundled into the same 9-pin connector.

The controller

The controller is genuinely the brain of the system: the only box making real-time decisions from every other input. It reads the throttle, PAS sensor, and brake cut-off switch; reads the three Hall wires to know where the rotor is; and fires six internal power switches (MOSFETs) to energize the phase wires in the correct sequence at the correct instant — six-step commutation. Get the Hall-to-phase pairing wrong and the motor won't turn, spins the wrong way, or judders. The controller also talks to the display over a serial data link, and separately watches an ignition/key-on wire that tells it to wake up at all — trivially easy to leave disconnected, producing symptoms indistinguishable from "the controller is dead."

The display

The display's job is bigger than showing a speed number: it's the interface for programming every parameter that shapes system behavior (below), and on power-up it's usually the display, not the battery switch, that sends the wake-up signal to the controller. Displays only work with controllers sharing the same protocol — Gate 3, next.

Connection What it carries If it's wrong
3 thick phase wires (U/V/W) High-current power to spin the motor Wrong order = motor runs backward or judders; by itself this does not damage anything
5 thin Hall wires (+5V, GND, 3 signals) Rotor position feedback Wrong pairing with phase wires = motor won't spin correctly; reversing +5V and GND can burn the Hall sensor
1 optional thin wire (often white), inside the 9-pin bundle Wheel-speed pulses or motor temperature Missing = display cannot show accurate coasting speed and falls back on a less accurate estimate
Controller-to-display data link, plus a separate ignition/key wire Serial protocol (UART, CAN, or a proprietary variant) and the power-on signal Mismatched protocol = controller never wakes up; looks exactly like a dead motor

Source: KT-LCD3/5/8H official manuals; Grin Technologies Grinfineon manual.

The Three Gates

Before a controller, a motor, and a display will work together, they have to pass through three independent checks. Any one failing produces a bike that looks broken even when every part is healthy on its own.

Gate 1: Voltage

Battery, controller, and motor must all be built around the same nominal voltage class — 36V, 48V, or 52V — and no clever wiring gets around this. 52V deserves special attention: a fully charged pack sits around 58.8V, while many "48V" controllers only carry capacitors rated near 63V — as little as 7% of headroom. A controller not specifically rated for 52V runs its capacitors and MOSFETs near their limit continuously on a full pack, not just during a fault. Building for 52V means capacitors rated 63V+, MOSFETs rated 75V+, and a spec sheet stating a maximum input at or above 58.8V — not just "48V compatible."

What goes wrong: an undervoltage cutoff tuned for the wrong pack shuts the bike down with charge left, or runs it down further than it should; a higher voltage than the electronics have headroom for tends to shorten component life rather than fail instantly — easy to overlook.

Gate 2: Current

A controller's amperage rating and a motor's rated power must match each other, not just the same voltage class. Too little current and the motor never develops real torque — gutless on hills, prone to tripping overcurrent protection under load. Too much current and the motor can carry more than its windings dissipate continuously, and sustained full-throttle running can overheat it. Controllers are designed to be turned down, not up: the practical floor on adjustable current limiting is typically around half the hardware maximum — why it's common to spec a controller somewhat above a motor's nameplate current and dial it back, rather than buying to the exact number.

Gate 3: Protocol

Even with voltage and current matched, the controller and display must speak the same communication protocol. The major families are KT/Kunteng (LCD3, LCD5, LCD8H), No.2 UART (S866, S830, SW900, S810), and Bafang's own UART and CAN lines — a UART display cannot talk to a CAN controller even when the connector looks identical. Closed platforms (Bosch, Shimano, Yamaha, and similar) run proprietary, encrypted CAN buses that no generic controller or display can bridge.

What goes wrong: the controller never wakes up. Because the display sends the controller its power-on signal over that protocol line, a mismatch looks and feels exactly like a dead motor or controller — the display lights up fine, but nothing downstream responds. The fast diagnostic: check whether the display reads a live speed value and its parameter menu opens; if either fails, the boxes aren't talking, and no motor-side troubleshooting fixes it.

Source: KT, No.2 UART, and Bafang official manuals; Bafang CR-series dealer manuals (UART vs CAN); EBiCS firmware documentation.

Why a Self-Learning Controller Can Drive a Motor It Has Never Seen

The 36-combination problem

Any hub motor has three phase wires and three Hall signal wires that must be paired up correctly for the motor to spin smoothly in the right direction. Wired randomly, there are 36 possible combinations. Of those, only about 3 produce a smooth forward spin, about 3 spin smoothly in reverse, and the remaining roughly 30 are either dead, jerky, or draw abnormally high current. Finding the right one by hand means swapping wires and re-testing, potentially dozens of times.

What "self-learning" actually does

A self-learning controller automates that search instead of a technician doing it by hand: with the wheel elevated and a dedicated pair of learning wires shorted together, it drives the motor through its own internal test sequence until one combination spins the wheel forward smoothly, then commits that combination to memory — electronically, in seconds, rather than recognizing the motor at all.

Not every ecosystem finds this alignment the same way:

  • KT / Kunteng (LCD3, LCD5, LCD8H): manual phase-code selection via parameter C2 (0–7 on LCD3/LCD5, 0–1 on LCD8H) — not self-learning by default. Standard setting for a Bafang motor on a KT controller is C2=0, adjusted by trial if the motor runs rough.
  • Generic 12-MOSFET No.2 UART controllers (S866-family displays): a dedicated self-learn wire, commonly white or green — short it and the controller cycles through combinations on its own. The implementation most commonly seen in the aftermarket.
  • Grin sinusoidal sensored controllers: no automatic mapping — newer generations deliberately removed it to support sinusoidal drive, so wiring order must be correct going in. More advanced drive modes can mean less wiring tolerance, not more.

The 6-step self-learning SOP

  1. Elevate the rear wheel so it spins completely free of the ground.
  2. Power on the display and select an assist level.
  3. Connect the self-learning wire (a single pair, commonly white or green — colors vary by manufacturer, confirm rather than assume).
  4. The wheel starts turning on its own. Forward = learned correctly; reverse = not converged yet — disconnect and reconnect the learning wire to trigger another attempt.
  5. Once it spins forward smoothly, disconnect the learning wire for good (tape or trim it). Never twist the throttle while it's connected — the controller is mid-sequence and won't respond correctly.
  6. Verify with the throttle: smooth takeoff, no stutter, expected top speed reached. Install complete.

Reading the result — the diagnostic that matters most

Observation What it means Next step
Spins forward on connect, smooth once disconnected, reaches expected top speed Success Insulate or trim the learning wire and install
Spins backward while the learning wire is connected Not converged yet Disconnect and reconnect to trigger another attempt
Won't turn at all, even with the learning wire connected Learning can't start Check phase and Hall wiring continuity (see the connector trap section below)
Turns only while the learning wire is connected, and stops the instant it's disconnected Learning cannot converge — not a wiring-order problem Stop re-running the cycle. Signals a deeper electrical or component fault — open/shorted phase wire, damaged Hall sensor, or blown MOSFET — that self-learning was never designed to correct. Test and very likely replace.

What self-learning can and can't fix

  • Can fix: wrong wiring order, mismatched Hall-to-phase pairing, and 60°-vs-120° Hall electrical spacing differences (most modern self-learning controllers auto-detect this).
  • Cannot fix: a Hall sensor physically mounted at the wrong angle (this can lock the controller into a persistently wrong state); a shorted or open phase wire; a blown MOSFET; or a motor whose inductance, resistance, or pole-pair count falls too far outside what the firmware assumes — cheap controllers don't measure phase current directly, they assume typical values.

The accurate way to describe self-learning is "wire it in any order and the controller will learn it" — never "compatible with any motor."

[INTERNAL] A sensorless (Hall-less) fallback exists on some controllers as a last resort when a Hall sensor fails — KT-LCD8H exposes this as parameter L3 (LCD3/LCD5 have no equivalent). Tradeoffs: hesitant starts, a non-sinusoidal drive waveform with an audible hum, and a measured top-speed drop of roughly 13% in one test (25.9 mph with Hall sensors, 22.5 mph without). Treat it as limp-home, not a permanent fix.

Source: NCyclebike self-learning demonstration; community failure-mode documentation (letrigo, Endless-Sphere); Grin Grinfineon manual; KT-LCD8H manual (L3).

P-Parameters and C-Parameters

P1: the number that tells the display how fast the wheel is really spinning

The formula, straight from the manufacturer's own documentation: P1 = gear reduction ratio × number of rotor magnet pieces, rounded to the nearest whole number, valid from 1 to 255.

Motor Magnets Gear ratio P1
Bafang G020 / H400B (front hub) 20 5:1 100
Bafang G062 (1000W fat-tire) 20 5:1 100
Shengyi DGW22C/S (350–500W) 16 5.3:1 85
Shengyi DGW25P (750W) 20 5:1 100
Shengyi DGW25LS (350W fat-tire) 20 4.33:1 87
Q100 (328rpm geared hub) 16 8.2:1 131 calculated — real installs needed 122–141 to line the cutoff up with a 25 km/h target
Direct-drive rear hub (no gear reduction) 46

There's a real terminology trap: "magnet pieces" and "magnet pole pairs" are two different numbers, used inconsistently across sources — one is exactly double the other. Manufacturer catalogs (above) count pieces; some forum calibrations count pole pairs and land on half the value. Treat any calculated P1 as a starting point, then finish with a GPS calibration (below). When the exact spec is unknown, most aftermarket geared hub motors are close to a 5:1 reduction with 20 magnet pieces — why 100 shows up so often. Too low, P1 thinks the bike is faster than it is and cuts power early; too high, it lets the bike run faster before cutting.

P2: the parameter that fixes a speed reading that dies on a coast

P2 sets how many pulses per wheel revolution the motor's internal speed sensor produces (0–6). Documented example: the Bafang G062 motor has only a single physical speed magnet, so the correct value is P2=1 — not the more common 5 or 6 — and leaving it higher makes the display's speed collapse to 4–6 km/h or jump erratically the instant the rider coasts (a geared hub's one-way clutch briefly decouples the internal rotor from the wheel). If speed reads correctly under power but wrong only while coasting, P2 is almost always the fix — work down from 6 rather than guessing.

C-parameters worth knowing (KT ecosystem)

Parameter Real default / value What it controls
C1 — PAS type and sensitivity 0–7 Forward rings: codes 0–2 (5, 8, or 10 signals); reverse rings: codes 5–7 (6, 10, or 12 signals)
C2 — motor phase code default 0 Standard for a Bafang motor on a KT controller; adjust by trial if the motor runs rough
C4 — throttle behavior 0 = always-on throttle 1 or 3 limits the throttle to roughly 6 km/h walk-assist speed
C5 — current limit 10 = full hardware maximum Turned down only, not up; floor is roughly half of the hardware maximum
C12 — undervoltage cutoff default 4 Auto-adjusts by voltage class (20V on 24V, 30V on 36V, 40V on 48V)
C14 — assist strength (1–3) only active when P3=1 Bench measurement, 350W motor, assist level 1: roughly 10W at C14=1 vs roughly 50W at C14=2

The No.2 UART family uses a completely different numbering scheme

Function KT parameter No.2 UART parameter (S866 / S830 / SW900)
Magnet count × gear ratio (same math as P1) P1 P07
PAS magnet count C1 (5/8/10-signal forward, 6/10/12-signal reverse) P13 (5, 8, or 12 only)
Current limit C5 (multiplier code, 0–10) P14 (typed directly in amps, 1–20A)

Both systems use a "P" prefix for some settings, which invites typing a KT-style number into a No.2 UART menu, or the reverse. They are not the same table, and the numbers do not cross over.

Calibrating displayed speed against GPS

  1. Adjust only the wheel diameter setting first, until displayed speed matches a phone's GPS speed — it's fine if the number entered doesn't match the tire's printed size; the goal is the reading, not the label.
  2. Temporarily set the speed limit well below the bike's real top speed (e.g. 15 mph) so it's obvious when the limit, not the bike, is what's stopping acceleration.
  3. Ride and watch, using GPS, for the speed at which the motor visibly tapers off power.
  4. Tapers off lower than intended → raise P1. Higher than intended → lower it.
  5. Make a large first adjustment (roughly ±10), then fine-tune in smaller steps (roughly ±3) until displayed speed and GPS agree within about 1 mph.

Source: Shengyi official motor catalog cross-referenced with community bench data; KT-LCD3/5/8H official manuals; S866/S830/SW900 manuals.

The 9-Pin Connector Trap

The 9-pin connector used on most hub motors (often called a Julet 9-pin or HiGo Z910) is a genuine physical standard — shell shape, pin spacing, and pin diameter are consistent enough that a motor from one brand will often plug straight into a controller built for a different brand. That's exactly what makes it dangerous: plugging in is not proof of anything. There is no cross-brand standard for what each of the nine pins does.

Commonly observed (not guaranteed) color convention: three thick phase wires in yellow, blue, and green; a thin red +5V and black ground for the Hall sensors; three thin Hall signal wires, again typically yellow, blue, and green; and a ninth thin white wire carrying either a wheel-speed or temperature signal, depending on the motor — never assume which without checking.

Documented mismatches make the point: a Bafang CST-series motor needs its yellow and blue wires swapped relative to one popular controller's own convention, and the same motor family from a different manufacturer (MXUS) has been documented with two different color arrangements only three months apart, from the same factory. Identical shells, identical-looking colors, still wrong.

[INTERNAL] Our internal connector-fitment reference lists both common 9-pin motor pinouts — Julet-style and HiGo Z910-style — as pinout not yet bench-verified, drawn from public references and community reports, not confirmed pin-by-pin on our own bench yet. Already bench-verified: the 3-pin throttle connector, the 3-pin PAS connector, and the loose 8-wire (no-connector) convention. Compatibility claims for the two 9-pin shells will update once bench verification is complete.

How to check before powering it up

  • Connector plugged in, battery on: measure Hall +5V vs GND — should read roughly 4–5V.
  • Slowly turn the wheel by hand and check each Hall signal wire against ground: each should swing cleanly between roughly 0V and 5V. A steady 2.5V while spinning fast is normal — the meter averaging a fast on/off swing, not a fault.
  • Battery disconnected: each phase wire should show a large resistance to the positive rail and to ground (tens of kilohms typical). Near zero ohms (a continuity beep) means a MOSFET has failed internally — the controller needs replacing, not rewiring.
Swapping the order of the three phase wires cannot burn anything — worst case the motor spins backward or judders. Reversing Hall +5V and ground can burn the Hall sensor instantly. When trying combinations by hand, only ever move the phase and Hall signal wires — never the +5V/ground pair. Power off before changing any connection.

Source: Grin Technologies connector documentation (Z910 pinout, Hall/MOSFET test procedures); cross-brand color reference; internal fitment database.

Brake Cut-Off Levers: NO vs NC

A brake cut-off lever's job is to tell the controller to stop delivering power the instant the rider squeezes the brake, through one of two opposite electrical logics — and mixing them up produces two very different, both bad, results.

Type Resting state When squeezed Controller sees
NO (normally open) Circuit open Circuit closes Closed = cut power
NC (normally closed) Circuit closed Circuit opens Open = cut power
Mismatch Symptom
An NC lever wired as if it were NO Bike never gets power at all — the controller reads the lever's resting "closed" state as "the brake is pulled," continuously
An NO lever wired as if it were NC Motor keeps running even while the brake lever is squeezed — the safety cutoff is silently defeated, the more dangerous of the two failure modes

"No power at all" is one of the most common e-bike complaints, and a brake cut-off problem is the free thing to rule out first: unplug the brake sensor connector and try the throttle. If power comes back, the fault is in that circuit — a lever not returning fully, a corroded or pinched wire, or a mismatch between NO and NC logic — not the motor or controller.

Hydraulic brake levers usually don't have a built-in switch. The common aftermarket fix is an external magnetic sensor: a small magnet on the lever body, paired with a sensor head on the handlebar close enough to trigger as the lever moves — wired into the same NO/NC logic externally, without opening the hydraulic system. A few higher-end hydraulic levers integrate a switch internally, but replacing one means replacing the whole lever assembly.

Because the two logic types are electrically incompatible, a replacement cut-off part has to be stocked as two separate items — NO and NC — never as one universal part.

Source: aftermarket brake cut-off documentation; internal fitment database.

Lights: Why a Relay

Powering a headlight straight off a controller's light-output wires is one of the most common ways a working e-bike ends up with a dead controller.

Documented case Result
A kit's stock, lower-lumen headlight worked fine; a brighter aftermarket headlight from the same catalog replaced it Controller's light circuit burned out
A 12V accessory light wired into a 48V-system controller The light failed and took out a component on the controller's daughter board
An aftermarket 12V LED light bar wired directly to the light-output pins Cooked the onboard resistor limiting current on that circuit
A headlight and a taillight both wired onto the same output circuit Burned out the light-output circuitry, twice

On some controllers, the light-output wires carry raw, unregulated battery voltage with essentially no protective circuit in between — one documented case described the wiring as coming "straight off the incoming battery wires: no switch, no circuit board." No manufacturer publishes an official current or wattage ceiling for a light output — a genuine industry-wide gap. The consistent consensus: these outputs were designed to trigger a relay, not power a headlight directly, and failures cluster around lights in the several-watt range and up.

The right way to wire a light

  1. Relay isolation (preferred): wire the controller's light-output pins into the low-current trigger side of a relay — mechanical or solid-state — and let the relay switch full battery voltage to the light. The controller only ever sees the small trigger current it was designed for.
  2. Independent DC-DC step-down: run a dedicated step-down converter (commonly 48/60/72V down to 12V) directly off the battery, bypassing the controller's light output entirely.
Before wiring in any light, verify what the output wire is doing with a multimeter — turn the light function ON first (many controllers read 0V at those pins with it off, easy to misread as "no output"). A reading close to full battery voltage means it's unregulated and cannot take a 6V or 12V light directly. Watch for a PWM trap too: a steady-looking 12V or 24V reading on a basic meter can be a fast on/off pulse being averaged, not true regulated voltage — one teardown found a supposedly steady output was really a 144Hz pulse at 50% duty cycle. When in doubt, treat it as unregulated. Always disconnect the battery before wiring in a new light.

Source: aftermarket kit vendor compatibility notes; community teardown reports on light-output voltage and PWM behavior.

Throttle and PAS

Throttle

A standard e-bike throttle is a simple 3-wire Hall-effect design: red +5V, black ground, signal wire. At rest the signal sits around 0.8V; twisted fully, it climbs smoothly to roughly 3.6–4.2V. This range is close to universal across brands, which is why a basic throttle is one of the most reliably interchangeable parts on the platform.

To test: red probe on the signal wire, black on ground, system powered on. A healthy throttle shows a smooth, continuous climb from about 0.8V to somewhere in the 3.6–4.2V range as it's twisted; a reading that jumps in steps, sticks partway, or bounces around means the throttle is bad.

Two failure modes worth knowing: a return spring gummed up with dirt (often just needs cleaning), and moisture in the connector causing the signal to drift on its own — this one is urgent, since a drifting signal can make the motor surge without anyone touching the throttle. Power down immediately rather than keep testing it live.

PAS (pedal-assist sensor)

A pedal-assist sensor reads a ring of small magnets on the crank or bottom bracket as the rider pedals, using the same Hall-sensor logic as the motor. The magnet count on the ring varies, and the controller or display has to be told which count is fitted:

Ecosystem Parameter Valid magnet counts
KT (forward-wired ring) C1, codes 0–2 5, 8, or 10 signals
KT (reverse-wired ring) C1, codes 5–7 6, 10, or 12 signals
No.2 UART P13 5, 8, or 12 only

If pedal assist feels choppy, hesitant, or lags a full stroke behind, that's almost always a magnet-count mismatch — fix it by changing C1 or P13, not by moving the sensor. Counter-intuitively, if pedaling backward produces assist but forward doesn't, that's also a C1-type setting, usually solved by switching between forward and reverse code ranges — not a reason to relocate the sensor.

Source: Grin Technologies Hall throttle spec; KT-LCD3/5/8H manuals (C1 table); S866 manual (P13).

Error Codes Are Family-Specific

The same two-digit number can mean something completely different depending on which display family produced it. Reading someone else's error-code table against your own display is a documented cause of misdiagnosing a perfectly healthy motor.

Display shows... Family
A two-digit code with an "_info" suffix (e.g. 01_info, 03_info) KT / Kunteng (LCD3, LCD5, LCD8H)
A code formatted E01–E13 No.2 UART (S866, S830, SW900, S810)
A bare two-digit number in the 07–30 range (e.g. 21, 22, 25, 26, 30) Bafang UART/CAN displays (500C, 860C, DPC18)

KT / Kunteng — only five codes exist

Code Meaning First thing to check
01_info Throttle signal abnormal Throttle fully returning; connector for corrosion or moisture
03_info Motor Hall signal abnormal Motor cable fully seated first (the single most common cause), then Hall wiring
04_info Torque sensor signal abnormal Only relevant on torque-sensor builds; re-check torque ring alignment
05_info Axle speed sensor abnormal Speed magnet position, motor cable
06_info Motor or controller short circuit Power down immediately; check phase-wire insulation

Bafang UART/CAN — a different, larger table

Code Meaning
21 Speed sensor fault — check the motor stator
22 BMS communication fault — check or replace the battery
30 Communication fault — check the connector between the wiring harness and the controller, or replace the controller
A widely repeated online report about "KT Error 30" is not actually about a Kunteng display — the original thread documents a different display brand paired with a different controller brand entirely. None of the official KT manuals reviewed here list a code 07, 08, 09, 10, 11, 12, 21, 22, or 30 — only the five codes above exist in the KT family. Always confirm which display family produced a code before consulting any table; the number alone tells you nothing.

Source: KT-LCD3/5/8H official manuals, cross-checked across multiple copies; Bafang 500C/860C/DPC18 manuals; S866/S830/SW900 manuals.

Battery and Connector Safety Basics

Common high-current connectors

XT60 is the connector most aftermarket hub-motor conversion kits ship with on the motor/controller side when no battery is included — the kit provides a male XT60 lead and expects a matching battery. Anderson Powerpole connectors show up on some controllers and kits and are keyed so the two halves only mate one way — verify polarity before the first connection rather than assuming red-to-red, black-to-black. XT90 is a larger, higher-current connector seen in the broader e-bike space; its specific use was not documented in the aftermarket kit sources reviewed for this article — confirm gauge and rating against your controller and battery before treating it as a drop-in swap.

Power-on sequence

Pressing the display's power button is usually what wakes the controller: the display sends a signal down a dedicated ignition/key wire, the controller powers up, and only then does the motor respond. The single most common cause of "the controller does absolutely nothing" is a missing or disconnected ignition/key wire — not a failed controller.

Never connect or disconnect a live connector

Separating two contacts still carrying current draws a small arc across the gap at the instant of separation. That arc pits and burns the metal contact surface a little each time, raising the connector's resistance — running hotter and eventually causing intermittent power or a connection that fails under load. Always switch off, or physically disconnect, power and give the controller's capacitors roughly a minute to discharge first.

Never short the battery

Never let a battery's positive and negative leads touch, even briefly. A charged pack has essentially no internal resistance standing between a dead short and a large, fast current spike — a fire risk as much as an electronics risk. It simply must not happen.

If you are not confident reading a multimeter or identifying whether a connector is live, treat every connector as live until you have confirmed otherwise with power fully disconnected.

Source: aftermarket conversion-kit installation documentation (XT60/Anderson usage); general connector safety practice.