From dc2e0a4dd9e28fa1d48b708864a5d4d45fe16b1f Mon Sep 17 00:00:00 2001 From: Rogerio Goncalves Date: Wed, 13 Sep 2023 13:50:26 +0100 Subject: [PATCH] readme and tests for z_calibration --- .github/workflows/ci-build_test.yaml | 2 + .github/workflows/ci-static_analysis.yaml | 1 + .github/workflows/klipper3d-deploy.yaml | 6 +- .github/workflows/upstream-sync.yaml | 4 +- README.md | 1 + test/klippy/z_calibration.cfg | 100 ++++++++++++++++++++++ test/klippy/z_calibration.test | 12 +++ 7 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 test/klippy/z_calibration.cfg create mode 100644 test/klippy/z_calibration.test diff --git a/.github/workflows/ci-build_test.yaml b/.github/workflows/ci-build_test.yaml index 2d9dfba2b..776c013da 100644 --- a/.github/workflows/ci-build_test.yaml +++ b/.github/workflows/ci-build_test.yaml @@ -1,6 +1,8 @@ # Perform continuous integration tests on updates and pull requests name: Build test + on: + workflow_dispatch: push: jobs: diff --git a/.github/workflows/ci-static_analysis.yaml b/.github/workflows/ci-static_analysis.yaml index 9f42b0899..4ca3f8f6a 100644 --- a/.github/workflows/ci-static_analysis.yaml +++ b/.github/workflows/ci-static_analysis.yaml @@ -1,5 +1,6 @@ # Perform continuous integration tests on pull requests name: black + on: pull_request jobs: diff --git a/.github/workflows/klipper3d-deploy.yaml b/.github/workflows/klipper3d-deploy.yaml index 0e4498491..507304603 100644 --- a/.github/workflows/klipper3d-deploy.yaml +++ b/.github/workflows/klipper3d-deploy.yaml @@ -1,8 +1,6 @@ name: klipper3d deploy on: workflow_dispatch: - schedule: - - cron: "0 0 * * *" push: branches: - master @@ -20,7 +18,7 @@ jobs: with: python-version: '3.8' - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('docs/_klipper3d/mkdocs-requirements.txt') }} @@ -34,7 +32,7 @@ jobs: run: docs/_klipper3d/build-translations.sh - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.2.5 + uses: JamesIves/github-pages-deploy-action@v4.4.3 with: branch: gh-pages # The branch the action should deploy to. folder: site # The folder the action should deploy. diff --git a/.github/workflows/upstream-sync.yaml b/.github/workflows/upstream-sync.yaml index 5e66695e5..d3869a01f 100644 --- a/.github/workflows/upstream-sync.yaml +++ b/.github/workflows/upstream-sync.yaml @@ -35,7 +35,7 @@ jobs: steps: # Fetch origin/prev_upstream - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: prev_upstream path: "repo" @@ -72,7 +72,7 @@ jobs: - name: Setup python if: ${{ steps.fetch.outputs.new_commits }} == '1' - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.10.3 cache-dependency-path: scripts/requirements_dev.txt diff --git a/README.md b/README.md index 5aa5be666..b716f72f5 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Features merged into the master branch: - [probe: Drop the first result](https://github.com/DangerKlippers/danger-klipper/pull/2) ([klipper#3397](https://github.com/Klipper3d/klipper/issues/3397)) +- [probe: z_calibration](https://github.com/DangerKlippers/danger-klipper/pull/31) ([klipper#4614](https://github.com/Klipper3d/klipper/pull/4614) / [protoloft/z_calibration](https://github.com/protoloft/klipper_z_calibration)) "Dangerous Klipper for dangerous users" diff --git a/test/klippy/z_calibration.cfg b/test/klippy/z_calibration.cfg new file mode 100644 index 000000000..eb7728877 --- /dev/null +++ b/test/klippy/z_calibration.cfg @@ -0,0 +1,100 @@ +# Test config for z_tilt and quad_gantry_level +[stepper_x] +step_pin: PF0 +dir_pin: PF1 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^PE5 +position_endstop: 0 +position_max: 250 +homing_speed: 50 + +[stepper_y] +step_pin: PF6 +dir_pin: !PF7 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^PJ1 +position_endstop: 0 +position_max: 250 +homing_speed: 50 + +[stepper_z] +step_pin: PL3 +dir_pin: PL1 +enable_pin: !PK0 +microsteps: 16 +rotation_distance: 8 +endstop_pin: ^PD3 +position_endstop: 0.5 +position_max: 250 + +[stepper_z1] +step_pin: PC1 +dir_pin: PC3 +enable_pin: !PC7 +microsteps: 16 +rotation_distance: 8 +endstop_pin: ^PD2 + +[stepper_z2] +step_pin: PH1 +dir_pin: PH0 +enable_pin: !PA1 +microsteps: 16 +rotation_distance: 8 + +[stepper_z3] +step_pin: PE3 +dir_pin: PG5 +microsteps: 16 +rotation_distance: 8 + +[extruder] +step_pin: PA4 +dir_pin: PA6 +enable_pin: !PA2 +microsteps: 16 +rotation_distance: 33.5 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: PB4 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK5 +control: pid +pid_Kp: 22.2 +pid_Ki: 1.08 +pid_Kd: 114 +min_temp: 0 +max_temp: 250 + +[heater_bed] +heater_pin: PH5 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK6 +control: watermark +min_temp: 0 +max_temp: 130 + +[probe] +pin: PH6 +z_offset: 0 + +[mcu] +serial: /dev/ttyACM0 + +[printer] +kinematics: cartesian +max_velocity: 300 +max_accel: 3000 +max_z_velocity: 5 +max_z_accel: 100 + +[z_calibration] +nozzle_xy_position: 100,100 +switch_xy_position: 101, 101 +bed_xy_position: 150, 150 +switch_offset: 0.5 +max_deviation: 3.0 diff --git a/test/klippy/z_calibration.test b/test/klippy/z_calibration.test new file mode 100644 index 000000000..5404a15f4 --- /dev/null +++ b/test/klippy/z_calibration.test @@ -0,0 +1,12 @@ +# Test case for z_calibration +CONFIG z_calibration.cfg +DICTIONARY atmega2560.dict + +# Start by homing the printer. +G28 +G1 Z5 X10 Y10 F6000 +M400 +GET_POSITION + +# Test CALIBRATE_Z +CALIBRATE_Z