Asking for help with meta script
-
I have 2 triggers, trigger2.g (Loading filament) trigger3.g (Unloading filament).
I have this code in my config.g :M950 J1 C"io4.in" ; define input for filament auto load, connects to the FS pin of the Orbiter 2.0 Filament Sensor
M581 P1 T2 S0 R2 ; define trigger for filament auto load triggers trigger2.g
M950 J2 C"io5.in" ; define input for filament unload, connects to FU pin of the Orbiter 2.0 Filament Sensor
M581 P2 T3 S0 R2 ; define trigger for filament auto load triggers trigger3.gI use R2 in the M581 to prevent loading and unloading triggers during a print job and it works great.
The problem is that I have seen unwanted loading and unloading triggers during bed calibration.
I figured I should write a meta script that would see that the printer is busy with another task or command and not let the triggers execute or query while the printer is busy, but I do not know how.
Can I get some direction on how to write this:If printer is busy
abort -
@cosmowave thanks again.
I did implement R-1 and that seemed to work just fine.
Once I did that I disassembled the filament sensor and added just a very small drop of med thick ca on the TAC switch to add a little height to help remove some space between the TAC switch and the 6mm bb that pushes on the switch when filament goes thru the tube. -
@quadcells I'm not clear on what you're asking here. From the doc the unload trigger is a physical switch you manually click. How is it unloading by itself when you calibrate the bed? Are you saying the triggers are randomly happening like from electrical noise?
-
@markz Hi, thanks for the reply.
I have a Orbiter 2.0 with the Filament Sensor installed. There is an "Unload" button and there is another button that is triggered when there is filament inserted into the sensor.
All was working fine for a long time then I started getting unloading during prints.
I then changed the M581 R0 to R2 to prevent unloading and loading during a print. That worked.
But I still get unwanted loading during calibration which I think is do to the filament moving around as the carriage moves about. So there might be a problem with the pcb board in the sensor housing that I need to investigate, but I thought writing some kind of code to prevent this from happening as an added safety.
Here is the code for the triggers:trigger2.g:
T0 ; select tool 0
M300 S2000 P100 ; play beep sound
M291 P"Filament autoloading!" S0 T3 ; display message
M302 P1 ; enable cold extrusion
G4 S1 ; wait for one second
G1 E15 F500 ; load filament inside the gears
G10 P0 S240 R0 ; set hotend temperature to 240
M116 ; wait for hotend to reach 240
G1 E150 F300 ; extrude 150mm, you may need to reduce speed for very soft TPU
M104 S0 T0 ; set hotend temperature to 0
M302 P0 ; disable cold extrusion
M291 P"Filament autoload complete!" S0 T3 ; display messagetrigger3.g:
T0 ; select tool 0
M300 S4000 P100 ; play beep sound
M291 P"Filament unloading!" S0 T3 ; display message
G10 P0 S235 R0 ; set hotend temperature to 235
M116 ; wait for hotend to reach 235
G0 E-5 F3600 ; extract filament to cold end
G4 S3 ; wait for 3 seconds
G0 E5 F3600 ; push back the filament to strive stringing
G0 E-15 F3600 ; Extract fast in the cold zone
G0 E-100 F300 ; continue extraction slow allow filament to be cooled enough before reaches the gears
M104 S0 T0 ; set hotend temperature to 0
M291 P"Filament unload complete!" S0 T3 ; display message -
@quadcells You can add the "M581 R-1" command at the beginning of your calibration.
From documentation:
"R Condition: whether to trigger at any time (R0, default), only when printing a file from SD card (R1), or only when not printing a file from SD card (R2, supported in RRF 3.2 and later). R-1 temporarily disables the trigger."I think you then need to activate the trigger again at the end of calibration with the "normal" M581 command.
-
@cosmowave oh, I was wondering why there was a R-1 to disable the triggers.
That seems easy and clean. I will try that.
Thanks -
@cosmowave thanks again.
I did implement R-1 and that seemed to work just fine.
Once I did that I disassembled the filament sensor and added just a very small drop of med thick ca on the TAC switch to add a little height to help remove some space between the TAC switch and the 6mm bb that pushes on the switch when filament goes thru the tube. -