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
blacksmithforlife
blacksmithforlifeβ€’17mo ago
stormy-gold
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...
blacksmithforlife
blacksmithforlifeβ€’17mo ago
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-gold
stormy-goldOPβ€’17mo ago
that's what I found as well. It's weird.
stormy-gold
stormy-goldOPβ€’17mo ago
No description
stormy-gold
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.
blacksmithforlife
blacksmithforlifeβ€’17mo ago
upload your printer.cfg
stormy-gold
stormy-goldOPβ€’17mo ago
stormy-gold
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
blacksmithforlife
blacksmithforlifeβ€’17mo ago
like 35 should in your USER OVERRIDES section
stormy-gold
stormy-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.
blacksmithforlife
blacksmithforlifeβ€’17mo ago
it should be rename_existing not rename_original
stormy-gold
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
miklschmidt
miklschmidtβ€’17mo ago
probably different klipper versions πŸ™‚
stormy-gold
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 πŸ˜„
miklschmidt
miklschmidtβ€’17mo ago
Then my guess is your V0 config already has a m106 override that has a rename_existing πŸ˜‰
stormy-gold
stormy-goldOPβ€’17mo ago
guess again πŸ˜„
miklschmidt
miklschmidtβ€’17mo ago
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-gold
stormy-goldOPβ€’17mo ago
It's a onepager on the v0. only one include, and that's the mainsail.cfg
miklschmidt
miklschmidtβ€’17mo ago
Because this has zero to do with RatOS
stormy-gold
stormy-goldOPβ€’17mo ago
stormy-gold
stormy-goldOPβ€’17mo ago
not a single instance of "rename"
miklschmidt
miklschmidtβ€’17mo ago
Ah, you have no [fan] section πŸ™‚ without a [fan] section klipper doesn't expose M106
stormy-gold
stormy-goldOPβ€’17mo ago
ooooooh πŸ˜„ there we go
miklschmidt
miklschmidtβ€’17mo ago
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-gold
stormy-goldOPβ€’17mo ago
Orca Slicer
miklschmidt
miklschmidtβ€’17mo ago
Just call SET_FAN_SPEED when you want to control your nevermore Orca slicer doesn't send a P parameter?
stormy-gold
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.
miklschmidt
miklschmidtβ€’17mo ago
stormy-gold
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
miklschmidt
miklschmidtβ€’17mo ago
yes klipper uses pin values between 0 and 1 0 = off, 1 = on Makes sense from an MCU perspective.
stormy-gold
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.
miklschmidt
miklschmidtβ€’17mo ago
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-gold
stormy-goldOPβ€’17mo ago
You can do that, sure.
stormy-gold
stormy-goldOPβ€’17mo ago
No description
stormy-gold
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.
miklschmidt
miklschmidtβ€’17mo ago
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-gold
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
miklschmidt
miklschmidtβ€’17mo ago
Perfect doesn't exist πŸ˜„
stormy-gold
stormy-goldOPβ€’17mo ago
That's why there is this Macro πŸ˜„
miklschmidt
miklschmidtβ€’17mo ago
apparently the guy has been sponsored to pick up development again last i heard
stormy-gold
stormy-goldOPβ€’17mo ago
That would be nice
miklschmidt
miklschmidtβ€’17mo ago
I never really became friends with superslicer, it was always so buggy for me
stormy-gold
stormy-goldOPβ€’17mo ago
it has a lot of fine tuning possibilities that I liked
miklschmidt
miklschmidtβ€’17mo ago
yeah
stormy-gold
stormy-goldOPβ€’17mo ago
but i threw all of those overboard in favor of tree supports πŸ˜„
miklschmidt
miklschmidtβ€’17mo ago
tree supports are indeed awesome They should be in SuperSlicer now though as "Organic supports"
stormy-gold
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
miklschmidt
miklschmidtβ€’17mo ago
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-gold
stormy-goldOPβ€’17mo ago
Yeah
miklschmidt
miklschmidtβ€’17mo ago
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-gold
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 πŸ˜„
miklschmidt
miklschmidtβ€’17mo ago
haha yeah i started with Cura too πŸ˜„
stormy-gold
stormy-goldOPβ€’17mo ago
This is what I love on orca
No description
stormy-gold
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
miklschmidt
miklschmidtβ€’17mo ago
I can't shake the habbit of looking through my browser tabs πŸ˜‚
stormy-gold
stormy-goldOPβ€’17mo ago
I mean... if it brings you joy... πŸ˜„ I'm not judging. Just not the masochistic type myself πŸ˜„
miklschmidt
miklschmidtβ€’17mo ago
It doesn't but old habits die hard πŸ˜‚
stormy-gold
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 πŸ˜„
blacksmithforlife
blacksmithforlifeβ€’17mo ago
You're welcome, just pay it forward

Did you find this page helpful?