I’m working on a torch height controller for a plasma cutter.
No code written as yet as i’m seeking a direction to get the project started, this is the first step.
I need to intercept the step and direction signals form another Arduino (GRBL CNC) and have one of two operations carried out by a second arduino. the signals being received need to be either passed directly through to output pins or ignored and the second arduino produces the step and direction signals.
The idea is that when the CNC plasma table is being jogged, homed etc in its idle state the commands for the Z axis height are controlled by the GRBL controller but once the table/Z axis is positioned and the Arc enable signal is triggered the second arduino then controls the height of Z Axis based on feedback from a sensor.
The direction is simply a case of matching the digital input to a digital output but what would be a good method of doing the same with the step pulses.
I was thinking of using pulse in but i have got it into my head that the wait for pulse operation of pulsein will create a lag in the axis operation which in itself isn’t the end of the world. Perhaps using interrupts would be the more sensible route. How might i achieve it.
I have code written in other working projects that i intend to use for parsing commands from GRBL and driving stepper motors, its this basic step through operation i wish to start with.