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)

Library for implementing reservoir computing models (echo state networks) for multivariate time series classification and clustering.

Framework overview This library allows to quickly implement different architectures based on Reservoir Computing (the family of approaches popularized

Filippo Bianchi 249 Dec 21, 2022
Codes and pretrained weights for winning submission of 2021 Brain Tumor Segmentation (BraTS) Challenge

Winning submission to the 2021 Brain Tumor Segmentation Challenge This repo contains the codes and pretrained weights for the winning submission to th

94 Dec 28, 2022
Non-Attentive-Tacotron - This is Pytorch Implementation of Google's Non-attentive Tacotron.

Non-attentive Tacotron - PyTorch Implementation This is Pytorch Implementation of Google's Non-attentive Tacotron, text-to-speech system. There is som

Jounghee Kim 46 Dec 19, 2022
A user-friendly research and development tool built to standardize RL competency assessment for custom agents and environments.

Built with ❤️ by Sam Showalter Contents Overview Installation Dependencies Usage Scripts Standard Execution Environment Development Environment Benchm

SRI-AIC 1 Nov 18, 2021
A new version of the CIDACS-RL linkage tool suitable to a cluster computing environment.

Fully Distributed CIDACS-RL The CIDACS-RL is a brazillian record linkage tool suitable to integrate large amount of data with high accuracy. However,

Robespierre Pita 5 Nov 04, 2022
(NeurIPS '21 Spotlight) IQ-Learn: Inverse Q-Learning for Imitation

Inverse Q-Learning (IQ-Learn) Official code base for IQ-Learn: Inverse soft-Q Learning for Imitation, NeurIPS '21 Spotlight IQ-Learn is an easy-to-use

Divyansh Garg 102 Dec 20, 2022
Can we visualize a large scientific data set with a surrogate model? We're building a GAN for the Earth's Mantle Convection data set to see if we can!

EarthGAN - Earth Mantle Surrogate Modeling Can a surrogate model of the Earth’s Mantle Convection data set be built such that it can be readily run in

Tim 0 Dec 09, 2021
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Matthias Wright 169 Dec 26, 2022
The official repo of the CVPR 2021 paper Group Collaborative Learning for Co-Salient Object Detection .

GCoNet The official repo of the CVPR 2021 paper Group Collaborative Learning for Co-Salient Object Detection . Trained model Download final_gconet.pth

Qi Fan 46 Nov 17, 2022
Official implementation of the paper 'Efficient and Degradation-Adaptive Network for Real-World Image Super-Resolution'

DASR Paper Efficient and Degradation-Adaptive Network for Real-World Image Super-Resolution Jie Liang, Hui Zeng, and Lei Zhang. In arxiv preprint. Abs

81 Dec 28, 2022
Implementation of "Distribution Alignment: A Unified Framework for Long-tail Visual Recognition"(CVPR 2021)

Implementation of "Distribution Alignment: A Unified Framework for Long-tail Visual Recognition"(CVPR 2021)

105 Nov 07, 2022
Repository accompanying the "Sign Pose-based Transformer for Word-level Sign Language Recognition" paper

by Matyáš Boháček and Marek Hrúz, University of West Bohemia Should you have any questions or inquiries, feel free to contact us here. Repository acco

Matyáš Boháček 30 Dec 30, 2022
Lecture materials for Cornell CS5785 Applied Machine Learning (Fall 2021)

Applied Machine Learning (Cornell CS5785, Fall 2021) This repo contains executable course notes and slides for the Applied ML course at Cornell and Co

Volodymyr Kuleshov 103 Dec 31, 2022
Implementation of "Semi-supervised Domain Adaptive Structure Learning"

Semi-supervised Domain Adaptive Structure Learning - ASDA This repo contains the source code and dataset for our ASDA paper. Illustration of the propo

3 Dec 13, 2021
Categorical Depth Distribution Network for Monocular 3D Object Detection

CaDDN CaDDN is a monocular-based 3D object detection method. This repository is based off of [OpenPCDet]. Categorical Depth Distribution Network for M

Toronto Robotics and AI Laboratory 289 Jan 05, 2023
CLOOB training (JAX) and inference (JAX and PyTorch)

cloob-training Pretrained models There are two pretrained CLOOB models in this repo at the moment, a 16 epoch and a 32 epoch ViT-B/16 checkpoint train

Katherine Crowson 64 Nov 27, 2022
How Effective is Incongruity? Implications for Code-mix Sarcasm Detection.

Code for the paper: How Effective is Incongruity? Implications for Code-mix Sarcasm Detection - ICON ACL 2021

2 Jun 05, 2022
A simple, unofficial implementation of MAE using pytorch-lightning

Masked Autoencoders in PyTorch A simple, unofficial implementation of MAE (Masked Autoencoders are Scalable Vision Learners) using pytorch-lightning.

Connor Anderson 20 Dec 03, 2022
Provably Rare Gem Miner.

Provably Rare Gem Miner just another random project by yoyoismee.eth useful link main site market contract useful thing you should know read contract

34 Nov 22, 2022
This is the repository for The Machine Learning Workshops, published by AI DOJO

This is the repository for The Machine Learning Workshops, published by AI DOJO. It contains all the workshop's code with supporting project files necessary to work through the code.

AI Dojo 12 May 06, 2022