(I'll be working to bring it back to stock for easier FB marketplace sale)
And so I did, eventually, get around to this. I went to put the original controller back in and...hrm. See, since I didn't plan to go back to the stock controller, I was a bit caviler with the disassembly. Didn't take pictures, cut off connectors, etc. So, looking at the unlabeled mess of a stock harness soldered together in whatever configuration eahora considered to be correct, I had absolutely no idea how to re-wire it.
I also lamented the lame (binary on/off) regen braking system that fardriver supports.
So, since I have the controller and no reason not too, I went ahead and kept on with that instead.
While wiring it up, all the connections became a bit of a wire mess. I got it all working, but it was decidely a rat's nest in the compartment. Figured I could do better, so I decided to try and make a "routing pcb", I'm gonna call it. Basically, just a bunch of screw terminal connectors for all the incoming wires (blinkers, horn, lights, controller, etc) and then wire jumpers on the board to make all the cross connections.
Flew too close to the sun and something shorted. Now the controllers is falling back to sensorless mode and there's a short between 5v and gnd on the controller. Shit.
Reached out to VESCLabs and the folks over there are, my goodness, absolutely top-notch. They supplied me with instructions on how to make an external hall array (needs some resistors, etc) and then upgraded the firmware to support reading hall signals from 3 other pins on the controller so I could get that functionality back. Try getting that level of individual support from Fardriver/Kelly/anybodyelese, lolnope.


With the hall signals sorted out, and the rat's nest back in place, all of the bike systems are functioning. I'll just live with the shame -- a very well labeled shame, mind you, but oh well.
I whipped up an "inventory" of the wires in the bike, along with a very amateur schematic attempting to detail the wiring schematic.

One of the biggest lifts by a LONG shot, however, was programming the sytem to get everything work in concert. It's a major flex, the flexibility of the VESC Maxim (and related) controllers, but it's also very young and the documentation/examples are few and far between.
First, a bit of topology. While the Maxim has a single 39pin connector, what's hiding inside the unit is two independant MCU's -- one is a STM-something-or-other and the other is an ESP32. The display also has it's own ESP32. Each of these are coordinated, primarily, via CANBus messages. As an example of this coordination:
The "mode" button connects to IOExpander pins that are, in turn, connected to the controller ESP. When you press the mode button, you need to register that in the controller esp and emit a CANBus message that the desired "mode" is now X (drive, 1, park, etc)
The controller STM needs to be listening for the message and actually change the motor control properties to enact the new mode. The controller then also issues a "mode X" message to the canbus indicating that the actual change has taken place.
The display listens for mode from the controller STM (NOT from the controller ESP) in order to update the display showing what mode is active.
There are canbus messages flying all over the place. Inputs, outputs, modes, stats, etc.
What's double tricky is that all of this is orchestrated in....LispBM -- a microcontroller oriented variant of Lisp. I've been a programmer for many, many years, but LISP syntax really stretches my brainpower, gotta be honest. The display rendering is also pretty raw, requiring fonts and images in a pre-made bin format and the tools for doing layout are very rough at this point still. On the plus side, I didn't really do too much advanced stuff for my display output, so that saves my bacon.
I did publish all of my code for this (
vesc_pkg/dash35b-simple at simple-dash · chuyskywalker/vesc_pkg) but it's ultra specific to my bike, my wiring, and my busted controller. However, it could prove useful to others for taking and modding, should someone else go down this path.
Ultimately, the bike is back together now, back on the original battery, and has the upgraded controller and screen. It's once again alive and kicking, better than it was before. I'll likely put a few miles on it to make sure all systems are good to go, then see about selling it.
(That said, the ebike/emoto market has been really cold as of late.)
No idea what I'm going to do with the massive battery from this build...