[FW 3.5.2] M569.2 and microstepping lookup table
-
Hi all,
I'm doing some tests with NEMA24 ST6018 motors and TMC5160 driver using the Trinamic eval-kit and the TMCL-IDE.
The IDE allows also to define a lookup table to compensate torque ripples, and by using the settings in the picture below, I noticed a huge noise reduction of the motor.
You can find also attached the export of the registries' content from the TMCL-IDE.
20240815_10.40.36_TMC5160_Settings.txtNow I'm trying to port these settings in a Duet-based system but unfortunately, I'm not getting the same results... I'd say the noise even got slightly worse.
I have a CAN-connected expansion board and I've run these commands to set the microstepping LUT (I converted to decimal the content of the registry from 0x60 to 0x69).M569.2 P10.0 R96 V1149798536
M569.2 P10.0 R97 V2770936978
M569.2 P10.0 R98 V2840930900
M569.2 P10.0 R99 V575228500
M569.2 P10.0 R100 V2082
M569.2 P10.0 R101 V2876095456
M569.2 P10.0 R102 V2299679402
M569.2 P10.0 R103 V525328
M569.2 P10.0 R104 V4294943830
M569.2 P10.0 R105 V16121857Furthermore, if I run the M569.2 commands without the V param to check if the registries are correctly written, I always get 0x00000000.
Does anyone have a hint if this could be the right approach to implement the lookup table and how I could check the registries' content?
Did someone try to exploit this Trinamic feature?Thank you in advance.
-
@leone most TMC5160 registers are write only, so they read back as zero.
You can provide hex values directly like this:
M569.2 P10.0 R96 V{0x44888888}
I suggest you try again using this notation, in case you made a mistake converting any of the values to decimal.
-
@leone What hardware and firmware version are you using? In the Gcode dictionary for M569.2, it says:
M569.2: Read or write stepper driver register
Supported in RRF 3.3 and later on main boards with TMC22xx or TMC51xx stepper drivers.From RRF 3.4.0 it is supported on expansion boards, I've added this to the Gcode entry. A small bug was fixed in 3.5.1:
[EXP1HCL] The M569.2 command to read stepper driver registers was not supported
You say you have a 'CAN-connected expansion board', is this a Duet 3 one, or something else?
You could try setting and reading back a register that is read/write, to check that it works. Check the datasheet to find which registers are safe to change temporarily.Ian
-
@dc42 thank you for the clarification and the suggestion. Unfortunately I get some errors with some hex values:
M569.2 P10.0 R97 V{0xA5292492} Error: at column 32: M569: expected non-negative integer
and if I echo the string, I get a decimal number which is different from a conversion I've done with a calculator (0xA5292492 --> 2770936978).
echo {0xA5292492} 2770937088.0 echo V{0x44888888} 1149798536
Can you replicate this behaviour?
-
hi @droftarts, I confirm that if I read a readable registry (e.g. M569.2 P10.0 R106) the command works.
What I see now, is that for some hex values, the command doesn't work because the value I'm passing is converted to a floating point.
M569.2 P10.0 R97 V{0xA5292492}
Error: at column 32: M569: expected non-negative integerecho {0xA5292492}
2770937088.0also, this number is different from a conversion I've done with a calculator (0xA5292492 --> 2770936978).
The following value it seems to be ok.
echo V{0x44888888}
1149798536Why do you think the conversion is generating a floating point number?
-
-
@leone please try the firmware build at https://www.dropbox.com/scl/fo/42aeqn7cndtkwe36nwkig/APkS2re8b3ROZZu0Z2NggxA?rlkey=z704mbv9kd3o6t67i857nhtl1&dl=0 and see if that fixes it.
Caution: although this build reports itself as 3.5.3-rc.1 the final 3.5.3-rc.1 build we release may be different.
-
@leone this issue is probably fixed in RRF 3.5.3-rc.1 released yesterday.
-
@dc42 thank you for having looked into that, the conversion now works.
Unfortunately, the behavior of the motors after changing the lookup table is still not the same as with the TMCL-IDE. -
@leone did you change the hysteresis values to the ones given by the TMC IDE too?
-
@dc42 yes, I set the driver parameters as in the TMCL-IDE (I copied the contend of the register 0x6C with M569.2).
I am using a custom board, I will check over the next few days if there is interference in the output of the TMC5160 distorting the signal going to the motor.