Custom device with servos based on Eleks-type laser engraver

I’m building a custom device, based on a Chinese Eleks-type laser engraver, bought on eBay, 55 x 60 cm, came with a link to Ben Box software. It’s controlled by Arduino Nano Mega328P (control board pic attached). My device won’t use a laser, nor engrave. It will have a custom manipulator, powered by servos. I’ll use the Eleks frame / steppers for X/Y motion only. I have this software question:

The device will be controlled by software from a PC which will produce g-code (for motion) and servo commands. From what I understand, g-code is really designed for stepper motors, not servos. This means I’ll either need a) two Arduinos, one for g-code, another one for servos, or b) one Arduino, which handles both g-code and servo commands. In case b), I assume I’ll have to take the GRBL or Marlin code, add my servo-handling code, then flash the Nano. Is this smart / doable? Will a Nano memory allow this? If this is doable, what’s a better fit for this: Marlin or GRBL?

Thanks in advance for any help.

http://funkyimg.com/i/2Sccs.jpg

What are you doing with the servos? Are they independent?

There is some support in Marlin for servos. Some bed sensors have servos so you can put in gcode to set a specific servo pin to a specific amount. I’m pretty sure you can do this for more than one servo. So I can see something like this working:

Move to X25 Y55
Set servo1 to 50%
Set servo2 to 0%
Move to X30
Set servo1 to 0%

But I don’t know if you can move the XY and the servos at the same time. I bet you could configure one to be the Z axis (I have seen this on some drawing machines before).

Having two separate controllers is going to be hard, because the one reading gcodw is going to reading a bit ahead and you won’t actually know where in the instructions it is. It has a buffer between the computer and the outputs so it creates smoother movements.

I’m 99% sure the included control board will not be able to handle two more pwm outputs, but a mega/ramps controller should work fine. Your servos aren’t enormous, right? You would take the existing control board and disconnect it, and connect the xy motors to the ramps. If your budget isn’t as tight, the mini rambo is more error proof.

The servo gcode in Marlin is M280:

http://marlinfw.org/docs/gcode/M280.html