So for folks trying to understand how tpwmthrs is calculated, and especially how to convert it to mm/s...
12,000,000 / (256 * tpwmthrs) = steps / second
You need steps per mm from M92... be careful with units...
Then multiply mm/step * step/second
Using evan38109's config as an example:
M350 X32 Y32 Z32 E32 I1 ; configure microstepping with interpolation
M92 X{400 / (18 * 2) * 32} Y{400 / (18 * 2) * 32} Z6400.00 E1674.00 ; set steps per mm
They're using 32 microstep units, and M92 gives microsteps per mm.
400 / (18 * 2) * 32 = 355.55 microsteps / mm
355.55 / 32 = 11.11 steps / mm
So for 40 tpwmthrs...
(1 mm / 11.11 steps) * (12,000,000 / (256 * 40)) = 105.5mm/s
The 12,000,000 comes from the clock frequency, tpwmthrs is in units of clock period
Check out the datasheet:
https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2160A-datasheet_Rev1.06.pdf