I 've been having encoder issues for the last 1000Klms or so that have been gradually getting worse, starting with the wrench icon and ENCDR on the odometer, to the bike failing to accelerate (felt like it was only running 2 phases), to an unexpected regen event in peak hour traffic after I hit a pothole that I narrowly avoided being a car sandwich.
Most of these events seemed to be related to a hard turn, potholes or jolts in the road, so I suspected it was a loose wire on the encoder connector at the board (XVectrix has mentioned this is a common problem).
Opening up the encoder housing (I've never opened it in the bike's life) I expected to see a loose wire (tried moving them at the connector - all fine) Hmmm....
So I removed the harness from the encoder and had a close look at it - all three hall wires had been rubbing on the (moving) bolt on the end of the optical encoder - the yellow wire was showing signs of rubbing, the brown you could see copper, but the blue one was practically cut through (!).
I repaired the blue wire by cutting it, and adding a short length of wire so the joint wasn't in tension relative to the other wires, and then heatshrinked the joints.
I then put a cable tie so that the encoder wires were away from the spinning bolt.
The worrying thing is that this was like this from the factory (eeek!). Keep this in mind if you start getting encoder errors that appear to be vibration, speed or impact related