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:

    pi@mainsailos:~/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)

Owner
null
Code release for NeX: Real-time View Synthesis with Neural Basis Expansion

NeX: Real-time View Synthesis with Neural Basis Expansion Project Page | Video | Paper | COLAB | Shiny Dataset We present NeX, a new approach to novel

null 536 Dec 20, 2022
Code release for NeX: Real-time View Synthesis with Neural Basis Expansion

NeX: Real-time View Synthesis with Neural Basis Expansion Project Page | Video | Paper | COLAB | Shiny Dataset We present NeX, a new approach to novel

null 538 Jan 9, 2023
[CVPR2022] Representation Compensation Networks for Continual Semantic Segmentation

RCIL [CVPR2022] Representation Compensation Networks for Continual Semantic Segmentation Chang-Bin Zhang1, Jia-Wen Xiao1, Xialei Liu1, Ying-Cong Chen2

Chang-Bin Zhang 71 Dec 28, 2022
FLAVR is a fast, flow-free frame interpolation method capable of single shot multi-frame prediction

FLAVR is a fast, flow-free frame interpolation method capable of single shot multi-frame prediction. It uses a customized encoder decoder architecture with spatio-temporal convolutions and channel gating to capture and interpolate complex motion trajectories between frames to generate realistic high frame rate videos. This repository contains original source code for the paper accepted to CVPR 2021.

Tarun K 280 Dec 23, 2022
RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation Ported from https://github.com/hzwer/arXiv2020-RIFE Dependencies NumPy

null 49 Jan 7, 2023
RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE - Real Time Video Interpolation arXiv | YouTube | Colab | Tutorial | Demo Table of Contents Introduction Collection Usage Evaluation Training and

hzwer 3k Jan 4, 2023
RIFE - Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE - Real-Time Intermediate Flow Estimation for Video Frame Interpolation YouTube | BiliBili 16X interpolation results from two input images: Introd

旷视天元 MegEngine 28 Dec 9, 2022
Real-Time-Student-Attendence-System - Real Time Student Attendence System

Real-Time-Student-Attendence-System The Student Attendance Management System Pro

Rounak Das 1 Feb 15, 2022
Medical Image Segmentation using Squeeze-and-Expansion Transformers

Medical Image Segmentation using Squeeze-and-Expansion Transformers Introduction This repository contains the code of the IJCAI'2021 paper 'Medical Im

askerlee 172 Dec 20, 2022
NBEATSx: Neural basis expansion analysis with exogenous variables

NBEATSx: Neural basis expansion analysis with exogenous variables We extend the NBEATS model to incorporate exogenous factors. The resulting method, c

Cristian Challu 100 Dec 31, 2022
An expansion for RDKit to read all types of files in one line

RDMolReader An expansion for RDKit to read all types of files in one line How to use? Add this single .py file to your project and import MolFromFile(

Ali Khodabandehlou 1 Dec 18, 2021
Thermal Control of Laser Powder Bed Fusion using Deep Reinforcement Learning

This repository is the implementation of the paper "Thermal Control of Laser Powder Bed Fusion Using Deep Reinforcement Learning", linked here. The project makes use of the Deep Reinforcement Library stable-baselines3 to derive a control policy that maximizes melt pool depth consistency.

BaratiLab 11 Dec 27, 2022
Edge-aware Guidance Fusion Network for RGB-Thermal Scene Parsing

EGFNet Edge-aware Guidance Fusion Network for RGB-Thermal Scene Parsing Dataset and Results Test maps: 百度网盘 提取码:zust Citation @ARTICLE{ author={Zhou,

ShaohuaDong 10 Dec 8, 2022
计算机视觉中用到的注意力模块和其他即插即用模块PyTorch Implementation Collection of Attention Module and Plug&Play Module

PyTorch实现多种计算机视觉中网络设计中用到的Attention机制,还收集了一些即插即用模块。由于能力有限精力有限,可能很多模块并没有包括进来,有任何的建议或者改进,可以提交issue或者进行PR。

PJDong 599 Dec 23, 2022
Plug-n-Play Reinforcement Learning in Python with OpenAI Gym and JAX

coax is built on top of JAX, but it doesn't have an explicit dependence on the jax python package. The reason is that your version of jaxlib will depend on your CUDA version.

null 128 Dec 27, 2022
Plug and play transformer you can find network structure and official complete code by clicking List

Plug-and-play Module Plug and play transformer you can find network structure and official complete code by clicking List The following is to quickly

null 8 Mar 27, 2022
Gradient Step Denoiser for convergent Plug-and-Play

Source code for the paper "Gradient Step Denoiser for convergent Plug-and-Play"

Samuel Hurault 11 Sep 17, 2022
A plug-and-play library for neural networks written in Python

A plug-and-play library for neural networks written in Python!

Dimos Michailidis 2 Jul 16, 2022
A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run.

Minimal Hand A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run. This project provides the

Yuxiao Zhou 824 Jan 7, 2023