Closed kAdonis closed 5 years ago
It's simply because the current goal is still just to get it working. And it should work but there hasn't been much testing to prove it.
It does make sense that we could/should use GLOBAL_SCALER
for better granularity but I don't know if there are any other major advantages. This way we can also forego setting the irun
and ihold
values on each call. Unless of course the user calls the overloaded method with a hold scaler specified.
...but I don't know if there are any other major advantages.
Trinamic states in the datasheet:
For high precision motor operation, work with a current scaling factor in the range 16 to 31, because scaling down the current values reduces the effective microstep resolution by making microsteps coarser
Now as the Watterott TMC5160 are available, probably more people will use them in their 3d printers.
Most stepper motors there need RMS current settings between 700 and 1000mA. The Watterott drivers have 0.075Ω sense resistors, which leads to CS values between 7 an 10, and therefore to low microstep resolution.
To keep CS >= 16 Globalscaler is needed.
Trinamic also recommends Globalscaler values above 128, so the best would be a combination of setting Globalscaler and CS for the rms_current
method
Edit: I asked Trinamic Support and they answered, that setting the current with Globalscaler is recommended. It is like adjusting the current by means of an analog signal, like with TMC2208 drivers
I opened a PR with the above code for easy testing
Hi First of all: thank you for this great work! Is there a reason you dont use Globalscaler for setting the current on TMC5160? Trinamic states in the Datasheet:
it could be:
This code is untested,I have two modified TMC5160BOB with a selfmade adapter-board on my 3D Printer, currently in standalone mode. I am waiting for a new adapter-board with SPI-support beeing etched. It should be ready next week. The TMC5160 are amazing, they ( and the mosfets) dont get even warm, with currents my TMC2130 overheat in 2 minutes.Edit: Tested an my printer (CoreXY with RAMPS/Re-Arm and TMC5160for X/Y)