Got the full setup together, end result can be seen in the video below.
The model I'm printing is the awesome Woven Pencil Holder by JamesThePrinter found here:
https://www.printables.com/model/202588-woven-pencil-holder
Finally got the g-code almost completely nailed down. It still leaves some small nubs when it travels to the switch, but I just paint the seam on the back of the model and they flake right off when it's done. If I figure out how to stop that, I'll update here. I run SuperSlicer, navigate to Printer Settings>Custom G-code>Before Layer Change and overwrite what is there with the following. This is for a bone stock E3S1 Pro.
;BEFORE_LAYER_CHANGE
G91; Relative movement for retraction
G1 E-1 F3000; Retract -1mm at 3000mm/min or 50mm/sec
G90; Absolute Positioning
G1 F9000 X235 Y230; Quick Move Away
G1 F600 X240; Slow down and press trigger
G4 P700; Wait 0.7 seconds - edit this to stop extruder blur
G1 F9000 X235; Move away
G91; Relative again for un-retraction
G1 E1 F2100; Un-Retract 1mm at 2100mm/min or 35mm/sec
G90; Back to Absolute
;{layer_z}
This is a continuation of my z-axis webcam mount found here:
https://www.printables.com/model/374525-ender-3-s1-pro-z-axis-mount-for-logitech-c920
I wasn't quite happy with the webcam quality (Sonic Pad issues, not webcam issues) and remembered I had an old DSLR that I could use for time lapse videos as well and wanted to try that out.
I needed an easy x-axis trigger and remembered the spare limit switch for the z-axis that came with the printer. After looking for the best place to put it, it lined up with the z-axis web camera mount that was already installed. I went back to Fusion 360 and remodeled this mount to work with the provided limit switch. The screw hole is sized for the screw that was included with the limit switch and the screw cuts its own threads when first installed in the mount.
The switch triggers at X=240 on mine (stock extruder). Yours may be slightly different depending on manufacturing tolerances. There is not any wiggle room with this as any less and the extrusion head hits the switch hard during bed mesh probes since the head travels to X240 during that probe. The full extent of extruder travel is capped at X245. The space between X240-X245 starts to really stress the extruder cable where it plugs into the extruder. If you don't want it triggering your camera during mesh probes (I run one before every print), you could slide the mount back a millimeter or two to allow for that or wait to turn on your camera until after the mesh probe is done.
In testing (now about 1000+ triggers of the switch so far), the slip fit of the mount appears to be tight enough to hold it in place.
The ‘box’ on the back where the cable goes through was intentionally made as large as it is so I could retain the factory plug on the supplied cable but also provide some strain relief/support for the cable.
The model will need printed with the ‘narrow’ end down. Due to the small contact area you may need to use a brim to help secure it to the bed.
The included Creality limit switch is wired for NC operation. You will need to take the wire out of the 3rd hole in the plug and move it to the 2nd hole to have it operate in NO operation. The board is labeled, it will be apparent which wires when you look at it.
The author marked this model as their own original creation.