Dual X Carriage on One Axis

Hi,

I want to upgrade my 3D printer. I am planning to build two X-carriage on the same X axis which are driven from seperate motors.

I am planning to use X-min endstop for one carriage and X-max endstop for the other carriage. One of any X motors should be driven only if the other X carriage is at the home position to avoid the collisions.
Is there any configuration / settings for that purpose? If not, can you give me a hint for how can I configure the software?

Imported from wikidot

Smoothie supports multi-motor axes using this technique : http://smoothieware.org/switch#homing-a-multi-motor-axis

However, that technique won’t work if your endstops are at different ends of the axis. I think it might be possible to get it to work with some clever control of the direction pins but I’m not sure exactly how.

Actually, what I want to implement is exactly like this,

If any of the X carriages goes to its endstop ( I mean if left hand side carriage goes to left hand side endstop and right carriage goes to right endstop) they could move together freely. Because there is no way to happen a collision here. But if any of the carriages moves to other direction (getting closer to other carriage) it should be allowed only if the other carriage is at the parking position. I think your suggestion doesn’t fit to my case. Dou you have any other suggestion or hint please?

In the homing a multi motor axis example, there is a g-code line in the example “G28 Z0” which sends Z axes (both 2 axes) to home position. The one of thar motors connected to lets say, M3 port, other is connected to M4. How does software sends both M3 and M4 motors to home positions when we send G28 Z0 command?

Lastly, why don’t we control the Motor’s enable pins while creating switch?
I mean like this,

switch.z-1.enable true
switch.z-1.input_on_command M1001
switch.z-1.input_off_command M1011
switch.z-1.output_pin 0.19

switch.z-2.enable true
switch.z-2.input_on_command M1002
switch.z-2.input_off_command M1012
switch.z-2.output_pin 0.21

What this is doing is very similar to controlling the enable pins, except on most drivers, disrabling the enable pin unpwowers the motors, which means you loose their position.