frix-x / klippain Goto Github PK
View Code? Open in Web Editor NEWGeneric Klipper configuration for 3D printers
License: GNU General Public License v3.0
Generic Klipper configuration for 3D printers
License: GNU General Public License v3.0
WIth the latest update Klipper will not work with the current Flow test and will stop on the G2/G3 commands
Can you include the ercf.py script in the scripts folder?
Will need to include instructions as well for others to move it to the klipper/klippy/extra folder.
This issue is to track and not forget to add a macro to calibrate the retraction as there is already for the flow and PA
Hi, Shouldn't move_speed for restore_gcode_state be specified in mm/s rather than mm/min in your pause_resume.cfg macro? e.g.
{% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed %}
Vs
{% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed * 60 %}
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St}
BTW - Really appreciate your adaptive mesh macros
Hello,
You have a little typo in graph_vibrations.py
# Be sure to make this script executable using SSH: type 'chmod +x ./graph_vibrations.sh' when in the folder !
It should be ".py" not ".sh"
# Be sure to make this script executable using SSH: type 'chmod +x ./graph_vibrations.py' when in the folder !
The issue seems to exist in many forms as I fix them. I've had it complain about the extruder. I also had it complain Option 'sensor_type' in section 'heater_bed' must be specified
when I removed the section related to the SB2040 in the overrides.
I'm still looking into this, but wanted to open a ticket. I'm not sure how I could have done anything wrong (yet) as this is a new install from the perspective of the system.
I wanted a fresh install so I moved all files to a directory called old. I then moved the kiuah directory back. I removed klipper, moonraker, etc then installed them again using Kiuah. I then ran the install script.
eg:
mkdir old;mv * old/; mv old/kiuah .
wget -O - https://raw.githubusercontent.com/Frix-x/klippain/main/install.sh | bash
Used klippain guided install to install initial hardware, including selecting the sb2040 canbus toolhead.
Here are the current versions:
Restarting printer
Start printer at Fri Apr 7 11:13:19 2023 (1680880399.4 4604.1)
klippy_cut.log
Hi,
This one is just to remember to deactivate the optional filament_motion_sensor during the macros relating to the filament in :
Seems to be good practice. Thanks
why am I having issues saving? even before you changed things I had problems.. have to move my extruder and bed heater to printer.cfg for it to save but its not working when i do this either. im saya that its conflicting.
This issue is to track and not forget to add a macro to calibrate and check the Z belts tension on a belted and multiple motor Z axis printer like the Voron 2.4
Planned work:
The relative reference is calculated in the middle of the mesh.
If I understand correctly, relative index should be the point where you calibrated your nozzle, so for most people probably the middle of the bed.
The calculation here assumes, that the nozzle was set up in the middle and your print area always is in the middle of the bed.
Calculation should use coordinates as indicator and pick the probe point nearest to it.
To be clear, I tried calculating it myself but I cannot figure out a way to do it in Jinja, it's so limited.
With Klicky, you can chose what axe to home first.
With an EBB36 can you home Y first, back away a few centimeters and home X, so the EBB doesn't crash in the Z chain.
See klicky_variables.cfg below:
variable_home_backoff_x: 10 # how many mm to move away from the X endstop after homing X variable_home_backoff_y: 20 # how many mm to move away from the Y endstop after homing Y variable_override_homing: 'Y' # configures what axis to home first
Would it be possible with your macros ?
I managed to change the code a bit to work with the voron tap but there are some changes needed to have a general approach.
Here are a few things I have found that need to be done:
Nothing really devestating just a few small additions/changes.
I can work on that if it's alright with you.
if an error loading error of the ercf occurs during print_start, the macro continues to run and the pause is only made when printing start...
In many .cfg files the pines are named z:[name of the alias].
with the z: the config dont work. I have to delete all z: then the config load.
In files vibr_calibrate_01.cfg and vibr_calibrate_02.cfg, the 's' is missing at the end of the file name for making it executable.
Otherwise, worked perfect.
Was able to make my machine run a little quieter.
Thanks for spending the time to build this.
I have configured an high Accel for my 2.4 (max accel 30k) and this disturbs homing and qgl.
So I propose to add a variable in variable.cfg to limit accel in those macro, something like accel_during_homing_tilt
Good morning, I have this problem, I can't understand why it always gives this error.
read write awards are ok i can edit the plot_graphs.sh on fluid and save
I'm using a mks pi , the directory is ~/mks instead of ~/pi
effectively it seems that it finds the file but as I am a nuvato on linux I am not understanding if you can help me thank you
// Resonances data written to /tmp/resonances_y_20230227_152504.csv file
23:27:26 // Running Command {plot_graph}...:
23:27:26 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 7: $'\r': command not found
23:27:26 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 14: $'\r': command not found
23:27:26 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 24: $'\r': command not found
23:27:26 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 31: $'\r': command not found
23:27:27 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 32: $'\r': command not found
23:27:27 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 39: $'\r': command not found
23:27:27 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 40: $'\r': command not found
23:27:27 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 44: $'\r': command not found
23:27:27 // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 45: syntax error near unexpected token $'{\r'' // /home/mks/printer_data/config/scripts/plot_graphs.sh: line 45:
function plot_shaper_graph {
'
23:27:27 // Command {plot_graph} finished
#################################################################################################################
RESULTS_FOLDER=/mks/printer_data/config/adxl_results # Path to the folder where storing the results files/mks/printer_data/config/scripts # Path to the folder where the graph_vibrations.py is located
SCRIPTS_FOLDER=
KLIPPER_FOLDER=~/mks/klipper # Path of the klipper main folder
STORE_RESULTS=0 # Number of results to keep (older files are automatically cleaned). 0 to keep them indefinitely
#################################################################################################################
At the Moment it is placed at START_PRINT. Resulting in changing the light only when printing.
Moving the STATUS_LEDS call to the macro will result in changing lights everytime the macro is called.
EXP1_1 is incorrectly defined as PE9 but should be PC9 ([output_pin beeper]), as PE9 is for X_ENABLE. In it's current state the spider_v1.cfg will throw the following error:
pin X_ENABLE is an alias for EXP1_1
Hi,
found a small error in line 109 of the pa_calibrate macro:
On calculating the print_height variable, spacing_purge is subtracted, however, the true print height needs to be calculated by subtracting spacing_band and then ADDING spacing_purge.
Suggested fix:
Change line to: {% set print_height = num_bands * band_height - spacing_band + spacing_purge %}
Additionally, at the moment the calculation of print_height does not take the line_width of the purge lines into account.
Also, the bands_per_height variable is calculated with one extra spacing_band at the top that is not needed since there is no more band to be printed.
Suggested fix: See pull request.
minor issue.
pinter.cfg has now
it is missing ] at the end.
I belive there are some slight inconsistancyies in the Instructions of vibr_calibrate_02.cfg
The provided python script in [graph_vibrations.py](https://github.com/Frix-x/klipper-voron-V2/blob/main/scripts] is however called graph_vibrations.py, so just the two words spun arround.
Thanks a lot for you work !!!
Now that the config is becoming more generic and used as is by multiple people (at least elpopo and me) on multiple machines (at least Voron V2.4 machines and also a TriZero machine), the REAME need to be improved to become more focused on global install instructions
@Frix-x, hey, I just tried to run your VIBRATIONS_CALIBRATION
routine and I ran into a Python ValueError
. I think it's because of how you're RegEx'ing with this line: https://github.com/Frix-x/klipper-voron-V2/blob/a3b33ae21b2f4c47bb86b0bc7b85f0e90eb47813/scripts/graph_vibrations.py#L176
turns out my login name (spikeygg) matches the start of your regex and the 'n' fits for resonance
so instead of getting the speed for the speed
variable, I get: ikeygg/reso
and eventually: // ValueError: invalid literal for int() with base 10: 'ikeygg/reso'
This is probably because RegEx is greedy by default grabbing the first thing it finds. If I were doing this I'd breakout the basename with os first, that way you can be sure your operating on the filename and not the whole path. Like this:
speed = re.search('sp(.+?)n', os.path.basename(logname)).group(1)
btw: I made this change locally on my printer and ran it through the script and it worked.
Hi Frix-x
Are you planning to support ERCF Happy Hare please?
https://github.com/moggieuk/ERCF-Software-V3
Thanks
In the current version, when we want to attach a probe, we perform the entry movement reversing the exit movement.
For euclid it's better to enter by the side the movement is softly
So I propose to add a type/lenght of movement in config
variable_probe_move_to_enter_when_attaching: "front"
variable_probe_move_to_enter_when_attaching_length: 20
is it possible to rename/revamp vibr_calibrate file because I find it not very explicit ?
We can do something like that :
vibr_calibrate_01.cfg -> shapper_calibration.cfg
vibr_calibrate_02.cfg -> axis_vibration_measurement.cfg
Currently when running the probe_calibrate it will try to do a probe dock and mount. My solution recently was to just remove the code inside probe_base.cfg as I use a 8mm probe.
for generalizing the config I beleive it would be helpfult o simply disable the klicky probe docking.
There doesn't seem to be any documentation describing how to interpret the belt tension graphs that your scripts generate. It would be useful to know how to read the graphs:
Thank you.
Hello,
At the moment, the macro "CALIBRATE" call "PA" and "Flow" calibration with a fixe bed size of 300x300.
{% if TYPE=="flow" %}
[...]
START_PRINT [...] SIZE=130_130_170_170
[...]
{% elif TYPE=="pressure_advance" %}
[...]
START_PRINT [...] SIZE=90_90_210_210
[...]
I think it would be beneficial to include some simple parameters to call this macro with different bed sizes. (at least 300 and 350)
Thank
Hi,
Can you add an update process in your README.md ?
For instance, If I want to update to your last macros but keep my changes (printer.cfg, pinout etc), how should I do ?
Thanks!
Hi,
Just wondering if you have any ideas how an end user could implement WLED? All of the current lighting calls are baked into the non-modifiable macros and use a specific format. That makes it a bit hard to use overrides (from what I understand) since we wouldn't really need to specify rgb values or use the current format.
WLED allows us to use complex animations and offload the processing to a very inexpensive esp32. All of the setup is done on the esp32 gui.
To use it in klipper, we simply add WLED to moonraker via IP or serial, and call the specific preset that we want (which was created through the WLED interface on the esp32).
For example:
WLED_ON string=chamber preset=1
This would load any complex animations or effects we set up for preset 1 without any extra configuring on the klipper side.
Here is the documentation:
https://moonraker.readthedocs.io/en/latest/configuration/#wled
This CANboard is pretty popular and used by many in the community. It would be nice to have this mcu added to the config/mcu folder.
pinout information can be found here: https://mellow.klipper.cn/#/board/fly_sb2040/pins
something like this:
https://gist.github.com/EricZimmerman/d6bf8a4b0a200611f3d9aa308a31e3c1
to allow for telling the printer to vibrate at 87 hz for troubleshooting based on output graphs
Tried running the belt calibration today. Both CSVs are generated but the plotting fails with an error about columns reduced from four to one on line 25436. Thoughts on how to fix?
Also is there a way to generate manually with the CSVs?
This issue is to track and not forget about this.
Goal is to be able to quicly find out the max flow for every hotend and every material you have with only a click in Mainsail/Fluidd
Hey,
As Moonraker changes files structures, the vibration macros does not work anymore on newly installed printer.
The shell command and plot_graphs.sh, where pathes are hardcoded, irremediably yield to error.
One way could be to convert all config to the new structure, another one to add symbolic links in the documentation.
What do you think about it?
Hi,
I'm setting up a fresh install and i ran into this issue when i try to home: !! Error evaluating 'homing_override:gcode': TypeError: can't multiply sequence by non-int of type 'float'
I am using the default "variable_sensorless_current_factor: 70"
attached is the relevant klipper log
`Homing X
Error evaluating 'homing_override:gcode': TypeError: can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 61, in render
return str(self.template.render(context))
File "/home/pi/klippy-env/lib/python2.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/klippy-env/lib/python2.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "", line 80, in top-level template code
TypeError: can't multiply sequence by non-int of type 'float'
Error evaluating 'homing_override:gcode': TypeError: can't multiply sequence by non-int of type 'float'`
Im having trouble getting Cura to recognize & use the script.
https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff
I'm placing it in C:\Users\xxx\AppData\Roaming\cura\master\plugins, as instructed here : https://github.com/Frix-x/klipper-voron-V2/blob/main/macros/probing/bed_mesh.cfg .
I've tried on 5.0 Beta, as well as 4.13 master fork.
Any help would be appreciated.
The calculation is wrong. You should use this:
{action_respond_info("PA of the last band: %.4f" % (pa_start + ((num_bands - 1) * pa_increment)))}
I'm getting this error when trying to run BELTS_SHAPER_CALIBRATION:
Traceback (most recent call last): File "/home/pi/klipper/scripts/graph_accelerometer.py", line 259, in main() File "/home/pi/klipper/scripts/graph_accelerometer.py", line 218, in main datas = [parse_log(fn, opts) for fn in args] File "/home/pi/klipper/scripts/graph_accelerometer.py", line 218, in datas = [parse_log(fn, opts) for fn in args] File "/home/pi/klipper/scripts/graph_accelerometer.py", line 22, in parse_log if not header.startswith('freq,psd_x,psd_y,psd_z,psd_xyz'): UnboundLocalError: local variable 'header' referenced before assignment
Hello, I notice the user_templates of the BTT_Octopus uses E_HEATER=MCU_HE0 & BED_HEATER=MCU_HE1 being MCU_HE0=PA2 & MCU_HE1=PA3 respectively, in most case the user should/would have used MCU_BED0=PA1 for BED and not PA3.
I use a Rapido and wired the heater to PA1 so when I simply swapped over the MCU_HE0 & MCU_HE1 in my MCU.cfg thats when I noticed it.
Furthermore, should I copy my entire MCU.cfg content or just my swapped terminals (lights, nevermore, neopixels) and serial path in overrides.cfg or the MCU.cfg also doesnt get errased on updates?
I also use a toolhead thermistor (I never really confirmed how accurate it was but yeah still using it), it seems for this LDO toolhead board I have not manage to add it in my overrides.cfg successfully it will say and I have to modify /config/hardware/temperature_sensors/chamber_temp.cfg and use the following making the Klippain dirty obviously.
[gcode_macro _USER_VARIABLES]
variable_chamber_temperature_sensor_enabled: True
variable_chamber_temperature_sensor_name: "Chamber"
gcode:
[thermistor CMFB103F3950FANT]
temperature1: 0.0
resistance1: 32116.0
temperature2: 40.0
resistance2: 5309.0
temperature3: 80.0
resistance3: 1228.0
[temperature_sensor Chamber]
sensor_type: CMFB103F3950FANT
sensor_pin: CHAMBER_TEMPERATURE
min_temp: 0
max_temp: 100
gcode_id: chamber_th
Hi
Do you plan to support displays and menus? For example mini12864.
It would be nice to have an option in the upcoming V3 to enable Virtual Endstops for X and Y. At the moment I hard coded it by setting the endstop pins to tmc2209_stepper_x:virtual_endstop and tmc2209_stepper_y:virtual_endstop which works but is not pretty.
This should work with with any mcu with an STM cpu. In printer.cfg add the following include to the 'Other temperature sensors configuration' section:
[include config/hardware/temperature_sensors/mcu_temp.cfg]
Create the mcu_temp.cfg in the above location, containing the following code:
[temperature_sensor mcu]
sensor_type = temperature_mcu
min_temp = 0
max_temp = 90
I get this error msg in the console upon start-up:
Error evaluating 'homing_override:gcode': jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'sensorless_current_factor'
This happened after moving to klippain from your earlier version. Not sure where to look, the klippy log looks normal to me.
My machine is stock 2.4, with TAP and Stealthburner. normal endstops installed.
In the readme file, we can find an exemple of the Gcode Start command for Superslicer :
START_PRINT EXTRUDER_TEMP={first_layer_temperature[initial_extruder] + extruder_temperature_offset[initial_extruder]} BED_TEMP=[first_layer_bed_temperature] MATERIAL=[filament_type] CHAMBER=[chamber_temperature] SIZE={first_layer_print_min[0]}{first_layer_print_min[1]}{first_layer_print_max[0]}_{first_layer_print_max[1]}
But the macros were renamed to PRINT_START and END_PRINT, so it'd be better to update the readme file to respect macro's names
I'm getting the above error when the print_start macro calls the auto_z_calibration macro with the computed mesh_center.
Not sure what exactly the issue is, rather I'm not sure why the {mesh_center} variable is passing (0, 0)
instead of (0,0)
or (174,174)
to the CALIBRATE_Z macro. I believe CALIBRATE_Z BED_POSITION=(0,0) syntax works correctly as I tried that when I ran it manually.
The entire bed_mesh.cfg was copied verbatim and include behavior is working as expected.
Here is a excerpt from my PRINT_START macro if it will help.
...
{% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %}
COMPUTE_MESH_PARAMETERS SIZE={FL_SIZE}
SCRUB
{% set mesh_center = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].mesh_center %}
CALIBRATE_Z BED_POSITION={mesh_center}
BED_MESH_CLEAR
Attach_Probe_Lock
ADAPTIVE_BED_MESH
Dock_Probe_Unlock
...
Here is the console output from the commands leading up to the error
RELATIVE_REFERENCE_INDEX=12 ALGORITHM=bicubic
Computed mesh parameters: MESH_MIN=120,120 MESH_MAX=229,229 MESH_CENTER=174,174 PROBE_COUNT=5,5 ...
!! Malformed command 'CALIBRATE_Z BED_POSITION=(0, 0)'
!! Malformed command 'CALIBRATE_Z BED_POSITION=(0, 0)'
I'd appreciate any insight.
Hi there,
I followed the youtube guide and i get this message. Im using the klicky probe. Any idea why i am getting this message? This happens after the printer does the z_calibrate and tries to run the bed mesh and mesh points are being loaded.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.