I have a e-bike project that I am using kv31f and kms as the motor controller. Since I need a torque control, I have to use the current control mode of kms. As far as I understood, the torque control must first go through a speed control and after a threshold the torque control takes place. The problem is that in e-bikes the pedal is mechanically coupled with the motor, so when the user pedals the motors also spins. In this situation it seems to me that if the motor is already spinning or even above the rpm threshold, the controller is unable to enter the current control. The faults the system gives is kind of random to me, for example: peak current on phase (A/B/C) which is strange cause I am trying to use current control. Motor overspeed in low rpm and even under voltage using a DC power supply.
So, my question is: How can I use a current control for an e-bike with a motor mechanically coupled with the pedal?
Thanks in advance