aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* mathutil: Move coordinate_descent() to new fileKevin O'Connor2018-03-044-39/+45
| | | | | | | Add a new python file (mathutil.py) and move the coordinate_descent() code to it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* clocksync: Fix multi-mcu frequency adjustments with long movesKevin O'Connor2018-03-031-1/+1
| | | | | | | Commit 02ae2ab9 had a typo causing the new long move handling logic to not take effect. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Remove trailing '*' checksum indicator from M23 commandKevin O'Connor2018-03-021-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Add a wrapper around the results of lookup_command()Kevin O'Connor2018-02-276-105/+109
| | | | | | | | Add a lookup_command() method to the SerialReader class that provides a wrapper that stores the serial and commandqueue references. This makes it easier to run the send() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use git describe --alwaysKevin O'Connor2018-02-261-1/+1
| | | | | | | | Add --always flag to "git describe" command to get a build identifier even if one checks out the repo with a depth parameter that prunes out the last tagged version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Don't clear must_exit flag at start of pollreactor_run()Kevin O'Connor2018-02-261-1/+0
| | | | | | | Avoid a timing race where must_exit is set before pollreactor_run() is started. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add at90usb646 supportDouglas Hammond2018-02-251-1/+1
| | | | Signed-off-by: Douglas Hammond wizhippo@gmail.com
* clocksync: Rework multi-mcu adjust to better handle long movesKevin O'Connor2018-02-191-11/+19
| | | | | | | | | | | | | | | | | | | The multi-mcu clock syncing code relies on the ability to periodically update the mcu clock adjustments. If a series of very long moves are submitted then it is possible the adjustments could become unstable. For example, if an adjustment is made to reduce a clock error over the next couple of seconds, but it is applied to a longer period because the next move lasts many seconds, then this would result in a bigger adjustment for the following move, which would result in an even bigger error when that move lasts many seconds. This can repeat until the system destabilizes. Check for cases where the print_time is far in the future of the current estimated print time and average over a longer period in that case. That should reduce the possibility of the adjustment code becoming unstable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ad5206: Warn if ad5206 enable pin is invertedKevin O'Connor2018-02-171-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Add tips for porting to new kinematics to Code_Overview.mdKevin O'Connor2018-02-171-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Increase calibration log level from debug to infoKevin O'Connor2018-02-163-13/+12
| | | | | | | Output more information by default from the bed_tilt and delta_calibrate commands. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Initial support for virtual sdcardKevin O'Connor2018-02-112-1/+167
| | | | | | | | Add support for directly printing from a local file on the host. This may be useful if the host cpu is not fast enough to run OctoPrint well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Introduce request_restart() methodKevin O'Connor2018-02-111-20/+12
| | | | | | | Use request_restart() method instead of prep_restart() and motor_heater_off(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Extract special cases from process_data()Kevin O'Connor2018-02-111-20/+28
| | | | | | | Handle the unlikely case of pending commands in a new method process_pending(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Fix PWM static start value setupDave Bacon2018-02-101-1/+1
| | | | | | config_setup uses ._start_value instead of ._static_value which isn't defined. Signed-off-by: Dave Bacon <drb.github@mrbacon.com>
* pins: Warn on invalid pin formatKevin O'Connor2018-02-071-7/+17
| | | | | | Raise an error if a pin description isn't formatted correctly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_tilt: Negate parameters reported by bed_tilt_calibrateKevin O'Connor2018-02-051-1/+1
| | | | | | | | The bed_tilt_calibrate command determines the tilt of the bed. However, we need to report the tilt compensation which is the negative of the bed tilt. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Report stats whenever the heater is activeKevin O'Connor2018-02-051-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Allow any stats producer to determine when stats are neededKevin O'Connor2018-02-055-20/+12
| | | | | | | | Instead of using the toolhead class to determine if stats should be reported, allow every printer object with a stats() callback to determine if stats are needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* clocksync: Respond faster to clock changesKevin O'Connor2018-02-051-1/+1
| | | | | | | Average clock sync times over approximately 30 seconds instead of 120 seconds so that the clock prediction responds to changes faster. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Introduce load_config_prefix() for modules that take parametersKevin O'Connor2018-02-0311-18/+12
| | | | | | | | Use both load_config() and load_config_prefix() functions when dynamically loading a module from the extras directory - if the config section name has parameters in it then use load_config_prefix(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: No need to store fileconfig in main printer objectKevin O'Connor2018-02-031-24/+22
| | | | | | Just pass the fileconfig reference to the ConfigWrapper instances. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Call set_nonblock() in create_pty()Kevin O'Connor2018-02-021-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Make sure need_ack is always restored on run_script()Kevin O'Connor2018-02-021-3/+5
| | | | | | Restore need_ack even on a G-Code exception. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Keep reading input to check for M112 (emergency stop)Kevin O'Connor2018-02-021-11/+26
| | | | | | | | | | | | OctoPrint (and other software) will sometimes send additional commands even if the previous command has not yet responded with an "ok". Change the g-code input reading code to keep reading input so that an M112 can be detected (and processed out-of-order). To avoid the extreme case where one writes an entire g-code file to the input without any pacing, disable the input reading if more than 20 commands are pending. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Propagate errors from run_script()Kevin O'Connor2018-02-011-0/+4
| | | | | | | If the script being run raises an error, then stop running that script and return the error to the caller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Ack even empty linesKevin O'Connor2018-02-011-2/+2
| | | | | | An empty input line should still return an "ok" message. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Clarify hardware_pwm and allow cycle_time to be set on software pwmKevin O'Connor2018-01-295-33/+24
| | | | | | | | Specify hardware pwm cycle times using the same method as software pwm (in seconds, not clock ticks). Allow the fan code to be configured with an explicit cycle time even when using software pwm. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Default the restart method to 'command' on non-serial portsKevin O'Connor2018-01-291-2/+8
| | | | | | | | If the mcu supports command restarts and it does not appear to use a real serial port, then default the restart method to 'command'. This is a better default on boards with native USB support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Support default values in get_constant() callsKevin O'Connor2018-01-292-7/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Add stats reportingKevin O'Connor2018-01-282-1/+10
| | | | | | | Report the current temperature, current pwm setting, and target temperature as statistics in the log. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing_override: Allow moves prior to homing an axisKevin O'Connor2018-01-286-14/+34
| | | | | | | Add support for disabling homing checks via the homing_override mechanism. This may be useful to move an axis prior to homing it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Create a probe:z_virtual_endstop pinKevin O'Connor2018-01-281-1/+12
| | | | | | | Create a virtual pin that may be used as the z endstop pin on cartesian printers that use the probe in place of a z endstop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Support activate/deactivate scripts on each probeKevin O'Connor2018-01-283-0/+34
| | | | | | | | Allow a set of g-code scripts to be run on each probe invocation. This may be useful for probes that need to be setup before they are useful (eg, with servo actuated probes). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing_override: Add basic support for running custom g-code on G28Kevin O'Connor2018-01-281-0/+28
| | | | | | | | Allow users to override the behavior of G28 using a new "homing_override" config section. This may be used on printers that require specific steps during the homing process. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_tilt: Add support for automatic bed tilt move transformationKevin O'Connor2018-01-282-3/+109
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta_calibrate: Add initial support for a DELTA_CALIBRATE commandKevin O'Connor2018-01-283-30/+224
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Initial support for Z-Probe hardwareKevin O'Connor2018-01-286-6/+78
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Allow the user to specify a minimum z positionKevin O'Connor2018-01-281-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* replicape: Move the replicape code from chipmisc.py to extras directoryKevin O'Connor2018-01-282-217/+222
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ad5206: Move the ad5206 code from chipmisc.py to extras directoryKevin O'Connor2018-01-282-27/+30
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* servo: Move the servo code from chipmisc.py to extras directoryKevin O'Connor2018-01-282-56/+59
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* multi_pin: Move the multi_pin code from chipmisc.py to extras directoryKevin O'Connor2018-01-282-50/+57
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Move fan code to extras directoryKevin O'Connor2018-01-284-66/+78
| | | | | | | The print cooling fan and printer heater_fan are independent modules that can reside in the extras directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add support for dynamic loading of python modulesKevin O'Connor2018-01-282-3/+22
| | | | | | | | Check if a config section matches a python filename in the klippy/extras/ directory. If it does, load that python code to handle the config section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Support generic printer_state() and stats() callbacksKevin O'Connor2018-01-284-57/+71
| | | | | | | | | | | Instead of hardcoding which objects are called on state transitions, allow any "printer object" to be invoked if it has a printer_state() method. Convert connect, ready, shutdown, and disconnect callbacks to this mechanism. Similarly, allow all printer objects to provide a stats() callback. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add access methods and avoid peeking into the printer classesKevin O'Connor2018-01-2810-85/+103
| | | | | | | | | 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>
* gcode: Add a run_script() helper method to run g-code scriptsKevin O'Connor2018-01-281-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Extend register_command() so that it can also unregister a commandKevin O'Connor2018-01-281-0/+6
| | | | | | | If register_command() is passed None as the function to call, then treat it as an unregister command request. 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>