So I've removed all the screws from both sides of the hub and nothing seems to be getting loose on it. Do I need to hit with a mallet or something like that?
The technique I use is to hit the end of the axle with a large rubber mallet until the cover on the opposite side comes loose.
A block of wood and a large hammer can be used if necessary.
The covers on later motors are sealed with silicon sealant and it might be better to try and separate them at the joint using the thin blade of an old knife by tapping it in around the casing until it comes away.
Once the cover is removed, the opposite side cover can hopefully be removed by using a piece of wood as a drift and tapping the remaining cover from the inside as near to the outer edge as possible. Rotating the stator will allow you work your way around the entire cover, especially the section that is hidden behind the controller's heatsink plate.
The bearing on the left side of the axle has the harness wires going through it and will need to be moved back from the stator to allow the cable to be fed through the slot in the axle.
Take a good picture of the
connections on the old controller or make a detailed note of
all the wiring connections before unsoldering the wires from the controller and withdrawing the wiring from under the bearing. There are circlips fitted to this side which is used to retain the bearing
(and also prevent the wire from rubbing against the inside of the hub) which will need to be removed.
I recommend filing or sanding the edge of the slot to prevent the new cable from becoming damaged by chaffing against the sharp edges.
Check out
this post for more information, and also
this one showing pictures from a similar procedure with the
external controller wiring.
Alan