I'm having a hard time setting the correct values of the PI-controllers of the TMC4671. Through simulation I know exactly which values the PI-controllers should have, but the datasheet doesn't clearly state how the parameters are interpreted by the chip.
I'm using the classic PI-structure for which the datasheet states the following scalings (eg. for torque PID)
y_pid_forque = pid_torque_p * error_torque/256
y_pid_torque_rate = pid_torque_i * error_torque/65536/(32us)
The P and I-values are s16, which leads to the first problem: minimum P-value is 1/256, so about 0.0039. However, since the current controller gets mA as input and an output-range of 24 V (in my application), the desired P-value tends to be lower than that for motors which require less than 1 A maximum current.
The real problem, however, is the I-setting. First off, it isn't stated what kind of integrator method for the discrete PI-controller is used. My best guess is the Euler-method though since only the 32us is stated. If i'm using that, then the I value would be calculated as P/Tv * 32e-6 * 65536. However, the given formula from the datasheet suggest I'll have to use P/Tv * 65536/32e-6. Whatever formula I use doesn't really fit the register values, and I couldn't find any more hints on how the internal PI-controllers handle the register values.
My simulation gives me P = 0.0028 and Tv = 2.3054e-5 as values for the torque controller. So what am I supposed to put into the registers to get these PI-settings?