Commit Graph

33 Commits

Author SHA1 Message Date
Michael Rose 27f8cf025e
z_tilt: expose an 'applied' status to allow macros to skip QGL/Z_TILT_ADJUST (#4313)
This is useful for macros that'd like to skip QGL if already leveled,
e.g.:

```
    {% if not printer.quad_gantry_level.applied %}
        QUAD_GANTRY_LEVEL
    {% endif %}
```

Signed-off-by: Michael Rose <elementation@gmail.com>
2021-06-02 11:11:19 -04:00
Kevin O'Connor 4115a77342 gcode: Automatically call reset_last_position() on a toolhead set_position()
Generate a "toolhead:set_position" event on a call to
toolhead.set_position() and use that event to automatically call
gcode.reset_last_position().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-08-20 21:03:22 -04:00
Kevin O'Connor f931da1b87 extras: Use "from . import module" for relative imports
Use alternate import syntax to improve Python3 compatibility.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
fess c9daefd97f z_tilt: retries, fix extra retry bug.
round to only 6 decimal places of precision.  prevents doing extra retry
from small variations due to floating point math.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2020-05-18 14:55:25 -04:00
fess 7b0e6725ca z_tilt: retries fixup err message
print retries status before erroring on increase

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2020-05-18 14:55:25 -04:00
Kevin O'Connor dce46ea053 z_tilt: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 3990d997de z_tilt: Raise a gcode.error() instead of directly calling respond_error()
Raising an error (instead of reporting an error) is important as only
a raised error will stop a print from virtual_sdcard.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-24 10:10:33 -04:00
Kevin O'Connor 8ed0f7c5c3 kinematics: Remove support for identifying Z steppers
The caller can now determine which steppers are connected to cartesian
Z movement via the new stepper.is_active_axis() method.  It is
therefore no longer necessary for the kinematic code to identify these
steppers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-23 20:47:01 -05:00
Kevin O'Connor 2843c85019 toolhead: Rename _full_flush() to flush_step_generation() and use globally
Update code that modifies the low-level kinematics handlers to first
call toolhead.flush_step_generation().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor bd3c8920f6 mcu: Remove set_ignore_move()
Update callers of set_ignore_move() to use the trapq system to set a
stepper to ignore moves.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Petri Honkala f8f0c3f142 z-tilt: Unresolved symbol fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-09-24 12:17:03 -04:00
fess 49c36f868b z_tilt: Support retries
Support retrying Z_TILT_ADJUST a configurable number of times
to a configurable tolerance both in the config or as parameters.

- By default keeps original behavior of no retries.
- Adds parameters RETRIES and RETRY_TOLERANCE to QUAD_GANTRY_LEVEL gcode.
- adds config options retries and retry_tolerance to uad_gantry_level]
- issues an error if we are getting worse intead of approaching tolerance
- issues an error if retries were requested but we did not reach the tolerance
in the specified number of retries

the minimum change should  be a single z step for those
probing 2 points for 2 stepper motors and 3 for 3 stepper motors.

at one point it was suggested to use the amount of z adjustment instead of the
range of the probed points as a trigger for retry. I've chosen not to do this.
using z adustment in these cases means the minimum unit of change is related to
the angle created by the probed points  and the distance to stepper motor and
can be more than a couple steps which is rather unintuitive.

for the case when someone is using more probed points than z steppers the
probed points range will have some fixed minimum value that can't be reduced
which is also unintuitive but that case should idealy be the rarer case, and
the user can learn to set a higher tolerance that matches their probing setup.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-06-18 12:12:25 -04:00
fess 4681775219 z_tilt: Add RetryHelper
add RetryHelper class in prep for implementing retries for both z_tilt
and quad_gantry_level

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-06-18 12:12:25 -04:00
Kevin O'Connor 20851ab3e9 z_tilt: Separate z adjustment code to new ZAdjustHelper class
Introduce a new class to perform the low-level Z stepper adjustments.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-17 11:17:47 -04:00
fess 7d2e3de977 z_tilt: minimum points 2
"The z_tilt_adjust was coded to require 3 points because the original
intent was for railcore-xl and voron.  Since then, a number of users
have started using z_tilt_adjust for prusa i3 style printers with dual z
steppers.  That's fine, but we just haven't gotten around to removing
the superfluous check in the code." -- Kevin O'Connor

remove that check.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-05-21 14:17:09 -04:00
fess 9887e72570 probe: ProbePointsHelper adjustable minimum points
Factor out minimum required points check for ProbePointsHelper
in prep for setting different values for quad_gantry_level
and z_tilt_adjust

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-05-21 14:17:09 -04:00
Arne Jansen f145439267 z_tilt: bugfix for final correction of z-offset
The z_adjust offset provided to adjust_steppers is calculated given the
steppers adjust exactly according to the given x_adjust/y_adjust. As the
algorithm eliminates an offset that is common to all steppers, this offset
must be taken into account in the final correction.

Signed-off-by: Arne Jansen <arne@die-jansens.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-10 12:00:35 -04:00
Kevin O'Connor 1731fbbca4 gcode: Change respond_info() to log by default
It makes sense to log most respond_info() content, so do that by
default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-04 13:04:18 -05:00
Kevin O'Connor 857e7ed5f1 klippy: Convert printer_state("connect") to an event handler
Convert all users of the printer_state("connect") handler to register
a "klippy:connect" event handler instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 11:09:55 -05:00
Petri Honkala b2d5a8e65b z_tilt: unresolved reference fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-01-08 08:44:25 -05:00
Kevin O'Connor 43f2eac239 z_tilt: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor c3550158bb z_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 33887b8c39 probe: Support manual probing at runtime
Don't require the config file to specify manual probing.  Instead,
allow the user to select manual probing on each ProbePointsHelper
invocation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 8e7eac9b08 probe: Implement ProbePointsHelper get_probed_position() locally
Now that all users of ProbePointsHelper use the same
get_probed_position() code, it is possible to implement that locally
within the ProbePointsHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Arksine 3387cccdcf bed_mesh: move probe x and y offsets to the [probe] module
All probe offsets are now passed to the finalize() callback in the ProbePointsHelper Class.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-19 16:52:23 -04:00
Kevin O'Connor ca505bf4ac kinematics: Convert get_rails() method to get_steppers()
All callers of get_rails() actually just want the steppers, so return
them directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-16 10:16:16 -04:00
Kevin O'Connor 94dc8167c9 z_tilt: Don't default "points" parameter to "z_positions" parameter
It's rare to have all the Z stepper locations directly under the
printable surface, so using z_positions for points is not a good
default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-15 10:30:27 -04:00
Kevin O'Connor d9a32f75fa probe: Rename get_position() callback to get_probed_position()
The different uses of get_position() can be confusing, so choose a
different name for the ProbePointsHelper callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 15:33:12 -04:00
Kevin O'Connor 0216201cb6 delta: Rename get_position() to calc_position()
Calculating the cartesian position from the stepper positions can be
complex and cpu intensive, so rename it to calc_position() to be more
descriptive.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor 0791c69499 stepper: Replace PrinterHomingStepper with PrinterRail
Update the code to use the term "rail" when dealing with a motor
controlled "axis".  A rail has a series of steppers and endstops that
control that motor controlled "axis".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor b96542f0e5 stepper: Don't peak into PrinterStepper members
Add additional wrapper functions so that no outside callers need to
peak into the member variables of PrinterStepper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor 544f8c1e85 stepper: Add a get_name() method to PrinterStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor 3025638b9b z_tilt: Add support for Z_TILT_ADJUST
Add new module to support independent adjustments to multiple Z
steppers to account for bed tilt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-22 22:23:44 -04:00