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

(SKR 1.3) Assign DIAG pins for homing dir #15972

Merged
merged 6 commits into from
Nov 23, 2019

Conversation

pfillion42
Copy link
Contributor

@pfillion42 pfillion42 commented Nov 22, 2019

Requirements

SKR 1.3
Stepstick that use stallguard diag pin
sensorless homing with stallguard
(X,Y,Z)_HOME_DIR == 1

Description

Added a condition to correctly assign the pins of SKR 1.3 when using sensorless homing in positive direction with stallguard. In the case that the printer use positive homing direction, marlin use (X,Y,Z)_MAX_PIN to trigger but the stallguard diagnostic pin is physically on (X,Y,Z)_MIN_PIN

Benefits

The code automatically validates the need to change the allocation of pins

Related Issues

To assign the pins and apply them to the right logical endstops. In the case where:

1.There is one or more TMC2130 steppers used on the Z axis
2.I use diagnostic pills (Stallgard sensorless homing) to activate endstops
3. The homing direction on the Z axis is upwards

As it is specific to this board, I believe that the change can be included
To assign the pins and apply them to the right logical endstops. In the case where:

1.There is one or more TMC2130 steppers used on the Z axis
2.I use diagnostic pills (Stallgard sensorless homing) to activate endstops
3. The homing direction on the Z axis is upwards

As it is specific to this board, I believe that the change can be included
@pfillion42 pfillion42 changed the title Pin reassignment when stallguard is used on the Z axis conditional on homing direction Pin reassignment when stallguard is used on the Z axis conditional on homing direction SKR 1.3 Nov 22, 2019
// Use normal endstop pins
#define Z_MIN_PIN P1_25
#define Z_MAX_PIN P1_24
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Z-axis only?
Why only with stallguard?
Why "TMC2130" only?
Why only this board?
Why at all?

Copy link
Contributor Author

@pfillion42 pfillion42 Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Z-axis only?
No

Why only with stallguard?
Yes

Why "TMC2130" only?
You're right, not necessarily only tmc2130 but all the stepstick that uses the pin diag on the SKR 1.3

Why only this board?
Because it is related to the way SKR1.3 is manufactured.
The Z Stepstic connector diagnostic pin uses P1_25, the same as Z min Endstop.

If you are trying to use Stallguard to homing the Z axis (x cary assembly) on the upper brackets, as for the prusa i3, the diagnostic pin of the Z Stepstick will not trigger Z_MAX_PIN as it should.

Why at all?
That's all why.
Look SKR 1.3 Board layout
SKR1 3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it is only for the z axis but, I can also do the pin validation for x and y also in the case where someone uses stallguard and home in the opposite direction.

Copy link
Contributor Author

@pfillion42 pfillion42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new commit with all axis validation

@pfillion42 pfillion42 changed the title Pin reassignment when stallguard is used on the Z axis conditional on homing direction SKR 1.3 Pin reassignment logic to use stallguard on diag pins and homing in positive direction on SKR 1.3 Nov 22, 2019
@pfillion42
Copy link
Contributor Author

My bad, i just see that my description was not transfert in the request

@thisiskeithb
Copy link
Member

pins_BTT_SKR.h is shared by both the SKR 1.1 and SKR 1.3, so if you only want this apply to the SKR 1.3, it should be moved to pins_BTT_SKR_V1_3.h.

New version with limit switches pins re-transferred to SKR 1.1 and SKR 1.3 map files that include proposed changes to support the stallguard in a positive direction
@pfillion42
Copy link
Contributor Author

pins_BTT_SKR.h is shared by both the SKR 1.1 and SKR 1.3, so if you only want this apply to the SKR 1.3, it should be moved to pins_BTT_SKR_V1_3.h.

Good point!
I made the changes in the 3 files BTT_SKR so that the pins are treated by board

@thinkyhead
Copy link
Member

the stallguard diagnostic pin is physically on (X,Y,Z)_MIN_PIN

For boards that have this as a fixed behavior, I see that our only option is to switch the pin definition so that the endstop pin corresponds to the DIAG pin which is in use. Perhaps in the future we'll have a more general way to route the DIAG pin to the endstop function, considering the DIAG pin a more formal member of the endstop pin family.

@thinkyhead thinkyhead merged commit 4a5dee6 into MarlinFirmware:bugfix-2.0.x Nov 23, 2019
@thinkyhead thinkyhead changed the title Pin reassignment logic to use stallguard on diag pins and homing in positive direction on SKR 1.3 (SKR 1.3) Assign DIAG pins for homing dir Nov 23, 2019
LinoBarreca pushed a commit to LinoBarreca/Marlin that referenced this pull request Dec 18, 2019
philippniethammer pushed a commit to philippniethammer/Marlin that referenced this pull request Dec 21, 2019
christran206 pushed a commit to christran206/Marlin2.0-SKR-Mini-E3-1.2 that referenced this pull request Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants