Shown is the circuit that provides the motor current control function, with interfaces to the current sensor and the throttle. I tried to draw this on a drawing program, but it takes too long, with learning curve.
This circuit requires an unipolar sensor.
The current sensor is an Allegro Microsystems ACS 755-130, avalable from Digikey. The sensor is out of production, but Digikey reports an inventory of over 500.
The dual op amp is an LM 324 or equivalent, available from You-do-it Electronics.
The rest of the parts are available from Radio Shack, or other hobby electronics distributors.
All passive pats are +- 20%.
This function can be implemented in a microcontroller (beyond my skill set). The sample rate should be at least:
(number permanent magnet poles) x (Max rpm / 60) x 10 This may be be a problem if the micro controller is doing other functions.
I've selected the components to work with most systems. Ra might have to be selected for other motor, voltage, controller drive systems, or other current sensors. If the current control function is too slow, reduce Ra (by factors 0f 2 -5). If the motor current hunts or surges, increase Ra by the same factors. (hunting or surging on a high power system could get exciting.) Iterate into optimum response for your application.