Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [bugfix-2.0.x] Dual Z Setup - Z steppers run at different steps/mm (SKR 1.3 + TMC2208) #13470

Closed
Yannik opened this issue Mar 24, 2019 · 10 comments

Comments

@Yannik
Copy link
Contributor

Yannik commented Mar 24, 2019

On a Dual-Z setup with a SKR1.3 and TMC2208's running the latest bugfix-2.0.x, the Z stepper runs with the correct steps/mm, while the second Z stepper (E1) runs at an incorrect (lower) steps/mm.

This may be related to #13469.
config.zip

@kAdonis
Copy link
Contributor

kAdonis commented Mar 24, 2019

It is related to #13469
you have defined Z_DUAL_STEPPER_DRIVERS
so you need to define
#define Z2_DRIVER_TYPE TMC2208
and comment
//#define E1_DRIVER_TYPE TMC2208

@Yannik
Copy link
Contributor Author

Yannik commented Mar 24, 2019

@kAdonis
Okay, that's a bit confusing. I still have to use INVERT_E1_DIR to set the right direction, right?

The build is now running into an TMC2208 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN. error.

I could manually set these constants in the board configuration, but shouldn't this be handled automatically (and therefore be fixed upstream?).

@kAdonis
Copy link
Contributor

kAdonis commented Mar 24, 2019

Okay, that's a bit confusing. I still have to use INVERT_E1_DIR to set the right direction, right?

yes, it is

I dont have a SKR1.3 and no TMC2208
I see no way to handle all possible configurations automatically
AFAIK the SKR1.3 is kept basic to be cheap, with only the pins broken out, the average user needs

@Yannik
Copy link
Contributor Author

Yannik commented Mar 24, 2019

@kAdonis The UART pins are defined for E1:

#define E1_SERIAL_TX_PIN P1_04
#define E1_SERIAL_RX_PIN P1_01

It works fine if I simply add

#define Z2_SERIAL_TX_PIN P1_04
#define Z2_SERIAL_RX_PIN P1_01

to the pins config.

I thought that this could be handled automatically, same as the motor pins are automatically set e1->z2 if dual z steppers are used.

@gloomyandy
Copy link
Contributor

The pins file for the SKR V1.3 is very new (as is the board) and came I think from bigtreetech, these sorts of things take time to iron out. It should probably have both sets of defines in the pins files, but to be honest it is not that unusual for you to have to make modifications to the pins files when using slightly non-standard configurations.

I suppose you could argue that the mapping should happen automatically when Marlin maps Z2 to E1, but it all adds to the (already complex) Marlin config. I don't think the "right" way to handle this has become established yet. Very few pins files currently have any TMC2208 configurations especially for software serial.

For now a PR that defines the Z2 values might help others avoid the problems.

@forkoz
Copy link
Contributor

forkoz commented Mar 25, 2019

They left out serial0 but its the same pins as mks sbase. Jumpers also had to be removed, not just moved to the side to set the correct stepping on LV8729.

@thinkyhead
Copy link
Member

I thought that this could be handled automatically, same as the motor pins are automatically set e1->z2 if dual z steppers are used.

It probably could be. These are some new things and haven't been integrated at every level.

@YMita2017
Copy link

Thanks, but seems reverse.
And can't change by #define E1_invert_dir.

@YMita2017
Copy link

Find problem and locally fix it.
But problem of Z axis support triple stepper support left. (not fixed)

Configuration_adv.h
449 + #define INVERT_Z2_VS_Z_DIR true // Set 'true' if Z motors should rotate in opposite directions

L6470_Marlin.cpp
60 - INVERT_Z_DIR , // 5 Z3
60 + #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
61 + INVERT_Z_DIR ^ INVERT_Z2_VS_Z_DIR , // 5 Z2
62 + #else
63 + INVERT_Z_DIR , // 5 Z2
64 + #endif

stepper.cpp
322 - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0)
322 + #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE((v) != INVERT_Z2_VS_Z_DIR); }while(0)

@github-actions
Copy link

github-actions bot commented Jul 5, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants