Commit Graph

1819 Commits

Author SHA1 Message Date
Kevin O'Connor 26fb421d59 atsamd: Convert SAMD51 to use armcm_timer
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-06 22:03:09 -05:00
Kevin O'Connor 55df8bf55f armcm_timer: Add a generic timer mechanism for ARM CortexM3/M4 chips
The ARM CortexM3 (and later) chips almost always have a 32bit timer in
the "Debug and Watch Trace" (DWT) unit which resides within the cpu
core itself.  This timer is generally faster to access than timers
located on the chip's peripheral bus.  When combined with the standard
ARM SysTick timer it provides a (generally) portable mechanism to
implement Klipper's software timer mechanism.  It's generally also
faster than using the vendor specific timers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-06 22:03:09 -05:00
Kevin O'Connor c171b28a0b gcode: Return to a default gcode speed of 25mm/s
Commit f4d323ad changed the handling of the self.speed variable, and
it inadvertently changed the default startup speed.  Return to the
default of 25mm/s.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 23:45:09 -05:00
Kevin O'Connor 4c48c1e8e4 bltouch: Issue just a pin_up command on a normal raise probe attempt
In the normal case, a regular pin_up command should be sufficient to
raise the probe.  (Should the regular pin_up fail, the code can issue
a "reset" command during the retry.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 18:03:07 -05:00
Kevin O'Connor 345a5f4e1f bltouch: Increase default pin_move_time from 200ms to 675ms
Use the same pin move time that Marlin uses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 18:02:53 -05:00
Kevin O'Connor cd8678aa6d spi_temperature: Fix order of init
Commit c3efcd9c moved the config_spi setup to a build_config callback.
It's also necessary to move the config_thermocouple to a build_config
callback as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-04 09:30:26 -05:00
Kevin O'Connor 5b9ce328e5 docs: Clarify FAQ item on running multiple instances of klippy
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:41:57 -05:00
Kevin O'Connor d088a7ca72 tmc2130: Share config reading helpers with tmc2208.py code
Add helper function for reading current, microsteps, and stealthchop
settings from the config file.  Use these helpers in both the tmc2130
and tmc2208 modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:39:07 -05:00
Kevin O'Connor 0920a518ce tmc2208: Rename self.field_helper to self.fields
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:15:43 -05:00
Kevin O'Connor 30b6414295 tmc2208: move local set_field/get_field helpers to FieldHelper class
Move these helper functions to the FieldHelper class so that they can
be used by other Trinamic drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 14:07:27 -05:00
Kevin O'Connor 17a17c5b77 tmc2208: Add helper for setting fields from the config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 13:03:44 -05:00
Kevin O'Connor 83001959f1 tmc2208: Use field definitions during driver init
Reduce the amount of bit manipulations by using the FieldHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 12:22:12 -05:00
Dmitry Frolov 51f14b9c8c tmc2208: Add register field formatters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
2019-02-03 11:19:36 -05:00
Kevin O'Connor 955fdcaa0c tmc2130: Convert field helper into a class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 11:11:15 -05:00
Arksine cdcc320710 bed_mesh: add support for round beds
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-02-02 23:29:00 -05:00
Arksine 542f941f07 bed_mesh: log when fade completes.
- Also simplify the math for the mesh x and y multipliers.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2019-02-02 23:29:00 -05:00
lorf 54683c9535 tmc2208: Decode register fields in DUMP_TMC (#1156)
Report values of TMC2208 register fields in DUMP_TMC command to help in
tuning and diagnostics.

This also adds functions to refer to register fields by name for TMC drivers
and register mappings for TMC2208.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
2019-02-02 19:46:27 -05:00
Kevin O'Connor 3b6ddb08a1 bltouch: Don't error on startup if the bltouch is in an error state
Stopping the connect sequence can make it difficult to get the bltouch
out of an error state.  Allow the connect to proceed, ideally if the
bltouch stays in an error state it will be detected during the first
probe attempt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-31 09:43:35 -05:00
Kevin O'Connor a5d3d161d3 bltouch: Retry reset/pin_up if the raise probe attempt fails
There's no harm in retrying the attempt if it appears to have failed
for some reason.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-31 09:43:29 -05:00
Samori Gorse 04c6e1f646 idle_timeout: Added a missing logging import
I noticed Octoprint was disconnecting after a while, and after reading the logs, I came across this error:

```
Unhandled exception during run
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/klippy.py", line 171, in run
    self.reactor.run()
  File "/home/pi/klipper/klippy/reactor.py", line 176, in run
    g_next.switch()
  File "/home/pi/klipper/klippy/reactor.py", line 203, in _dispatch_loop
    timeout = self._check_timers(eventtime)
  File "/home/pi/klipper/klippy/reactor.py", line 82, in _check_timers
    t.waketime = t.callback(eventtime)
  File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 62, in timeout_handler
    return self.check_idle_timeout(eventtime)
  File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 59, in check_idle_timeout
    return self.transition_idle_state(eventtime)
  File "/home/pi/klipper/klippy/extras/idle_timeout.py", line 35, in transition_idle_state
    logging.exception("idle timeout gcode execution")
NameError: global name 'logging' is not defined
```

I therefore added the missing import.

Signed-off-by: Samori Gorse <samori.gorse+github@gmail.com>
2019-01-29 11:18:44 -05:00
Kevin O'Connor c3e889a67c docs: Add performance results for SAMD51
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:05:50 -05:00
Kevin O'Connor 8cd83b4c2d atsamd: Initial support for SAMD51
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Kevin O'Connor f6ce875818 lib: Update samd51 to work with gcc and bootloaders
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Kevin O'Connor e47ba6374a lib: Add Atmel SAMD51 cmsis files
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Kevin O'Connor c5fc264a07 atsamd: Add a get_pclock_frequency() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Kevin O'Connor 8f763d80b7 atsamd: Select the 8K bootloader by default
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Kevin O'Connor 40b5de1680 atsamd: Pass the power management id to enable_pclock()
Pass the power management id instead of the APBCMASK bit to the
enable_pclock() function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Kevin O'Connor ed1334c24b atsamd: Clarify clock generation code
Implement gen_clock() and route_pclock() helpers in an effort to make
the code more readable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 20:02:16 -05:00
Arksine 893cbbab83 pause_resume: update documentation
Add updates to example-extras.cfg and G-Codes.md documenting pause_resume.  Also add M600 (filament change) to sample-macros.cfg.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Arksine 7605752dc2 pause_resume: initial implementation of pause/resume functionality for Klipper
This module adds PAUSE and RESUME gcodes that can programatically determine if the gcode is printing from virtual sd or over the serial connection.  It also captures the current toolhead position and gcode feedrate on pause, and recovers that position and feedrate on resume.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Arksine 8385dc20e6 gcode: add 'speed' parameter to dictionary returned by get_status()
Signed-off-by: Eric Callahan  <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Arksine e69742df8f virtual_sdcard: prepare for pause_resume implementation
- Add is_active() member function to return the active printing status of the virtual sdcard
- M27 now reports current file position when file has been opened. See http://marlinfw.org/docs/gcode/M027.html

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-01-28 11:23:52 -05:00
Ales Stimec 0d4544e72a config: Added example config file for Geeetech gt2560 controller.
Signed-off-by: Ales Stimec <ales.stimec@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-28 11:20:01 -05:00
Kevin O'Connor 90827a88de docs: Minor wording change to step_distance FAQ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-27 16:52:16 -05:00
Kevin O'Connor 71ef715a88 docs: Expand FAQ on why step_distance is used
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-27 11:29:42 -05:00
Kevin O'Connor 932acd3048 usbserial: Allow USB ids to be specified via Kconfig
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-25 19:04:14 -05:00
Kevin O'Connor 1ad1ed573a simulator: Fix simulator build
Commit b6ccd268 inadvertently broke the simulator build - fix it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-25 18:23:27 -05:00
Kevin O'Connor ee86463ed2 avr: Only prompt for CLEAR_PRESCALER and SIMULAVR with LOW_LEVEL_OPTIONS
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-25 18:07:31 -05:00
Kevin O'Connor b6ccd2682c Kconfig: Move SERIAL_BAUD to src/Kconfig and show with LOW_LEVEL_OPTIONS
Move the definition of SERIAL_BAUD to the main src/Kconfig file.  Only
show this as an option if the user selects the ability to configure
low-level options.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-25 18:02:03 -05:00
Kevin O'Connor 4fec225115 avr: Rename AVR_SERIAL and AVR_USBSERIAL to SERIAL and USBSERIAL
Rename the config options to be more consistent with other
architectures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-25 17:52:09 -05:00
fredizzimo 15afcf69fe docs: Improve the BLTouch documentation (#1107)
Signed-off-by Fred Sundvik <fsundvik@gmail.com>
2019-01-25 12:53:00 -05:00
Kevin O'Connor eb7842c221 atsam: Add support for the SAM3X8C micro-controller
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-22 09:07:12 -05:00
Kevin O'Connor 7327394c50 adc_temperature: Add support for linear interpolation of resistances
Add support for performing linear interpolation between a set of
measured temperature/resistance pairs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 21:28:25 -05:00
Kevin O'Connor fc946c796c adc_temperature: Split linear interpolation code into its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 20:27:41 -05:00
Kevin O'Connor 99980817c3 adc_temperature: Move PrinterADCtoTemperature to adc_temperature.py
Move the low-level PrinterADCtoTemperature() class from thermistor.py
to adc_temperature.py and use it from the Linear() class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 20:24:51 -05:00
Kevin O'Connor 0c4fc64ef8 thermistor: Separate thermistor configuration from basic ADC callback logic
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 18:38:12 -05:00
Kevin O'Connor 76138fde5c docs: Add a FAQ item for "Do I have to use OctoPrint?"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 12:01:24 -05:00
Kevin O'Connor 5a6a429bc0 bltouch: Take into account clock skew when calculating command duration
We want the duration of each command to be an exact multiple of
SIGNAL_PERIOD.  The durations might not be exact if the bltouch is on
a secondary mcu.  Account for this in send_cmd().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:56:08 -05:00
Kevin O'Connor 8a97bc592b bltouch: Add a pin_up_touch_mode_reports_triggered config option
Rework the undocumented test_sensor_pin config option into a
pin_up_touch_mode_reports_triggered option and document it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00
Kevin O'Connor 56141c21d7 bltouch: Raise probe on startup
Send a pin_up command during startup and try to verify that the probe
actually raises.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-21 09:52:11 -05:00