aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* thermistor: Fallback to using beta if Steinhart-Hart c3 is negativeKevin O'Connor2018-04-091-4/+11
| | | | | | | | If the c3 coefficient is negative it can cause the adc calculations to fail. The c3 shouldn't be negative in practice, so fallback to a simple beta calculation in that case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermistor: Add support for defining custom thermistorsKevin O'Connor2018-04-091-0/+26
| | | | | | Add the ability to define a new thermistor type in the config file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pid_calibrate: Make sure to unregister new control class on errorKevin O'Connor2018-04-061-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Move Thermistor and Linear to their own files in extras/Kevin O'Connor2018-04-044-124/+154
| | | | | | | | Move the Thermistor code to a new thermistor.py module. Move the Linear code to a new adc_temperature.py module. This simplifies the heater.py code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Move adc logic into Thermistor classKevin O'Connor2018-04-042-35/+51
| | | | | | | | The Thermistor (and Linear) class should handle all the details of reading the ADC values and converting them to temperatures. So, move that logic out of the Heater() class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Merge ThermistorBeta class into Thermistor classKevin O'Connor2018-04-041-13/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Add PrinterHeaters class that stores all sensors and heatersKevin O'Connor2018-04-047-31/+67
| | | | | | | | | | | | 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>
* pins: Remove module level get_printer_pins() and setup_pin() functionsKevin O'Connor2018-04-049-44/+36
| | | | | | | | Most callers did a lookup of the pins module via printer.lookup_object("pins"). Use that as the standard method and remove these less frequently used methods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Limit junction speed of short movesKevin O'Connor2018-04-031-3/+8
| | | | | | | | | | | | | | | | | | | | The existing junction algorithm limits the speed between two moves by determining the maximum speed an arc between those two moves would have if the cetripetal acceleration of that arc did not exceed the printer's maximum acceleration. However, should the slicer send an actual arc to the printer, then the existing junction algorithm would not impose any significant limit on the travel speed of that arc. This would permit the head to travel in a circle at high velocity and with a greater centripetal acceleration than the printer's maximum acceleration. To avoid this, impose a limit on the junction velocity of short moves so that an approximate centripetal acceleration of that move does not exceed the move's acceleration limit. Suggested by Michael Barbour. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_tilt: Apply bed_tilt_calibrate settings to current sessionKevin O'Connor2018-04-031-6/+15
| | | | | | | | Apply the bed tilt settings immediately after finding them. This makes it easier for users to perform automatic tilt calibration at the start of every print. 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>
* klippy: Automatically clear rollover_info on each restartKevin O'Connor2018-04-035-20/+21
| | | | | | | Automatically clear the information printed at the start of each log file rollover on a klippy internal restart. 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 some comments to the thermistor mathKevin O'Connor2018-03-291-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* display: Round temperature and position to nearest whole numberKevin O'Connor2018-03-191-5/+5
| | | | | | | The "%d" formatting truncates a floating point number - use "%.0f" to show a rounded number. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* display: Remove unneeded semicolons from fileKevin O'Connor2018-03-191-7/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pid_calibrate: Move PID calibration logic from heater.py to new fileKevin O'Connor2018-03-183-143/+137
| | | | | | | | Drop support for M303 and PID_TUNE, and replace it with a new PID_CALIBRATE command. Move the logic for this command from heater.py to a new pid_calibrate.py file in the extras/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add z_offset parameterKevin O'Connor2018-03-173-8/+12
| | | | | | | | | Move the probe_z_offset parameter from delta_calibrate and bed_tilt_calibrate to a z_offset parameter within the probe config section. It's easier to understand the z offset setting when it is in the probe config section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_tilt: Take into account the XY position used with z_virtual_endstopKevin O'Connor2018-03-172-8/+54
| | | | | | | | If a z_virtual_endstop is in use, then record the last XY position that is used when the Z is homed. Use that XY position to report what change is needed to the z position_endstop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_tilt: Require at least 3 probing points for bed_tilt_calibrateKevin O'Connor2018-03-171-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Default z_position to the configured minimum position on Z axisKevin O'Connor2018-03-171-11/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Move pwm and digital output pins to new module in extras/Kevin O'Connor2018-03-172-33/+21
| | | | | | | | Rename the digital_output, pwm_output, and static_pwm_output config sections to output_pin and move to a new module in the extras/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* static_digital_output: Add static_digital_output section to extras/Kevin O'Connor2018-03-172-9/+17
| | | | | | | Move the code for the static_digital_output config section from chipmisc.py to a new file in the extras/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* replicape: Add config controls for the servo[01]_enable linesKevin O'Connor2018-03-171-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Position returned by M114 should be relative to last G92Kevin O'Connor2018-03-152-17/+40
| | | | | | | | It looks like OctoPrint is expecting the result from M114 to be relative to the last G92 command. Also, introduce GET_POSITION to report the actual location that the printer is at. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* verify_heater: Provide additional information on a heater errorKevin O'Connor2018-03-121-2/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Rework starting error messageKevin O'Connor2018-03-121-1/+1
| | | | | | | Commit 9bc4239e now emphasizes the first line of a multi-line error message, so rework startup_message to conform to that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add some hints for common errors during PROBEKevin O'Connor2018-03-121-1/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: On a multi-line error message, report the first line twiceKevin O'Connor2018-03-121-2/+2
| | | | | | | | Report the first line of a multi-line error message twice - once as part of the informational content, and once with the "!!" error prefix. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Fix typo in seek error handlingKevin O'Connor2018-03-121-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Allow min_temp to go below zeroKevin O'Connor2018-03-121-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* verify_heater: Scale hysteresis duration checkKevin O'Connor2018-03-111-6/+7
| | | | | | | | | | If a heater falls out of the target range, accumulate the temperature differences to determine if an error should be raised. This should make it less likely to report an error for heaters that drift slightly out of range, and it should make error reporting faster for heaters that rapidly fall out of range. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* verify_heater: Change default hysteresis to 10 degreesKevin O'Connor2018-03-111-2/+2
| | | | | | | A default of 4 degrees and 10 seconds may be too aggressive - change the default to 10 degrees and 15 seconds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* verify_heater: Add initial support for verifying heaters and sensorsKevin O'Connor2018-03-112-0/+69
| | | | | | | Add runtime checks to heaters and temperature sensors to check for possible hardware faults. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Allow external callers of try_load_module()Kevin O'Connor2018-03-111-2/+2
| | | | | | | It can be useful to automatically pull in a module in the extras/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Initial support for dual carriagesKevin O'Connor2018-03-091-30/+79
| | | | | | | Add support for additional carriages on cartesian printers. This is used by some printers to handle multiple extruders. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* display: Use separate hd44780 screen drawingKevin O'Connor2018-03-081-48/+151
| | | | | | | | Separate out the hd44780 screen drawing from the st7920 code. Use a layout that takes advantage of the 20 columns. Add custom hd44780 fonts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* display: Choose arrow character based on displayMarcio Teixeira2018-03-061-1/+3
| | | | | | | Choose the arrow character based on whether the display is ST7920 or HD44780. Signed-off-by: Marcio Teixeira <marcio@alephobjects.com>
* homing: allow to disable homing retractcruwaller2018-03-062-1/+3
| | | | | | Homing retract can be disabled by setting homing_retract_dist to 0. Signed-off-by: Petri Honkala <cruwaller@gmail.com>
* display: Add initial support for LCD screens attached to an MCUKevin O'Connor2018-03-066-2/+525
| | | | | | | | Add support for displaying basic status information on ST7920 and HD44780 based LCDs that are attached directly to a micro-controller. Signed-off-by: Marcio Teixeira <marcio@alephobjects.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Support sending messages at a background priorityKevin O'Connor2018-03-062-4/+12
| | | | | | | Support low-priority message transmits. This may be useful for bulk commands that should be delayed util the comms are otherwise idle. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* 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>