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)

Generative Models as a Data Source for Multiview Representation Learning

GenRep Project Page | Paper Generative Models as a Data Source for Multiview Representation Learning Ali Jahanian, Xavier Puig, Yonglong Tian, Phillip

Ali 81 Dec 03, 2022
Pytorch implementation of "Training a 85.4% Top-1 Accuracy Vision Transformer with 56M Parameters on ImageNet"

Token Labeling: Training an 85.4% Top-1 Accuracy Vision Transformer with 56M Parameters on ImageNet (arxiv) This is a Pytorch implementation of our te

蒋子航 383 Dec 27, 2022
Code for our work "Activation to Saliency: Forming High-Quality Labels for Unsupervised Salient Object Detection".

A2S-USOD Code for our work "Activation to Saliency: Forming High-Quality Labels for Unsupervised Salient Object Detection". Code will be released upon

15 Dec 16, 2022
Punctuation Restoration using Transformer Models for High-and Low-Resource Languages

Punctuation Restoration using Transformer Models This repository contins official implementation of the paper Punctuation Restoration using Transforme

Tanvirul Alam 142 Jan 01, 2023
Codes for our paper "SentiLARE: Sentiment-Aware Language Representation Learning with Linguistic Knowledge" (EMNLP 2020)

SentiLARE: Sentiment-Aware Language Representation Learning with Linguistic Knowledge Introduction SentiLARE is a sentiment-aware pre-trained language

74 Dec 30, 2022
Official implementation for "QS-Attn: Query-Selected Attention for Contrastive Learning in I2I Translation" (CVPR 2022)

QS-Attn: Query-Selected Attention for Contrastive Learning in I2I Translation (CVPR2022) https://arxiv.org/abs/2203.08483 Unpaired image-to-image (I2I

Xueqi Hu 50 Dec 16, 2022
structured-generative-modeling

This repository contains the implementation for the paper Information Theoretic StructuredGenerative Modeling, Specially thanks for the open-source co

0 Oct 11, 2021
Keras + Hyperopt: A very simple wrapper for convenient hyperparameter optimization

This project is now archived. It's been fun working on it, but it's time for me to move on. Thank you for all the support and feedback over the last c

Max Pumperla 2.1k Jan 03, 2023
This is Official implementation for "Pose-guided Feature Disentangling for Occluded Person Re-Identification Based on Transformer" in AAAI2022

PFD:Pose-guided Feature Disentangling for Occluded Person Re-identification based on Transformer This repo is the official implementation of "Pose-gui

Tao Wang 93 Dec 18, 2022
Python TFLite scripts for detecting objects of any class in an image without knowing their label.

Python TFLite scripts for detecting objects of any class in an image without knowing their label.

Ibai Gorordo 42 Oct 07, 2022
The official implementation of You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient.

You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient (paper) @misc{zhang2021compress,

46 Dec 07, 2022
PanopticBEV - Bird's-Eye-View Panoptic Segmentation Using Monocular Frontal View Images

Bird's-Eye-View Panoptic Segmentation Using Monocular Frontal View Images This r

63 Dec 16, 2022
Retina blood vessel segmentation with a convolutional neural network

Retina blood vessel segmentation with a convolution neural network (U-net) This repository contains the implementation of a convolutional neural netwo

Orobix 1.2k Jan 06, 2023
A ssl analyzer which could analyzer target domain's certificate.

ssl_analyzer A ssl analyzer which could analyzer target domain's certificate. Analyze the domain name ssl certificate information according to the inp

vincent 17 Dec 12, 2022
Real-Time Semantic Segmentation in Mobile device

Real-Time Semantic Segmentation in Mobile device This project is an example project of semantic segmentation for mobile real-time app. The architectur

708 Jan 01, 2023
GAN encoders in PyTorch that could match PGGAN, StyleGAN v1/v2, and BigGAN. Code also integrates the implementation of these GANs.

MTV-TSA: Adaptable GAN Encoders for Image Reconstruction via Multi-type Latent Vectors with Two-scale Attentions. This is the official code release fo

owl 37 Dec 24, 2022
IJCAI2020 & IJCV 2020 :city_sunrise: Unsupervised Scene Adaptation with Memory Regularization in vivo

Seg_Uncertainty In this repo, we provide the code for the two papers, i.e., MRNet:Unsupervised Scene Adaptation with Memory Regularization in vivo, IJ

Zhedong Zheng 348 Jan 05, 2023
Talk covering the features of skorch

Skorch Talk Skorch - A Union of Scikit-learn and PyTorch Presentation The slides can be downloaded at: download link. Google Colab Part One - MNIST Pa

Thomas J. Fan 3 Oct 20, 2020
A clean implementation based on AlphaZero for any game in any framework + tutorial + Othello/Gobang/TicTacToe/Connect4 and more

Alpha Zero General (any game, any framework!) A simplified, highly flexible, commented and (hopefully) easy to understand implementation of self-play

Surag Nair 3.1k Jan 05, 2023
PConv-Keras - Unofficial implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions". Try at: www.fixmyphoto.ai

Partial Convolutions for Image Inpainting using Keras Keras implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions", https

Mathias Gruber 871 Jan 05, 2023