Remap ebike throttle voltage

Hello i have an ebike with a throttle that operates very non linear when it comes to riding the bike

It's easy to control low speeds but hard to control high speeds towards the last 40% of the throttle, very twitchy and it's hard to cruise at the right speed

My goal is to remap the entire input throttle range from about 0.80V to 3.80V to output range of 1.30V-3.00V

I know basically nothing about arduino but i heard about a map function

Im thinking i can take the signal line from the throttle and put it to input on arduino, then another line from output on arduino to my ebike controller

It will be alot of code because from 0.80V-3.80V is 300 values

For example to start i would map 0.80v to 1.30v, then 0.81v to 1.31v, 0.82v to 1.32v etc

Can anyone write me some example code in which i could do this?

Here is the reference for the map() function from the Arduino language reference

Would it be possible to set up the ebike in a rig, run it and measuring RPM, preferably torque and trottle signal? That would give a rather good possibikity to correlate the throttle signal to the demand for RPM/torque.
Build a measuring devic that measures speed and trottle and store some data on SD or put a laptop in the backpack and do some driving.
Does the trottle output look like none linear related to the turning of the control? Or is it linear and the receiver needs a none linear signal?

More easily - and safely - done with op-amps!

@Paul__B
You really have a point! It takes a person very familiar to a testing, developing engineer to react properly if full speed suddenly is ordered by a malfunctioning controller. I know, I've experienced it in 3 ton forklift truck.

Maybe the bike throttle is just broken.

Railroader:
Would it be possible to set up the ebike in a rig, run it and measuring RPM, preferably torque and trottle signal? That would give a rather good possibikity to correlate the throttle signal to the demand for RPM/torque.
Build a measuring devic that measures speed and trottle and store some data on SD or put a laptop in the backpack and do some driving.
Does the trottle output look like none linear related to the turning of the control? Or is it linear and the receiver needs a none linear signal?

No i think the throttle output is quite linear

I think a lot of the reason is the ebike controller itself

It just doesn't seem to inject much power into the motor until the throttle hits about 50% and i have no deadband at the beginning or end because i tuned it out with resistors

So it could be fixed i think with having higher output at the beginning of the throttle and having some duplicate outputs towards the end to make it less twitchy

At the very close end of the throttle eg 90% onwards the controller injects field weakening and the speed jumps about 10kph, this area is incredibly twitchy to control

I am interested in hearing any other ways to improve on the throttle, since the arduino way adds alot of extra failure points to the throttle, and id also have to map 300 values to really do it well

Paul__B:
More easily - and safely - done with op-amps!

Do you have any more info? Maybe some op-amps could make produce a more sensitive signal at the beginning and less sensitive signal at the end?

Quote No i think the throttle output is quite linear
I think it is none linear!

Investigate it! Thinking , what ever that would be, is seldomly not good enough.

Bump for any input on the op-amp idea

It involves a couple of series diodes (1N4148 or 1N914) in the negative feedback which decrease the loop gain when they conduct at 1.2 V.

PM:

tolkaNo:
Hey I read your reply about the signal diodes

It's about time!

tolkaNo:
What im thinking is to add a diode in the forward position on the ground line of the throttle to make the voltage increase faster at the beginning

The problem with that suggestion is that you are introducing a fixed "idle" speed - you could not actually stop!

The effect would be the same as adding a resistance in series with the ground of the control potentiometer.

tolkaNo:
And add another diode in the reverse position on the power line of the throttle to make the voltage increase slower at the end
Do you think this would work?

A reverse biased diode will simply not conduct, so that gets you nowhere. Both of these ideas simply alter the range of the potentiometer, not its linearity.

No, this will need an op-amp circuit to implement. What supply voltage is available for this in the bike? Will need to find a suitable op-amp to work with this.