My first attempt to contributing - it started by trying to figure out my Amps to Accel/Decel Ratios from a log in Python, but then I realized there’s a distinct relationship between the Torque Offset needed and Speed:

Which kind of makes sense, average torque at standstill is 0 and at speed you’re pulling more Amps. I used linear regression to find coefficients for `atr_filtered_current`

and `erpm`

. Intercept was relatively small, so I constrained it to 0. Essentialy, instead of multiplying by `SIGN(d->erpm)`

, we can use `d->erpm`

itself:

```
float torque_adjusted = d->atr_filtered_current - 0.00022 * d->erpm * accel_factor;
expected_acc = torque_adjusted / accel_factor;
```

I’m assuming heavier riders need bigger Torque Offset, so that’s where the top `accel_factor`

comes from. It can be rearranged a bit, but by storing the `torque_adjusted`

first, it can be used as input in the Classic Torque Tilt as well (no need to raise nose at fast speeds).

The value of roughly `0.00022`

is what I got from the regression, but since `accel_factor`

is taken into account, I’m hoping it should be more or less the same for all riders if they tune that.

## This is where the fun begins!

By some miracle (Im0rtality’s vesc_toolchain) I’ve been able to test it and to my surprise it worked! Less over-reacting, bonks and drops felt really good, and overall it was mostly a pleasant experience.

There was however one weird moment, where on a messed up sidewalk it sort of jerked. I think. (probably wheel locked for a moment > different ERPM > different Torque Offset > different setpoint?). I’m guessing it might need to rely more strongly on some filtering or accurate wheelslip detection in some edge cases.

Still though, pretty excited. But I know placebo is a thing, would anyone be willing to try it at their own risk? Here’s a pre-compiled `.vescpkg`

:

Or if anyone could send me some representative VESC Tool ride logs for analysis, that would be much appreciated as well. And please tell me if it’s a completely wrong and flawed approach! What do you think?