Commit Graph

1317 Commits

Author SHA1 Message Date
Kevin O'Connor b8a4cf7701 gcode: Add '_' prefix to internal methods
Mark methods internal to gcode.py with an underscore so that it is
easier to see which functions are purely helper functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-24 18:45:18 -04:00
Kevin O'Connor 6268c702e5 spi_temperature: MAX6675 and MAX31855 should use spi mode 0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-22 11:40:53 -04:00
fess 260e4f54cf quad_gantry_level: Require exactly 4 probe points
quad_gantry_level requires exactly 4 probe points assert as much at
config time.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-05-21 14:17:09 -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
Kevin O'Connor 84bae6ff41 mcu: Fix reserve pin check
Fix typo causing conflict with mcu name and constant name.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-21 09:40:13 -04:00
LyleCheatham 1235972b77 util: Ignore errors in clear_hupcl (allows OSX to run)
Signed-off-by: Lyle Cheatham <hello@lylecheatham.com>
2019-05-20 16:49:42 -04:00
Stephan de7ead1783 tmc5160: Add support for TMC5160 steppers (#1637)
Signed-off-by: Stephan Oelze <stephan.oelze@gmail.com>
2019-05-20 16:29:37 -04:00
alfsoft 777013da4f menu: Changed Menu item "Feed Filament" name (#1609)
"Feed Filament" menu item value was off-screen that made this item useless. So I changed its name to just "Feed". Users shall easily guess that this item is for filament feeding because this item is located in "Filament" menu.

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2019-05-09 14:41:37 -04:00
fess 0a9e3b744c quad_gantry_level: Limit maximum adjustment
safety feature that prevents quad_gantry_level from trying to do a
correction that might break things - if your probe fires early for
whatever reason and tries to do an 8mm correction in one corner instead
we abort if a correction is over a configurable limit by default 4mm

configurable via `max_adjust` parameter in the config

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-05-01 14:35:24 -04:00
fess af78d854ac quad_gantry_level: More compact info messages
In particular trying to keep the output from a single quad_gantry_level
so that it fits in the octoprint terminal window without the need to
scroll

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-05-01 14:34:10 -04:00
Martin Nowroth 60bc93f36b temperature_fan: Add gcode command for temperature_fan.py (#1520)
Adding gcode command for setting the target temperature of temperature_fan.
Example gcode: SET_TEMPERATURE_FAN_TARGET temperature_fan=chamber target=35.0

Signed-off-by: Martin Nowroth <madnoth@gmail.com>
2019-04-15 21:13:29 -04:00
Len Trigg 1102c6c232 tsl1401cl_filament_width_sensor: Fix incorrect math in filament width sensor. (#1541)
The parameter to the M221 command should be the ratio of the nominal to
measured filament area, rather than the ratio of the diameters. Since we
are taking the ratio, most of the area calculation cancels out.

Fixes #1535.

Signed-off-by: Len Trigg <lenbok@gmail.com>
2019-04-15 21:11:26 -04:00
Dmitry 1b92af6078 display: Add ST7567 display support (#1540)
Signed-off-by: Dmitry Budaev <condemil@gmail.com>
2019-04-15 21:07:29 -04:00
Trevor Jones 9cb21de68e virtual_sdcard: consistent sorting (#1387)
Signed-off-by: Trevor Jones <trevorjones141@gmail.com>
2019-04-14 11:34:22 -04:00
Daniel 7373e92092 serialhdl: Enforce exclusive access on POSIX, this is default behavior on windows. (#1216)
Signed-off-by: Daniel Joyce <daniel.a.joyce@gmail.com>
2019-04-14 11:27:43 -04:00
Janar Sööt 0a392b6543 menu: initial support for analog buttons (#977)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-04-14 11:18:52 -04:00
Kevin O'Connor d7e1061c63 bus: Don't reserve any pins if BUS_PINS_x is not defined
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-07 20:43:23 -04:00
Janne Grunau 478a916f51 replicape: add support for Linux hardware PWM (#1443)
The servo pins (P9_14/P9_16) are muxed to the SOCs hardware PWM unit
driven by a 13MHz GP timer. They have to be driven by the linux host
mcu. This commits adds hardware PWM support using the linux sysfs
user space interface.

The servo pins can be specified as "replicape:servo0" and
"replicape:servo1". Removes the "servo0_enable", "servo1_enable"
configuration parameters.
Fixes #1105.

Signed-off-by: Janne Grunau <janne-3d@jannau.net>
2019-04-06 13:51:51 -04:00
Kevin O'Connor 516fbf4f32 klippy: Report the underlying error on an internal error during connect
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:38:46 -04:00
Kevin O'Connor 79ecee0996 homing_override: Use gcode_macro style templates on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:35:23 -04:00
Kevin O'Connor 7d246e2624 probe: Use gcode_macro style templates on activate/deactivate_gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:35:23 -04:00
Kevin O'Connor 486c07c190 gcode_macro: Evaluate macros using Jinja2 template engine
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:35:23 -04:00
Kevin O'Connor f8bde6b1ef linux: Convert SPI to use enumerations
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:31 -04:00
Kevin O'Connor bc9fd03dab atsamd: Use enumerations for buses and reserve pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:31 -04:00
Kevin O'Connor 1ab02e5225 bus: Support bus enumerations and add support for reserved pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:31 -04:00
Kevin O'Connor 4c3d50693e bus: Change bus parameter in config_spi/config_i2c
Be explicit when using an spi_bus vs i2c_bus in the parameter name.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:31 -04:00
Kevin O'Connor be6b29fabf sx1509: Convert code to use generic i2c bus support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:30 -04:00
Arksine 2e16be224e uc1701: make contrast configurable
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-04-02 15:53:16 -04:00
Kevin O'Connor 60ff2e9dc1 force_move: Avoid divide by zero in move time calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-31 09:00:23 -04:00
Kevin O'Connor 75b73b09d6 corexy: Fix minimum halt velocity
Due to the corexy kinematics, the individual steppers may have a
velocity of sqrt(2) times faster than the cartesian velocity _and_ can
have an acceleration of sqrt(2) times faster.  Make sure to calculate
in the higher acceleration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-30 14:35:18 -04:00
Douglas Hammond c105adc80b temperature_fan: Fix. Temperature fan min speed should be used (#1405)
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
2019-03-28 14:07:40 -04:00
Kevin O'Connor 907dd88ceb msgproto: Propagate original error message in create_command()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-28 09:32:09 -04:00
Florian Heilmann bece690c5b tmc2660: Automate VSENSE computation
Adjust the HEND default, which was faulty after the the fields update, remove disallowance of setting CS

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-03-22 20:38:42 -04:00
amblidex 0980b7e4ec tmc2130: add SET_TMC_CURRENT and SET_TMC_FIELD commands (#1419)
Signed-off-by: Frank Kang <amblidex@outlook.com>
2019-03-22 20:37:03 -04:00
lauckhart 7a344acde8 configfile: Add "include" support (#1359)
Allows configuration files to include other configuration files using
[include filename.cfg] syntax.  Klippy loads include files in the
position of the include header; subsequent definitions override
included values.  Supports wildcards (e.g. [include macros/*.cfg).
Allows included files to include other files but blocks recursion.

Signed-off-by: Greg Lauckhart <greg@lauckhart.com>
2019-03-22 20:31:40 -04:00
Matt Baker f2fbe98454 bed_mesh: enable relative offset bed meshes (#1323)
Adds parameter for bed meshes to be adjusted relative to a probed point
during calibration. This allows the probe z offset to be ignored for
probes that are not stable over time (for example, the thermal drift of
inductive probes). An endstop other than the probe is then necessary to
determine the bed-nozzle offset.

Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2019-03-21 10:39:22 -04:00
Robert Konklewski 6f91574cd9 menu: Show current positions based on gcode positions (#1389)
menu: Show current positions based on gcode positions

Added "move_[xyze]pos" properties to the "gcode" object for use in menus.
The new properties track the toolhead's position in gcode coordinates,
taking gcode and bed leveling offsets into account.
This position is equal to the value returned by M114 gcode.

Changes the move menus to show current position based on gcode
position. This allows gcode offsets and bed leveling offsets
to be taken into account, and prevents unexpected toolhead
movements when moving it using the menu.

Signed-off-by: Robert Konklewski <nythil@gmail.com>
2019-03-21 10:37:28 -04:00
Kevin O'Connor 746a378c18 endstop: Use "pin_value" instead of "pin" when querying endstop state
Now that enumerations are available, any variable named "pin" can only
be used to describe a gpio pin.  Rename the end_stop_state "pin"
parameter to "pin_value".  Also, rename "end_stop_query" command to
"end_stop_query_state" to notify users to upgrade both host and mcu
code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-19 10:48:33 -04:00
Kevin O'Connor 53290664ee pins: Document support for '~' to enable pull-down resistors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 21:07:31 -04:00
Kevin O'Connor 0af89e4766 thermocouple: Define thermocouple types using enumerations
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 618b374ae5 pins: Simplify alias code
Simplify the pin aliasing code now that all pins are defined via
enumerations.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor df6136802a linux: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor ae24baf99a pru: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 91cf497656 stm32f1: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 8aa8feedb8 lpc176x: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 7e2c0ffa91 atsamd: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 8b0195f896 atsam: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 8f541d090e avr: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor db6e2d4c9e msgproto: Convert static strings to a more generic enumeration system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor 7eda55e2b0 buildcommands: Use dictionaries to describe commands, responses, and output
Avoid transmitting lists of message ids for commands and responses -
gzip doesn't do a good job of compressing them.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor d3f6dad853 controller_fan: Allow multiple controller_fan sections to be defined
It may be necessary to define multiple fans, so allow each config
section to be named.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-10 13:57:01 -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
amblidex e2af1c1f2a menu: Set input_max for moving toolhead in menu to same value for all move increments (#1372)
Signed-off-by: Frank Kang <amblidex@outlook.com>
2019-03-08 14:11:47 -05:00
Kevin O'Connor 1b1d3f15d8 probe: Fix PROBE_CALIBRATE command
The z_offset calculation should have been calculated from the probe
height to the measured bed position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 12:34:13 -05:00
Kevin O'Connor eac22df7cb probe: Catch toolhead.move() exceptions in cmd_PROBE_CALIBRATE()
Slightly rework the self._move_position() code and also use it in
PROBE_CALIBRATE.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 12:32:01 -05:00
Rui Caridade 5c0a2479be screws_tilt_adjust: Add new screws_tilt_adjust tool (#1367)
Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
2019-03-08 11:47:17 -05:00
Kevin O'Connor 563bc37073 tmc2130: Rename driver_BLANK_TIME_SELECT to driver_TBL
Use the field names from the trinamic specification.  This makes the
field similar to all the other driver_XXX config options.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 11:25:19 -05:00
Kevin O'Connor 9c0cf829ee tmc2660: Minor indentation fix
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 11:20:32 -05:00
Florian Heilmann 789379e95b tmc2660: Add INIT_TMC and SET_TMC_FIELD gcodes
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-03-08 11:04:14 -05:00
Florian Heilmann 8e17df5d78 tmc2660: Raise SPI speed to 4 Mhz
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-03-08 11:04:14 -05:00
Florian Heilmann e96b71a9a3 tmc2660: Use helper functions for register access and simplify TMC2660 parameters
sense_resistor is now a mandatory parameter for tmc2660 blocks. Duet2 users should use a value of 0.051

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-03-08 11:04:14 -05:00
Florian Heilmann 4541f16cd9 tmc2660: Add vsense_resistor config parameter
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-03-08 11:04:14 -05:00
Voron 975b0dbd84 quad_gantry_level: Fixing logic to use probed Z values correctly (#1328)
Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
2019-03-08 11:01:49 -05:00
Kevin O'Connor 8f37700d23 verify_heater: If the heating_gain check fails, just use max_error check
Don't immediately raise an error if the heating_gain check fails.
Instead, just transition to the normal max_error check.  This should
make the code less likely to raise an error should the heater have a
slow approach to the target temperature.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 10:55:46 -05:00
Kevin O'Connor f2ca7d5c66 verify_heater: Improve handling of new targets when temperature is dropping
Allow the first check_gain_time interval to only require a
heating_gain relative to the lowest observed temperature during that
interval.  This makes the code less likely to raise a spurious error
when the heater is enabled while the heater temperature is dropping.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 10:55:46 -05:00
Kevin O'Connor 893bb32d01 verify_heater: Only reset the error count if within the hysteresis range
Don't reset the error counter if the reported temperature is
significantly above the target temperature.  This may help catch cases
where the temperature sensor reports random values.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 10:55:46 -05: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 d62a41b930 manual_stepper: Add support for moves with acceleration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-03 13:38:10 -05:00
Kevin O'Connor 946eb6b7ae atsamd: Add definitions for SAMD21E18 chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-01 19:05:00 -05:00
Kevin O'Connor d57bc79513 atsamd: Use the full micro-controller name for CONFIG_MCU
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-01 19:03:34 -05:00
Kevin O'Connor 027f52087c gcode: Improve handling of end of input when reading from a debug file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-01 10:06:44 -05:00
Arksine 3c79e484d5 filament_switch_sensor: initial implementation of switch based filament runout/insert sensor
This implementation includes a BaseSensor class that all underlying sensor implementations should subclass.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-03-01 00:45:51 -05:00
Arksine 3cd1f9676d pause_resume: Implement send_pause_command()
This allows for pausing from inside a reactor callback.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-03-01 00:45:51 -05:00
Kevin O'Connor c8d7e28a35 atsamd: Add support for programming SERCOM pins
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-01 00:40:44 -05:00
Kevin O'Connor 8617cbcb76 tmc2130: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-01 00:35:20 -05:00
Kevin O'Connor c039b33f2a tmc2130: Add support for INIT_TMC command
Signed-off-by: Frank Kang <amblidex@outlook.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-01 00:24:39 -05:00
Kevin O'Connor 5f5d39ef3f bed_screws: Fix missing import
Reported by @JoaoFelipe.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-28 00:30:05 -05:00
Kevin O'Connor 264505a1b0 tmc2130: Report write-only registers in DUMP_TMC
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 18:53:18 -05:00
Kevin O'Connor f7d8fde502 tmc2208: Report write-only registers in DUMP_TMC
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 18:49:45 -05:00
Kevin O'Connor 1b064b5a5d tmc2660: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:33:17 -05:00
Kevin O'Connor c1670ea336 tsl1401cl_filament_width_sensor: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:33:17 -05:00
Kevin O'Connor 20040f4a18 quad_gantry_level: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:33:17 -05:00
Kevin O'Connor a4a23dee9f respond: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:33:17 -05:00
Kevin O'Connor 0b095ddf47 temperature_fan: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:33:17 -05:00
Kevin O'Connor f13c5d4cdb sx1509: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:33:17 -05:00
Kevin O'Connor adc4af2fc4 serialqueue: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:20:15 -05:00
Kevin O'Connor e4d52a19b8 stepcompress: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:20:15 -05:00
Kevin O'Connor 2d99a1e802 buttons: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:34:22 -05:00
Kevin O'Connor ef1bf60ab7 hd44780: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:31:47 -05:00
Kevin O'Connor 51051478af st7920: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:31:31 -05:00
Kevin O'Connor d6d23c8415 thermistor: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:29:41 -05:00
Kevin O'Connor 9f1d9bf0f4 probe: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:28:55 -05:00
Kevin O'Connor ea1814e017 Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:27:52 -05:00
Kevin O'Connor e504147285 font8x14: Store font as strings instead of as bytearray
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:26:59 -05:00
Kevin O'Connor af882ee0fe chelper: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:20:57 -05:00
Kevin O'Connor 9d8c7ddc1e pins: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:19:42 -05:00
Kevin O'Connor 9be6cf226b klippy: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:18:43 -05:00
Kevin O'Connor 21e45cac64 spi_temperature: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:14:23 -05:00
Kevin O'Connor ee1236805e toolhead: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:11:12 -05:00
Kevin O'Connor b934313c3d heater: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:09:24 -05:00
Kevin O'Connor d7e8264d92 extruder: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:07:41 -05:00
Kevin O'Connor 118b7593a6 msgproto: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:06:15 -05:00
Kevin O'Connor 45203070ed util: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:05:37 -05:00
Kevin O'Connor e7eb745d99 mathutil: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:04:56 -05:00
Kevin O'Connor 5bbae0710a gcode: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:04:19 -05:00
Kevin O'Connor 65d6253fb8 clocksync: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:01:52 -05:00
Kevin O'Connor e5e079faf2 console: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:00:30 -05:00
Kevin O'Connor dddfb681c7 pins: Add support for pull down resistors
Add initial support for selecting pull down resistors (for
micro-controllers that support it).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 11:13:21 -05:00
Douglas Hammond b6589406d4 temperature_sensor: Add generic temperature sensor support
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-26 13:15:56 -05:00
Douglas Hammond f9968904d6 temperature_fan: Remove stats as it now supports gcode reports
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
2019-02-26 12:07:00 -05:00
Douglas Hammond 3887ad4fce heater: Support generic gcode_id registration for sensors
Support reading a "gcode_id" parameter from heater/sensor config
sections.

Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-26 12:07:00 -05:00
Kevin O'Connor 34209e6189 heater_bed: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-26 11:20:01 -05:00
Kevin O'Connor adf6040e9e gcode: Use an event to handle restart request actions
Instead of directly turning off motors, heaters, and fans from
gcode.py, raise a new event and allow the heater, fan, and toolhead to
handle the event as needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 21:26:27 -05:00
Kevin O'Connor ff9605c082 gcode: The set_temp() takes an extruder number not a heater id
Commit cf6c5e6f did not fix the shared heater case - a set_temp()
request takes the extruder id, not the heater id (nor the gcode sensor
id).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 21:04:02 -05:00
Kevin O'Connor c54c81dc2a heater: Return heaters with a gcode_id from new get_gcode_sensors()
The gcode.py code should not peek into the heater classes to obtain
the gcode_id.  Instead, introduce a new get_gcode_sensors() so that
the gcode.py code does not need to.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 20:34:26 -05:00
Kevin O'Connor bb4fab5570 heater: Rename add_sensor() to add_sensor_factory()
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 20:34:12 -05:00
Kevin O'Connor cf6c5e6f18 gcode: A set temperature request should use the heater name, not the gcode id
When setting a temperature, lookup the heater via
self.heaters.lookup_heater() and do not use the gcode ids.  This fixes
temperature setting when multiple extruders share the same heater.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 20:32:30 -05:00
Kevin O'Connor 13b2e091b8 gcode: Rename self.heater to self.heaters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-25 20:04:05 -05:00
Arksine f7d8854587 bed_mesh: simplify configuration
The 'bed_shape' option has been removed.  The user will enter a 'bed_radius' if they have a round be, otherwise they should enter 'min_point' and 'max_point'.  When the bed is round the user should supply a 'round_probe_count' option, otherwise just 'probe_count'.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-02-25 13:34:14 -05:00
Arksine 7694c3e1b8 bed_mesh: fix get_position()
Fix a bug where the fade factor is calculated incorrectly when get_position() is called.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-25 13:34:14 -05:00
Arksine f308171be4 bed_mesh: refactor fade_target
Offset the entire mesh by the fade target amount rather than offset each z lookup.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-25 13:34:14 -05:00
Rui Caridade 749beb731c probe: Set z min value in probe_accuracy to z_offset. (#1314)
Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
2019-02-25 12:52:54 -05:00
Kevin O'Connor 80c8bd8b4d bed_screws: Add a helper tool for leveling bed screws
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-24 00:49:47 -05:00
Kevin O'Connor 5bc47d9416 tmc2130: Use FieldHelper() to set/get driver fields
Use the field helper to simplify the bit manipulation in the driver.
This also enables the extended DUMP_TMC output.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-21 11:35:58 -05:00
Kevin O'Connor b260eb9168 gcode: Raise a config error on invalid register_command()
Raise a printer.config_error() on an invalid register_command() call.
This error is easier to handle for the vast majority of callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-18 18:04:42 -05:00
Rui Caridade 276d5a1436 probe: Add PROBE_ACCURACY command
Implementation of "PROBE_ACCURACY" to measure the maximum, minimum,
average and standard deviation of a probe.

Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-18 00:36:28 -05:00
Kevin O'Connor cc4ecef88b mcp4018: Add initial support for the mcp4018 digipot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-16 08:16:37 -05:00
nopbit 0f674ef407 tsl1401cl_filament_width_sensor: Filament Width Sensor Support (#1132)
Support added for filament diameter sensor. Sample configuration parameters added to example-extras.cfg.

Signed-off-by: Mustafa YILDIZ <mydiz@hotmail.com>
2019-02-14 10:13:48 -05:00
KevinOConnor c6d1d1bd8c
Merge pull request #1242 from john--/pr_generic_heater
Generic Heater Support
2019-02-14 10:08:26 -05:00
John Jardine 6316b2c1b6 Generic Heater Support
Adds the ability to register a custom/generic heater through a new extra called heater_generic.
This takes a gcode_id that is reported by M105. Adds a new command to set the temperature for any heater using the syntax:
SET_HEATER_TEMPERATURE HEATER=<heater_name> TARGET=<target_temp>

Signed-off-by: John Jardine <john@gprime.net>
2019-02-14 01:15:11 +00:00
Kevin O'Connor 98ed462865 spi_software: Implementation of software spi
Signed-off-by: Matt Janus <FragginRight@variabl.es>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-13 11:52:20 -05:00
Kevin O'Connor 2d7c3a84ee manual_stepper: Add an "extras" module for manually controlling a stepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:38:13 -05:00
Kevin O'Connor b0b9fc6f4a probe: Use manual_probe helper when performing manual probes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor 35ea4a137d probe: Add PROBE_CALIBRATE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor d14a53e160 manual_probe: Add a helper script for performing manual Z probing
Add MANUAL_PROBE and Z_ENDSTOP_CALIBRATE commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor 59a60d68f5 Revert "serialhdl: Enforce exclusive access on POSIX, this is default behavior on windows. (#1216)"
This reverts commit fdbbda9484.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-10 11:57:02 -05:00
Daniel fdbbda9484 serialhdl: Enforce exclusive access on POSIX, this is default behavior on windows. (#1216)
Signed-off-by: Daniel Joyce <daniel.a.joyce@gmail.com>
2019-02-10 11:51:29 -05:00
Kevin O'Connor f1c804907c virtual_sdcard: Don't list files starting with a '.'
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-08 11:48:53 -05:00
Arksine 9766d62ad3 pause_resume: fixes
- When using absolute extrusion the gcode position e-axis position is now captured on PAUSE and restored in RESUME with a call to the G92 handler.
- Add a get_status() function that returns a dictionary with an 'is_paused' key.
- Do not allow consective calls to PAUSE or RESUME to exectue.  Also do not allow a RESUME to executed without a previous PAUSE.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-08 10:53:59 -05:00
Arksine ca4e10dbd6 gcode: add 'abs_extrude' to get_status() dictionary
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-08 10:53:59 -05:00
Kevin O'Connor c171b28a0b gcode: Return to a default gcode speed of 25mm/s
Commit f4d323ad changed the handling of the self.speed variable, and
it inadvertently changed the default startup speed.  Return to the
default of 25mm/s.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 23:45:09 -05:00
Kevin O'Connor 4c48c1e8e4 bltouch: Issue just a pin_up command on a normal raise probe attempt
In the normal case, a regular pin_up command should be sufficient to
raise the probe.  (Should the regular pin_up fail, the code can issue
a "reset" command during the retry.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 18:03:07 -05:00
Kevin O'Connor 345a5f4e1f bltouch: Increase default pin_move_time from 200ms to 675ms
Use the same pin move time that Marlin uses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 18:02:53 -05:00
Kevin O'Connor cd8678aa6d spi_temperature: Fix order of init
Commit c3efcd9c moved the config_spi setup to a build_config callback.
It's also necessary to move the config_thermocouple to a build_config
callback as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 09:30:26 -05:00
Kevin O'Connor d088a7ca72 tmc2130: Share config reading helpers with tmc2208.py code
Add helper function for reading current, microsteps, and stealthchop
settings from the config file.  Use these helpers in both the tmc2130
and tmc2208 modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:39:07 -05:00
Kevin O'Connor 0920a518ce tmc2208: Rename self.field_helper to self.fields
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:15:43 -05:00
Kevin O'Connor 30b6414295 tmc2208: move local set_field/get_field helpers to FieldHelper class
Move these helper functions to the FieldHelper class so that they can
be used by other Trinamic drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 14:07:27 -05:00
Kevin O'Connor 17a17c5b77 tmc2208: Add helper for setting fields from the config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 13:03:44 -05:00
Kevin O'Connor 83001959f1 tmc2208: Use field definitions during driver init
Reduce the amount of bit manipulations by using the FieldHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 12:22:12 -05:00
Dmitry Frolov 51f14b9c8c tmc2208: Add register field formatters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
2019-02-03 11:19:36 -05:00
Kevin O'Connor 955fdcaa0c tmc2130: Convert field helper into a class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 11:11:15 -05:00
Arksine cdcc320710 bed_mesh: add support for round beds
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-02 23:29:00 -05:00
Arksine 542f941f07 bed_mesh: log when fade completes.
- Also simplify the math for the mesh x and y multipliers.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-02-02 23:29:00 -05:00
lorf 54683c9535 tmc2208: Decode register fields in DUMP_TMC (#1156)
Report values of TMC2208 register fields in DUMP_TMC command to help in
tuning and diagnostics.

This also adds functions to refer to register fields by name for TMC drivers
and register mappings for TMC2208.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
2019-02-02 19:46:27 -05:00
Kevin O'Connor 3b6ddb08a1 bltouch: Don't error on startup if the bltouch is in an error state
Stopping the connect sequence can make it difficult to get the bltouch
out of an error state.  Allow the connect to proceed, ideally if the
bltouch stays in an error state it will be detected during the first
probe attempt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-31 09:43:35 -05:00
Kevin O'Connor a5d3d161d3 bltouch: Retry reset/pin_up if the raise probe attempt fails
There's no harm in retrying the attempt if it appears to have failed
for some reason.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-31 09:43:29 -05:00
Samori Gorse 04c6e1f646 idle_timeout: Added a missing logging import
I noticed Octoprint was disconnecting after a while, and after reading the logs, I came across this error:

```
Unhandled exception during run
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/klippy.py", line 171, in run
    self.reactor.run()
  File "/home/pi/klipper/klippy/reactor.py", line 176, in run
    g_next.switch()
  File "/home/pi/klipper/klippy/reactor.py", line 203, in _dispatch_loop
    timeout = self._check_timers(eventtime)
  File "/home/pi/klipper/klippy/reactor.py", line 82, in _check_timers
    t.waketime = t.callback(eventtime)
  File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 62, in timeout_handler
    return self.check_idle_timeout(eventtime)
  File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 59, in check_idle_timeout
    return self.transition_idle_state(eventtime)
  File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 35, in transition_idle_state
    logging.exception("idle timeout gcode execution")
NameError: global name 'logging' is not defined
```

I therefore added the missing import.

Signed-off-by: Samori Gorse <samori.gorse+github@gmail.com>
2019-01-29 11:18:44 -05:00
Kevin O'Connor 8cd83b4c2d atsamd: Initial support for SAMD51
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Arksine 7605752dc2 pause_resume: initial implementation of pause/resume functionality for Klipper
This module adds PAUSE and RESUME gcodes that can programatically determine if the gcode is printing from virtual sd or over the serial connection.  It also captures the current toolhead position and gcode feedrate on pause, and recovers that position and feedrate on resume.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Arksine 8385dc20e6 gcode: add 'speed' parameter to dictionary returned by get_status()
Signed-off-by: Eric Callahan  <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Arksine e69742df8f virtual_sdcard: prepare for pause_resume implementation
- Add is_active() member function to return the active printing status of the virtual sdcard
- M27 now reports current file position when file has been opened. See http://marlinfw.org/docs/gcode/M027.html

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Kevin O'Connor eb7842c221 atsam: Add support for the SAM3X8C micro-controller
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-22 09:07:12 -05:00
Kevin O'Connor 7327394c50 adc_temperature: Add support for linear interpolation of resistances
Add support for performing linear interpolation between a set of
measured temperature/resistance pairs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 21:28:25 -05:00
Kevin O'Connor fc946c796c adc_temperature: Split linear interpolation code into its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 20:27:41 -05:00
Kevin O'Connor 99980817c3 adc_temperature: Move PrinterADCtoTemperature to adc_temperature.py
Move the low-level PrinterADCtoTemperature() class from thermistor.py
to adc_temperature.py and use it from the Linear() class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 20:24:51 -05:00
Kevin O'Connor 0c4fc64ef8 thermistor: Separate thermistor configuration from basic ADC callback logic
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 18:38:12 -05:00
Kevin O'Connor 5a6a429bc0 bltouch: Take into account clock skew when calculating command duration
We want the duration of each command to be an exact multiple of
SIGNAL_PERIOD.  The durations might not be exact if the bltouch is on
a secondary mcu.  Account for this in send_cmd().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:56:08 -05:00
Kevin O'Connor 8a97bc592b bltouch: Add a pin_up_touch_mode_reports_triggered config option
Rework the undocumented test_sensor_pin config option into a
pin_up_touch_mode_reports_triggered option and document it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 56141c21d7 bltouch: Raise probe on startup
Send a pin_up command during startup and try to verify that the probe
actually raises.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor e36122797b bltouch: Attempt to verify that the probe raises after each probe attempt
Query the bltouch state during the pin_up command to try and verify
that the probe does actually retract.  This may be useful to detect if
the bltouch enters into an "error" state.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 99f96f2832 bltouch: Use pin_down mode for probing
The BLTouch is more accurate when probing in "pin_down" mode than
"touch_mode" (at least on some hardware).  Rework the code to use that
mode.

When probing in pin_down mode, the BLTouch can go into an error state
if a pin_up is not sent immediately after a touch signal.  Rework the
pin_up code to reduce the time it takes to transmit the command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 04f5baa182 bltouch: Simplify time keeping of scheduled events
Introduce a sync_print_time() method and update send_cmd() to track
the duration of bltouch commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 26e818d900 bltouch: Verify probe always deploys during a homing operation
Verify that there is always some movement during a probing operation.
This is normally done by the homing.py code (via its verify_movement
check), but that check may not be enabled when z_virtual_endstop is
used.  So, always enable the check in the bltouch.py code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 293366d033 thermistor: Breakout thermistor math to its own class
Separate the thermistor math from the heater temperature callback
system.  This may make it easier for debugging.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-20 18:51:00 -05:00
Víctor Martínez 432e6c490a util: Don't crash when calling get_cpu_info on OS X (#1102)
Signed-off-by: Víctor Martínez <knoopx@gmail.com>
2019-01-11 13:00:44 -05:00
Kevin O'Connor f0b7d6d67a klippy: Report the first error generated
Only update the status message with the first error report.
Subsequent errors are often the result of the first error and
reporting the last error can be misleading.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-11 12:41:55 -05:00
Kevin O'Connor 32632c8226 mcu: Fix timing of endstop checking
Make sure to not query the given endstop until after the start of the
requested operation.  This ensures that the operation has started
prior to querying the status of that operation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-10 12:27:56 -05:00
Kevin O'Connor 0119e42d13 homing: Always start endstop checking before the nominal move start
Make sure the endstop checking is started prior to any movement.  This
helps ensure the verify_movement check is accurate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-10 12:17:57 -05:00
Master92 a27838bc05 controller_fan: Add support for a fan cooling the controller-board (#1070)
Whenever a stepper driver or a heater becomes active, it is desirable to turn on a fan cooling the associated parts on the controller board. This module implements such a fan that turns on whenever a stepper or specified heater turns on, decelerates to a configurable speed when all of the watched parts turn off, and returns to an off-speed, when a user-defined timeout is met.

Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-01-10 12:12:15 -05:00
Kevin O'Connor 2c31fd8313 tmc2208: Check for debugging mode before checking for a retransmit
Allow the tmc2208 code to be run from regression test cases.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-10 09:55:54 -05:00
Kevin O'Connor c0ea0312e5 klippy: Fix error handling during connect phase
Make sure to exit the _connect() method if a connect event handler
raises an error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 13:46:26 -05:00
Kevin O'Connor bf647749dd menu: Don't peek into printer.objects member variable
Use the printer.lookup_objects() method to get the list of available
printer objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 12:03:46 -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
Kevin O'Connor 797367b9f5 klippy: Convert printer_state("ready") to an event handler
Convert all users of the printer_state("ready") handler to register a
"klippy:ready" event handler instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 10:59:43 -05:00
Kevin O'Connor f4be0ac7be klippy: Convert printer_state("disconnect") to an event handler
Convert all users of the printer_state("disconnect") handler to
register a "klippy:disconnect" event handler instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 10:59:43 -05:00
Kevin O'Connor fb7fe282c8 klippy: Convert printer_state("shutdown") to an event handler
Convert all users of the printer_state("shutdown") handler to register
a "klippy:shutdown" event handler instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 10:59:43 -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
Janar Sööt 3a4a1d678e menu: allow empty command gcode if action is present
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 0cbe851777 menu: enhancements
- changes that make easier to use menu as module UI
- new helper method for delayed callbacks
- method for getting the menu instance from display
- new action for sending menu:action events
- allow_without_selection option for cards

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 005cbe157a menu: allow names in card content and simplify define single card decks
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:53 -05:00
Janar Sööt b9cccc5959 menu: support for click button long press
- long press with timer (button release is not needed anymore)
- initial support for edit mode long press gcode

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:45 -05:00
Janar Sööt 265769787f reactor: support for delayed callbacks
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:36 -05:00
Kevin O'Connor e26d1a3567 i2ccmds: Pass the i2c address as a 7-bit number (0-127)
The sam3 i2c code and the linux code use a 7-bit i2c address, while
the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the
least significant bit always zero.  A similar issue occurred in the
host code (sx1509.py and replicape.py use 7-bit addresses while
uc1701.py and mcp4451.py use 8-bit addresses).

Consistently use 7-bit addresses in all the code.  This breaks
compatibility between host and mcu software, so make a change to the
config_i2c command to force users to synchronize software updates.
This also breaks common Smoothieboard configs, so update the mcp4451
code to validate the i2c_address.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-07 20:00:44 -05:00
Kevin O'Connor 75ad16ea1a sam3: Add support for sam4s8c chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-07 19:34:31 -05:00
Master92 6ccc0732c1 menu: Fix filament loading and unloading feature (#1082)
As discussed in #1057, the default loading- and unloading procedure does
not behave as expected. Setting the extruder to relative mode fixes this.

Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-01-07 10:25:19 -05:00
Paulo Drugos ffbb4198c1 menu: Correction for the resume option appears when the toolhead is not printing (#1077)
Signed-off-by: Paulo Drugos paulodrugos@gmail.com
2019-01-05 19:11:03 -05:00
Kevin O'Connor c3efcd9c8d bus: Set all SPI CS pins high before first config_spi message
If an SPI device is shared among many devices, then all the device's
CS pins should be set high prior to setting up the clk pin.
(Otherwise, there's a chance a device could interpret the clk pin
setup as part of a transmission.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 22:26:34 -05:00
Kevin O'Connor 24fe606d4d toolhead: Do not apply main printer accel/velocity to extrude only moves
Limit speed and acceleration of extrude only moves to just the
max_extrude_only_velocity and max_extrude_only_accel config settings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 12:47:45 -05:00
Kevin O'Connor a2f0c36e7d toolhead: Don't report an error if request too high in SET_VELOCITY_LIMIT
If a requested value is higher than the configured maximum, then just
limit the value to the configured maximum instead of raising an error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 12:47:40 -05:00
Kevin O'Connor 7fe14f05e6 thermistor: Avoid divide by zero error if min_temp=-273.15
Reported by @TheGuv.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 12:47:37 -05:00
Kevin O'Connor c2086796bf mcp4728: Add initial support for the mcp4728 i2c dac chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 18:17:56 -05:00
Alec B. Plumb 59e9b6562f respond: An extra for sending messages to the printer host. (#1053)
I have made one change to `gcode.py` to support quoted parameter
values.

I have added support for the basic `M118` command (see
https://reprap.org/wiki/G-code#M118:_Echo_message_on_host). I have
also added a `RESPOND` command that takes extended parameters.
`ECHO` might be a better name than `RESPOND` but is already defined
in `gcode.py`.

Signed-off-by: Alec B. Plumb <alec@etherwalker.com>
2019-01-02 17:45:35 -05:00
john-- f6c9150349 heater: take a gcode_id when setting up a heater (#1028)
Allow an arbitrary gcode_id to be supplied during heater setup. This allows future extras to register additional IDs beyond B, and T#.

Signed-off-by: John Jardine <john@gprime.net>
2019-01-02 17:44:02 -05:00
bondus f4d323adbc gcode: Minor change to make M220 command take effect immediately (#1000)
This makes M220 (change print speed) command effect the next move command (G0/G1).
Before it only made a differenc once a G0/G1 command with an F parameter was executed.

Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
2019-01-02 17:41:35 -05:00
Kevin O'Connor 1be24b8fc7 bus: Don't raise a "duplicate pin" warning on None pins
If "None" is used for an spi cs pin, then it should not reserve "None"
for other uses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:37:39 -05:00
Kevin O'Connor 68ebde0d86 display: Fix handling of M117 command if lowercase 'm' is used
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:34:56 -05:00
Petri Honkala e4e0fec681 tmc2660: error and whitespace fixes
- redundant parentheses removed
	- parameter reference fixed
	- raise error fixed

Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Petri Honkala f99002df4f tmc2208: error raise fixed for rx/tx mcu check
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Kevin O'Connor c6065e29a6 mcu: Allow set_stepper_kinematics() to set the kinematics back to None
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-24 11:42:13 -05:00
Kevin O'Connor 5dc74f3152 winch: Add experimental support for cable winch kinematics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-24 11:38:59 -05:00
Kevin O'Connor ec9cb3a1b3 polar: Experimental support for polar kinematics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-24 11:38:59 -05:00
Kevin O'Connor 7e3e02a17a kinematics: Add a "none" debugging kinematics
Add a dummy kinematics class for development testing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-24 11:38:59 -05:00
Kevin O'Connor d0f09727a9 bltouch: Issue both a "reset" and a "pin_up" after a successful probe
Not all BLTouch clones raise the pin on a "reset" request, so
explicitly send a "pin_up" command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:46 -05:00
Kevin O'Connor ccc25a03d5 bltouch: Add a config option to disable the bltouch sensor test
It appears some bltouch "clones" do not report the probe as triggered
when put in "touch mode" while the pin is raised.  Add a config option
to allow users to disable the test.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:41 -05:00
Kevin O'Connor ce064e6e2d bltouch: Always make sure to check the endstop at least every 1ms
Some of the bltouch implementations may only respond to a probe event
with a 5ms pulse.  Make sure to check the signal pin at least every
millisecond to ensure no signal is lost.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:27 -05:00
Kevin O'Connor 76b57ba05a bltouch: Fix typo in pin_move_time parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 11:43:04 -05:00
Kevin O'Connor 44aa5def73 bltouch: Allow the pin_move_time to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 10:34:54 -05:00
Kevin O'Connor e0b2d7c51d bltouch: Add a BLTOUCH_DEBUG command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-03 22:52:32 -05:00
Kevin O'Connor aac92ffb91 bltouch: Fix bug - must restore stepper position after homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-01 22:09:06 -05:00
Arksine cf6a56cebf bed_mesh: Introduce fade_target option
To deal potential z scaling when fade is enabled, a fade_target option has been introduced.  This option may either be set to 0.0 or any z position within the range of the mesh.  A value of 0.0 will result in previous behavior, where z adjustment phases out until no further adjustment is added.  A non-zero value will phase out adjustment until the target has been reached, after which the rest of the print will be offset along the z axis by the fade_target.  By default the fade_target will be calculated as an average of the mesh.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Arksine 35f41b7402 bed_mesh: Disable z-adjustment fade by default.
Due to various potential issues with fading out z-adjustment, it is better to disable by default and allow users to opt-in.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Kevin O'Connor 824e55d75a bltouch: Add initial support for a bltouch "extras" module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:34:20 -05:00
Kevin O'Connor a726c58671 mcp4451: Minor update - remove unnecessary mcu import
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:36:49 -05:00
Kevin O'Connor 147d805231 mcp4451: Use bus.py helper code for i2c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:33:22 -05:00
Kevin O'Connor e5150fe187 uc1701: Add support for SSD1306 in i2c mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 22:04:06 -05:00
Kevin O'Connor d2aa78c16a uc1701: Cache icons and fonts in byte display order
This reduces the amount of bit manipulaton needed during screen
updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 065a8eb826 uc1701: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a79d87ca8e uc1701: Add all_framebuffers to reduce vram indexing in the code
Add a self.all_framebuffers variable and change self.vram to only
contain the new display data.  This allows the main code to access the
self.vram member variable without the need to index for current/old
data.  (It also updates the code to match the latest st7920 and
hd44780 code.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor e231ac7422 uc1701: Add support for SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a00d7b418f display: Add a get_dimensions() method to lcd chip classes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 9ba94ded9e tmc2660: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 1c71ea27e0 uc1701: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 5bb0bd755d tmc2130: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor ab6a8ec76e ad5206: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor be58c7f8ec replicape: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 7cadd8d3f4 spi_temperature: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 58890e32a2 bus: Add klippy/extras/bus.py module with SPI bus helper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 2cc0313b72 avr: Add initial support for atmega32u4 chips
Signed-off-by: Trevor Jones <trevorjones141@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-20 12:58:33 -05:00
Kevin O'Connor ac72f8ec78 console: Try to improve the description of the SUPPRESS command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 17:16:14 -05:00
Kevin O'Connor f3c4deb1ab lpc176x: Convert i2c code to use standard i2ccmds.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-14 10:23:56 -05:00
Jiri Dobry e541466591 servo: This patch create ability to enable/disable attached servo. (#880)
Cheap mechanical servos have small flickering. When this servo stay on one position, this flickering slowly destroy internal potentiometer and make servo unusable. Many mechanisms need servo only to change position. Therefore I create this minor path to enable/disable servo. It stop pulses for this servo, that's all.

Corresponding G-code is:
SET_SERVO SERVO=config_name [WIDTH=] [ENABLE=<0|1>]
SET_SERVO SERVO=config_name [ANGLE=] [ENABLE=<0|1>]

For example:
SET_SERVO SERVO=touch ANGLE=80 ENABLE=1 ; enable servo and set position
G4 P200 ; wait 200ms
SET_SERVO SERVO=touch ENABLE=0 ; disable servo

This patch add one option to servo configuration:
enable: <False/True> # default True

It not have impact to user code existing already because it is optional parameter and default value is same as original behavior.

Signed-off-by: Jiri Dobry <jdobry@centrum.cz>
2018-11-14 09:38:09 -05:00
James b45ccfea97 display: FR icon changed to "Feed Rate" (#860)
Signed-off-by: James Wood <j@j-w.co>
2018-11-13 10:14:01 -05:00
Lucas Fink f6c2e8b4eb bed_mesh: Fix some fragile identity comparisons
Signed-off-by: Lucas Fink <software@lfcode.ca>
2018-10-31 16:02:45 -04:00
Florian Heilmann b98e12c19a sx1509: Relax restrictions on SX1509 pins (#836)
This allows SX1509 pins to be used as temperature fans and heater fans. Heaters are still disallowed.

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-30 18:08:12 -04:00
Florian Heilmann 3328ade194 tmc2660: Fix typo in TMC2660 extra (#830)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-29 12:44:45 -04:00
Kevin O'Connor 8432f6f40c avr: Add support for atmega328p
The atmega328p is basically the same as the atmega328 - add explicit
support for it so that avrdude doesn't complain while flashing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-29 11:55:15 -04:00
Florian Heilmann 90bc3be6a0 Add DUMP_TMC capabilities to the TMC2660 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-28 18:45:49 -04:00
Florian Heilmann 4372d1812c Implement idle event support in the TMC2660 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-28 18:45:49 -04:00
Kevin O'Connor d25e02144c idle_timeout: Add printing/ready/idle tracking
Internally track the overall printer state.  Generate events on state
transitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 18:39:45 -04:00