I've been looking at a few configurations for this circuit. A quick one transistor DC inverting amplifier is possible, but the temperature stability would not be very good. An operational amplifier would be better. But if I want to remap the control linearity the op amp would get rather complicated to work with. I also want to be able to set the minimum ebraking, right now when the switch engages it drops out the slip regen so it reduces the braking, it would be better if the initial ebraking was equal to or slightly greater than the slip regen so you didn't get the feeling that applying the brakes initially caused less braking.
I have on hand some hardware that would allow fiddling with the gain, linearity and offset to make the feel of the brake better while also handling the requisite gain and offset requirements. Since this is an experiment anyway, I think I'll try that. If it doesn't work out we can always revert to the op amp.
I'm considering trying an experiment with the Adafruit Trinket microprocessor. It is a very small (about an inch long) and very low cost Arduino type board, providing a subset of the normal Arduino range as it is based on an 8 pin microprocessor (the ATTiny 85). The chip can read an analog voltage from the eBrake lever, filter it, apply the gain and offset calculations, and output an analog voltage to feed to the controller. I've worked with this chip on a number of projects, though I haven't used these Trinket boards before. I purchased a few some months ago and they're still sitting in the anti-static pink bags.
The usual analog output from these micros is PWM, so it needs to be filtered and possibly buffered, and is a compromise of ramp rates, noise and drive impedance. Instead of that I will use a separate Digital to Analog chip that will generate a very clean and buffered rapidly adjustable DC output voltage. The particular DAC chip I have is very tiny and comes on a little breakout board from either Adafruit or Sparkfun, and the interface is an I2C bus which requires only 2 pins to talk to a number of devices. This is good for the Trinket since it has only 5 I/O pins, and really only 3 I/O pins if you want to leave the USB programming fully available.
From a hardware standpoint this makes the project quite simple, these two very small boards have just a few interconnects to wire up. It does add a software component to the project and makes testing interesting. The software can be developed on a laptop with the available free tools and libraries, and loaded to the Trinket with a USB cable (no programmer required). It will take very little code to read the voltage, filter, offset, and send results to the DAC. The update rate will be quite fast, and the resolution more than 10 bits which should be beyond adequate.
Introducing a microprocessor into a braking system is a concern. Of course the Sabvoton Controller is already using a microprocessor to control ebraking. The function of the micro I am introducing is very simple compared to what the Controller is doing. During testing we will lower the ebraking gain of the Sabvoton, so the maximum braking will be only moderate. The way this ebrake lever works is also helpful for safety as there is a mechanical switch that enables ebraking in the Controller so if the lever is released the ebraking will cease regardless of the output voltage from the micro's DAC. This is also rear tire braking which is not as problematic if wrong.
Occasionally the micro may get a bad ADC voltage reading, so each reading will be range checked for sanity before being used. Additionally each value used for calculations will be the average of a number of ADC readings. The calculations will be simple integer arithmetic with careful attention to the range of values. We can do 16 or even 32 bit arithmetic on this micro to insure that there is adequate range for the calculations without danger of arithmetic overflow.
Thorough testing will be done, and when it is shown to be reliable the ebraking current in the Controller can be increased to a more normal level. In the event of a failure the ebraking system can be unplugged, or perhaps I will set up a fixed potentiometer value so it can be set to some value as a backup, and of course the dual 203mm hydraulic front disc brakes are unaffected by all this, so considerable braking is always available.