Please pardon me, I completely missed post #25. Not sure how; it has pretty pictures that should have jumped out at me. So I thought this thread was still at the stage of you asking questions rather than posting that you had it working.Thanks for the explanations @strantor; I'm just not familiar at all with this stuff at the hardware level.
As for the software items I mentioned, I've already written them all. Everything basically works already but I still need to figure out how to put it all into together into a box that I can mount onto the handlebar. I'm sure there will be other issues to sort out once I try it outside.
I do have an Arduino but I felt like the Pi gave me more options. Maybe just because I'm more familiar with it.
BTW, it only takes 45 seconds for the Pi3 to bootup.
All I wanted to do originally was control the speed of the electric push cart via remote control instead of having to keep my hand on the handlebar all the time. Sounds like all I needed then is an Arduino, an IR receiver and then wire the Arduino directly to the existing potentiometer?
The openCV aspect is pretty cool, and something you wouldn't have been able to do with arduino. Arduino would have been perfect for what you originally described though.
I am curious though about this 5-speed business. I see no reason why the motor controller would be limited in this way. I wager that it is capable of 0-100% stepless speed control, and the thing limiting you to 5 speeds is the handlebar twist grip. I originally called it a speed pot but maybe it isn't a pot at all, but rather a 5-position selector switch with 5 different resistor values. I would be curious what happens if you disconnect it and connect an actual Potentiometer in its place. Maybe that doesn't matter to you now with the solution you've devised, but if it does, and if you try it, I'd be interested in hearing the result.