Quote Originally Posted by devmonkey View Post
I squared the gantry today. I used the method of equalising diagonals. First I had to make a measuring stick:

Click image for larger version. 

Name:	IMG_20200628_114528 (Large).jpg 
Views:	243 
Size:	127.7 KB 
ID:	28479 Click image for larger version. 

Name:	IMG_20200628_114714 (Large).jpg 
Views:	268 
Size:	132.1 KB 
ID:	28480

Then I had the machine drill 4 holes in a rectangle and inserted dowel pins, zero'd the DTI on one diagonal then measure the error on the other. The arduino board I made for axis squaring only had 8 bits of step offset. This machine uses 1610 screws and 16x microstepping so 8 bits represents 255*10/(200*16) = 0.8mm of software correction to the limit switch. Therefore I had to get it close first by moving the proximity sensor targets first, I got the diagonal error down to 0.32mm.

Fine tuning squareness was then done by changing the offset in the arduino code. After lots of messing around trying to calculate the gantry error angle then the actual number of steps to offset one switch I gave up. I just drilled holes with offset at zero, then with offset at 255, then interpolated the two errors to get the 'correct' offset (note this is not the correct way to do this but it works well enough over these very short distances). Plugged this into the software and low and behold:
Click image for larger version. 

Name:	IMG_20200628_161145 (Large).jpg 
Views:	234 
Size:	132.5 KB 
ID:	28481

0.01mm error over ~1000mm diagonals. Square enough for now, it is repeatable. Can't do better than that without a much better DTI and some measurement of backlash.

Annoying sources of error whilst doing this were 1) a dowel pin that got scratched up pulling it out with pliers, 2) not having the DDCS home twice, this made it a little more consistent, don't know why.

I also noticed that the EM806 stall detection is not working for a stalled start, it works fine if you stall a spinning motor. Is this something I can tune or is it just a limitation of sensorless stall detection?
I think that stall detection only works if the motor speed is greater than 300 rpm - so won't detect a stationary, stalled, motor. Unfortunately...