aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* tmc2130: Add initial support for TMC2130 stepper motor driversKevin O'Connor2018-05-201-0/+70
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Reset extrude_factor and extruder position on a tool changeKevin O'Connor2018-05-201-0/+2
| | | | | | | The extrude_factor and extruder position are specific to the current extruder, so reset them to default values on a Tn command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Raise an error if a duplicate command is registeredKevin O'Connor2018-05-203-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Fix SET_PRESSURE_ADVANCE so that it works with multiple extrudersKevin O'Connor2018-05-202-3/+13
| | | | | | | 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>
* output_pin: Use new gcode.register_mux_command()Kevin O'Connor2018-05-201-13/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* servo: Use new gcode.register_mux_command()Kevin O'Connor2018-05-201-8/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Add ability to register a "mux" commandKevin O'Connor2018-05-201-0/+23
| | | | | | | | | | It's common to add commands that dispatch to a particular object instance depending on the value of a command parameter. (For example, the command "SET_SERVO SERVO=xyz" wants to be handled by the particular "xyz" servo instance.) Add a register_mux_command() helper to gcode.py make it easier to do this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Verify horizontal_move_z not less than probe's z_offsetKevin O'Connor2018-05-201-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Move code from bed_tilt and delta_calibrate into ProbePointsHelperKevin O'Connor2018-05-203-53/+56
| | | | | | | | Move the common config reading and probe object lookup from the bed_tilt.py and delta_calibrate.py code into the ProbePointsHelper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Raise an error if position_endstop is not in min/max rangeKevin O'Connor2018-05-182-11/+22
| | | | | | | | Raise an error during config parsing if the position_endstop is not between the position_min and position_max. This avoids a confusing error message during homing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Allow the fan shutdown_speed to be configuredKevin O'Connor2018-05-183-7/+7
| | | | | | | Add a shutdown_speed config option to fans so that users can specify the speed on a shutdown event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add temperature controlled fansDouglas Hammond2018-05-171-21/+97
| | | | Signed-off-by Douglas Hammond <wizhippo@gmail.com>
* util: Change the /tmp/printer pty to be group readableKevin O'Connor2018-05-161-1/+3
| | | | | | | | For some reason, Linux creates the pseudo tty with group writable permissions, but not group readable. Use chmod to allow the device to also be group readable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Fix typo in error report - name should be self.nameKevin O'Connor2018-05-141-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Apply speed rounding after calling home_prepare()Kevin O'Connor2018-05-141-4/+9
| | | | | | | | | | The step speed rounding and the cpu delay must be run after running the endstop specific preparation code. Otherwise, a delay in the home_prepare() code could undo those calculations. Specifically, this could lead to errors on a multi-mcu setup when the Z is homed using a virtual_z_offset and there is a delay in the activate_gcode section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* temperature_fan: Add support for temperature-triggered fan.Michael Barbour2018-05-102-7/+53
| | | | Signed-off-by: Michael Barbour <barbour.michael.0@gmail.com>
* console: Fix handling of bad commandsKevin O'Connor2018-05-081-1/+0
| | | | | | | Don't return early on a command error - continue to process remaining commands and pop commands from the queue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Convert linux SPI code to use the generic spicmds.c codeKevin O'Connor2018-05-071-12/+14
| | | | | | | | | | Use the generic spi send/receive code on Linux. Update the replicape code to use the updated command format. Also, update the replicape code to turn off the stepper motors on a shutdown event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Rework SPI message transmissionKevin O'Connor2018-05-071-10/+13
| | | | | | | | | Improve the SPI message transmit system. Add support for bus speed and bus mode. Add support for sending SPI messages on shutdown. Signed-off-by: Petri Honkala <cruwaller@gmail.com> Signed-off-by: Douglas Hammond <wizhippo@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Support sending empty strings from create_message()Kevin O'Connor2018-05-071-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Fix batching of BACKGROUND_PRIORITY_CLOCK messagesKevin O'Connor2018-05-051-1/+2
| | | | | | | | | In order to properly delay BACKGROUND_PRIORITY_CLOCK messages, they must be 5ms beyond the minimum defined by MIN_REQTIME_DELTA. So, add both MIN_REQTIME_DELTA and MIN_BACKGROUND_DELTA to the timing of these messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* clocksync: Change timer frequency to avoid resonating with other timersKevin O'Connor2018-05-051-2/+4
| | | | | | | | | | | If the clock querying messages occur at a similar frequency to other events on the micro-controller or host, then it's possible for the load created by those other events to skew the clock synchronization. In particular, the 500ms lcd screen update could resonate with the 1 second clock query. Use an unusual clock querying frequency to avoid this issue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Fix hub-ctrl compilationcruwaller2018-05-051-1/+1
| | | | Signed-off-by: Petri Honkala <cruwaller@gmail.com>
* thermistor: Add Honeywell 100K and MGB18 thermistor definitionsKevin O'Connor2018-04-301-0/+2
| | | | | | Add two additional thermistors (as suggested by Tim Miller). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Move the host C code to a new klippy/chelper/ directoryKevin O'Connor2018-04-307-0/+0
| | | | | | | Move the C code out of the main klippy/ directory and into its own directory. This reduces the clutter in the main klippy directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Add logging on start, stop, stats, and shutdownKevin O'Connor2018-04-231-0/+18
| | | | | | Add additional logging to the virtual_sdcard support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Add a SET_VELOCITY_LIMIT commandKevin O'Connor2018-04-201-3/+38
| | | | | | | Add a command to adjust the maximum velocity, acceleration, and junction deviation parameters. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Add minval/maxval/above/below options to get_X parsersKevin O'Connor2018-04-205-45/+53
| | | | | | Add value checking to gcode parameter parsing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Add a set_shutdown_speed() methodKevin O'Connor2018-04-202-1/+3
| | | | | | | Add a set_shutdown_speed() method so that the heater_fan code does not need to peek into the fan object's internal members. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Add a SET_GCODE_OFFSET commandKevin O'Connor2018-04-201-1/+14
| | | | | | | | The M206 command is confusing (it uses negative offsets) and isn't very flexible. Add a new SET_GCODE_OFFSET command to make it easier to add virtual offsets to gcode commands. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Rename homing_add to homing_offsetKevin O'Connor2018-04-201-17/+17
| | | | | | | | | The M206 command is confusing as positive values in that command result in negative offsets to future g-code commands. Perform the parameter negation in the M206 command instead of storing it that way internally. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Limit Z lift speed to be the same as the probing speedKevin O'Connor2018-04-201-3/+7
| | | | | | | When using an automatic probe, limit the Z lift speed to be no greater than the Z probing speed. This can reduce Z jerks during probing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Reword the error messages during config file parsingKevin O'Connor2018-04-201-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Scale fan speed requests between 0 and max_powerKevin O'Connor2018-04-202-5/+3
| | | | | | | | If the fan's max power is limited by the config, then scale speed requests between 0 and max_power. This makes more sense for typical g-code fan speeds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Allow max_accel_to_decel to be greater than max_accel in configKevin O'Connor2018-04-201-3/+3
| | | | | | | | | If max_accel_to_decel is greater than max_accel in the config, then just internally limit max_accel_to_decel to max_accel. This makes it easier to completely disable the max_accel_to_decel feature (as it can just be set to a high value in the config). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add STM32F103 portGrigori Goronzy2018-04-091-0/+1
| | | | | | | | | | | | Add a fully functional STM32F1 port, currently mostly targeting STM32F103 microcontrollers. This requires an 8 MHz XTAL. The maximum possible step rate is around 282K steps per second. This uses stm32flash to burn the firmware. The bootloader needs to be started by setting BOOT0 to 1 and resetting the MCU. There is no automatic bootloader, unlike on Arduino. Signed-off-by: Grigori Goronzy <greg@kinoho.net>
* adc_temperature: Support defining custom sensors in the config fileKevin O'Connor2018-04-091-0/+19
| | | | | | | Allow the user to define a custom sensor with their own set of temperature/voltage measurements. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adc_temperatures: Add "PT100 INA826" sensor typeKevin O'Connor2018-04-091-1/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adc_temperature: Support multiple ranges for ADC lookupKevin O'Connor2018-04-091-10/+54
| | | | | | | | | | Instead of supporting a single linear range for the temperature lookup, allow multiple ranges to be defined. This makes the lookup more accurate when a full lookup table is available. Update the AD595 sensor to use the full table defined in its spec. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* 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>