I've done that with A4988 drivers:
Remove the plastic part that holds the pin headers.
Unsolder the V
mot and GND pins
Now solder wires to the empty pads or solder the pins from above.
Connect V
mot and GND to 24V
Connect both powersupplys GND to have common ground.
Enjoy the silence