MKS-TinyBee icon indicating copy to clipboard operation
MKS-TinyBee copied to clipboard

TMC2209 microstep DIP switch settings

Open HoverClub opened this issue 2 years ago • 19 comments

@radioproektor in https://github.com/makerbase-mks/MKS-TinyBee/issues/1#issuecomment-1013806992 ... and referenced https://github.com/makerbase-mks/MKS-TinyBee/issues/14#issue-1157121266

I'm pretty sure that the above linked graphic isn't correct. The TinyBee DIP switches connect to Vdd when ON, Gnd (via internal pull-down on 2209) when OPEN. Switch table should look like this:

MS1 MS2 uSteps
OFF OFF 8
ON OFF 32
OFF ON 64
ON ON 16

Note that MS3 switch is normally left OFF (open circuit) when using a 2209 as it's connected to the Tx UART output on some modules. On other modules it's connected to SPREAD input (switch ON to enable SpreadCycle, OFF for StealthChop) eg. FYSETC v3+. Usually pin next MS2 is marked SP or SPRD instead of UART or Tx on the module.

References: TinyBee Schematic : https://github.com/makerbase-mks/MKS-TinyBee/blob/main/hardware/MKS%20TinyBee%20V1.0_001/MKS%20TinyBee%20V1.0_001%20SCH.pdf Trinimatic TMS2209 Datasheet: https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2209_Datasheet_V103.pdf

HoverClub avatar Mar 15 '22 14:03 HoverClub

tinybee does not support uart mode, ms3 can ignore it

MKS-hosiey avatar Mar 16 '22 03:03 MKS-hosiey

I know it doesn't support UART mode but you still need to consider MS3 switch if using a 2209 module that has SPREAD signal on that pin. eg: https://wiki.fysetc.com/Silent2209/#v30-hardware-connection V3.0 hardware.

HoverClub avatar Mar 16 '22 16:03 HoverClub

Another question regarding TMC2209 Standalone and the DIP switches. If I set it to 16 does it automatically interpolate to higher steps? I ask because I have never used standalone. I have always been able to setup the TMC's through the firmware (UART or SPI).

3DSmitty avatar Mar 29 '22 01:03 3DSmitty

From the datasheet:

13 STEP/DIR Interface The STEP and DIR inputs provide a simple, standard interface compatible with many existing motion controllers. The MicroPlyer step pulse interpolator brings the smooth motor operation of high- resolution microstepping to applications originally designed for coarser stepping.

So, yes, the device produces 16 (256 / 16) interpolated "steps" at the motor from each of the 1/16 microsteps supplied.

HoverClub avatar Mar 29 '22 08:03 HoverClub

Ok thank you HoverClub. So it is enabled by default good to know. According to the schematic the MS3 switch does connect to VDD so I would say yes it can be used to turn ON SpreadCycle or OFF for StealthChop.

3DSmitty avatar Mar 29 '22 12:03 3DSmitty

... so I would say yes it can be used to turn ON SpreadCycle or OFF for StealthChop. Only if it's connected to the SPREAD signal on the specific 2209 module that you are using (most use that pin for UART Tx , some for SPRD).

HoverClub avatar Mar 30 '22 14:03 HoverClub

Looking at the schematic of the MKS TMC2209 only has a resistor between the SPREAD pin and MS3 so in theory it should work? By default, it comes with interpolation and stealthchop2 enabled.

3DSmitty avatar Mar 30 '22 16:03 3DSmitty

The resistor connects Sprd to +5v - permanently enabling StealthChop mode (https://github.com/makerbase-mks/MKS-StepStick-Driver/blob/master/MKS%20TMC2209/MKS%20TMC2209%20V1.0_001/MKS%20TMC2209%20V1.0_001%20SCH.pdf). It'll work fine but I'd leave MS3 switch OFF to avoid shorting the UART signal to ground.

HoverClub avatar Mar 30 '22 16:03 HoverClub

True.

3DSmitty avatar Mar 31 '22 03:03 3DSmitty

After reading this topic I am left with doubts, my English is not very good, maybe I have a bad interpretation From what is stated here.

When setting to 64 microstepping How many steps does the tcm2209 actually work at?

LouisR21 avatar May 07 '22 19:05 LouisR21

@LouisR21 normally you only want to set the TMC drivers to 16 steps if interpolation is enabled. It will automatically interpolate to 256 steps when needed. This way you get the most torque and speed out of your TMC driver. Hope that helps.

3DSmitty avatar May 07 '22 21:05 3DSmitty

AFAIK it interpolates a full step to 256 microsteps therefore if you supply 64 microsteps to the drive it'll "expand" each 1/64 microstep to 4 small steps (256/16). Ideally, you should use the microstep value that gives the positional accuracy you need from the machine. (which also depends on the motors and drive system you are using). You should always use the smallest microstep value you need to obtain the accuracy required - higher values just use more processing and comm bandwidth.

HoverClub avatar May 07 '22 22:05 HoverClub

@LouisR21 normally you only want to set the TMC drivers to 16 steps if interpolation is enabled. It will automatically interpolate to 256 steps when needed. This way you get the most torque and speed out of your TMC driver. Hope that helps.

you help me a lot! I am grateful for your response. maybe there is my problem in step calculations why its my first time using TMC.

Could you support me to correctly configure the TMC in the tinybee. I don't know about interpolation, I'm going to investigate today on the subject, and if I have any problems, can I consult you?

LouisR21 avatar May 07 '22 22:05 LouisR21

AFAIK it interpolates a full step to 256 microsteps therefore if you supply 64 microsteps to the drive it'll "expand" each 1/64 microstep to 4 small steps (256/16). Ideally, you should use the microstep value that gives the positional accuracy you need from the machine. (which also depends on the motors and drive system you are using). You should always use the smallest microstep value you need to obtain the accuracy required - higher values just use more processing and comm bandwidth.

Interesting information, in my opinion these configurations are responsible for the problems of losing steps that I have seen published in other topics about tinybee.

LouisR21 avatar May 07 '22 22:05 LouisR21

@LouisR21 Interpolation is enabled by default on the tinybee and in Marlin

3DSmitty avatar May 07 '22 22:05 3DSmitty

@3DSmitty Understood, this week I will make adjustments, I had it set to 64, I think that could be creating a collapse in communication and generating this? 163733926-46610b74-b949-49b1-b3aa-5586c7d98da3

LouisR21 avatar May 07 '22 22:05 LouisR21

@LouisR21 yes good possibility. You may want to double check your current is also correct. Too high or too low will cause it to loose steps.

3DSmitty avatar May 07 '22 22:05 3DSmitty

@HoverClub @3DSmitty thanks for the explanations, something tells me that this will solve my headache hehehe

LouisR21 avatar May 07 '22 22:05 LouisR21

Hack to do tmc2209 uart mode is at https://github.com/makerbase-mks/MKS-TinyBee/issues/6 You might loose some functionality on display and stuff. Has not been tested very much yet.

AapoTahkola avatar Jun 29 '22 12:06 AapoTahkola