Firmware request: Tool Change Mode with enclosure lights left ON

Thank you for the macro. Too bad turning the lights on is pointless in combination with the no unplugging while powered. So controller / power supply are unable to cut power to toolhead for a tool change? I’ll see what I can rig up to power the enclosure separately and still have at least a switch or remote control on fan/lights.

Toolhead specific initialization is done at machine startup. Of course it would’ve been possible to design hot-pluggable tools into the firmware, but it isn’t there now.

The power bus for the toolhead does not have a disconnect in the controller - that is not something that can be fixed without a new PCB. EDIT: toolhead and linear modules are separated from the touchscreen, and the add ons.

I agree the best bet is going to be an aux switch. I bet it would be trivial to add some diodes so that software control of the enclosure lights could be maintained, but there’s really no need for that if there’s a switch on the outside.

Just a thought, since the enclosure module firmware has been released, it would be pretty trivial to rewrite the controller so that any time power is applied it just turns the lights on. Fan would have to be dealt with. Probably not worth is over just splicing the lights directly and removing the enclosure control box.

1 Like

I still havent even assembled my enclosure. i think i might do that this weekend.

Def agree with the default ON for lights. Not sure why default is OFF. Day or night, ON and some additional light isn’t a problem while OFF is well… dark.

OK, well here’s a module firmware that turns the lights on at startup

Snapmaker_V1.9.3_20201230.zip (32.9 KB)

Much better. The controller does think the lights are off, but if you turn on and then off the lights will respond. https://github.com/brent113/Snapmaker2-Modules/tree/enclosure_lights_startup

2 Likes

Are you sure about that? There is firmware code for controlling three power domains, one of which is for the toolhead and linear modules. I haven’t tested this but I would expect that disable_power_domain(POWER_DOMAIN_EXECUTOR) should make it safe to change the toolhead while keeping the lights on.

1 Like

Looks like the toolhead and linear modules are in the same power domain. That would allow the enclosure lights to stay on though. Just need to reboot the controller after it’s done I think.

I think this would require touchscreen firmware modifications in addition to controller firmware. But it does look like this can be software patched.

1 Like

Lookin good! Thanks for that firmware brent!
I’ll install it today after current laser cut is done. Loving the community.
sooo… has it been long enough with your platform in the mail for us to request replacements of ours? :smile: My A350 platform is over 1.2mm off in z from one side to the other. Going to shim for now.

1 Like

Thank you for this piece of firmware.- This in combination with the macro mades it.
I have edited the macro, so toolchange is possible and a bit more comfortable now, unfortunately i am not able to keep the work origin if i run the macro…

YOU WILL LOOSE YOUR ACTUAL WORK ORIGIN!

G28 O F3000; Move home if needed
M1010 S3 P100; Turn the lights on
M82
G53 G1 X250 Z150 F5000; Actual Machine Coordinate System,- Move to X250 Z150 with Speed of F500
G4 P5000; Wait 5Sec, so you could be ready
M1999; restart the machine controller, this needs about 12sec

I have now recognized, the touchscreen has its problems about tool detection,- could we restart the touchscreen from the console as well?

I think you can unplug it and replug it, but otherwise it requires firmware changes.

Give me some time to write a test a firmware modification based on zauguins info that disables power too. The touchscreen can be restarted from the controller if I add a command for it

1 Like

I added the M2001 gcode command to control power domains. When certain domains are enabled the screen and controller are automatically rebooted.

Snapmaker_V4.0.1_20201231.zip (141.1 KB)

And example pair of Luban macros to do a toolhead would looks like this now:
Macro 1: “Start Tool Change”

G28 O F3000; Move home if needed
M1010 S3 P255; Turn the lights on
G53 G1 X250 Z150 F5000; Actual Machine Coordinate System,- Move to X250 Z150 with Speed of F500
M2001 T0 ; Disable power to the toolhead

Macro 2: “Finish Tool Change”

M2001 T ; Enable Tool Power, rebooting machine

Command documentation:

/*
 * Power domain control:
 *   S: just for screen
 *   T: for the toolhead and all linear modules
 *   B: for bed and addons, like the enclosure
 * 
 * Call with:
 *   M2001 S{0} T{0} B{0}
 */

Example usage:
M2001 ; Get status of each power domain
M2001 T0 ; Turn off the toolhead/linear modules
M2001 T0 B0 ; Turn off the toolhead/linear modules and bed/enclosure
M2001 S T B ; Turn everything on. Will reboot, if T or B was off previously

1 Like

@brent113 Is this zip a new firmware from you?
If so whatb are the changes to the latest from snapmaker?
Only the M2001 or more?

Only M2001, based on top of the current Snapmaker 4.0.0 branch.

Full changes here: https://github.com/Snapmaker/Snapmaker2-Controller/pull/47/commits/3f5d1a608bed770a9c5cb3634718ce8b2473a4ce

so you just made a hot swap module macro for use with your custom firmware?

edit: when is snapmaker going to start paying you to make their products better?

1 Like

Brent, does this firmware also include the laser grayscale you came up with?

You should branch off and start your own custom firmware - Brentmaker or something like that

Feature request, implement that bed heater on and off we talked about hehe.

Altho i ran it with the bed on and I think it went ok im sure that it would be more proper yeah

This weekend I’m going to rebase the grayscale changes and publish a bug fix branch like you’re describing. The bed heater will be on that list as well. Currently those changes are built on top of Marlin and not on top of snapmaker firmware, with a few thousand commits in between.

But for now, that’s just a standalone firmware with only M2001 and nothing else.

Hmm i hope i can figure out how to use the github, last time i tried i got real frusterated lol

Thanks for all of your work!

Great @brent113, your code made it to the official-firmware!

Thank you for your work!

2 Likes

Our firmware developer received this request our official GitHub page.

We are very glad that users can pull requests or report issue there.

Cheers
Edwin

My solution to this has been to move the toolhead to the position I want to change it, and then changing out the head/bed without unplugging the connected tool. Lights are on the whole time, and I can get the new head attached, and then just power off, change the plugs, and power back on.

It would be nice to have a setting for “enclosure lights always on” though.