Commit Graph

2195 Commits

Author SHA1 Message Date
Kevin O'Connor 0b4fbc78a8 adxl345: Allow multiple simultaneous clients
It is now possible to have multiple tools gathering adxl345 data at
the same time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:26:39 -04:00
Kevin O'Connor 404b64fd62 adxl345: Change default chip name from "default" to "adxl345"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:26:36 -04:00
Kevin O'Connor 22167f9510 adxl345: Compress each sample from 6 bytes to 5 bytes
Transmit data from mcu to host using 5 bytes per sample and up to 10
samples per message block.  This improves bandwidth efficiency.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor e34137582d adxl345: Implement timing via new adxl345_status messages
Query the adxl345 message counter every 100ms so that accurate timing
can be obtained during measurements.  This allows the adxl345 data to
be exported with timestamps while captures are running.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor dd95f80d9d adxl345: Support querying accelerometer data from webhooks interface
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor d87f7a77c3 adxl345: Add new start_internal_client() function and use in callers
Introduce a new start_internal_client() function and change all client
code to use that instead of manually calling start_measurements() and
finish_measurements().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor 8cfaed441d adxl345: Always initialize device on start_measurements() call
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor e03e0e9dac adxl345: Move g-code commands to new helper class
Separate out the G-Code command handlers to a new ADXLCommandHelper()
class.  This helps separate the sensing code from the user interface
code.

Deprecate the RATE parameter of the ACCELEROMETER_MEASURE command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:45 -04:00
Kevin O'Connor 6999ff6256 motion_report: Add helper tool for internal subscribers of data
Add support for internal clients to "subscribe" to data like external
clients.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:12:11 -04:00
Kevin O'Connor 5fd1c9853d tmc: Add support for a get_status() method
Export mcu_phase_offset and drv_status information.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:00:46 -04:00
Kevin O'Connor 950477849d mcu: Support multi-mcu homing
Support endstops and probes attached to a different micro-controller
than their associated steppers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-28 16:08:57 -04:00
Kevin O'Connor 2e131497ca homing: Fix error in retract move causing "must home axis" errors
It's possible for the original homing move of an axis to alter the
position of other axes.  Make sure those other axes are not requested
to move on a subsequent second home retract move, as that could cause
an error if those other axes have not been homed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-28 15:45:11 -04:00
Kevin O'Connor 8d4d16d51a manual_stepper: Add missing calc_position() wrapper call
Commit 3814a132 added code to homing.py to call calc_position() - add
that function to manual_stepper.py .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-26 12:23:12 -04:00
Kevin O'Connor 84ac5b0146 configfile: Support config.getchoice() with integer keys
If the choice mapping uses integer keys then lookup the config option
using self.getint().  This simplifies the callers and improves the
encoding of the printer.configfile.settings export.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-25 10:36:45 -04:00
Kevin O'Connor 75183bfb86 Revert "toolhead: change SET_VELOCITY_LIMIT respond behavior"
This reverts commit 9f75e348b0.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-24 12:34:00 -04:00
stefand 9f75e348b0 toolhead: change SET_VELOCITY_LIMIT respond behavior
Returns only the current values if no new ones have been passed.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-08-24 10:49:31 -04:00
Kevin O'Connor 2fdd8a420d motion_report: Add support for dumping steps/trapq via API server
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 11:10:19 -04:00
Kevin O'Connor cf2e941aec webhooks: Add register_mux_endpoint() helper function
Add ability to register an endpoint that invokes a handler based on a
parameter in the request.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 11:10:19 -04:00
Kevin O'Connor 809f1ccea6 stepper: Add mcu_to_commanded_position() method
Convert stepper.get_past_commanded_position() to the more general
stepper.mcu_to_commanded_position().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 11:10:19 -04:00
Kevin O'Connor f2d10b5729 tmc: Use config.getint() when reading microstep setting
Don't use config.getchoice() as that results in a string reported by
printer.configfile.settings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 10:50:18 -04:00
Kevin O'Connor e5d5c25154 bed_mesh: Use config lists
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor fe1b2f5124 tmc_uart: Use config.getlist() for select_pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 31564f3b43 static_digital_output: Use config.getlist() for pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 92e1821423 multi_pin: Use config.getlist() for pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor e784c19a96 duplicate_pin_override: Use config.getlist() for pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8f7eedd95e board_pins: Use config list helpers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8a59de9431 z_tilt: Use config.getlists() for z_positions config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor d0e4b03739 safe_z_home: Use config.getfloatlist() for home_xy_position config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor d82dc1e844 resonance_tester: Use config.getlists() for probe_points config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 2461b30a6a quad_gantry_level: Use config.getlists() for gantry_corners config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8a556f2581 homing_heaters: Use config.getlist() for heaters and steppers config options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 65fb494e77 heater_fan: Use config.getlist() for heater config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8f85786b3f gcode_button: Use config.getfloatlist() for analog_range config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 7f82dcb442 endstop_phase: Use config.getintlist() for trigger_phase config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 58dedb6b16 menu_keys: Use config.getfloatlist() for analog_range_ config options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor ab023bb61d delta_calibrate: Use config.getfloatlist() for parsing "stable positions"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 99b0cacf3b controller_fan: Use config.getlist() for heater and stepper config parameters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor d3484efe73 probe: Use config.getlists() for points config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 673ecec6a2 screws_tilt_adjust: Use config.getfloatlist() for coordinates config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor a546415884 bed_screws: Use config.getfloatlist() for coordinates config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 3ef6e2ba56 adxl345: Use config.getlist() for axes_map config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 67d99fe8a8 stepper: Use config.getlists() for gear_ratio config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor f9ca5b9098 configfile: Add helpers for parsing list of parameters from the config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Eric Callahan c64ea474d7 webhooks: log client requests on shutdown
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-08-21 15:00:29 -04:00
Kevin O'Connor 65ed55a43b endstop_phase: Calculate phase based on trigger position
Update the endstop_phase code to use the phase of the stepper motor at
the endstop trigger time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 22:35:59 -04:00
Kevin O'Connor 3814a13251 homing: Calculate homing position based on trigger time
Calculate the "homing position" using the endstop trigger time instead
of the position of the steppers.

This is in preparation for multi-mcu homing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 22:35:59 -04:00
Kevin O'Connor 1dc2ab048f mcu: Return time of trigger from home_wait()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 22:01:23 -04:00
dawidmpunkt b4ee93043a
htu21d: Update htu21d.py (#4520)
Line 202: should be self.humidity instead of self.temp

Signed-off-by: Dawid Murawski <dawid.m@gmx.net>
2021-08-17 15:52:47 -04:00
Randell Hodges f313a2294a
bed_mesh: Added PROFILE name option (#4522)
Added optional PROFILE parameter to allow bed_mesh_calibrate to
save the mesh directly into the provided profile name instead of
default. If omitted, it will be stored in default.

Signed-off-by: Randell L Hodges <rhodges@taxfodder.com>
2021-08-17 15:30:14 -04:00
Pascal Pieper 73a7840697 output_pin: fix time difference calculation
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
2021-08-17 14:45:53 -04:00