I'm waiting on some proximity switches to arrive. In the meantime I've started to work on the control side, my enclosure with psu and drivers is finished so this is about the actual machine control

In the past I've always used MACH and an old PC, this time I'm going try using a standalone DDCS controller, no experience of these other than checking it powers up.
Click image for larger version. 

Name:	IMG_20200607_125748 (Large).jpg 
Views:	1081 
Size:	443.2 KB 
ID:	28307

The are 4 axis controllers (there is a thread on here somewhere) but have no capability to slave two axis together. My solution is to add a daughter board that will both slave two drivers and handle the gantry squaring. I don't think such a thing is available so I've started to build one. The basic system is an arduino nano with appropriate opto isolation that sits between the controller X outputs and X home input and the two X drivers and two X home switches.

The (untested) algo to deal with this is as follows. Under normal operation the arduino will mirror the X signals to drivers X1+X2. When a home switch is triggered AND the machine is moving in the homing direction the system will enter a homing state. It will suppress further steps to the motor whose home switch triggered whilst continuing to pass thru steps to the other motor. Once both home switches have triggered it will signal home to the controller. The controller will then back away from the home switches, the system will then perform the opposite logic and suppress steps to the motor whose switch releases first until both switches are released then clear home to the controller and return to the normal state.

The system never generates its own steps rather it chooses when to pass through steps from the controller, the hope is that it can sit passively and just do its job without the operator or controller having to do anything special. There will be a configurable max overdrive/underdrive number of steps that if exceeded will fault the estop. It will also be possible to set offsets for each motor home position so that the axis can be squared up without moving proximity switches or targets.

The DDCS has a sensible power domain isolation between the logic and stepper outputs on one side and home/limit inputs and outputs on the other side. My system will honor this isolation, on the switch side using opto isolators on the COM+/- domain. The stepper signal side will have a ground shared with the DDCS logic side, the stepper signals themselves are just 5v differential logic so can be connected directly to the arduino pins.

I've written the code, knocked up the schematic and just made a quick PCB so will assemble and test for when my home switches arrive.

Click image for larger version. 

Name:	dualaxis_schematic.png 
Views:	1133 
Size:	22.3 KB 
ID:	28308 Click image for larger version. 

Name:	dualaxis_board.png 
Views:	1063 
Size:	19.5 KB 
ID:	28309 Click image for larger version. 

Name:	IMG_20200607_124700 (Large).jpg 
Views:	1072 
Size:	106.8 KB 
ID:	28310

There is also a tiny oled screen and a couple of buttons for configuration.

Once I've validated it works as intended the code can be shared.