Anyone here using Marlin 1.0.0, RAMPS 1.4 and Radio Control Servos?

Anyone here using Marlin 1.0.0, RAMPS 1.4 and Radio Control Servos?

I wanted to test things out with my spare electronics and a servo before changing my Kossel Mini z-probe setup. I’ve got a jumper added to the RAMPS so the servos get power, uncommented #define NUM_SERVOS in Configuration.h and uploaded the code, power cycled, etc.

It’s responding to M280 commands, letting me set a position between 0 and 180 and read it back. But I don’t see anything on any of the PWM pins that would cause servos to turn. I’ve hooked my 'scope up to it, 0 volts, not a hint of a frequency.

Did you check the “Servo Option notes” in the readme at https://github.com/ErikZalm/Marlin/tree/Development?
There are 2 more options, not sure of they are required, though. After you defined those, you should be able to switch between the positions with M401 and M402.

I did. If I uncomment
#define SERVO_ENDSTOPS {-1, -1, 0}// #define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0}
then it won’t even compile the sketch, I get an error “expected primary-expression before ‘{’ token” re Marlin_main.cpp: In function ‘void homeaxis(int)’. error: expected ‘)’ before ‘{’ token. There is a ) before {.

I was hoping to be able to at least turn the servo with M280.

Just upgraded to the Beta Arduino software 1.5.8, it gives more info about the error. Looks like it’s the #define in Configuration.h that’s the problem rather than Marlin_main.cpp…

Dropped the #define statements and added
const int SERVO_ENDSTOPS[]= { -1, -1, 0 };
const int SERVO_ENDSTOP_ANGLES[]= { 0, 0, 0, 0, 70 ,0 };
to marlin_main.cpp. It compiles without issues. Still no output on the PWM ports. I wonder if it could be the RAMPS1.4 or Arduino? @Think3dPrint3d have you done anything with RC Servos? I’m running Marlin_Kossel_T3P3_20140805.

Not touched the servo code at all. You might want to try running a simple servo sketch to confirm the firmware vs hardware issue.

Hm, the latest stable compiled ok for me with those defines in Arduino 1.0.6

I’m not trying to run 1.0.1 yet, still at 1.0.0. I’ll try a simple servo sketch. It that works I’ll have a go at migrating changes in 1.0.0 for the T3DP3D Kossel Mini to 1.0.1

Thanks for the simple sketch idea @Think3dPrint3d , it didn’t work first time, I found a forum post that mentioned the pin mappings for the servos with RAMPS 1.4 (11,6,5,4), changed 9 to 11 and the sketch started working. Checking the Marlin code I found lines including things like defined(SERVO0_PIN). A single line added to pins.h and it’s all working :smiley:

#define SERVO0_PIN 11