Description
I want to just lay out the foundation for a possible improvement, and also get feedback to verify the idea.
Issue
Lemma 1
Current is proportional to forward torque but only when its vector is at a 90-degree electrical angle.
Lemma 2
The current always lags the rotating voltage vector.
In the present Voltage control scheme, a 90-degree electrical angle is not maintained when speed increases.
Currently, this is the control scheme
Arduino-FOC/src/StepperMotor.cpp
Lines 297 to 299 in 45219c4
Vd=0
Vq=BEMF+ Itarget R

(Source)
Proposal
The voltage vector must be phase-shifted to compensate for the current vector lag. Since Park transform is already implemented, the phase lead angle can happen naturally by manipulating Vd. (White vector below)
The control should look like this:
Setting Vd=-Itarget * ω*RL will shift the effective current target vector to the desired 90deg. Only then will this current be proportional to torque.
ω is the electrical angular speed in rad/s. I.e. shaft speed * poles_pairs.
If the combined motor inductance RL is unknown, it can be set to 0.
From what I know, coil inductance can be an approximation of motor inductance, but I don't know how good. On the other hand, RLcan be found experimentally presumably by optimizing the value for maximum motor power.
References:
https://docs.simplefoc.com/voltage_torque_mode#voltage-control-with-current-estimation-and-back-emf-compensation
https://endless-sphere.com/sphere/threads/tsdz2-mid-drive-with-860c-850c-or-sw102-displays-only-flexible-opensource-firmware-casainho-code-only.93818/post-1376865
https://github.com/EGG-electric-unicycle/documentation/blob/master/Shane_Colton/3phduo.pdf - page 27.