The easiest/quickest way to control Stepper Motors is by using generic 3D printer boards/shields.
These circa £6.00p boards can control up to 5 Stepper motors + 3 FET power outputs.
This Shield simply piggybacks onto an Arduino Mega.
Each stepper requires an A4988 (circa £1.00p/module)
The A4988 is a micro stepping driver for controlling bipolar stepper motors.
You can control the stepper motor with just 2 pins from a controller.
The step increment of the Stepper is set by placing shorting links, in the case below you see 3 links enabling the Stepper to Step in 16th increments.
Please also note the two added 150 ohm resistors (top left), these simulate two temperatures (hot end and hot bed). These are required as they allow the Software to bypass the Temperature failure routines.
Without jumpers the step increment defaults to single stepping.
MRL integration :-
In a nut Shell , To control the Steppers >>>Send them G-Code via a serial link.
There are 2 things to setup in the Marlin configuration.h tab to get you up and running.
either :- #define BAUDRATE 115200 (works ok if you are using the Webgui)
or :- #define BAUDRATE 57600 (seems to be the default of Generic MRL Gui)
Depending on what shield you have it has to be set up accordingly, the generic board above is a Ramps style.
// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
#define MOTHERBOARD 33
Save and upload Sketch to the Mega.......
From then on the system is live.
As a quick test this G-Code command will move the X axis Stepper 12 Steps :-
G0 X12 ; move 12 Steps (absolute) on the X axis To send this using the WebGui serial monitor it has to be converted to Hex :-
47 30 20 58 31 32 0a
the 0a at the end (LF linefeed) is all that is nessesary to terminate the command.
Paste this into the Serial "send" box and provided you have specified "hex" protocol in the dropdown list the G-Code command will be executed and the Stepper will fire into action.
This is just an intro into Stepper control via MRL, ultimately the G-Code commands can be sent via a Python sketch within MRL.
The gif graphic at the start of this writeup is an example of how this can be achieved using a "PS4" controller to control the Steppers.