Perform lifting at the end of EddyTap.run_probe(). This is in
preparation for performing tap analysis during retraction.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new EddyParameterHelper to override ProbeParameterHelper.
Only use the printer.cfg lift_speed, samples, sample_retract_dist,
samples_result, samples_tolerance, and samples_tolerance_retries
settings for normal probe operations. Don't use these defaults when
using a "METHOD" set to "scan", "rapid_scan", or "tap". Each of these
probing mechanisms is distinct and it's unlikely a user could
meaningfully set a default for all of them.
Don't set sample_retract_dist when using "scan" and "rapid_scan"
modes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Theoretically a "tap" probe should detect the exact point that the
nozzle contacts the bed. In practice, however, there can be a
systemic bias that one may wish to account for. This bias may be due
to backlash, thermal expansion, a detection bias, or similar issues.
Add a new tap_z_offset config parameter to allow users to specify an
offset.
Also, update the Z_OFFSET_APPLY_PROBE command to support modifying
this value.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The config option 'z_offset' name is confusing as its behavior is
notably different from how other probe hardware uses 'z_offset'.
Rename to 'descend_z' to make its behavior more clear.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new create_probe_result() helper function that can generate a
ProbeResult using a toolhead position and a set of probe offsets.
Use this helper in other modules.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
compatibility fix for newer avr-libc - define stack pointer
add missing avr/io.h include to adc.c
add missing avr/io.h include to spi.c
Signed-off-by: Nicolás Méndez <9phhsyrbm@relay.firefox.com>
Use a different method of setting the hardware pwm registers so that
the actual cycle_time is much closer to the requested cycle_time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There is no need for elaborate math scaling of the cycle_time value to
the local clock ticks. Just hardcode a scale of 16, which simplifies
the math calculations.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If the config parameter "max_power" is less than 0.05, the heaters will never start heating. Added PWM threshold scaling with "max_power" value.
Signed-off-by: Maksim Bolgov <maksim8024@gmail.com>
If a greenlet is created from a greenlet then it seems the Python
interpreter will increment its call depth counter and that can
eventually lead to a RecursionError exception being raised.
To avoid this issue, switch back to the main run() instance if a new
greenlet needs to be created.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
When delaying response registration, don't warn about any of these
messages that arrive prior to the aactual response registration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename mcu.register_response() to mcu.register_serial_response and
validate the message response format.
Only register the callbacks after the mcu has been initialized. This
avoids invoking callbacks with data from a previous sessions, which
could lead to internal errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 1473b79a moved the deprecate mesage generation to the
PrinterConfig() class, but failed to use the proper variable name for
'section'.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Generate intermediate updates if a set_pwm() call schedules an update
far in the future.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allow the "tap_threshold" to be overriden during PROBE type commands.
This makes it easier to calibrate an initial tap_threshold.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Describe the METHOD= parameter in the probe_eddy_current chapter.
Use similar layout for both the load_cell_probe and probe_eddy_current
sections.
Avoid duplicating the METHOD= parmeter for other commands.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Verify no gaps at start and end of requested capture range.
Raise an error if a gap is detected.
Raise an error if not enough data collected during "tap".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Register an event handler to make sure measurements are stopped if a
gcode error occurs while using EddyScanningProbe. EddyTap and
EddyDescend use ProbeSessionHelper which already provides this
handling, but EddyScanningProbe doesn't use that wrapper so it must be
implemented manually.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Subscribing to all sensors can cause a burden on the MCU communication
channels. Add a new '-s' command line option to data_logger.py that
allows a user to request the subscriptions that they wish to capture.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Increase ADC report time from every 15ms to every 10ms and batch every
5 reports into a single message. This should improve the
responsiveness and reduce the communication overhead when using ADC
buttons.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the get_last_value() method to return time first then value
(instead of value, then time). This makes get_last_value() match the
order of parameters that is used in the adc update callback.
This also fixes ads1x1x to return the "print_time" instead of a system
time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allow the user to deselect CONFIG_WANT_TRIGGER_ANALOG even if one of
the sensors could utilize the support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>