aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extruder.py
Commit message (Collapse)AuthorAgeFilesLines
* stepper: No need to pass printer reference to kinematic/stepper constructorsKevin O'Connor2018-06-221-9/+8
| | | | | | The config reference already stores a reference to the printer object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Convert to using iterative solverKevin O'Connor2018-06-201-58/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Report max_extrude_ratio in logKevin O'Connor2018-06-051-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Fix SET_PRESSURE_ADVANCE so that it works with multiple extrudersKevin O'Connor2018-05-201-3/+11
| | | | | | | Use the new gcode.register_mux_command() so that SET_PRESSURE_ADVANCE works correctly with multiple extruders. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Add minval/maxval/above/below options to get_X parsersKevin O'Connor2018-04-201-9/+9
| | | | | | Add value checking to gcode parameter parsing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Add PrinterHeaters class that stores all sensors and heatersKevin O'Connor2018-04-041-12/+4
| | | | | | | | | | | | Add a PrinterHeaters class that can stores references to available temperature sensors and stores references to instantiated heaters. Add a extras/heater_bed.py file and delay instantiation of the heater_bed object. This allows the heater.py module to be imported earlier during the setup phase, and allows the PrinterHeaters class to be available for registering sensors and heaters. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Log SET_PRESSURE_ADVANCE changesKevin O'Connor2018-04-031-3/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add SET_PRESSURE_ADVANCE command.Michael Barbour2018-04-031-5/+22
| | | | Signed-off-by: Michael Barbour <barbour.michael.0@gmail.com>
* heater: Add stats reportingKevin O'Connor2018-01-281-0/+2
| | | | | | | Report the current temperature, current pwm setting, and target temperature as statistics in the log. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add access methods and avoid peeking into the printer classesKevin O'Connor2018-01-281-7/+7
| | | | | | | | | Add get_reactor(), lookup_object(), lookup_module_objects(), and set_rollover_info() to the main Printer class so that callers do not need to peek into the class' members. Similarly, add get_printer() and get_name() methods to the ConfigWrapper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add support for extruders sharing the same heaterKevin O'Connor2018-01-211-1/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Remove unused variable self.configKevin O'Connor2018-01-161-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Fix pressure advance on tiny moves with over extrusionsKevin O'Connor2018-01-081-2/+5
| | | | | | | | | | | | The extruder check_move() code will permit moves with huge extrusion ratios if the amount extruded is tiny. (Some slicers emit these silly moves - they are allowed because they are harmless.) Unfortunately, the pressure advance code did not handle the huge extrusion ratios - it would result in a massive, near instantaneous, extruder move in an attempt to build pressure in the extruder. Catch this case and limit the impact to the pressure advance code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Store pointers to step_const and step_delta in PrinterStepperKevin O'Connor2017-11-181-7/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Calculate the stepper name directly from the config sectionKevin O'Connor2017-11-181-1/+1
| | | | | | | There is no need to pass the name to the PrinterStepper class as it can determine the name itself. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Pass print_time directly to MCU callsKevin O'Connor2017-09-191-12/+13
| | | | | | | | | Now that the print_time is always synchronized with the mcu_time, there is no longer a need to track mcu_time as a separate quantity. Eliminate references to mcu_time from the code and pass print_time directly in its place. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Remove unused set_max_jerk() callKevin O'Connor2017-09-081-2/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Allow heater_fan to work with heater_bedKevin O'Connor2017-09-071-6/+5
| | | | | | | Fix order of init error preventing heater_fan from being used with heater_bed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Provide more details on extruder errorsKevin O'Connor2017-09-051-10/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Fix typo in initKevin O'Connor2017-09-051-1/+0
| | | | | | Commit 7a81bfc4 broke extrude only moves due to a typo in the commit. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Eliminate set_max_jerk() from kinematic classesKevin O'Connor2017-09-031-8/+9
| | | | | | | | Allow the kinematic classes to query the max velocity, max accel, and max halt velocity from the toolhead class instead of having the toolhead class call into the kinematic classes with those values. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Add support for heater_fan objectsKevin O'Connor2017-07-171-0/+10
| | | | | | | Add support for fans designed to cool the components of an extruder or heater. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Support running arbitrary gcode on extruder changeKevin O'Connor2017-06-091-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add initial support for multi-extrudersKevin O'Connor2017-06-091-3/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Allow each module to define their config sectionsKevin O'Connor2017-06-091-0/+5
| | | | | | | | Create add_printer_objects() functions in the fan, heater, extruder, and toolhead modules. Create the necessary printer component objects from this call instead of placing the code directly in klippy.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Rework maximum retraction checkKevin O'Connor2017-05-021-7/+8
| | | | | | | | On a retract move (which are common during "wipe" operations), treat the move as if it were an extrude only move. It's valid for a retract move to reverse more filament then it would be practical to push. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Extend over extrusion checks to retractionsKevin O'Connor2017-05-021-3/+4
| | | | | | | Ensure a move with a retraction (negative extrude) is also checked for sane extrusion rates. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Support minimum/maximum value checks on configuration variablesKevin O'Connor2017-04-111-8/+14
| | | | | | | Verify that numeric parameters are in a sane range when reading the config. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Merge stepcompress_push_accel() and stepcompress_push_const()Kevin O'Connor2017-04-071-4/+4
| | | | | | | | It's not necessary to have separate C functions for constant acceleration and constant velocity as constant velocity can be obtained by using a constant acceleration of zero. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Pass constant velocity and acceleration directly to mcu_stepperKevin O'Connor2017-04-071-43/+16
| | | | | | | | Rename step_sqrt/step_factor to step_accel/step_const and have them directly take the velocity and acceleration in millimeters and seconds. This simplifies the kinematic classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Make sure EXTRUDE_DIFF_IGNORE doesn't trigger due to roundingKevin O'Connor2017-03-201-4/+9
| | | | | | | | | | | The code disables lookahead between two extruding moves with significantly different extrude ratios. Unfortunately, it was possible for very tiny moves to show different extrude ratios just due to how the slicer implements rounding when it produces the gcode. Allow lookahead to be enabled between moves with extrude ratios that are different if they don't noticeably produce more or less extrusion. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Avoid maximum extrude cross section errors on infinitesimal movesKevin O'Connor2017-03-191-4/+6
| | | | | | | | Be less likely to raise a "Move exceeds maximum extrusion cross section" error on very short moves. It's okay to extrude a little extra plastic on moves shorter than the nozzle diameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Eliminate high-level build_config phaseKevin O'Connor2017-03-131-3/+0
| | | | | | | | | | Now that the mcu objects can be created prior to connecting to the mcu, it is no longer necessary to separate the init and build_config phases in the high-level code. Move the mcu objection creation from the build_config phase to the init phase and eliminate the build_config phase. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Pressure advance lookahead time should start after decelKevin O'Connor2017-03-031-0/+4
| | | | | | | The pressure advance lookahead time should start after any full deceleration moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Allow configuration of pressure advance lookahead timeKevin O'Connor2017-02-221-6/+15
| | | | | | | | | | | | Instead of defaulting the pressure advance lookahead time to be the same as the pressure_advance variable, allow it to be configured. Default the new config setting (pressure_advance_lookahead_time) to 10ms. Also, make the setting more accurate if a future move is accelerating in the middle of the lookahead window. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Do extruder lookahead based on time instead of corneringKevin O'Connor2017-02-061-39/+36
| | | | | | | | | When calculating the extruder lookahead, determine how far to lookahead by the amount of elapsed time each move takes. This makes the extruder lookahead code more flexible as it is no longer limited to the next immediate cornering moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Move extruder specific lookahead into extruder classKevin O'Connor2017-02-061-4/+56
| | | | | | | | Instead of calculating min/max_corner_v in the toolhead class, calculate it in the extruder class. This keeps the extruder specific code together. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Change variables to use suffix "_v2" instead of prefix "junction_"Kevin O'Connor2017-01-161-4/+4
| | | | | | | | The junction speeds are tracked in velocity squared - introduce the common suffix "_v2" to track that instead of using a prefix of "junction_". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Calculate sane defaults for extrude only velocity and accelKevin O'Connor2017-01-031-2/+7
| | | | | | | | Instead of requiring the user enter velocity and accel parameters for extrude only moves, calculate sane defaults from the printer's maximum velocity and accel. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Do sanity checks on extrusion ratesKevin O'Connor2017-01-031-1/+13
| | | | | | | Add a run-time check to ensure the incoming g-code doesn't have a ridiculously large e move. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add nozzle and filament diameter config settingsKevin O'Connor2017-01-031-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Don't call into kinematic class on extrude only movesKevin O'Connor2016-12-281-3/+1
| | | | | | | | Add a is_kinematic_move flag to the Move class and clear it on extrude only moves. Don't call the kinematic check_move() or move() methods for extrude only moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Fix retractKevin O'Connor2016-12-011-1/+1
| | | | | | | Commit 7554c7f6 broke retract moves. Fix by making sure extrude_r is always a positive number. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Specify maximum acceleration and velocity in toolhead classKevin O'Connor2016-12-011-2/+4
| | | | | | | | | | Change the config file so the maximum accel and velocity are specified in the "printer" section instead of the individual "stepper" sections. The underlying code limits the velocity and accel of the toolhead relative to the print object, so it makes sense to configure the system that was as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Store the stepper position in the mcu_stepper classKevin O'Connor2016-11-191-8/+2
| | | | | | | Move the storage of the stepper location from the kinematic classes to the low-level mcu_stepper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Add EndstopMoveError wrapper around EndstopErrorKevin O'Connor2016-11-181-1/+2
| | | | | | | | Allow an EndstopError to be raised without a destination position. Introduce EndstopMoveError wrapper so that current callers can continue to pass in a move destination. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Create QueryEndstops class from gcodeKevin O'Connor2016-11-181-1/+1
| | | | | | | | | | | Create the QueryEndstops in the gcode handler instead of in the kinematic classes. This simplifies the gcode handler as it can directly register its response callback. Also, store the stepper name in the stepper class. Also, propagate the print_time of the query request to the mcu_endstop class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Check if the motor needs to be enabled in the kinematic classesKevin O'Connor2016-11-141-5/+11
| | | | | | | Check for motor enable in the kinematic classes so it doesn't need to be checked on every move. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Do all step rounding in C codeKevin O'Connor2016-11-131-47/+36
| | | | | | | | | | | | | | | | | Commits f0cefebf and 8f331f08 changed the way the code determined what steps to take on fractional steps. Unfortunately, it was possible in some situations for the C code to round differently from the python code which could result in warnings and lost steps. Change the code so that all fractional step handling is done in the C code. Implementing the step rounding logic in one location avoids any conflicts. In order to efficiently handle the step rounding in the C code, the C code has also been extended to directly send the "set_next_step_dir" command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Default to a high direction pin meaning positive directionKevin O'Connor2016-11-081-3/+3
| | | | | | | | | Invert the default meaning of the stepper direction pin. Instead of treating a low value as position motion, treat a high value as positive motion. This matches what other firmwares do, and it matches what common stepper motor drivers document. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>