Open the connector between a hub motor and its controller and you are looking at eight or nine wires in five or six colours. Most riders read those colours as a wiring diagram: match them up and the motor spins. Half of that is true. The colours tell you what each wire is for. They do not, on their own, promise that the motor will run correctly.
Before anything else: power down. Switch the bike off, take the battery out, and wait thirty seconds. Plugging or unplugging phase wires with power present arcs across the pins and destroys controller MOSFETs. Every step below assumes the battery is out while you change a connection.
What the eight or nine wires actually are
Three thick wires are the phase wires — yellow, green and blue. They carry the three-phase current that turns the motor, which is why they are the heavy ones.
Five thin wires are the hall sensor group — red is +5V, black is ground, and yellow, green and blue carry the Hall A, B and C position signals. These tell the controller where the rotor is, so it knows when to energise each phase.
If your motor has a ninth wire, it is usually a temperature sensor.
Notice that yellow, green and blue each appear twice, once thick and once thin. Thickness is the reliable tell: power on the thick side, signal on the thin side. Never join a thin wire to a thick one.
Start colour-to-colour, then stop assuming
The first attempt is always like to like: yellow phase to yellow phase, green to green, blue to blue, and the same across the hall wires. On a motor and controller built as a set, that is usually the entire job.
The catch is that phase wires and hall wires are paired inside the controller logic — the blue phase belongs with the blue hall signal, and so on. When you mix parts from different manufacturers, the factory that wound the motor and the factory that programmed the controller may never have agreed on which colour sits in which position. The plugs still fit. The colours still match. The pairing underneath does not.
Why people talk about 36 combinations
Three phase wires can be ordered six ways. Three hall signal wires can be ordered six ways. Six times six is thirty-six possible wirings, and typically only one or two of them drive the motor properly. That is the real reason a colour-matched connection can still fail.
Read the result from behaviour, not from the wire colours:
Smooth forward rotation. Correct. Stop testing and tidy the cables.
Smooth rotation, wrong direction. You are one step away. Swap any two phase wires and it will run forward.
Juddering, stuttering, or a knocking noise. Commutation is out of sequence — the controller is firing the phases in the wrong order.
No movement, or a locked, stalled feel. Wrong combination; the controller cannot get the motor started.
Unusually high no-load current, or heat building up fast. Cut power immediately. Continuing to test in this state damages the motor and the controller.
A method that beats guessing
Lift the driven wheel off the ground before every test, and change one thing at a time.
Begin with the colour-to-colour baseline and give it a brief, gentle test. Smooth and forward means you are finished. Smooth but reversed means you swap any two phase wires and you are finished. If it judders or refuses to turn, leave the phase wires exactly as they are and work the three hall signal wires through all six arrangements, testing each one. If all six fail, restore the hall wires to their original order, change the phase arrangement, and repeat those six hall arrangements against it.
Judge the winner by three things together: rotation that is quiet and smooth, the lowest no-load current of any combination you tried, and no hesitation on start. A digital multimeter is what turns that middle criterion from a guess into a measurement, and it is also how you confirm the hall group is receiving its 5V in the first place.
When there are no hall wires at all
Some controllers offer a sensorless mode that uses only the three phase wires. It behaves differently on purpose: starts are hesitant, low-speed pulling is weak, and everything feels normal once the wheel is turning. For a motor whose hall sensors have failed, that trade is often better than replacing the motor.
Before you cut anything
Replacement connectors and a clean crimp matter as much as the wiring order. A waterproof connector kit lets you re-pin a plug instead of splicing, and a complete main wiring harness is often the faster answer when the original loom has been cut about by a previous repair.
One last thing worth knowing: this whole exercise is about the electrical layer only. The controller and display talk over a separate protocol, and matching colours there proves nothing at all — that is covered in why a new display may not work with your controller. If the motor was behaving strangely before you opened anything, read the guidance on a motor that runs by itself first; that fault is not a wiring-order problem and should not be tested on the road.
Colour tells you what a wire does. Behaviour tells you whether you got it right.