For my upcoming experiments I wanted to use a servo with Marlin (firmware). Setting up to 4 servos with Marlin and Ramps board it’s pretty easy. Follow the next steps and you will be ready to go.
But first, I hope you’ll enjoy my demo project, a Fork And Place for candy!
First, set a jumper to supply 5v to the servos. Left side of the reset button connecting the two first pins. And connect the servo to one of the four connectors in the right side.
Next, config Marlin to enable the servos.
Go to Configuration.h and uncomment next line adding the number of servos you want to use:
#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
Last, edit your GCodes to use M280 PX SX whenever you want to control your servos (P for selecting your servo number and S for the position of it).
And be aware that your G-MOVES aren’t going to wait for your servos positioning, so you might need some delays (G4).
As an small example i built a Fork and Place system based on a servo and a toothpick. Basically the servo moves a piston holding a toothpick. Here some closer pictures: