gcode command M106 already registered
I want to reconfigure M106 to properly control the various fans from orca slicer, especially an air scrubber like a nevermore.
When I do what I did for my Voron V0, i get the Error message "gcode command M106 already registered" - is there a macro somewhere in RatOS that already redefined M106?
60 Replies
It's already in klipper
https://www.klipper3d.org/G-Codes.html
stormy-goldOPβ’17mo ago
yes I know that, but you can overwrite it in your own config. Like I wrote, i did this for my Voron V0 running regular klipper + Mainsail and it works like a charm. So it has to be something in RatOS...
ratos doesn't do anything with m106
https://github.com/search?q=repo%3ARat-OS%2FRatOS-configuration+m106&type=code
as you can see, it is just used within a macro, but nothing special
stormy-goldOPβ’17mo ago
that's what I found as well. It's weird.
stormy-goldOPβ’17mo ago

stormy-goldOPβ’17mo ago
that's from my config of the V0 --> No problems
pasting the same macro into my RatOS config yields the error above.
upload your printer.cfg
stormy-goldOPβ’17mo ago
stormy-goldOPβ’17mo ago
there you go
plus mymacro.cfg:
[gcode_macro M106]
#rename_original: XM106
gcode:
{%if params.P is not defined or params.P|int == 0 %}
{% set fan = 'Part_Cooling_Fan' %}
{% elif params.P|int == 2 %}
#{% set fan = 'Nevermore' %} # Hier externen Fan einfΓΌgen
{% elif params.P|int == 3 %}
{% set fan = 'Nevermore' %}
{% endif %}
{%if fan is not defined %}
RESPOND TYPE=echo MSG="Unknown Fan"
{% else %} {% set speed = (params.S|int if params.S is defined else 255)/255 %} SET_FAN_SPEED FAN={fan} SPEED={speed} {% endif %} rename_original doesn't make any difference
{%if fan is not defined %}
RESPOND TYPE=echo MSG="Unknown Fan"
{% else %} {% set speed = (params.S|int if params.S is defined else 255)/255 %} SET_FAN_SPEED FAN={fan} SPEED={speed} {% endif %} rename_original doesn't make any difference
like 35 should in your
USER OVERRIDES
sectionstormy-goldOPβ’17mo ago
It was there previously. I moved it there to see if the klipper log would give me a file name where it find's the second M106 macro (as mine would be first). It currently doesn't do anything. my_macros is currently all commented out in order to be able to use the machine.
it should be
rename_existing
not rename_original
stormy-goldOPβ’17mo ago
did that - error message is gone. I'm still confused as to why I got the error message in the first place - As I said, it's fine (without renaming) on my v0 config
probably different klipper versions π
stormy-goldOPβ’17mo ago
v0.11.0-299 vs -304. different, yeah, but not far apart.
i'd love to update both to 0.12.0-37, but the small one is in the middle of a small job for the big one π
Then my guess is your V0 config already has a m106 override that has a rename_existing π
stormy-goldOPβ’17mo ago
guess again π
Your second M106 override is merged with the previous one, so your gcode section replaces the other gcode section and
rename_existing
is merged.
Are you absolutely sure?stormy-goldOPβ’17mo ago
It's a onepager on the v0. only one include, and that's the mainsail.cfg
Because this has zero to do with RatOS
stormy-goldOPβ’17mo ago
stormy-goldOPβ’17mo ago
not a single instance of "rename"
Ah, you have no [fan] section π
without a [fan] section klipper doesn't expose M106
stormy-goldOPβ’17mo ago
ooooooh π
there we go
Which is why the override is needed on your V0 in the first place
What is the point of that override btw?
Makes no sense to me
stormy-goldOPβ’17mo ago
Orca Slicer
Just call SET_FAN_SPEED when you want to control your nevermore
Orca slicer doesn't send a P parameter?
stormy-goldOPβ’17mo ago
It sends one
P3 for the filter fan
P2 I think for the external cooling fan
not sure if it sends P1 or no P parameter on the part cooling fan
The Gcode macro translating the P values to my actual fan names was the only way I could find to get Klipper to not just ignore the P value and run the part cooling fan at the requested speed instead.
GitHub
OrcaSlicer/doc/Auxiliary-fan.md at e187ada1e9857b18c9a0df74f08dcb89...
G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.) - SoftFever/OrcaSlicer
stormy-goldOPβ’17mo ago
Having the part cooling ramp to 100% instead of my nevermore did not work well for ABS prints π
it's the same macro
just... broken
SET_FAN_SPEED FAN={fan} SPEED={speed} will set the fan to Speed = 255 at 100%, the SET_FAN_SPEED Command likes a decimal instead.
so it's gonna do 100% for every value > 0 π
and it will just use fan0-3 instead of fans with actual names
which sucks for the UI
yes klipper uses pin values between 0 and 1
0 = off, 1 = on
Makes sense from an MCU perspective.
stormy-goldOPβ’17mo ago
I have 4 machines, i can't remember which fan is fan 2, so i modified the macro.
that's all fine, they just missed a /255.
Well i don't really get the point of using orca to control anything except for the part fan in the first place, i'd just slap in SET_FAN_SPEED for the filter in the start/end gcode personally, but that's just me
klipper will just ignore the P params in that case
no config change needed
stormy-goldOPβ’17mo ago
You can do that, sure.
stormy-goldOPβ’17mo ago

stormy-goldOPβ’17mo ago
it's nice to just use the existing options in the filament settings.
I'd prefered to modify the gcode command behind that box in orca slicer but it doesn't give you the option.
yeah this a bambu leftover, instead of implementing this correctly (ie, define the fan name to control an exahust fan in your profile and echo SET_FAN_SPEED in case of klipper) they added a random doc on github π
yep indeed
stormy-goldOPβ’17mo ago
it's not perfect. Neither is prusaslicer, unfortunately.
And i feel like superslicer hit a wall and isn't that actively developed any more
Perfect doesn't exist π
stormy-goldOPβ’17mo ago
That's why there is this Macro π
apparently the guy has been sponsored to pick up development again last i heard
stormy-goldOPβ’17mo ago
That would be nice
I never really became friends with superslicer, it was always so buggy for me
stormy-goldOPβ’17mo ago
it has a lot of fine tuning possibilities that I liked
yeah
stormy-goldOPβ’17mo ago
but i threw all of those overboard in favor of tree supports π
tree supports are indeed awesome
They should be in SuperSlicer now though
as "Organic supports"
stormy-goldOPβ’17mo ago
I missed them so much when moving away from cura, but that one is just so awful if you wanna manage different filaments
Yeah can't stand Cura personally, it generates some real awkward toolpaths and the options and what they do make no sense to me
stormy-goldOPβ’17mo ago
Yeah
It seems to me like they tried to accomodate for bad firmware by baking it into the generated gcode instead and it just doesn't work π
stormy-goldOPβ’17mo ago
it was the first slicer i used with my CR10, so I stuck with it for a while, thinking prusaslicer is for prusa machines...
long time ago π
haha yeah i started with Cura too π
stormy-goldOPβ’17mo ago
This is what I love on orca

stormy-goldOPβ’17mo ago
even though i first thought it was just a gimmick
but having mainsail right there in the slicer is great for a browser-window-hoarder like me π
3 screens, 10 browsers... where the f is my mainsail window gone? π
the only downside: it doesn't handle multiple machines running in parallel very well
I can't shake the habbit of looking through my browser tabs π
stormy-goldOPβ’17mo ago
I mean... if it brings you joy... π
I'm not judging.
Just not the masochistic type myself π
It doesn't but old habits die hard π
stormy-goldOPβ’17mo ago
I'm so sorry, I seem to have not thanked you. Thank's a lot man! π
You can do it, I believe in you π
You're welcome, just pay it forward