A Moonraker plug-in for real-time compensation of frame thermal expansion

Overview

Frame Expansion Compensation

A Moonraker plug-in for real-time compensation of frame thermal expansion.

Installation

Credit to protoloft, from whom I plagarized in near entirety the install.sh script -> Z Auto Calibration


Clone this repo into you home directory. For example:

cd /home/pi
git clone https://github.com/alchemyEngine/klipper_frame_expansion_comp

Copy the frame_expansion_compensation.py module to the Klippy extras folder:

cp /home/pi/klipper_frame_expansion_comp/frame_expansion_compensation.py /home/pi/klipper/klippy/extras/

[Optional] Configure Moonraker Updates

Run the install shell script:

bash /home/pi/klipper_frame_expansion_comp/install.sh

Configure the update manager. Add the following section to moonraker.conf:

[update_manager client frame_expansion]
type: git_repo
path: /home/pi/klipper_frame_expansion_comp
primary_branch: main
origin: https://github.com/alchemyEngine/klipper_frame_expansion_comp.git
install_script: install.sh

Configuration

[frame_expansion_compensation]
#temp_coeff:
#   The temperature coefficient of expansion, in mm/K. For example, a
#   temp_coeff of 0.01 mm/K will move the Z axis downwards by 0.01 mm for every
#   Kelvin/degree celcius that the frame temperature increases. Defaults to 0.0,
#   no offset.
temp_sensor:
#   Temperature sensor to use for frame temp measurement. Use full config
#   section name without quoutes. E.g. temperature_sensor frame
#smooth_time:
#   Smoothing window applied to the temp_sensor, in seconds. Can reduce motor
#   noise from excessive small corrections in response to sensor noise. The
#   default is 2.0 seconds.
#max_comp_z:
#   Disables compensation above this Z height [mm]. The last computed correction
#   will remain applied until the toolhead moves below the specified Z position
#   again. The default is 0.0mm (always on).
#max_z_offset:
#   Maximum absolute compensation that can be applied to the Z axis [mm]. The
#   default is 99999999.0mm (unlimited).
z_stepper:
#   The Z stepper motor linked with the Z endstop, as written in printer.cfg.
#   Used for triggering reference temperature measurement. Usually 'stepper_z'
#   unless otherwise defined.

G-Code Commands

The following commands are available when the frame_expansion_compensation config section is enabled:

  • SET_FRAME_COMP ENABLE=[<0:1>]: enable or disable frame expansion compensation. When disabled, the last computed compensation value will remain applied until next homing.
  • QUERY_FRAME_COMP: report current state and key parameters of the frame expansion compensation.

Overview

TODO

Comments
  • QUERY_FRAME_COMP in klipper implementation...

    QUERY_FRAME_COMP in klipper implementation...

    The new klipper documentation doesn't say anything about a query function.... will it still work? If not any reason I shouldn't just stay with the plugin?

    opened by PhilBaz 7
  • stepper_z for multiple Z steppers.

    stepper_z for multiple Z steppers.

    Im on a 24. Voron with 4 Z stepper motors stepper_z - stepper_z3. defined as bellow.

    Is config, z_stepper: stepper_z , still correct?

    The frame compensation appears as if its functioning. Doesn't throw an error, and the query looks as it should. But i dont think it is functioning. I cranked up the temp_coeff: 0.03 producing -0.12mm on a 23min first layer. and it appeared to have no effect. I previously used a manual correction of -0.06mm to correct going into the second layer.

    So I'm at a bit of a loss. I suspect something is not working correctly.

    Im also using 'virtual gantry backers' and have created a corresponding issue there as well. I would appreciate any thoughts or input.

    https://github.com/Deutherius/VGB/issues/3

    printer.cfg

    [frame_expansion_compensation] temp_coeff: 0.03 ##0.0009 temp_sensor: temperature_sensor ToolHP max_z_offset: 0.12 z_stepper: stepper_z

    [stepper_z] ## Z0 Stepper - Front Left ## In Z-MOT Position step_pin: PD14 dir_pin: PD13 enable_pin: !PD15 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16

    position_max: 330 ##<<<<<<<<<

    endstop_pin: ^PA0

    position_min: -5 homing_speed: 32 second_homing_speed: 3 homing_retract_dist: 3

    [tmc2209 stepper_z] uart_pin: PD10 interpolate: True run_current: 0.8 hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0

    [stepper_z1] ## Z1 Stepper - Rear Left ## In E1-MOT Position step_pin: PE6 dir_pin: !PC13 enable_pin: !PE5 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16

    [tmc2209 stepper_z1] uart_pin: PC14 interpolate: True run_current: 0.8 hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0

    [stepper_z2] ## Z2 Stepper - Rear Right ## In E2-MOT Position step_pin: PE2 dir_pin: PE4 enable_pin: !PE3 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16

    [tmc2209 stepper_z2] uart_pin: PC15 interpolate: true run_current: 0.8 hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0

    [stepper_z3] ## Z3 Stepper - Front Right ## In E3-MOT Position step_pin: PD12 dir_pin: !PC4 enable_pin: !PE8 rotation_distance: 40 gear_ratio: 80:16 microsteps: 16

    [tmc2209 stepper_z3] uart_pin: PA15 interpolate: true run_current: 0.8 hold_current: 0.8 sense_resistor: 0.110 stealthchop_threshold: 0

    opened by PhilBaz 2
  • questions regarding temp_sensor & z_stepper configurations

    questions regarding temp_sensor & z_stepper configurations

    Hi,

    My chamber temp sensor was already defined in [temperature_fan] section as the chamber fan was controlled by this thermsitor, I cannot use it to define in a [temperature_sensor] section otherwise an error would be raised. How can I deal with this issue? Any work around?

    Also, how to configure the z_stepper for voron2.4 since there're 4 z steppers?

    Thanks.

    opened by dukeduck1984 1
  • Updated install.sh to no longer use dummy service

    Updated install.sh to no longer use dummy service

    The dummy service should no longer be needed for use with Moonraker. Updated the install.sh file to continue following the pattern used by Z Auto Calibration. In addition, updated the README since copying the file into Klipper isn't needed since the install.sh file will just create a link.

    opened by randellhodges 0
  • Problem with process_frame_expansion

    Problem with process_frame_expansion

    Hello, I have a problem with the process_frame_expansion.py script. If I run the measure_thermal_behavior.py and the process_meshes.py all sound good but when I run the process_frame_expansion.py script I have this error:

    [email protected]:~/measure_thermal_behavior $ python3 process_frame_expansion.py thermal_quant_mark988#5325_2022-05-29_23-12-26.json Analyzing file: thermal_quant_mark988#5325_2022-05-29_23-12-26 sys:1: RankWarning: Polyfit may be poorly conditioned

    And it doesn't create the temp_coeff_fitting.png

    I am attaching the edited measure_thermal_behavior.py the out.txt and the thermal_quant fil

    Thank you for your help

    Marco

    measure_thermal_behavior.zip e

    opened by panik988 0
  • measure_thermal_behavior : Anything to be gained by adding klicky z_calibration between meshes?

    measure_thermal_behavior : Anything to be gained by adding klicky z_calibration between meshes?

    I have a klicky probe.

    My brain is telling me it would be nice to have the z-calibration routine/data added into the measure_thermal_behavior script.

    But I cant actually figure out what it would be useful for. the z-calibration does drift with temperature and time, over squishing after long periods of heated chamber.

    Is there anything to be gained here?

    https://github.com/protoloft/klipper_z_calibration

    opened by PhilBaz 0
  • Need methodology for different active lengths

    Need methodology for different active lengths

    I'm trying to apply this to an i3 bedslinger style frame, where the gantry is supported by twin stainless steel leadscrews, and inside an enclosure. The deviation from expected Z position is going to be dependent on the thermal growth of the length of leadscrew that is supporting the gantry. When the nozzle is at z=0 there's about 50 mm of active leadscrew, so if the chamber was heated from 20C to 40C the leadscrews would grow thermally 0.0000173 mm/mm/C x 50mm x (40C-20C) = 0.017mm. But when the nozzle gets up to z=100mm there would be 100+50 = 150mm of leadscrew active, so the total growth would be 0.0000173 x 150mm x 20c = 0.052mm. So the compensation needs to know the active length of the support element, which may change from layer to layer as it does in the case of the i3. I don't think what you currently have set up here takes that in to account.

    feature request 
    opened by cmgreyhounds 1
Releases(v0.0.2)
  • v0.0.2(Aug 3, 2022)

    What's Changed

    • Updated install.sh to no longer use dummy service by @randellhodges in https://github.com/alchemyEngine/klipper_frame_expansion_comp/pull/4

    Re-run install.sh after updating and make any necessary changes to your Moonraker config (see README/Configuration).

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Dec 18, 2021)

PPO is a very popular Reinforcement Learning algorithm at present.

PPO is a very popular Reinforcement Learning algorithm at present. OpenAI takes PPO as the current baseline algorithm. We use the PPO algorithm to train a policy to give the best action in any situat

Rosefintech 11 Aug 23, 2021
🤗 Paper Style Guide

🤗 Paper Style Guide (Work in progress, send a PR!) Libraries to Know booktabs natbib cleveref Either seaborn, plotly or altair for graphs algorithmic

Hugging Face 66 Dec 12, 2022
SOLO and SOLOv2 for instance segmentation, ECCV 2020 & NeurIPS 2020.

SOLO: Segmenting Objects by Locations This project hosts the code for implementing the SOLO algorithms for instance segmentation. SOLO: Segmenting Obj

Xinlong Wang 1.5k Dec 31, 2022
A pytorch implementation of Detectron. Both training from scratch and inferring directly from pretrained Detectron weights are available.

Use this instead: https://github.com/facebookresearch/maskrcnn-benchmark A Pytorch Implementation of Detectron Example output of e2e_mask_rcnn-R-101-F

Roy 2.8k Dec 29, 2022
Official implementation of NeurIPS'21: Implicit SVD for Graph Representation Learning

isvd Official implementation of NeurIPS'21: Implicit SVD for Graph Representation Learning If you find this code useful, you may cite us as: @inprocee

Sami Abu-El-Haija 16 Jan 08, 2023
Pyramid R-CNN: Towards Better Performance and Adaptability for 3D Object Detection

Pyramid R-CNN: Towards Better Performance and Adaptability for 3D Object Detection

61 Jan 07, 2023
Codeflare - Scale complex AI/ML pipelines anywhere

Scale complex AI/ML pipelines anywhere CodeFlare is a framework to simplify the integration, scaling and acceleration of complex multi-step analytics

CodeFlare 169 Nov 29, 2022
Pytorch implementation of "ARM: Any-Time Super-Resolution Method"

ARM-Net Dependencies Python 3.6 Pytorch 1.7 Results Train Data preprocessing cd data_scripts python extract_subimages_test.py python data_augmentation

Bohong Chen 55 Nov 24, 2022
Image data augmentation scheduler for albumentations transforms

albu_scheduler Scheduler for albumentations transforms based on PyTorch schedulers interface Usage TransformMultiStepScheduler import albumentations a

19 Aug 04, 2021
Classifying cat and dog images using Kaggle dataset

PyTorch Image Classification Classifies an image as containing either a dog or a cat (using Kaggle's public dataset), but could easily be extended to

Robert Coleman 74 Nov 22, 2022
The implementation code for "DAGAN: Deep De-Aliasing Generative Adversarial Networks for Fast Compressed Sensing MRI Reconstruction"

DAGAN This is the official implementation code for DAGAN: Deep De-Aliasing Generative Adversarial Networks for Fast Compressed Sensing MRI Reconstruct

TensorLayer Community 159 Nov 22, 2022
Fast and simple implementation of RL algorithms, designed to run fully on GPU.

RSL RL Fast and simple implementation of RL algorithms, designed to run fully on GPU. This code is an evolution of rl-pytorch provided with NVIDIA's I

Robotic Systems Lab - Legged Robotics at ETH Zürich 68 Dec 29, 2022
Pytorch Geometric Tutorials

Pytorch Geometric Tutorials

Antonio Longa 648 Jan 08, 2023
TalkingHead-1KH is a talking-head dataset consisting of YouTube videos

TalkingHead-1KH Dataset TalkingHead-1KH is a talking-head dataset consisting of YouTube videos, originally created as a benchmark for face-vid2vid: On

173 Dec 29, 2022
This repo provides function call to track multi-objects in videos

Custom Object Tracking Introduction This repo provides function call to track multi-objects in videos with a given trained object detection model and

Jeff Lo 51 Nov 22, 2022
Source code for Task-Aware Variational Adversarial Active Learning

Contrastive Coding for Active Learning under Class Distribution Mismatch Official PyTorch implementation of ["Contrastive Coding for Active Learning u

27 Nov 23, 2022
Official implementation for "Image Quality Assessment using Contrastive Learning"

Image Quality Assessment using Contrastive Learning Pavan C. Madhusudana, Neil Birkbeck, Yilin Wang, Balu Adsumilli and Alan C. Bovik This is the offi

Pavan Chennagiri 67 Dec 30, 2022
Regulatory Instruments for Fair Personalized Pricing.

Fair pricing Source code for WWW 2022 paper Regulatory Instruments for Fair Personalized Pricing. Installation Requirements Linux with Python = 3.6 p

Renzhe Xu 6 Oct 26, 2022
Implementation for "Exploiting Aliasing for Manga Restoration" (CVPR 2021)

[CVPR Paper](To appear) | [Project Website](To appear) | BibTex Introduction As a popular entertainment art form, manga enriches the line drawings det

133 Dec 15, 2022
A Machine Teaching Framework for Scalable Recognition

MEMORABLE This repository contains the source code accompanying our ICCV 2021 paper. A Machine Teaching Framework for Scalable Recognition Pei Wang, N

2 Dec 08, 2021