Configuring Filament-error.g to play nice with Pause.g
-
Hey guys,
I am trying to configure my filament runout macro (filament-error.g) to allow automatic unloading followed by a pause to allow manual loading. Since pause.g has redundant code (retraction, lift, repositioning), should I use M226 at the end of my macro like this?
;Filament runout macro M83 ; relative extruder moves G1 E-.5 F2000 ; retract 0.5mm of filament G91 ; relative positioning G1 Z10 F360 ; lift Z by 10mm G90 ; absolute positioning G1 X5 Y5 F6000 ; go to X5 Y5 G0 E-5 F3600 ; Extract filament to cold end G4 S3 ; Wait for 3 seconds G0 E5 F3600 ; Push back the filament to reduce stringing G0 E-15 F3600 ; Extract fast in the cold zone G0 E-50 F300 ; Continue extraction slow allow filament to be cooled enough before reaches the gears M226 ; Pause
-
Okay, M226 did not work. It threw an error.
-
@CCS86
Why not wrap the "redundant" code in pause.g in a conditional block?if sensors.filamentMonitors[0].status="ok" ;do stuff not required on filament change, but required on normal pause
-
@OwenD said in Configuring Filament-error.g to play nice with Pause.g:
@CCS86
Why not wrap the "redundant" code in pause.g in a conditional block?if sensors.filamentMonitors[0].status="ok" ;do stuff not required on filament change, but required on normal pause
I like that approach, thank you.
Is there a command line call to report the status of a sensor like that, to verify in the console? I searched the wiki and couldn't find anything.
:edit: I'm testing by writing into a macro. What is the opposite of "ok" status? I have tried !ok, null, bad, off. I can't seem to find any of this stuff on the wiki.
-
@CCS86
To verify in the console just use echoecho sensors.filamentMonitors[0].status
All possible values are here
https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#sensorsfilamentmonitorsstatus-filamentmonitorYou could use
if (sensors.filamentMonitors[0].status != "ok")
however that would resolve to true if the sensor was in an error state for example.
Probably better to be specific by usingif (sensors.filamentMonitors[0].status = "noFilament")
-
@OwenD said in Configuring Filament-error.g to play nice with Pause.g:
@CCS86
To verify in the console just use echoecho sensors.filamentMonitors[0].status
All possible values are here
https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#sensorsfilamentmonitorsstatus-filamentmonitorYou could use
if (sensors.filamentMonitors[0].status != "ok")
however that would resolve to true if the sensor was in an error state for example.
Probably better to be specific by usingif (sensors.filamentMonitors[0].status = "noFilament")
Excellent, thank you much!
Bookmarked that page for future reference. It would definitely be helpful if the Duet team could add more of this to the wiki. I hate bugging other people for reference I could look up myself.
-
@CCS86
The object model is very fluid, with additions and changes happening all the time.
That particular documentation is auto generated so as to save the development team spending time doing documentation that could otherwise be spent... well developing.It is referenced in the GCode meta data documentation.
Unfortunately with so many features, the documentation itself is daunting for new users especially.Perhaps the very start of the documentation page(s) could include a drop down box of selections?
Example
I'm looking for help on
- Firmware installation
- Wiring
- G Code commands
- Conditional G Code & meta commands
Etc etc
-
Good points.
-
@CCS86 said in Configuring Filament-error.g to play nice with Pause.g:
Is there a command line call to report the status of a sensor like that, to verify in the console? I searched the wiki and couldn't find anything.
:edit: I'm testing by writing into a macro. What is the opposite of "ok" status? I have tried !ok, null, bad, off. I can't seem to find any of this stuff on the wiki.
If you enable the Object Model Browser, you can browse and watch the values in real time, e.g. in this case feed a bit of filament in and out of your sensor by hand while you watch the values on screen (assuming the screen is within sight of the printer).
-
@achrn said in Configuring Filament-error.g to play nice with Pause.g:
If you enable the Object Model Browser, you can browse and watch the values in real time, e.g. in this case feed a bit of filament in and out of your sensor by hand while you watch the values on screen (assuming the screen is within sight of the printer).
Very cool! I hadn't tried that yet, thanks.