Skip to content

Commit

Permalink
Merge branch 'Klipper3d:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dianlight authored Apr 16, 2024
2 parents a9b4029 + 2425a74 commit 10ecacb
Show file tree
Hide file tree
Showing 25 changed files with 1,232 additions and 63 deletions.
188 changes: 188 additions & 0 deletions config/printer-artillery-sidewinder-x3-plus-2024.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# For the Artillery Sidewinder X3 Pro/Plus that came factory installed with V1.29 firmware, follow these steps.
# - Compile with the processor model STM32F401.
# - Select the 48KiB bootloader,
# - Select USB PA11/PA12 for USB communication interface.
# - Select USART2 PA3/PA2 for UART communication via the Wi-Fi Tx/Rx pins
# To set 48KiB bootloader, you need to make a change to make menuconfig Kconfig file
# Here is a link to a how-to video: https://youtu.be/dpc76zN7Dh0
# Rename klipper.bin to yuntu.bin
# Copy the file out/yuntu.bin to an SD card and then restart the printer with that SD card
#
# For models that did not come with V1.29 installed
# - Compile with the processor model STM32F401.
# - Select the NO BOOTLOADER
# - Select USB PA11/PA12 for USB communication interface.
# - Select USART2 PA3/PA2 for UART communication via the Wi-Fi Tx/Rx pins
# - quit, save, make
# - Connect your printer to a computer running Pronterface, Octoprint, Repetier, BedLeveler5000 (anything with Console capability)
# - Power on the machine and send M997 through console into Marlin, this will put the board into "DFU" mode
# - DO NOT TURN OFF THE PRINTER
# - Connect your Linux/Klipper device to the USB port
# - Run lsusb and verify that the STM32 DFU device is visible (Bus 001 Device 006: ID 0483:df11 STMicroelectronics STM Device in DFU Mode)
# - Run sudo make flash 0483:df11
# - Run lsusb again and there should be two devices:
# Bus 001 Device 007: ID 1d50:614e OpenMoko, Inc. stm32f401xc
# Bus 001 Device 003: ID 0cf3:e010 Qualcomm Atheros Communications stm32f401xc
# See docs/Config_Reference.md for a description of parameters.

[mcu]
serial: /dev/ttyACM0
restart_method: command

[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 15
max_z_accel: 100
square_corner_velocity: 5

[led LED_Light]
white_pin: PC2
initial_white: 1.0

[neopixel hotend_neopixel]
pin: PD2
color_order: GRB
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0

[stepper_x]
step_pin: PA8
dir_pin: PC9
enable_pin: !PA15
microsteps: 16
rotation_distance: 40
endstop_pin: !PB9
position_min: 0
position_endstop: 0
position_max: 315
homing_speed: 50

[stepper_y]
step_pin: PC7
dir_pin: !PC6
enable_pin: !PC8
microsteps: 16
rotation_distance: 40
endstop_pin: !PB8
position_endstop: 0
position_max: 315
homing_speed: 50

[stepper_z]
step_pin: PB10
dir_pin: !PA4
enable_pin: !PC4
rotation_distance: 8
microsteps: 16
position_min: -1
position_max: 400
endstop_pin: probe:z_virtual_endstop # Use Z- as endstop
#homing_speed: 10.0

[extruder]
max_extrude_only_distance: 100.0
step_pin: PC11
dir_pin: !PC10
enable_pin: !PC12
microsteps: 64
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA6
sensor_type: EPCOS 100K B57560G104F #Generic 3950
sensor_pin: PC5
min_extrude_temp: 170
min_temp: 0
max_temp: 300
# Calibrate E-Steps https://www.klipper3d.org/Rotation_Distance.html#calibrating-rotation_distance-on-extruders
rotation_distance: 17.75
# Calibrate PID: https://www.klipper3d.org/Config_checks.html#calibrate-pid-settings
# - Example: PID_CALIBRATE HEATER=extruder TARGET=200
control: pid
pid_kp: 30.356
pid_ki: 1.857
pid_kd: 124.081
# Calibrate PA: https://www.klipper3d.org/Pressure_Advance.html

[heater_bed]
heater_pin: PA7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC0
max_temp: 100
min_temp: 0
# Calibrate PID: https://www.klipper3d.org/Config_checks.html#calibrate-pid-settings
# - Example: PID_CALIBRATE HEATER=heater_bed TARGET=60
control: pid
pid_kp: 64.230
pid_ki: 0.723
pid_kd: 1425.905

[heater_fan hotend_fan]
pin: PB1
heater: extruder
heater_temp: 50.0

[fan]
pin: PB0

[temperature_fan Artillery_MCU]
sensor_type: temperature_mcu
pin: PA5
max_temp: 60.0
target_temp: 40.0
min_temp: 0
shutdown_speed: 0.0
kick_start_time: 0.5
off_below: 0.19
max_speed: 1.0
min_speed: 0.0
control: watermark

[filament_switch_sensor filament_sensor]
pause_on_runout: true
switch_pin: PC1

[probe]
pin: PC14
x_offset:45.2
y_offset:11.6
speed:5
lift_speed:15
z_offset: 2.350

[safe_z_home]
home_xy_position: 110, 145 # X, Y coordinate (e.g. 100, 100) where the Z homing should be
speed: 300.0
z_hop: 10
z_hop_speed: 15.0

[bed_mesh]
speed: 300
horizontal_move_z: 6
mesh_min: 46,15
mesh_max: 300,300
probe_count: 10, 10
fade_start: 1.0
fade_end: 0.0
algorithm: bicubic

[screws_tilt_adjust]
screw1: 120, 153
screw1_name: center reference
screw2: 7, 45
screw2_name: front left
screw3: 210, 45
screw3_name: front right
screw4: 227, 145
screw4_name: right center
screw5: 210, 245
screw5_name: rear right
screw6: 7, 245
screw6_name: rear left
screw7: 7, 145
screw7_name: left center
horizontal_move_z: 8
speed: 300
screw_thread: CW-M4
6 changes: 6 additions & 0 deletions docs/Config_Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ All dates in this document are approximate.

## Changes

20240415: The `on_error_gcode` parameter in the `[virtual_sdcard]`
config section now has a default. If this parameter is not specified
it now defaults to `TURN_OFF_HEATERS`. If the previous behavior is
desired (take no default action on an error during a virtual_sdcard
print) then define `on_error_gcode` with an empty value.

20240313: The `max_accel_to_decel` parameter in the `[printer]` config
section has been deprecated. The `ACCEL_TO_DECEL` parameter of the
`SET_VELOCITY_LIMIT` command has been deprecated. The
Expand Down
37 changes: 36 additions & 1 deletion docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,8 @@ path:
# be provided.
#on_error_gcode:
# A list of G-Code commands to execute when an error is reported.
# See docs/Command_Templates.md for G-Code format. The default is to
# run TURN_OFF_HEATERS.
```

### [sdcard_loop]
Expand Down Expand Up @@ -1995,6 +1996,40 @@ z_offset:
# See the "probe" section for more information on the parameters above.
```

### [probe_eddy_current]

Support for eddy current inductive probes. One may define this section
(instead of a probe section) to enable this probe. See the
[command reference](G-Codes.md#probe_eddy_current) for further information.

```
[probe_eddy_current my_eddy_probe]
sensor_type: ldc1612
# The sensor chip used to perform eddy current measurements. This
# parameter must be provided and must be set to ldc1612.
#z_offset:
# The nominal distance (in mm) between the nozzle and bed that a
# probing attempt should stop at. This parameter must be provided.
#i2c_address:
#i2c_mcu:
#i2c_bus:
#i2c_software_scl_pin:
#i2c_software_sda_pin:
#i2c_speed:
# The i2c settings for the sensor chip. See the "common I2C
# settings" section for a description of the above parameters.
#x_offset:
#y_offset:
#speed:
#lift_speed:
#samples:
#sample_retract_dist:
#samples_result:
#samples_tolerance:
#samples_tolerance_retries:
# See the "probe" section for information on these parameters.
```

### [axis_twist_compensation]

A tool to compensate for inaccurate probe readings due to twist in X gantry. See
Expand Down
56 changes: 56 additions & 0 deletions docs/Eddy_Probe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Eddy Current Inductive probe

This document describes how to use an
[eddy current](https://en.wikipedia.org/wiki/Eddy_current) inductive
probe in Klipper.

Currently, an eddy current probe can not be used for Z homing. The
sensor can only be used for Z probing.

Start by declaring a
[probe_eddy_current config section](Config_Reference.md#probe_eddy_current)
in the printer.cfg file. It is recommended to set the `z_offset` to
0.5mm. It is typical for the sensor to require an `x_offset` and
`y_offset`. If these values are not known, one should estimate the
values during initial calibration.

The first step in calibration is to determine the appropriate
DRIVE_CURRENT for the sensor. Home the printer and navigate the
toolhead so that the sensor is near the center of the bed and is about
20mm above the bed. Then issue an `LDC_CALIBRATE_DRIVE_CURRENT
CHIP=<config_name>` command. For example, if the config section was
named `[probe_eddy_current my_eddy_probe]` then one would run
`LDC_CALIBRATE_DRIVE_CURRENT CHIP=my_eddy_probe`. This command should
complete in a few seconds. After it completes, issue a `SAVE_CONFIG`
command to save the results to the printer.cfg and restart.

The second step in calibration is to correlate the sensor readings to
the corresponding Z heights. Home the printer and navigate the
toolhead so that the nozzle is near the center of the bed. Then run an
`PROBE_EDDY_CURRENT_CALIBRATE CHIP=my_eddy_probe` command. Once the
tool starts, follow the steps described at
["the paper test"](Bed_Level.md#the-paper-test) to determine the
actual distance between the nozzle and bed at the given location. Once
those steps are complete one can `ACCEPT` the position. The tool will
then move the the toolhead so that the sensor is above the point where
the nozzle used to be and run a series of movements to correlate the
sensor to Z positions. This will take a couple of minutes. After the
tool completes, issue a `SAVE_CONFIG` command to save the results to
the printer.cfg and restart.

After initial calibration it is a good idea to verify that the
`x_offset` and `y_offset` are accurate. Follow the steps to
[calibrate probe x and y offsets](Probe_Calibrate.md#calibrating-probe-x-and-y-offsets).
If either the `x_offset` or `y_offset` is modified then be sure to run
the `PROBE_EDDY_CURRENT_CALIBRATE` command (as described above) after
making the change.

Once calibration is complete, one may use all the standard Klipper
tools that use a Z probe.

Note that eddy current sensors (and inductive probes in general) are
susceptible to "thermal drift". That is, changes in temperature can
result in changes in reported Z height. Changes in either the bed
surface temperature or sensor hardware temperature can skew the
results. It is important that calibration and probing is only done
when the printer is at a stable temperature.
22 changes: 22 additions & 0 deletions docs/G-Codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,28 @@ babystepping), and subtract if from the probe's z_offset. This acts
to take a frequently used babystepping value, and "make it permanent".
Requires a `SAVE_CONFIG` to take effect.

### [probe_eddy_current]

The following commands are available when a
[probe_eddy_current config section](Config_Reference.md#probe_eddy_current)
is enabled.

#### PROBE_EDDY_CURRENT_CALIBRATE
`PROBE_EDDY_CURRENT_CALIBRATE CHIP=<config_name>`: This starts a tool
that calibrates the sensor resonance frequencies to corresponding Z
heights. The tool will take a couple of minutes to complete. After
completion, use the SAVE_CONFIG command to store the results in the
printer.cfg file.

#### LDC_CALIBRATE_DRIVE_CURRENT
`LDC_CALIBRATE_DRIVE_CURRENT CHIP=<config_name>` This tool will
calibrate the ldc1612 DRIVE_CURRENT0 register. Prior to using this
tool, move the sensor so that it is near the center of the bed and
about 20mm above the bed surface. Run this command to determine an
appropriate DRIVE_CURRENT for the sensor. After running this command
use the SAVE_CONFIG command to store that new setting in the
printer.cfg config file.

### [pwm_cycle_time]

The following command is available when a
Expand Down
1 change: 1 addition & 0 deletions docs/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,4 @@ communication with the Klipper developers.
troubleshooting CAN bus.
- [TSL1401CL filament width sensor](TSL1401CL_Filament_Width_Sensor.md)
- [Hall filament width sensor](Hall_Filament_Width_Sensor.md)
- [Eddy Current Inductive probe](Eddy_Probe.md)
2 changes: 1 addition & 1 deletion docs/Resonance_Compensation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ First, measure the **ringing frequency**.
to 5.0. It is not advised to increase it when using input shaper
because it can cause more smoothing in parts - it is better to use
higher acceleration value instead.
2. Disable the `miminum_cruise_ratio` feature by issuing the following
2. Disable the `minimum_cruise_ratio` feature by issuing the following
command: `SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0`
3. Disable Pressure Advance: `SET_PRESSURE_ADVANCE ADVANCE=0`
4. If you have already added `[input_shaper]` section to the printer.cfg,
Expand Down
7 changes: 0 additions & 7 deletions docs/Status_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,6 @@ understands it).
- `z_position_lower`: Last probe attempt just lower than the current height.
- `z_position_upper`: Last probe attempt just greater than the current height.

## manual_stepper

The following information is available in the
`manual_stepper` object:
- `enabled`: Returns True if the stepper is currently enabled.
- `position`: The requested position.

## mcu

The following information is available in
Expand Down
1 change: 1 addition & 0 deletions docs/_klipper3d/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,5 @@ nav:
- CANBUS_Troubleshooting.md
- TSL1401CL_Filament_Width_Sensor.md
- Hall_Filament_Width_Sensor.md
- Eddy_Probe.md
- Sponsors.md
3 changes: 3 additions & 0 deletions klippy/extras/bltouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def multi_probe_end(self):
self.verify_raise_probe()
self.sync_print_time()
self.multi = 'OFF'
def probing_move(self, pos, speed):
phoming = self.printer.lookup_object('homing')
return phoming.probing_move(self, pos, speed)
def probe_prepare(self, hmove):
if self.multi == 'OFF' or self.multi == 'FIRST':
self.lower_probe()
Expand Down
1 change: 1 addition & 0 deletions klippy/extras/homing_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def cmd_G28(self, gcmd):
# Perform homing
context = self.template.create_template_context()
context['params'] = gcmd.get_command_parameters()
context['rawparams'] = gcmd.get_raw_command_parameters()
try:
self.in_script = True
self.template.run_gcode_from_command(context)
Expand Down
Loading

0 comments on commit 10ecacb

Please sign in to comment.