Commit Graph

775 Commits

Author SHA1 Message Date
Kevin O'Connor 390d549c0c delta: Fix maximum halt velocity calculation
If an arm is nearly parallel to the bed then that tower's carriage may
have a velocity up to 3 times greater than the toolhead's maximum
velocity (relative to the print).  Take that into account when
calculating the stepper's maximum halt velocity.

This fixes some rare "No next step" shutdowns on delta printers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 22:29:18 -04:00
Kevin O'Connor 094b9de69e gcode: Send proactive state messages
Send a g-code info message on printer state changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 21:31:27 -04:00
Kevin O'Connor 91691afdcf gcode: Catch errors on fd read and write
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 21:06:54 -04:00
Kevin O'Connor d1da6100a6 klippy: Remove unneeded loop in run() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 21:06:54 -04:00
Maks Zolin e3a49dc692 quad_gantry_level: Add gantry leveling (ruled hyperbolic parabola correction) (#631)
Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
2018-09-12 08:33:20 -04:00
Kevin O'Connor 5791a4d8c4 toolhead: Set commanded_pos[] to move.end_pos
Commit 4573932f allowed move.end_pos to differ from the requested end
position - the toolhead class should use the updated position when
storing its commanded position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-11 13:45:33 -04:00
Kevin O'Connor 4573932f89 toolhead: Handle rounding errors with extrude only moves
It's possible that a g-code transform class may make an extrude only
move appear as a kinematic move due to limitations of double precision
math.  Handle this by checking for an inconsequential move distance
instead of checking for a move distance of exactly zero.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-11 13:40:52 -04:00
Florian Heilmann 947a7b2b0f tmc2660: Implementation of TMC2660 extra (#621)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-09-11 12:34:05 -04:00
Arksine d6f72eefa1 bed_mesh: Cache last position when get_position() is called.
Fixes issue #626.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-09-10 15:10:43 -04:00
Kevin O'Connor ef6068dc42 mcu: Log MCU information before configuring
Log the details of the MCU prior to attempting to configure the MCU.
This way, the log contains the MCU information even if a configuration
error occurs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 18:34:10 -04:00
Kevin O'Connor 5801e6f4d0 pins: Verify the pin_map setting
Raise an error if pin_map is not set to a valid value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 18:16:44 -04:00
Kevin O'Connor 30013a1fb8 mcu: Rename add_config_object() to register_config_callback()
Change the name of the config registration method and pass an explicit
reference to the callback to the new method.  This makes the
relationship between mcu registration and build_config() more clear in
the calling code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 11:48:22 -04:00
Kevin O'Connor 8fe8a6deb3 statistics: Move stats handling to new "extras" module
Move the generation of statistics to its own module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 13:46:19 -04:00
Kevin O'Connor 18b04ffe68 klippy: Rename lookup_module_objects() to lookup_objects()
Rename the method and support returning all known objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:53:34 -04:00
Kevin O'Connor 50196c7141 klippy: Use reactor register_callback() mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:43:40 -04:00
Kevin O'Connor ab4060e145 console: Use reactor register_callback() mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:31:36 -04:00
Kevin O'Connor 165317e33f toolhead: Support M204 with P and T instead of S
Recent versions of Slic3r now send M204 with P and T instead of with
S, so support that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:22:43 -04:00
Kevin O'Connor 5632cf6d77 serialqueue: Increase receive message debug queue to 100 messages
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:16:13 -04:00
Kevin O'Connor ce79b6ca00 menu: Queue g-code commands to avoid command reordering
The gcode.run_script() code can pause which can result in the menu
code being called reentrant - avoid that by queuing the gcode commands
within the menu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:14:27 -04:00
Kevin O'Connor cf4f23ebf2 probe: Use probe speed for initial move to the Z height
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-30 16:20:23 -04:00
Kevin O'Connor f3edea2943 toolhead: Forward original config error if raised in kinematics class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-30 10:19:08 -04:00
Arksine 40b7ba5111 probe: Add ability to multi-sample points to ProbePointsHelper
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-29 12:01:19 -04:00
Arksine 1588426229 probe: Refactor z lift code to its own function.
Call lift-z prior to the first move.  This prevents the nozzle from hitting the build surface in situations that home the nozzle off and below the bed.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-29 12:01:14 -04:00
Kevin O'Connor ca7a80a946 tmc2208: Initial support for configuring TMC2208 drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:51:27 -04:00
Kevin O'Connor afd5d55c00 tmc2130: Minor code cleanup
Rework the code to use set_register() with the string name of the
desired register to set.  Add a get_register() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:47:24 -04:00
Kevin O'Connor ad480bd470 mcu: Avoid adding the same stepper multiple times to an endstop
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-26 23:06:32 -04:00
Romain “Artefact2” Dal Maso 11e9bb286e probe: Allow restarting an incomplete probe set
Signed-off-by: Romain “Artefact2” Dal Maso <artefact2@gmail.com>
2018-08-24 13:20:55 -04:00
Arksine e94f3b7827 gcode: M117 fix
Resolves issue where M117 is not correctly executed when the message begins with numeric or special character.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-22 12:53:42 -04:00
Janar Sööt 65f0fd6238 display menu module for klipper
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-08-20 22:33:05 -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
Arksine 52df40dfbb bed_mesh: update z_offset check
Only check the probe's z_offset against the stepper_z endstop position if the probe is used as a virtual endstop.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-19 16:52:23 -04:00
Kevin O'Connor 1b07be070b heater_fan: Allow multiple heaters to be defined for a heater_fan
Support the case where a single cooling fan is used with multiple
extruders.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-17 10:20:12 -04:00
Arksine e0bd221c57 bed_mesh: mesh bed leveling for Klipper
Initial implementation of configurable Mesh Bed Leveling.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-17 09:22:55 -04:00
Florian Heilmann 64e6d85898 sam4e8e: Add the SAM4e8e port
This can be flashed to e.g. the duet wifi using bossac. It requires a
later version as is currently included in the klipper repo (1.8
vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-08-08 10:44:49 -04:00
Kevin O'Connor cf2393efc8 samd21: Add support for gpio pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:03:21 -04:00
Kevin O'Connor 7783767c35 klippy: Move tracking of accessed config items into _read_config() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-03 18:54:23 -04:00
Kevin O'Connor 82738955d2 virtual_sdcard: Check if other events need to run after each file read
Periodically check if other events need to run - this prevents the
virtual_sdcard processing from starving other events.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-02 20:27:34 -04:00
Kevin O'Connor f2d232ef77 force_move: Provide defaults for SET_KINEMATIC_POSITION parameters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-02 08:58:18 -04:00
Kevin O'Connor c0c892d524 force_move: Add support for FORCE_MOVE command
Add initial support for commands that will forcibly move a stepper
(without updating the kinematic classes with the new position).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 12:44:07 -04:00
Kevin O'Connor a434341aa9 force_move: Simplify STEPPER_BUZZ code
Separate the setup and movement parts of cmd_STEPPER_BUZZ() into their
own functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 11:45:18 -04:00
Kevin O'Connor 2c5eba44ee force_move: Rename stepper_buzz.py to force_move.py
This is in preparation for extending the ability to make manual moves.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 11:15:51 -04:00
Kevin O'Connor 13ccb1a46f mcu: Minor whitespace changes
Wrap lines at 80 columns.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 10:54:31 -04:00
Kevin O'Connor 98580ac1c2 adc_temperature: Minor whitespace changes
Wrap lines at 80 columns.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 10:51:48 -04:00
Kevin O'Connor 334a839123 stepper: Minor whitespace changes
Wrap lines at 80 columns.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 10:18:10 -04:00
Kevin O'Connor 273a98d39a pins: Explicitly pass can_invert and can_pullup to lookup_pin()
Don't pass pin_type to lookup_pin() - instead, if a pin can be
inverted or can have a pullup, then the caller must explicitly specify
that when calling lookup_pin().  This simplifies the code for the
cases where it is not valid to invert or pullup.

Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin()
apply default pullup and invert flags.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 09:44:45 -04:00
Kevin O'Connor 7d0f3649f3 spi_temperature: The query_thermocouple command is an init command
Make sure to use is_init=True when sending query_thermocouple -
otherwise, the config CRC is likely to mismatch on every connection.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 19:50:11 -04:00
Kevin O'Connor 63dffd9307 spi_temperature: Provide a default value for spi_speed
All of the Maxim chips support a 4Mhz spi transfer rate, so use that
as a default spi speed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:49:14 -04:00
Kevin O'Connor 5b124d59f2 spi_temperature: Remove spi_mode parameter
All of the Maxim chips can use SPI mode 1, so no need to configure it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:47:17 -04:00
Kevin O'Connor 70f765f62f spi_temperature: Don't raise error on a fault - invoke a shutdown
Raising an error from the background message reception thread isn't
well defined.  Instead, on a temperature fault, invoke a printer
shutdown.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:20:45 -04:00
Kevin O'Connor a084c38b41 spi_temperature: Eliminate get_configs() callback
Those chips that require an spi init sequence can generate the message
directly in the chip specific class.

Also, don't send an spi init message for chips that are read-only.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:20:38 -04:00