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

Add G38.4 and G38.5 #13348

Merged

Conversation

michielbaird
Copy link
Contributor

@michielbaird michielbaird commented Mar 10, 2019

Requirements

  • Filling out this template is required. Pull Requests without a clear description may be closed at the maintainers' discretion.

Description

Add support for G38.4 and G38.5

This adds the option to move away from the target and stop as soon as the Z-endstop stops being triggered. See: http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G38-probe

  • G38.2 and G38.3 move in a direction and stop as soon as the Z-endstop is triggered.
  • This PR extends this functionality to stop was soon as the endstop is un-triggered.

Benefits

  • I intend to use this function to add auto skew correction on the Prusa MK42 board
  • This will be used to calibrate the position of the induction pads.

Related Issues

#6199

@michielbaird michielbaird changed the title Add g38.4 and g38.5 Add G38.4 and G38.5 Mar 10, 2019
@thinkyhead thinkyhead force-pushed the add-G38.4-and-G38.5 branch 2 times, most recently from d787f6d to 743af33 Compare March 10, 2019 14:14
@thinkyhead
Copy link
Member

Looks good. As soon as it passes it can be merged. I don't recommend trying to piggyback MK2 skew calibration onto G38, but you may be able to use the underlying probe changes via a separate G-code. I don't know what Prusa uses, but I suggest overloading M852.

@thinkyhead thinkyhead force-pushed the add-G38.4-and-G38.5 branch 3 times, most recently from 6f74d36 to 2d5784e Compare March 10, 2019 15:16
@thinkyhead
Copy link
Member

To get this rebased, squashed branch to your working copy:

git fetch origin
git checkout add-G38.4-and-G38.5
git reset --hard origin/add-G38.4-and-G38.5

@michielbaird
Copy link
Contributor Author

Thank you very much, looking forward to seeing this get merged

@boelle
Copy link
Contributor

boelle commented Mar 10, 2019

i look forward to this also :-D

the only thing i'm not sure on is my probe offset, the nozzle can go to 0,0 when i ask it to and i can place the nozzle on the 250,210 corner diagional to 0,0 so i assume that my X and Y min numbers are correct

so far i have used bilinear and some carefull selected numbers to get it to hit the 9 prove points on the bed, but it has always seemed like the probe was not on dead center

how can i check that my offset is correct ? (just asking so i can prepare for when the next bit is added)

@@ -672,14 +672,17 @@ void Endstops::update() {
}while(0)

#if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ)
#if ENABLED(G38_PROBE_AWAY)
#define _G38_OPEN_STATE (G38_move > 2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thinkyhead I think this is a bug, this should be a 3

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I usually double-check my late-night coding the next day, but I was about ready to just merge and forget!

@michielbaird
Copy link
Contributor Author

how can i check that my offset is correct ? (just asking so i can prepare for when the next bit is added)

Part of the calibration is calibration is calculating this offset translation. My endstops on my clone are out of spec so I expect this to come up during my testing

@thinkyhead thinkyhead force-pushed the add-G38.4-and-G38.5 branch from 7d6c19d to e97d9df Compare March 10, 2019 22:20
@thinkyhead thinkyhead merged commit b824a51 into MarlinFirmware:bugfix-2.0.x Mar 10, 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.

3 participants