Skip to content

Commit

Permalink
Merge pull request #238 from Frix-x/develop
Browse files Browse the repository at this point in the history
v4.0.1
  • Loading branch information
Frix-x authored Jun 18, 2023
2 parents 4baf0ea + 6195dcc commit 67f6bb9
Show file tree
Hide file tree
Showing 27 changed files with 393 additions and 185 deletions.
8 changes: 8 additions & 0 deletions config/hardware/accelerometers/adxl345_BTT_SB22xx.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[include generics/adxl345_software_spi.cfg]

# As it's a toolhead ADXL, we add some default pins overrides from here
[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO
16 changes: 3 additions & 13 deletions config/hardware/accelerometers/adxl345_ebb.cfg
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
[include generics/adxl345_software_spi.cfg]

# As it's a toolhead ADXL, we add some default pins overrides from here
[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../macros/helpers/resonance_override.cfg]
[include ../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../macros/calibration/IS_vibrations_measurement.cfg]
8 changes: 6 additions & 2 deletions config/hardware/accelerometers/adxl345_rpi.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# This file is the recommended way to get an accelerometer connected and used in Klipper
# This ADXL file is dedicated to be used with ADXL boards
# connected over the SPI bus of the RaspberryPi
# It is the official and recommended way to get an
# accelerometer connected and used in Klipper

# Do not forget to also flash the RPi with the Klipper firmware!

[include ../../mcu_definitions/rpi.cfg]


[adxl345]
cs_pin: rpi:None
axes_map: -z,y,x
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
Expand Down
16 changes: 3 additions & 13 deletions config/hardware/accelerometers/adxl345_sb2040.cfg
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
[include generics/adxl345_software_spi.cfg]

# As it's a toolhead ADXL, we add some default pins overrides from here
[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../macros/helpers/resonance_override.cfg]
[include ../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../macros/calibration/IS_vibrations_measurement.cfg]
17 changes: 3 additions & 14 deletions config/hardware/accelerometers/adxl345_sht.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
[include generics/adxl345_hardware_spi1.cfg]

# As it's a toolhead ADXL, we add some default pins overrides from here
[adxl345]
cs_pin: toolhead:ADXL_CS
spi_bus: spi1
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../macros/helpers/resonance_override.cfg]
[include ../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../macros/calibration/IS_vibrations_measurement.cfg]
17 changes: 1 addition & 16 deletions config/hardware/accelerometers/adxl345_skr.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
[adxl345]
spi_bus: ssp1
cs_pin: ADXL_CS
axes_map: -z,y,x

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../macros/helpers/resonance_override.cfg]
[include ../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../macros/calibration/IS_vibrations_measurement.cfg]
[include generics/adxl345_hardware_ssp1.cfg]
11 changes: 8 additions & 3 deletions config/hardware/accelerometers/adxl345_usb.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# USB support for RPi pico and KUSBA V2
# Edit the serial line with the correct address.
# This ADXL file is dedicated to be used with ADXL boards
# connected over USB to the pi as dedicated and standalone ADXL-MCU boards

# This include KUSBA, ...


# You need to override the following to be able to set the proper serial in your overrides.cfg file
[mcu adxl]
serial: /dev/serial/by-id/xxx

[adxl345]
cs_pin: adxl:gpio1
spi_bus: spi0a
axes_map: -z,y,x
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
Expand Down
25 changes: 25 additions & 0 deletions config/hardware/accelerometers/generics/adxl345_hardware_spi1.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This ADXL file is dedicated to be used with ADXL boards
# connected over the SPI bus of the MCU boards on "spi1"

# This include most Mellow toolhead boards such as SHT boards, ...
# But also Octopus, etc...

# If using a toolhead board, be sure to have the pin override in your mcu.cfg (toolhead:ADXL_CS)


[adxl345]
cs_pin: ADXL_CS
spi_bus: spi1
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../../macros/helpers/resonance_override.cfg]
[include ../../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../../macros/calibration/IS_vibrations_measurement.cfg]
22 changes: 22 additions & 0 deletions config/hardware/accelerometers/generics/adxl345_hardware_ssp1.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This ADXL file is dedicated to be used with ADXL boards
# connected over the SPI bus of the MCU boards on "ssp1"

# This include BTT SKRv1.4, ...


[adxl345]
cs_pin: ADXL_CS
spi_bus: ssp1
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../../macros/helpers/resonance_override.cfg]
[include ../../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../../macros/calibration/IS_vibrations_measurement.cfg]
26 changes: 26 additions & 0 deletions config/hardware/accelerometers/generics/adxl345_software_spi.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This ADXL file is dedicated to be used with ADXL boards
# connected over the software SPI bus of the MCU boards

# This include most BTT toolhead boards such as EBB boards, SB2209, SB2240,
# but also some Mellow boards such as the Fly-SB2040, ...
# If using a toolhead board, be sure to have the pin override in your mcu.cfg (toolhead:ADXL_CS)


[adxl345]
cs_pin: ADXL_CS
spi_software_sclk_pin: ADXL_SCLK
spi_software_mosi_pin: ADXL_MOSI
spi_software_miso_pin: ADXL_MISO
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../../macros/helpers/resonance_override.cfg]
[include ../../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../../macros/calibration/IS_vibrations_measurement.cfg]
2 changes: 1 addition & 1 deletion config/kinematics/corexy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
kinematics: corexy
max_velocity: 400
max_accel: 8000
max_z_velocity: 50
max_z_velocity: 30
max_z_accel: 500
square_corner_velocity: 5.0
1 change: 1 addition & 0 deletions config/machine.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ resolution: 0.1

[include ../macros/helpers/filament_swap.cfg]
[include ../macros/helpers/heatsoak.cfg]
[include ../macros/helpers/prime_line.cfg]
[include ../macros/helpers/nozzle_cleaning.cfg]
[include ../macros/helpers/temp_check.cfg]

Expand Down
2 changes: 1 addition & 1 deletion config/mcu_definitions/toolhead/BTT_SB2240_v1.0.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[board_pins toolhead_manufacturer]
mcu: toolhead
aliases:
MCU_MOTORDRIVE_STEP=PD0 , MCU_MOTORDRIVE_DIR=PD1 , MCU_MOTORDRIVE_ENABLE=PD2 ,
MCU_MOTORDRIVE_STEP=PD0 , MCU_MOTORDRIVE_DIR=PD1 , MCU_MOTORDRIVE_ENABLE=PD2 , MCU_MOTORDRIVE_DIAG=PB3 ,
MCU_MOTOR_SPI_NSS=PA15 , # CLK/MOSI/MISO are shared with SPI2 configuration

MCU_STOP1=PB6 , MCU_STOP2=PB5 , MCU_STOP3=PB7 ,
Expand Down
4 changes: 1 addition & 3 deletions docs/features/flow_calibration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ This macro is parametric and most of the values can be adjusted with their respe

If you installed and use the full config folder of this github repository, this is already enabled by default and should work out of the box.

If you want to install it to your own custom config, here is the way to go:
1. Copy the [calibrate_flow.cfg](./../../macros/calibration/calibrate_flow.cfg) macro file directly into your own config.
2. **IMPORTANT STEP**: Add and activate (if not already the case) a `[gcode_arcs]` section in your config as it's used for the round corners. Don't hesitate to change the resolution to something like 0.1 or 0.2 to get a better surface finish in the corner radius.
If you want to install it to your own custom config, just copy the [calibrate_flow.cfg](./../../macros/calibration/calibrate_flow.cfg) macro file directly into your own config and include it. Do not forget to issue a firmware restart.


## Usage
Expand Down
18 changes: 12 additions & 6 deletions docs/features/is_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,32 @@ Results can be found in the [ADXL results folder](./../../adxl_results/) that is
## Installation

1. Copy the [IS_shaper_calibrate.cfg](./../../macros/calibration/IS_shaper_calibrate.cfg) macro file directly into your own config.
2. Be sure to have the `gcode_shell_command.py` Klipper extension installed. Easiest way to install it is to use the advanced section of KIAUH.
2. Be sure to have the `gcode_shell_command.py` Klipper extension installed. Easiest way to install it is to use the advanced section of KIAUH. This is done automatically when running Klippain.
3. Add my [scripts](./../../scripts/) folder at the root of your own config (ie. in your `~/printer_data/config/` directory).

Note: if using Windows to do the copy/paste of the files, be careful with the line endings for the `plot_graphs.sh` file and the `graph_vibrations.py` file: **Linux line endings (LF or \n) are mandatory!** If the file are using Windows line endings, you will get errors like `\r : unknown command` when running the script. If you're not confident regarding your text editor behavior, the best way is to directly download the files on the pi by using for example wget over SSH:

```
```bash
wget -P ~/printer_data/config/scripts https://raw.githubusercontent.com/Frix-x/klippain/main/scripts/plot_graphs.sh
wget -P ~/printer_data/config/scripts https://raw.githubusercontent.com/Frix-x/klippain/main/scripts/graph_vibrations.py
```

4. Make the scripts executable using SSH. When in the folder, use:
4. Make the scripts executable using SSH. When in the folder (`cd ~/printer_data/config/scripts`), use:

```
```bash
chmod +x ./plot_graphs.sh
chmod +x ./graph_vibrations.py
```

5. Include the `shell_commands.cfg` to your config to be able to call the plot_graphs script. You can either copy/paste its content to your own `printer.cfg` file or just include it using `[include path/to/shell_commands.cfg]`.
5. Add this new section at the end of your `printer.cfg` file:
```
[gcode_shell_command plot_graph]
command: bash /home/pi/printer_data/config/scripts/plot_graphs.sh
timeout: 500.0
verbose: True
```

Note: if your user is not `pi`, please correct it in the `[gcode_shell_command plot_graph]` command accordingly.
Note: if your user is not `pi`, please correct the path in the command accordingly.

6. (Optional) You can modify the first lines of the `plot_graphs.sh` script to configure where you want to store the results. Default: `~/printer_data/config/adxl_results`

Expand Down
18 changes: 12 additions & 6 deletions docs/features/vibr_measurements.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,32 @@ Results can be found in the [ADXL results folder](./../../adxl_results/) that is
## Installation

1. Copy the [IS_vibrations_measurement.cfg](./../../macros/calibration/IS_vibrations_measurement.cfg) macro file directly into your own config.
2. Be sure to have the `gcode_shell_command.py` Klipper extension installed. Easiest way to install it is to use the advanced section of KIAUH.
2. Be sure to have the `gcode_shell_command.py` Klipper extension installed. Easiest way to install it is to use the advanced section of KIAUH. This is done automatically when running Klippain.
3. Add my [scripts](./../../scripts/) folder at the root of your own config (ie. in your `~/printer_data/config/` directory).

Note: if using Windows to do the copy/paste of the files, be careful with the line endings for the `plot_graphs.sh` file and the `graph_vibrations.py` file: **Linux line endings (LF or \n) are mandatory!** If the file are using Windows line endings, you will get errors like `\r : unknown command` when running the script. If you're not confident regarding your text editor behavior, the best way is to directly download the files on the pi by using for example wget over SSH:

```
```bash
wget -P ~/printer_data/config/scripts https://raw.githubusercontent.com/Frix-x/klippain/main/scripts/plot_graphs.sh
wget -P ~/printer_data/config/scripts https://raw.githubusercontent.com/Frix-x/klippain/main/scripts/graph_vibrations.py
```

4. Make the scripts executable using SSH. When in the folder, use:
4. Make the scripts executable using SSH. When in the folder (`cd ~/printer_data/config/scripts`), use:

```
```bash
chmod +x ./plot_graphs.sh
chmod +x ./graph_vibrations.py
```

5. Include the `shell_commands.cfg` to your config to be able to call the plot_graphs script. You can either copy/paste its content to your own `printer.cfg` file or just include it using `[include path/to/shell_commands.cfg]`.
5. Add this new section at the end of your `printer.cfg` file:
```
[gcode_shell_command plot_graph]
command: bash /home/pi/printer_data/config/scripts/plot_graphs.sh
timeout: 500.0
verbose: True
```

Note: if your user is not `pi`, please correct it in the `[gcode_shell_command plot_graph]` command accordingly.
Note: if your user is not `pi`, please correct the path in the command accordingly.

6. (Optional) You can modify the first lines of the `plot_graphs.sh` script to configure where you want to store the results. Default: `~/printer_data/config/adxl_results`

Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions macros/base/homing/tilting.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ gcode:
RESPOND MSG="QGL..."
{% endif %}
QUAD_GANTRY_LEVEL
G28 Z
{% endif %}
{% elif conf_ztilt %}
{% if printer.z_tilt.applied|lower == 'false' or FORCE_OPERATION %}
{% if verbose %}
RESPOND MSG="Z tilt adjust..."
{% endif %}
Z_TILT_ADJUST
G28 Z
{% endif %}
{% else %}
{% if verbose %}
Expand Down
Loading

0 comments on commit 67f6bb9

Please sign in to comment.