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

Bugfix: Correct dir_pin on stepper_z1 and stepper_z2 #489

Open
wants to merge 1 commit into
base: Voron2.4
Choose a base branch
from

Conversation

0xhqli
Copy link

@0xhqli 0xhqli commented Dec 16, 2024

  • Correct dir_pin on stepper_z1 and stepper_z2

Tried moving gantry up using sample config. The front side moved up and the back side moved down.

Checked other sample configs and found ! on dir_pin normally look similar between motors z and z2, and motors z1 and z3. Previous commit has ! on dir_pin similar between motors z and z1, and the motor z2 and z3.

Swapping the ! on dir_pin on z1 and z2 corrects the issue

* Correct dir_pin on stepper_z1 and stepper_z2

Tried moving gantry up using sample config. The front side moved up and the back side moved down. 

Checked other sample configs and found ! on dir_pin normally look similar between motors z and z2, and motors z1 and z3. Previous commit has ! on dir_pin similar between motors z and z1, and the motor z2 and z3. 

Swapping the ! on dir_pin on z1 and z2 corrects the issue
@CFreeman918
Copy link

I think this is dependent on your motor cables and the startup procedure has you run STEPPER_BUZZ STEPPER on each z motor.

@0xhqli
Copy link
Author

0xhqli commented Dec 17, 2024

Admittedly, I was focusing more on which stepper activated and its location during through STEPPER_BUZZ, and not paying too much attention to direction. It's a tad easy to miss which way the stepper moves and get lost on where in the pattern you are, so I jog the axis a 2-3 mm to check directionality after confirming the motors for the axis activate through STEPPER_BUZZ.

Also, I doubt my cable motors are an issue, they came with the LDO voron v2.4 stepper motor kit. If the cables for the steppers were the issue, it'd a bit odd to get 2 bad cables in one kit, since both motor cables used for the back steppers would need to be miswired in the same way to produce those results.

And if that was the only things I found, then I'd just depin and rewire the connectors, and call it a day. The sign that makes me think it's a misconfiguration in the sample file is how the pattern for dir_pin in the z steppers is different from the configuration files for other boards. For example(s):
Kraken config:

## Z0 Stepper - Front Left
##  Connected to Motor_5-S5
##  Endstop connected to MIN3
[stepper_z]
...
dir_pin: !PG10
...
##  Z1 Stepper - Rear Left
##  Connected to Motor_6-S6
[stepper_z1]
...
dir_pin: PD7
...
##  Z2 Stepper - Rear Right
##  Connected to Motor_7-S7
[stepper_z2]
...
dir_pin: !PB3
...
##  Z3 Stepper - Front Right
##  Connected to Motor_8-S8
[stepper_z3]
...
dir_pin: PB6
...

Octopus Config:

## Z0 Stepper - Front Left
##  Connected to MOTOR_2
##  Endstop connected to DIAG_2
[stepper_z]
...
dir_pin: !PG3
...
##  Z1 Stepper - Rear Left
##  Connected to MOTOR_3
[stepper_z1]
...
dir_pin: PC1
...
##  Z2 Stepper - Rear Right
##  Connected to MOTOR_4
[stepper_z2]
...
dir_pin: !PF10
...
##  Z3 Stepper - Front Right
##  Connected to MOTOR_5
[stepper_z3]
...
dir_pin: PF0
...

SKR1.3

## Z0 Stepper - Front Left
[stepper_z]
...
dir_pin: !z:P2.6
...
##  Z1 Stepper - Rear Left
[stepper_z1]
...
dir_pin: z:P0.20
...
##  Z2 Stepper - Rear Right
[stepper_z2]
...
dir_pin: !z:P2.11
...
##  Z3 Stepper - Front Right
[stepper_z3]
...
dir_pin: z:P0.11
...

SKR1.4

## Z0 Stepper - Front Left
[stepper_z]
...
dir_pin: !z:P2.6
...
##  Z1 Stepper - Rear Left
[stepper_z1]
...
dir_pin: z:P0.20
...
##  Z2 Stepper - Rear Right
[stepper_z2]
...
dir_pin: !z:P2.11
...
##  Z3 Stepper - Front Right
[stepper_z3]
...
dir_pin: z:P0.11
...

Spider

## Z0 Stepper - Front Left
[stepper_z]
...
dir_pin: PD13
...
##  Z1 Stepper - Rear Left
[stepper_z1]
...
dir_pin: !PC13
...
##  Z2 Stepper - Rear Right
[stepper_z2]
...
dir_pin: PE4
...
##  Z3 Stepper - Front Right
[stepper_z3]
...
dir_pin: !PC4
...

Looking at these other configs, there's a clear pattern where Z0 and Z2 spin in one direction, and Z1 and Z3 spin in the opposite direction. This pattern also matches up with the locations of which of the Z_Drive are normal versions and which of them are the mirrored versions.

Compared to the current config file for M8P v2.0

## Z0 Stepper - Front Left on MOTOR3_A
[stepper_z]
...
dir_pin: PB7
...
##	Z1 Stepper - Rear Left on Motor5
[stepper_z1]
...
dir_pin: PG12
...
##	Z2 Stepper - Rear Right on Motor6
[stepper_z2]
...
dir_pin: !PD7
...
##	Z3 Stepper - Front Right on Motor7
[stepper_z3]
...
dir_pin: !PD3
...

Z0 and Z1 spin in the same direction, and Z2 and Z3 spin in the opposite direction.

This runs contrary to the pattern found in the other config files, and seems to cause the one half of the gantry to move up while the other half moves down. Correcting the config so Z0 and Z2 spin the same direction and Z1 and Z3 spin the other direction fixes the issue.

@julianschill
Copy link
Contributor

I agree that it makes sense to have a default configuration where all axis at least move in the same direction, when all motors are wired the same. This is the case for all other configs. If it's the wrong direction the user has to invert, but chances are 50% they get it right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants