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

Extend PTC options and fix probing bugs #18253

Merged
merged 6 commits into from
Jun 10, 2020

Conversation

rudihorn
Copy link
Contributor

Requirements

This patch exposes some of the constants used by probe temperature calibration to the user and solves bugs described in #18227 .

Description

In the following code a bug was fixed where 2d point addition was performed to calculate probe_pos_xyz by casting measure_point to an xyz value first. The 0.5f constant is exposed to the user. In addition probe.offset_xy is projected to 2D so that PTC_PROBE_HEATING_OFFSET is in reference to the Z coordinate frame, not the probe trigger point.

            probe_pos_xyz = xyz_pos_t(temp_comp.measure_point) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }),
              noz_pos_xyz = probe_pos_xyz - xy_pos_t(probe.offset_xy); // Nozzle position based on probe position

The following fixes a bug where the probe wasn't stowed after each probe, stopping the printer from heating below the trigger point.

    const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false);  // verbose=0, probe_relative=false

Benefits

Allows probing on non-genuine pinda v2 probes.

Related Issues

#18227

@rudihorn rudihorn changed the base branch from 2.0.x to bugfix-2.0.x June 10, 2020 17:19
@rudihorn
Copy link
Contributor Author

Actually hold out on merging this, I would like to add linear extrapolation for temperatures below the start temperature.

@thisiskeithb
Copy link
Member

Does this retain compatibility with genuine PINDA V2 probes? I have a genuine MKS3s and another custom printer with a PINDA V2 I can test this on once the PR is ready for review.

@rudihorn
Copy link
Contributor Author

Does this retain compatibility with genuine PINDA V2 probes? I have a genuine MKS3s and another custom printer with a PINDA V2 I can test this on once the PR is ready for review.

This doesn't really change much, except it may adjust the height that your probe heats up at. Arguably the old code that did this process did something, but most likely not what it intended so a change of behavior is arguably not wrong either. In fact now that I think about it, the old code might in cases produce a wrong starting temperature value / offset. The linear extrapolation might also change the behavior at lower temperatures if enabled (disabled by default).

I also believe that the difference in probe behavior is probably more likely to be my aluminum heat bed rather than the probe itself. Though I do remember reading somewhere that the probes differ.

I have added the linear extrapolation, and so I'm happy for this to be reviewed.

@rudihorn
Copy link
Contributor Author

It is however a design decision if it is better to have the reference point be the Z=0 offset w.r.t M851 or if it should be w.r.t the probe trigger point and I should not project probe.offset_xy. Arguably this doesn't matter, though the nozzle will always be lower than the probe, so the user should be sure not to put jargon here and I think M851 in this regard, as M851 defines the lowest the probe is allowed to go.

@rudihorn
Copy link
Contributor Author

Thanks @thinkyhead! @thisiskeithb happily still give it another test and if you have any issues just get back to me on this and I'll make sure they are patched ASAP.

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.

None yet

3 participants