I'm currently building a small 2'x3' gantry machine with a z axis that has a plasma torch, and an air micro grinder and touch probe that retract independently using pneumatics. There is also a laser cross projector for material alignment. Each of these has some x,y,z offset associated.
This is a prototype for a medium size (around 4'x8') machine which will also have a tool changer and much larger spindle. I will probably make the plasma torch retractable instead of the spindle on that one since it is smaller.
The goal is to do plasma cutting, engraving, drilling, and tapping in one machine, although the first prototype will only do center marking instead of drilling and tapping.
I've used EMC2 for simple 3 axis desktop mills, but haven't done anything this complicated with it before.
Ideally I'd like to switch between heads and handle their coordinate offsets with a single command. One idea would be to treat the plasma, touch probe, and laser as special tools which can be selected along with the actual tools that go in the spindle with M6. Alternatively, I could use M1xx codes to set plasma, touch, laser, or spindle modes.
I was wondering if anyone had any suggestions about what works well in terms of EMC2 configuration for this.
Could You, please, expand little more on the intended hardware design of the tool movement mechanisms?
If I understand correctly, Z moves all tools, plasma and microgrinder have additional mechanisms to move with respect to Z and spindle motor.
And if I understand correctly You want each of those tools to be either "retracted up and rest" or "lowered down to working position", no middle positions, because Z movements will adjust actual height.
I see 2 options:
1) I think that each of the moving tools could be assigned one of U, V or W axes. Then You can move them with appropriate g-code commands. This requires homing switch for each of them.
2) with use of stepgen, limit3 and mux2 components You can move them from one position to another with M62/M63 commands:
a) M62 Px triggers movement of particular tool to working position.
b) in HAL link motion.digital-out-0x pin to mux2.n.sel pin
c) setp mux2.n.in0 0
Set it to any value, which corresponds to stepgen position, when tool is in "retracted up to take a rest" position. Most probably it would be zero.
setp mux2.n.in1 1000
Set it to any value, which corresponds to stepgen position, when tool is in "ready to work" position.
d) route mux2.n.out to limit3.n.in
e) route limit3.n.out to stepgen.n.pos-cmd
M63 Px will turn off particular motion.digital-out-0x pin, thus changing mux2.n.out value to upper position and so it will go there.
Here is some basic info about the components I mentioned:
If You are using hardware step generation, then simply load 2 additional stepgens and use them.
I have yet to come up with a solution, how to home such "joints".
Probably custom HAL component could be written to handle all of these tasks.
BTW I think that these kind of questions could get a faster answer on EMC user mailing list.