Scale the max_z_velocity limit by the amount of movement in the Z.
This should improve bed_mesh and vase mode prints on delta printers.
Reported by @hywelmartin and @dalegaard.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The backport of Python3's configparser causes issues when there is
unicode characters in the config file. To avoid introducing new
errors, go back to using the Python2 version of ConfigParser when
running on Python2.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Explicitly specify the comment_prefixes as regular Python2 strings -
otherwise the configparser wont ignore non-ascii characters in
comments.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Newer versions of configparser no longer default to ignoring trailing
comments that start with a semicolon. Add that setting explicitly to
avoid breaking existing config files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a test case to verify that every optional module successfully
loads on both Python2 and Python3. This is intended to catch syntax
and module imports that are not compatible between Python versions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The error checking is not complete in this change - the code should
handle the case where an input string is not valid utf8.
The code will continue to run on Python2 after this change, however
the execution time on Python2 is measurably slower after making this
change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
A larger smooth_time results in a slower reaction time for the PID.
This increased delay can cause temperature oscillations with high
power heaters. Many boards produce good results without any
smoothing. So, it seems a smooth_time of 1 second is a better
default.
Reported by @ReXT3D.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
When adding steppers to a `PrinterRail`, detect duplicated `endstop_pin`
settings and add them to the already-registered endstop.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Transmit data from mcu to host using 5 bytes per sample and up to 10
samples per message block. This improves bandwidth efficiency.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Query the adxl345 message counter every 100ms so that accurate timing
can be obtained during measurements. This allows the adxl345 data to
be exported with timestamps while captures are running.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce a new start_internal_client() function and change all client
code to use that instead of manually calling start_measurements() and
finish_measurements().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Separate out the G-Code command handlers to a new ADXLCommandHelper()
class. This helps separate the sensing code from the user interface
code.
Deprecate the RATE parameter of the ACCELEROMETER_MEASURE command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support endstops and probes attached to a different micro-controller
than their associated steppers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's possible for the original homing move of an axis to alter the
position of other axes. Make sure those other axes are not requested
to move on a subsequent second home retract move, as that could cause
an error if those other axes have not been homed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 3814a132 added code to homing.py to call calc_position() - add
that function to manual_stepper.py .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If the choice mapping uses integer keys then lookup the config option
using self.getint(). This simplifies the callers and improves the
encoding of the printer.configfile.settings export.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert stepper.get_past_commanded_position() to the more general
stepper.mcu_to_commanded_position().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Calculate the "homing position" using the endstop trigger time instead
of the position of the steppers.
This is in preparation for multi-mcu homing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Added optional PROFILE parameter to allow bed_mesh_calibrate to
save the mesh directly into the provided profile name instead of
default. If omitted, it will be stored in default.
Signed-off-by: Randell L Hodges <rhodges@taxfodder.com>
Changed the bed_screws_adjust command so that it finishes after 4
consecutive accepts. Before if you had 4 screws and adjusted the
first one you had to accept 7 times to finish the bed_screws_adjust.
Signed-off-by: Christian Enderle <mail@chrenderle.de>
The atmega328pb has officially named these pins as PE2 and PE3, so use
that naming scheme instead of the previous Klipper invented names.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Track the offset between driver phase and mcu position. This offset
should be constant as long as neither the driver nor the mcu is reset.
If the offset ever changes, log a warning.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Try to keep the host mcu_position synchronized with the
micro-controller by querying during startup and after every homing
event.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The Trinamic specs aren't consistent with upper vs lower case, which
can be confusing. Improve clarity by using lower case names
consistently in the code. Register names will continue to use all
upper case naming in the code.
Update the SET_TMC_FIELD command to automatically convert field names
to lower case.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If a shutdown occurs during homing, make sure any follow up errors are
clear that the cause of the error is the shutdown. This suppresses
the confusing "Unable to obtain 'trsync_state' response" messages.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It is possible for a homing move to not fully complete. Fixup the
trapq history to make processing of the history easier for callers.
Similarly, do not add artificial "null" moves to the trapq history.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Using sc->last_step_clock for the last position marker does not work
properly, because the stepper.py code calls stepcompress_reset() prior
to calling stepcompress_set_last_position(). Fix by passing an
explicit clock to stepcompress_set_last_position().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This fixes the bug introduced by f1091a484b.
The problem is that condition was returning string which
could not be converted to boolean. We solve that by showing
`Start Printing` when `is_active`.
```
ERROR:root:Unhandled exception during run
Traceback (most recent call last):
...
File "/opt/klipper/klippy/extras/display/menu.py", line 117, in eval_enable
return bool(ast.literal_eval(self._enable_tpl.render(context)))
File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
/opt/octoprint/uploads/wait_print.gcode
```
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Created two new extended gcodes: Z_OFFSET_APPLY_ENDSTOP, and Z_OFFSET_APPLY_PROBE.
These use the z gcode offset to revise the probe offset, or z endstop position
allowing users to make a frequently used babystepping value permanent without
manual config editing.
Signed-off-by: Ben Eastep <shifting@shifting.ca>
A higher UART baud rate will allow for faster transfers and may result
in more stable operation in general. Increase the baud to 40000 on
32bit MCUs and leave the baud at 9000 baud for 8bit AVR MCUs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It looks like the tmc2209 chips have increased uart errors with the
default SENDDELAY of zero. Increasing the SENDDELAY to two seems to
work around this issue.
Reported by @ReXT3D.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Validation passes if either of the following succeeds (in order):
1. Active firmware's raw dictionary changed after update
2. Checksum of firmware.cur matches expected
Additionally, deletes firmware.bin if found after update succeeds.
Signed-off-by: Justin Schuh <code@justinschuh.com>
Document change in behavior of the controller_fan module.
Lookup heater objects in connect() event handler.
Return list of stepper names from stepper_enable.get_steppers().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allows contoller_fan sections to monitor only certain steppers instead of
all of them, similar to how heaters are currently handled.
Signed-off-by: Sophie Hirn <sophie.hirn@wyvernscale.com>
Set the reqclock on trsync commands to ensure those commands do not
cause 32-bit timer rollover errors. Otherwise, it may result in
"Timer too close" errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Do not infer the sercom from the config section name, as that
prevents one from using SPI buses on multiple samd mcus.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add menuconfig option for stm32f072
* Add support for internal temp of stm32f072
* Share the temperature calculation logic between stm32f0x2 MCUs
Signed-off-by: Erik Henriksson <erikhenrikssn@gmail.com>
- Add dual_carriage abilities for hybrid-corexy and hybrid-corexz
- Introduce the module idex_mode
- Fix add_stepper to the correct rail in hybrid-corexy
Signed-off-by: Fabrice GALLET <tircown@gmail.com>
Before this change, a `CANCEL_PRINT` set a `print_stats` to `paused`
that would later be workaround-ed with `fluidd`/`mainsail` to re-define
`CANCEL_PRINT`.
This sets a proper canceled state, but additionally closes a file
from a `virtual_sdcard` context for `canceled`/`error`, as this is no longer
resumable from this point.
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Sometimes an automated filament load is implemented,
but extruder might not always extrude filament.
This adds a flag to check if this operation is possible.
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Separate out trsync handling from endstop handling in mcu.py code.
Enable the low-level trdispatch C code.
This is in preparation for multi-mcu homing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add ability to run C code directly from the low-level socket reading
thread. This enables host based low-latency handlers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The BED_MESH_OFFSET gcode can be used to apply X and/or Y offsets the the mesh lookup. This allows printers with independent extruders to correct the Z adjustment when changing a tool.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This is a temporary offset applied to the mesh used to fade toward a "target". For clarity, apply the fade offset when the final z calculation is made.
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
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>
neopixel: add sync param to prevent waking toolhead
dotstar: refactor to match neopixel methods and add sync parameter
Signed-off-by: Paul McGowan <mental405@gmail.com>
Add help description to HELP
Add help description to RESPOND
Add help description to MEASURE_AXES_NOISE, TEST_RESONANCES and SHAPER_CALIBRATE
Add help description to PAUSE, RESUME, CLEAR_PAUSE and CANCEL_PRINT
Add help description to GET_POSITION
Add help description to SET_RETRACTION and GET_RETRACTION
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Pass a print_time instead of a clock to get_past_commanded_position().
Fix calculation on steppers that home and use an inverted direction
pin.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
To support continuous belt printing, add nestable repeat
loop support via an `[sdcard_loop]` module.
Supported G-Code:
- SDCARD_LOOP_BEGIN COUNT=n ; Loop for N times, or infinitely if N is 0
- SDCARD_LOOP_END ; End of loop
- SDCARD_LOOP_DESIST ; Complete all loops without iterating
Marlin M808 compatibility example in `config/sample-macros.cfg`:
- M808 Ln ; Loop for N times, or infinitely if N is 0
- M808 ; End of loop
- M808 K ; Complete all loops without iterating
Added unit tests in test/klippy/sdcard_loop.test
See https://reprap.org/wiki/G-code#M808:_Set_or_Goto_Repeat_Marker
Signed-off-by: Jason S. McMullan <jason.mcmullan@gmail.com>