RAMPS 1.4 servo code trouble

I recently purchased a mega 2560 with RAMPS 1.4 to tinker with. I am perplexed trying to program a servo to run on the board. Currently I am trying to run the sweep example code. There are 4 servo ports on the board associated with pins 11,6,5, and 4 (I believe). I cannot get them to run my servos. I can run the example code on all of my other arduino boards. The blink code runs so I know the board is alive and well. I am aware that I have to set an enable pin low to play with the stepper drivers on this board. Is there an enable for the servos? I have tried all four ports and pins. I have verified power and ground. I don't have a scope to check the pulse on the servo pins.

Update - I tied an LED with a 220 ohm resistor across the servo port and it has a shifting glow just as it should with a changing PWM signal. It looks like the code is working. The signal must be too low a level. + on the port measures 5v. My other arduinos move this servo. I would think that RAMPS would be more powerful rather than less since it is designed for driving 3D printers. I have powered the RAMPS unit with 12v from an external power supply just to make sure it wasn't lack of power from the USB connection. Does anyone here have experience with RAMPS 1.4 shields?

Do you mean "servo" or "stepper"? The RAMPS board is normally used with stepper motors. You don't need any extra board to use servos with an Arduino.

If you are using stepper motors please post a link to the motor datasheet and tell us what stepper motor drivers you are using with the RAMPS board.

...R

I mean servos. I am not having any problem with steppers on the board. The RAMPS 1.4 board has 3 pin headers for 4 servos.

Can you post a link to the datasheet for the RAMPS board so we can see how the servo connections should be used?

...R

The datasheet information can be found at RAMPS 1.4 - RepRap
Since I am pretty sure that my code is working (see comment about glowing LED) I think I will post in the electronic section. I am thinking that it must be a signal level problem. I need help from someone more familiar with this hardware.

I can see no reference to servos in that link. If I have missed it perhaps you can post the relevant piece of text.

There are some 3 pin connectors on the board but they seem to be for end-stop switches.

...R

Have you checked that there is power on the 3-pin servo headers? I can't find a 5V regulator on the RAMPS board. If it is drawing 5V from the Arduino then there won't be enough power for more than one servo. I think you need to supply +5V from somewhere.

Yes. The RAMPS shield was designed to drive multiple stepper motors and watch multiple sensors for 3D printers. It has 16 amps of dedicated power. It is driven by a mega 2560 which supplies the brains. I am not using it for those purposes. I want to play with it. Hence I am more interested in the 4 servo ports right now.

I brought home an oscilloscope from work today to check the signal tonight. The signal off the RAMPS is 20 ms with a duty cycle between .5 and 2.5 ms just as it should be. The scope shows the voltage of the signal at 4.5 volts.

I put the same code on an UNO and the signal is identical. The only difference is that the servo will run on the UNO but not the RAMPS. I can't get my head around this. All code and circuits aside, the same signal should trigger the same result.

Robin2:
I can see no reference to servos in that link. If I have missed it perhaps you can post the relevant piece of text.

There are some 3 pin connectors on the board but they seem to be for end-stop switches.

…R

Note the servo header pinout notes lower left. The servo headers themselves are closer to the bottom center, but the notes are lower left of the diagram.

Image from Reply #9 so we don't have to download it. See this Image Guide

...R

Thanks. I had not noticed those pins. However I can't see any instructions about how you control those servo connectors with an Arduino.

This list of pins does not mention servos

// For RAMPS 1.4
#define X_STEP_PIN 54
#define X_DIR_PIN 55
#define X_ENABLE_PIN 38
#define X_MIN_PIN 3
#define X_MAX_PIN 2

#define Y_STEP_PIN 60
#define Y_DIR_PIN 61
#define Y_ENABLE_PIN 56
#define Y_MIN_PIN 14
#define Y_MAX_PIN 15

#define Z_STEP_PIN 46
#define Z_DIR_PIN 48
#define Z_ENABLE_PIN 62
#define Z_MIN_PIN 18
#define Z_MAX_PIN 19

#define E_STEP_PIN 26
#define E_DIR_PIN 28
#define E_ENABLE_PIN 24

#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13

#define FAN_PIN 9

#define PS_ON_PIN 12
#define KILL_PIN -1

#define HEATER_0_PIN 10
#define HEATER_1_PIN 8
#define TEMP_0_PIN 13 // ANALOG NUMBERING
#define TEMP_1_PIN 14 // ANALOG NUMBERING

...R

systemslave:
It has 16 amps of dedicated power.

It has a 16A TWELVE VOLT supply. There is no 5V regulator on the RAMPS shield. It feeds 12V to the Arduino MEGA and gets 5V from the +5V pin. The regulator on the Arduino MEGA is probably limited to about 1A which might be enough to run one servo but not two.

systemslave:
The scope shows the voltage of the signal at 4.5 volts.

I'd be more interested in how the 5V supply pin behaves under load from the servo.

systemslave:
I put the same code on an UNO and the signal is identical. The only difference is that the servo will run on the UNO but not the RAMPS. I can't get my head around this.

How is the servo powered when you use the UNO?

I power the UNO with a 2.2 amp 8-20V power supply. The UNO is a Freeduino so it has servo headers for all of the pins. Very nice to have power, common, and signal pin sets for every pin. It makes wiring very clean.
freeduino.jpg

@Robin2
The pins are 11, 6, 5, and 4. You will see them referenced in the diagram.

Solved thanks to johnwasser. I didn't know that the power for the servos required a jumper! John rightly saw that I had a current problem. I went looking in the docs and found this...

The 5V pin in that connector on RAMPS only supplies the 5V to the auxiliary servo connectors. It is designed so that you can jumper it to the VCC pin and use the Arduino's power supply to supply 5V for extra servos if you are only powered from USB or 5V. Since there is not a lot of extra power from the Arduino's power supply you can connect it directly to your 5V power supply if you have one. You can also leave this pin not connected if you have no plan to add extra servos.

So, I jumpered the indicated pins and had the full power of my ATX supply which I have hacked into a very nice benchtop power supply. Thank you John! I did not know that I needed to add a jumper to get access to my power supply on the servos.

The board is very much fun now. It will run 5 steppers and 4 servos plus a hand full of sensors.

I finally found this paragraph about servos in the link in Reply #5

The 5V pin in that connector on RAMPS only supplies the 5V to the auxiliary servo connectors. It is designed so that you can jumper it to the VCC pin and use the Arduino's power supply to supply 5V for extra servos if you are only powered from USB or 5V. Since there is not a lot of extra power from the Arduino's power supply you can connect it directly to your 5V power supply if you have one. You can also leave this pin not connected if you have no plan to add extra servos.

It was carefully hidden in a section headed "Power Supply"

It looks like it may be relevant to your problem.

I still can't see any reference to Arduino pins for operarting servos - but if you know they are there it does not really matter.

...R

My thanks to you as well Robin2.