tomjack wrote:Maybe I can instal in parallel with the Z-axis a W-axis?
That's a very interesting idea, and ought to work well. Very ingenious.
The question is: How do I connect both axes with one engine?
Can I connect Z and W axis with one Stepgen?
You could, yes.
It would need a bit of cleverness in the HAL file to get a "bumpless transfer".
You would need a mux function to swap the input to the stepgen from the Z axis to the W axis
www.linuxcnc.org/docview/html/man/man9/mux2.9.html
You might want to use a linear A axis, I know it is wrong, but you might find you have to have ABCU&V to get a W. However, experiment first to see if that is the case. You will certainly need all 9 [AXIS_N] stanzas in the INI file, though they can be blank, I think, for the unused axes. You need to configure the COORDINATES and possibly GEOMETRY parameters in the INI file. You definitely need AXES=9 to have an active W axis.
You can't just transfer the input to the stepgen from Z to W, as that will lead to uncontrolled movement on the switch. I think the solution is to use a comp function
www.linuxcnc.org/docview/html/man/man9/comp.9.html
with the .out pin operating the mux2. That way the stepgen will always take the value of the larger of W or Z. You would normally "park" W at -250 or similar, then a G0 W200 would do nothing until W was equal to Z, at which point control of the stepgen would transfer to the W axis and you can drive to your +200 position. Then as you drive W back to -250, at the moment that the position is fractionally less than Z, then Z will take over control again.
This is only first-order bumpless, there is still a step change in velocity. It might be that the STEPGEN_MAXACCEL will handle this if tuned correctly, otherwise you will need to add a limit3 function between the mux2 and the stepgen.
www.linuxcnc.org/docview/html/man/man9/limit3.9.html
I have only discussed the logic here, if you need any help with the HAL implementation, feel free to ask.