klipper-led_effect icon indicating copy to clipboard operation
klipper-led_effect copied to clipboard

[Help] Stepper function

Open husnainali09 opened this issue 2 years ago • 13 comments

I am trying to fire the led when klicky d2f hits the bed during qgl and mesh/g28 like a comet effect. Please advice how to achieve this using stepper function?

husnainali09 avatar Jul 12 '22 10:07 husnainali09

You can try adding your gcode command here, in your probe settings.

[probe] #deactivate_gcode: # A list of G-Code commands to execute after each probe attempt # completes. See docs/Command_Templates.md for G-Code format. Do not # issue any commands here that move the toolhead. The default is to # not run any special G-Code commands on deactivation.

I would add a

SAVE_GCODE_STATE NAME="whatever"

Before your gcode and a ..

RESTORE_GCODE_STATE NAME="whatever"

At the end of your gcode command

Let me know if that works.

burntcoinpurse avatar Jul 13 '22 21:07 burntcoinpurse

I'm not sure how that command works. This is my probe section in printer.cfg Screenshot_20220714-094115_Chrome

husnainali09 avatar Jul 13 '22 23:07 husnainali09

I'll write it out for you in a few hours when I'm home. Work....ya know.

burntcoinpurse avatar Jul 14 '22 00:07 burntcoinpurse

Can you post you neopixel stuff too? It'll make it easier.

burntcoinpurse avatar Jul 14 '22 00:07 burntcoinpurse

[neopixel sb_leds] pin: sht36:PB15 chain_count: 3 color_order: GRBW initial_RED: 1.0 initial_GREEN: 0.0 initial_BLUE: 1.0 initial_WHITE: 0.0

husnainali09 avatar Jul 14 '22 01:07 husnainali09

[gcode_macro PRINT_START] variable_parameter_PRINT_MIN : 0,0 variable_parameter_PRINT_MAX : 0,0 gcode: # Parameters {% set bedtemp = params.BED|int %} {% set hotendtemp = params.HOTEND|int %} {% set Chamber = params.CHAMBER|default(0)|int %}

CLEAR_PAUSE
SAVE_GCODE_STATE NAME=STATE_PRINT_START
SET_LED_EFFECT EFFECT=bed_effects
G4 P500
M190 S{bedtemp}                ; set and wait for bed temp
G28
HEATSOAK T={bedtemp} MOVE=1
TEMPERATURE_WAIT SENSOR="temperature_sensor Chamber" MINIMUM={Chamber}
SET_LED_EFFECT EFFECT=bed_effects STOP=1
STATUS_READY
M104 S175                      ; set and wait for hotend temp
BedsFansSlow
M107						   ; Fan off
BED_MESH_CLEAR				   ; Clear Bed Mesh
STATUS_HOMING
G28 X Y
ATTACH_PROBE_LOCK
STATUS_READY
STATUS_CALIBRATING_Z
G28 Z                            ; home all axes
STATUS_READY
STATUS_LEVELING
QUAD_GANTRY_LEVEL
G28 Z
STATUS_READY
G90 													 											; absolute positioning
G0 Z20 F3000
STATUS_MESHING
BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX}                       ; Print area bed mesh calibrate
DOCK_PROBE_UNLOCK
STATUS_READY
STATUS_HEATING
M109 S{hotendtemp}             ; set and wait for hotend temp
STATUS_READY
#STATUS_CLEANING
# scrub_nozzle
STATUS_PRINTING
G92 E0                              																; reset Extruder
G1 X0 Y20 Z0.3 F19500.0           																	; move to start position
G1 X0 Y200.0 Z0.3 F1500.0 E15     																	; draw the first line
G92 E0                              																; reset Extruder
G1 Z2.0 F3000  
#SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1

RESTORE_GCODE_STATE NAME=STATE_PRINT_START

husnainali09 avatar Jul 14 '22 01:07 husnainali09

Thank you for looking into this !

husnainali09 avatar Jul 14 '22 01:07 husnainali09

You got it working?

burntcoinpurse avatar Jul 14 '22 01:07 burntcoinpurse

Nope

On Thu, 14 July 2022, 11:03 am burntcoinpurse, @.***> wrote:

You got it working?

— Reply to this email directly, view it on GitHub https://github.com/julianschill/klipper-led_effect/issues/70#issuecomment-1183835783, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQ2ZIYKBMBXEL2LWIBMEGLVT5RNPANCNFSM53KOG2NA . You are receiving this because you authored the thread.Message ID: @.***>

husnainali09 avatar Jul 14 '22 01:07 husnainali09

You're going to need to set up a display_template for the macro. Give each effect its own display_template. Then use the macro to run the template.

burntcoinpurse avatar Jul 14 '22 01:07 burntcoinpurse

You're going to need to set up a display_template for the macro. Give each effect its own display_template. Then use the macro to run the template.

[led_effect bed_effects] leds: neopixel:sb_leds autostart: false frame_rate: 24 heater: heater_bed layers: heaterfire 50 0 add (1,1,0),(1,0,0) static 0 0 top (1,0,0)

[gcode_macro LED_White] gcode: SET_LED LED=case_leds RED=1.0 GREEN=1.0 BLUE=0.5

[led_effect critical_error] leds: neopixel:sb_leds layers: strobe 1 1.5 add (1.0, 1.0, 1.0) breathing 2 0 difference (0.95, 0.0, 0.0) static 1 0 top (1.0, 0.0, 0.0) autostart: false frame_rate: 24 run_on_error: true

husnainali09 avatar Jul 14 '22 01:07 husnainali09

This is what i am using for bed effects etc but its the klicky trigger effect that i am chasing

husnainali09 avatar Jul 14 '22 01:07 husnainali09

activate_gcode: [gcode_macro KLICKY] gcode: SET_LED_EFFECT EFFECT="your effect" deactivate_gcode: [gcode_macro KLICKY_OFF] gcode: SET_LED_EFFECT EFFECT="your effect" STOP=1

add this to [probe] in printer.cfg to start an effect as soon as the probe deploys, and the second to cancel it when it retracts

or

deactivate_gcode: [gcode_macro KLICKY_BLINK] gcode: SET_LED LED=sb_leds RED=1 GREEN=0 BLUE=0 WHITE=0 FADETIME=0.5 G4 P500 SET_LED LED=sb_leds RED=0 GREEN=0 BLUE=0 WHITE=0 FADETIME=0.5

you can try this one which should flash red for 2 seconds after the probe triggers. Let me know how it works. I'm going to be installing my chamber heater lol

burntcoinpurse avatar Jul 14 '22 02:07 burntcoinpurse