Commit Graph

2290 Commits

Author SHA1 Message Date
Nick Douma 28b568a6ac
gcode_arcs: detect CW / CCW move with renamed G2/G3 command (#5096)
The G2 / G3 command might be renamed using `gcode_macro` + `rename_existing`. This change allow detecting clockwise / anti-clockwise moves when the command gets renamed.

Signed-off-by: Nick Douma <n.douma@nekoconeko.nl>
2022-01-22 20:47:51 -05:00
D4SK 2f1edac922
tmc: Fix number of arguments in phase endstop warning (#5184)
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2022-01-22 20:41:44 -05:00
Kevin O'Connor f97fd7c6e3 gcode: Handle M117 and M118 commands that start with a special character
Commit 7ef7bf60 broke the special handling for M117 commands that
start with a number or special character.  Fix that support and extend
to M118 as well.

Also improve handling of commands not separated by a space (eg,
"M117HELLO").

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-18 11:34:40 -05:00
Kevin O'Connor 02d5f9754f extruder: Support disassociating a stepper from all extruders
Support SYNC_STEPPER_TO_EXTRUDER commands with an EXTRUDER parameter
set to an empty string.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor eb2a67cb95 extruder: Support SYNC_STEPPER_TO_EXTRUDER on extruder objects
Refactor the extruder_stepper support so that it uses the
ExtruderStepper class defined in extruder.py.

Support the SYNC_STEPPER_TO_EXTRUDER command on steppers defined in
either extruder_stepper or extruder config sections.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor ffbd2698fe extruder: Separate extruder stepper tracking to new ExtruderStepper class
Move the stepper handling (including pressure advance handling) to a
new class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor 29724a7411 extruder: Don't store pressure_advance value in trapq moves
Store the pressure_advance value in "struct extruder_stepper" instead
of in the trapq's "struct move".  This makes it possible for multiple
stepper motors to have different pressure advance values while still
using the same trapq.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor 34a1ce4837 tmc2130: Rework current selection to prefer vsense=1
It is preferable to program the tmc drivers with an irun (or cs)
setting near 31, as otherwise the driver may have reduced microstep
precision.  It was possible for the driver to be programmed with
irun=16 or irun=17 when it could have been configured with irun=31
with vsense=1 instead.  This would occur on tmc2130/tmc2208/tmc2209
drivers for values around 0.900 to 1.000 amps (when using a typical
sense_resistor settings of 0.110 Ohms).

Change the code to prefer using vsense=1 to avoid this issue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:00:00 -05:00
individ-divided 538f09a2da
pause_resume: Do not clobber default state name by accident (#5156)
Previously accidentally used 'default' state name instead of the
stated one ('PAUSE_STATE'). This might collide with user usage of the
SAVE_GCODE_STATE macro.

Signed-off-by: David Grundberg <individ@acc.umu.se>
2022-01-16 13:00:24 -05:00
Tim Abraham babb067b60
neopixel: Update neopixel.py to add BRG color order (#5110)
Add BRG color option.
Document BRG color option.

Signed-off-by: Timothy Abraham <Timothyabe93@gmail.com>
2022-01-12 12:18:08 -05:00
Stephen Hurd f8afe49a2f
toolhead: Fix toolhead stop on SET_VELOCITY_LIMIT (#5053)
This fixes issue #5050

Signed-off-by: Stephen Hurd <deuce@synchro.net>
2021-12-30 18:56:24 -05:00
Kevin O'Connor 1c24317380 stm32: Enable ADC support on stm32g0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:26 -05:00
Kevin O'Connor 62cfc2527f statistics: Improve Python3 compatibility
Reported by @vladimir-poleh .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-15 11:27:08 -05:00
Kevin O'Connor 520273e5ab stepper: Support step_pulse_duration even on TMC drivers in UART/SPI mode
Commit 689231df changed the default step_pulse_duration to 100ns for
TMC drivers that are configured in UART/SPI mode, but it failed to
document that change in Config_Changes.md and Config_Reference.md.
Update those documents to reflect that change.

Update the code so that a user may specify a custom
step_pulse_duration even on TMC drivers that are configured in
UART/SPI mode.  This may be useful for drivers that use a level
shifter on the step pin that requires more than a ~300ns to detect a
level change.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-29 16:56:29 -05:00
Nitram 54acca37ba
delta: max z-accel and speed ratio calculation for deltas (#4689)
Adding a possibility to use a lower z- acceleration.

Signed-off-by: Martin Malmqvist <volcomosq@gmx.com>
2021-11-29 13:21:26 -05:00
Alex Zellner 05a8aca0a8
gcode: Allow rename_existing also for register_mux_command (#4843)
Signed-off-by: Alex Zellner <alexander.zellner@googlemail.com>
2021-11-22 11:22:12 -05:00
Kevin O'Connor faea45e60f mcu: Add checks to ensure pin max_duration doesn't overflow 32bit counter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-22 10:11:09 -05:00
Kevin O'Connor d1e13b7e12 mcu: Verify start value equal to shutdown value when using max duration
The mcu can only enforce the max duration if the start value is the
same as the shutdown value, so verify that before configuing the mcu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-22 10:08:56 -05:00
Dennis Marttinen 83889ac435 print_stats: Fix exception when canceling in/as first G-code
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
2021-11-21 08:01:43 -05:00
Pedro Lamas 7ef7bf608a gcode_macro: Add "rawparams" pseudo-variable
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2021-11-19 11:22:36 -05:00
Eric Callahan 46381e03a4
gcode_macro: fix reference issues to the variables attribute (#4925)
Create a copy of the dictionary prior to updating the the variable field.
This fixes an issue where webhooks holds a reference to the variables
dict returned by get_status().

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-11-19 02:01:16 -05:00
Geoffrey Young 5dcc377cde temperature_sensors: add ATC Semitec 104NT-4-R025H42G thermistor
module: extras/temperature_sensors.cfg

this thermistor is the 104NT-4 resold by Trianglelab (and others on Ali),
as well as the 300 degree resold by Slice Engineering, both of which use the
same RT table (TL even links to the ATC Semitec website)

see the 300 C tab on the Slice spreadsheet:
  https://docs.google.com/spreadsheets/d/1904x5JK-Sup-cX5DqHiiZWaFVTK6_PQBFxgi_6yXEJw/edit#gid=934228925
as well as the TL product page:
  https://www.aliexpress.com/item/32843785247.html
in addition to the RT table provided in temperature_sensors.cfg

Signed-off-by: Geoffrey Young <geoffrey.young@gmail.com>
2021-11-15 23:14:32 -05:00
Kevin O'Connor c179db3d43 temperature_sensors: Deprecate "NTC 100K beta 3950" thermistor
It seems the common "beta 3950" thermistors generally follow a
temperature table defined by the new "Generic 3950" definition.  Using
a table that actually follows the "beta 3950" temperature curve is
generally less accurate.  Deprecate the existing "NTC 100K beta 3950"
definition to avoid this common issue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:56:51 -05:00
Kevin O'Connor 19aac4055d temperature_sensors: Add a new "Generic 3950" thermistor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:52:55 -05:00
Kevin O'Connor c0909d2f7f temperature_sensors: Define default thermistors in config
Move the definitions of the default thermistors from thermistors.py to
the temperature_sensors.cfg file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:52:55 -05:00
Kevin O'Connor 596cd21751 temperature_sensors: Define default sensors in new config file
Move the default list of sensor modules from heaters.py to a new
temperature_sensors.cfg config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:52:55 -05:00
Kevin O'Connor d4aee4f55e mcu: Make a minor change to the protocol to require mcu update
Commit 9ecddd1b fixed a serious error (introduced in 7d95a004).  Force
a protocol version change so users are aware of the need to update the
mcu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-06 18:47:44 -04:00
Kevin O'Connor 689231df3a stepper: Add support for stepping on both edges of a step pulse
Add an optimized step function for drivers that support stepping on
both rising and falling edges of the step pin.  Enable this
optimization on 32bit ARM micro-controllers.  Automatically detect
this capability in the host code and enable on TMC drivers running in
SPI/UART mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 4acfd8d7c8 stepper: Make step pulse duration customizable at run-time
Remove the STEP_DELAY Kconfig option and replace it with a per-stepper
step_pulse_duration printer.cfg config option.

The AVR code will continue to have optimized code to step and "unstep"
in the same function (which is automatically activated when the step
delay is 40 ticks or less).  This change removes the Kconfig option
for single function step/unstep on 32bit processors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 8bfcedfb42 heaters: Remove support for deprecated pid_integral_max option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor 6e0431907d gcode_macro: Remove support for deprecated features
Remove support for default_parameter_xxx config options.  Remove
support for direct access to command parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor 0382ffbf68 pins: Remove support for deprecated pin_map option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor 1699f378de console: Remove support for PINS command
Remove support for builtin pin aliases from the console.py tool.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor b79a51c383 temperature_host: Remove support for deprecated rpi_temperature alias
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor eea0137bf0 stepper: Remove support for deprecated step_distance option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor d23c1b06c6 gcode: Fix Python3 syntax error
Fix error introduced in d6c3aaad.  Also, go back to only accepting
ascii characters on input.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 14:15:32 -04:00
Kevin O'Connor ccee189f99 palette2: Use regular str() types for input on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor 1dee974aea serialhdl: Use regular str() type for stats on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor fc5353364a util: Use regular str() type in get_git_version() on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor 7a6fd1a1aa console: Use regular str() types for commands on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor d6c3aaad8a gcode: Use regular str() types for g-code commands on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Also, accept utf8 on gcode input (instead of just ascii).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:51:52 -04:00
Eric Callahan d90c3bc57a idle_timeout: exit the timer if the printer is shutdown
This resolves an issue where the timer can get stuck
in an attempt to transition from Ready to Idle if
the printer is shutdown.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-29 18:39:47 -04:00
Kevin O'Connor cf4bfb1119 tmc: Rename handle_stepper_enable() method to _handle_stepper_enable()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-29 11:56:44 -04:00
Kevin O'Connor 14bdc8e569 stepper: Remove unused _dist_to_time() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-29 11:41:59 -04:00
Kevin O'Connor 86fee2d517 tmc: Track requested hold_current so SET_TMC_CURRENT doesn't reduce it
The code automatically reduces the hold_current so that it is no
greater than the run_current.  However, this could lead to confusing
behavior if one reduced and then increased the run_current via
SET_TMC_CURRENT commands.  To avoid that, this change adds support for
tracking the requested hold_current - thus changes to run_current
don't subtly alter the hold_current.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:13:38 -04:00
Kevin O'Connor 573fceefeb input_shaper: Fix python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 20:01:33 -04:00
Kevin O'Connor b62171f350 input_shaper: Restore shaper_type config option
The shaper_type config option got removed in commit d5a7a7f0 - restore
that option.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 18:06:11 -04:00
Dmitry Butyugin 54e21a7c26 input_shaper: Factored out AxisInputShaper class
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Dmitry Butyugin d5a7a7f00f input_shaper: Define input shapers in a single place in Python code
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Eric Callahan ec2116b4f7 temperature_sensor: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00