True Bed Leveling (Tramming)

My current printer uses a proximity sensor with auto bed leveling enabled in Marlin (does not work very well.)
My new printer I would like to use 4 small Z Steppers with their own endstops for bed leveling.

Hardware
Arduino Mega 2560 with ramps 1.4 running Marlin.
With 1X, 1Y and 2 Extruders

Arduino Uno with CNC Shield running my firmware for True Bed leveling.
With 4X Z Steppers

My Question is
Can I use digitalread to read the output from the Z driver socket in the Mega and the digitalWrite on the 4 steppers on the Uno.

My goal is when home is called the Mega tells the UNO to run the leveling sequence then the Uno to take the Z movements from the Mega

oldtimmer:
My Question is
Can I use digitalread to read the output from the Z driver socket in the Mega and the digitalWrite on the 4 steppers on the Uno.

I think the safe answer is NO.

I guess it may be possible to have the stepper pulse from the Mega cause an interrupt on the Uno and the Uno could then cause steps to happen on the 4 motors. I think you would need to use an interrupt to react quickly enough to keep things in sync.

You will also need to detect the Mega's direction signal.

You should probably also use the digitalWriteFast library for better performance.

You will need to experiment to see if you can get a system like this to work.

Rather than use 4 z-axis motors I would be tempted to use 3 subsidiary levelling motors which are operated by the Uno whn levelling is required but which have no impact on the normal vertical movement during printing.

Or just manually level the bed :slight_smile:

...R

Thank you for the reply.