I replaced the motor controller, and the bike works again! While I had it in the repair workshop, I also raised the rear carrier; I had it as low as it would go to accomodate the battery rack, but now that I'm not using the battery rack, I was able to raise it an inch or so.
That meant a bit of drilling so that I could lock it in the new position.
I also put on a bracket for a rear light; longer nights are coming along. And I tested the idea of putting a powerful beam torch on my helmet; that works fine for the helmet that has air grooves. It won't work with the dome helmet that I prefer to us in cold weather.
The third thing I did, was to install a screamer. A screamer is an electronic device that screams at 110 decibels when you switch it on - it's great for burglar alarms, which was where I had used it before. Now, I combined it with a 9 volt battery, a reset switch from a broken DSL router and a couple of yards of bell wire, so now at the touch of the button, my bike can scream.
I have it in mind for the following situations:
1) Pedestrians on towpaths and similar tracks; when I'm coming up behind them, I like to give them a ding on the bell to warn them that a bike is about to whizz past. If there's more than one of them, they're usually walking side-by-side, so I need them to clear a path for me. If they ignore the ding, and the second ding, I can now give them a yell with the screamer.
2) Dogs. Some dogs love to play at chasing bikes. I don't really mind being chased, as long as the stay out of my way. But some dogs like to weave in and out in front of me, and risk being run over if they time it wrong. So maybe the screamer will deter that.
3) Cars. Some drivers get very angry that a mere bike is occupying THEIR road, and want me to go away. So they honk their honker at me. Now I can scream back at them.