Repost permission granted by Jeremy, thanks from the V is for Voltage Community members and guest for sharing.
intro Electric Bike Hub Motor - How to Replace a Hall-effect Sensor
Brushless motors use electronic controllers instead of brush systems to control the timing and distribution of power to the motor. To do this, some controller systems use hall-effect sensors inside the hub, which track the motor's position. This information permits the controller to alternate power with the right timing and in the right sequence and, voila, it spins.
That's obviously the short version and it is a complex compared to standard DC motors, but brushless motors are more efficient and that's the benefit. Better efficiency means you get more mechanical energy per unit of power, which is a good thing! The bad thing is, hall-effect sensors are relatively unreliable in the hot, high voltage, rock-and-roll insides of electric bike hub motors.
In my case, the villain was voltage. Although, I certainly didn't help the situation when I crashed the stupid thing.
When the bike fell, the sensor and power leads--8 wires altogether--were crushed and severed as the axle ground against the concrete. As a result, the current intended for the motor found its way to one of the sensors and killed it as the heat changed the internal composition from silcon to silcon dioxide. The controller, as I said before, depends on these sensors to distribute power, so the whole system fails with the loss of even one of them.
Efficient, yes. Robust, no.
Sure enough, after repairing the wiring, I found that the motor didn't turn smoothly anymore. Rotation was jerky and it didn't produce much torque. This is known as "sputtering." There were also dead spots, where, if at rest, the wheel could not begin to spin. Major major problems. After a little research and hanging around the Golden Motor owner's forum, I learned that my problem was a failed sensor and it needed to be replaced.
This Instructable documents the process I followed to replace this sensor and bring my bike back to life.
First, a thousand thank-you's go out to myelectricbike, who walked me through this step-by-step, provided much of the information you'll read here, and is singlehandedly forging a first-rate forum for Golden Motor product owners.
step 1 Parts and Tools
* Replacement Hall-effect Sensors
For the particular motor I own, Golden Motor sales suggests Honeywell SS41 sensors, which I purchased from DigiKey. These are available, of course, from many other vendors. Do yourself a favor and buy extras. They're inexpensive and good to have on hand.
* Small zip ties
* Felt-tipped pen
* Glue (Recommended, but optional)
* Masking tape
* Multimeter (Recommended, but optional)
* Needle nose pliers
* Ratchet with 7mm Socket
* Small standard screwdriver
* Soldering iron, solder, and solder wick
* Wire cutters
step 2 Identify Failed Sensor
First, let's sort out the motor's wiring. There are eight wires, or leads, running from the motor. Three wires power the motor and are larger (16 AWG): Green, Blue, and Yellow. Two wires power the sensors and are smaller: Red and Black. And three wires connect the sensors to the controller: Green, Blue, and Yellow. For this project, we are concerned only with the smaller wires.
Now, there are two methods I've used to determine which of the three sensors failed. By the way, both require the motor to be fully assembled, so put the wrench away!
The first is to simply run the motor while one sensor lead is disconnected, then again for the second lead, and a third time for the last lead. If one sensor is dead (and that's your only problem), you'll see that disconnecting one or the other of the good sensors prevents the motor from turning altogether, while disconnecting the bad one has no effect at all--it still sputters. If this works, great. You've identified which sensor needs to be replaced. Remember which lead it is head to the next step.
If that didn't work, try this second method. It is more complex, but useful to identify more nuanced issues or problems stemming from multiple failures.
Prepare a firing order table on a spreadsheet with as many rows as there are magnets (46 for this model motor) and 4 columns. The first column should contain the switch point (1 - 46) and the remaining three should be used to record sensor output from each of the three leads. While the motor is connected to the controller, powered, and at rest--or, alternatively, powered with +5 volts from a workbench power supply--set up a multimeter to monitor the sensor's output. Record the voltage change between the sensor ground and sensor lead as the wheel is slowly turned.
In a perfect world you would use three multimeters and mark your readings from precisely the same point for each sensor. You, like most people, have at most one multimeter, so use masking tape and a felt-tipped pen to mark 46 points around the motor at which to take readings to ensure they correspond for each sensor. Once your table is complete, your problem should be apparent. If not, add an additional three columns to your table and preform a similar test on the larger power leads, but check for continuity instead of voltage change. If it is still unclear why your motor is not working, find help online at the Golden Motor owner's forum or elsewhere
step 3 Disassemble Wheel
For me, the sensors are mounted opposite the side where the wires enter the hub, but it may be different for you. Use your socket wrench to remove the bolts and a small screw driver to remove the hub cover.
Be aware the hub covers hold the axle and stator in place against the force of the rotor magnets, so be careful when you pry the cover loose. You will hear a pop once the cover breaks free from the wheel and the magnets pull the stator to one side. If necessary, apply a few drops of oil here to help slide the cover off.
step 4 Remove Failed Sensor
As you can see in the picture, the leads and sensor board are secured to the stator yoke spokes with small cable ties. Use your wire cutters to cut the ties and free the sensor board. With your soldering iron, or solder wick, remove the solder from all five leads and push them to the side. This should also free the sensor board, which you should set aside.
With your pliers, pull the bad sensor (or all three, if you want!), clean out the sensor well, insert the new sensor, and glue it in place (the glue is optional). Replace and solder the sensor board, then the sensor and power leads.
Here, it is wise to test each sensor lead for continuity using your multimeter from the end of the lead at the controller all the way up to the body of the sensor. While checking for continuity, move your leads around to be sure there are no intermittent breaks. If you find any, repair or replace as needed.
Secure the board and sensors with new cable ties and test the sensors once more. Before you put the cover back on, check to see that the sensor board doesn't sit so high that the board will make contact with the cover.
Close up the motor and you should be good to go.
step 4 Back in Business!
For more information about the kit I bought, visit the pages. Golden Motor web site.