Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STEAPP-860: added calculate the approximate wcs1_y before measured main wcs1_y #245

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
default:
image: python:2.7.18-slim-buster
tags:
- linux

stages: # List of stages for jobs, and their order of execution
- build
- deploy

workflow:
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)

build-job: # This job runs in the build stage, which runs first.
stage: build
before_script:
- apt-get update
- apt-get install -y git curl
script:
- ./scripts/ci-install.sh
- ./ci_build/python-env/bin/pip freeze --all > requirements.txt
- pip download -r requirements.txt -d packages --python-version 27 --platform manylinux2014 --no-deps
- ./scripts/ci-build-stereotech.sh
- ./ci_build/python-env/bin/python ./klippy/chelper/__init__.py
- mkdir dist
- cp -R ./klippy/. ./dist/klippy
- cp -R ./stereotech_config/. ./dist/config
- cp -R ./ci_build/firmware/. ./dist/firmware
- cp -R ./packages/. ./dist/packages
- cp ./requirements.txt ./dist/requirements.txt
- tar -cvjf klipper.tar.bz2 -C dist .
artifacts:
name: klipper
paths:
- "klipper.tar.bz2"
expire_in: 7 days

test-job:
stage: build
before_script:
- apt-get update
- apt-get install -y git curl
script:
- ./scripts/ci-install.sh
- ./scripts/ci-build.sh 2>&1
artifacts:
name: data-dict
paths:
- "ci_build/dict"
expire_in: 7 days

deploy_job:
stage: deploy
needs:
- build-job
- test-job
variables:
RELEASE_TYPE: testing
rules:
- if: $CI_COMMIT_BRANCH == "master"
variables:
RELEASE_TYPE: "stable"
- if: $CI_PIPELINE_SOURCE == "push"
before_script:
- pip install awscli
script:
- aws s3 --endpoint-url=https://storage.yandexcloud.net cp klipper.tar.bz2 s3://${BUCKET_NAME}/firmware_v5/${RELEASE_TYPE}/ --acl public-read
- touch klipper.sha
- echo "$CI_COMMIT_SHA" >> ./klipper.sha
- aws s3 --endpoint-url=https://storage.yandexcloud.net cp klipper.sha s3://${BUCKET_NAME}/firmware_v5/${RELEASE_TYPE}/ --acl public-read

trigger_job:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "develop" && $CI_PIPELINE_SOURCE == "push"
needs:
- deploy_job
trigger:
project: stereotech/steapp/STE-App-Build
Empty file added .gitlab/.gitkeep
Empty file.
3 changes: 1 addition & 2 deletions scripts/ci-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ mkdir -p ${BUILD_DIR} ${CACHE_DIR}
# Install system dependencies
######################################################################
echo -e "\n\n=============== Install system dependencies\n\n"
sudo apt-get update
PKGS="virtualenv python2-dev libffi-dev build-essential"
PKGS="${PKGS} gcc-avr avr-libc"
PKGS="${PKGS} libnewlib-arm-none-eabi gcc-arm-none-eabi binutils-arm-none-eabi"
PKGS="${PKGS} pv libmpfr-dev libgmp-dev libmpc-dev texinfo bison flex"
sudo apt-get install ${PKGS}
apt-get install -y ${PKGS}


######################################################################
Expand Down
8 changes: 5 additions & 3 deletions stereotech_config/calibrate/probe_5d.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[gcode_macro PROBE_TEMPLATE_POINT]
description: Macro for calibration template probing
variable_a_probe_z: 0.0
variable_a_probe_y: 0.0
variable_a_v_probe_z: 0.0
gcode:
{% set point = params.POINT|default('A_Z') %}
{% set offsets = printer.probe.offsets %}
{% set probe_a_horizontal = printer["gcode_macro CONSTANTS"].probe_a_horizontal %}
{% set probe_a_vertical = printer["gcode_macro CONSTANTS"].probe_a_vertical %}
{% set whitelist = ['A_Z', 'B_Z', 'C_Y', 'D_Y'] %}
{% set a_y = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_y if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_y > 0 else probe_a_horizontal[1] %}
{% set a_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z > 0 else probe_a_horizontal[2] + offsets[2] %}
{% set a_v_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z > 0 else probe_a_vertical[2] + offsets[2] %}
{% set a = [probe_a_horizontal[0] - offsets[0], probe_a_horizontal[1] - offsets[1], a_z] %}
{% set a = [probe_a_horizontal[0] - offsets[0], a_y - offsets[1], a_z] %}
{% set a_v = [probe_a_vertical[0] - offsets[0], probe_a_vertical[1] - offsets[1], a_v_z] %}
{% set max_y = printer.toolhead.axis_maximum[1]|float %}
#{% set whitelist = ['A_Z', 'A_Z_A0', 'A_Z_A90', 'A_X', 'A_Y', 'A_MX', 'A_MY', 'A_Z_A90', 'A_X_A90', 'A_MX_A90'] %}
Expand Down Expand Up @@ -74,8 +76,8 @@ gcode:
{% set axis = 'Y' %}
{% endif %}
#{% endif %}
{% if target_y|float > (max_y - 4.3) %}
{% set target_y = max_y - 5.5 %}
{% if target_y|float > (max_y - 6.3) %}
{% set target_y = max_y - 6.3 %} # 294
{% endif %}
G0 Z{safe_distance_z} F3600
G0 A0 C0 F3600
Expand Down
13 changes: 13 additions & 0 deletions stereotech_config/calibrate/probe_5d_template.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,16 @@ gcode:
PROBE_TEMPLATE_POINT POINT=D_Y_A90
SET_POINT MACRO=SAVE_SKEW_POINT POINT=3
CHECK_ACCURACY_SET_MODULE_FIVE_D

[gcode_macro GET_APPROXIMATE_Y]
description: calculate approximate wcs_1_y
gcode:
{% set distance = 55 %} # distance between points C and A
{% set x1 = printer.auto_wcs.points[2][0] %}
{% set x2 = printer.auto_wcs.points[3][0] %}
{% set wcs_1_x = (x1 + x2) / 2.0 %}
{% set probe_backlash_x = (x2 - (wcs_1_x + distance))|abs %}
{% set point_y = printer.auto_wcs.points[1][1] %}
{% set template_width = 10.0 %}
{% set wcs_1_y = point_y - probe_backlash_x + (template_width / 2.0) %}
SET_GCODE_VARIABLE MACRO=PROBE_TEMPLATE_POINT VARIABLE=a_probe_y VALUE={wcs_1_y}
16 changes: 12 additions & 4 deletions stereotech_config/calibrate/probe_v2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@
description: macro do move for measuring and calculated WCS. Sensor DAC_v_2
gcode:
{% if printer["gcode_button five_axis_module"].state == "PRESSED" %}
# wcs_1_z
PROBE_TEMPLATE_POINT POINT=A_Z
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=B_MY_A0_C30
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=7
PROBE_TEMPLATE_POINT POINT=B_Y_A0_C30
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1
# wcs_1_x
PROBE_TEMPLATE_POINT POINT=C_X
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=2
PROBE_TEMPLATE_POINT POINT=D_MX
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=3
# wcs_1_y
PROBE_TEMPLATE_POINT POINT=B_Y_A0_C30
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1
GET_APPROXIMATE_Y # calculate approximate wcs_1_y
PROBE_TEMPLATE_POINT POINT=B_MY_A0_C30
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=7
# wcs_2_z
PROBE_TEMPLATE_POINT POINT=A_Z_A90
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=4
# wcs_2_y
PROBE_TEMPLATE_POINT POINT=B_Y_A90_C60
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=5
PROBE_TEMPLATE_POINT POINT=B_MY_A90_C60
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=6
# wcs_2_x
PROBE_TEMPLATE_POINT POINT=D_MX_A90
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=8
PROBE_TEMPLATE_POINT POINT=C_X_A90
SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=9
# calculating wcs
{% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %}
{% set auto_wcs_adj = printer.save_variables.variables.auto_wcs_adj|default(0.0)|float %}
CALC_WCS_PARAMS THICKNESS={ template_thickness } ADJUSTMENT={ auto_wcs_adj } SENSOR_VERSION=1
Expand Down