Welcome! Log In Create A New Profile

Advanced

Auto Bed Leveling Servo not responding (M280 P0 S80)

Posted by duckfriedrice 
Auto Bed Leveling Servo not responding (M280 P0 S80)
May 04, 2014 08:53AM
Hi All,

I'm building a new corexy printer with auto leveling Z Probe with Z endstop hanging at the end,

and positioned by a 9g RC Servo.

I've been following the instructions on ZennmasterM's blog on the web,

Cables wired to correct pins on ramps 1.4,
5V Vcc jumpered
Marlin firmware adjusted according to the above blog

But when I type in the following code in Prontrface, there's no responce for the servo next to the hotend

M280 P0 S150

My head is blanked and don't have a clue of how to go forward from here.

Please can somebody assist me in getting the servo to work please

Many thanks

---------------------------------------

There's one little remark that I wanted to say,

I'm using the most updated version of Marlin firmware, running it with Arduino 0023 software

I've changed the settings in the RC servo section at the bottom of the configuration.h page

I've tried to compile the firmware at first, but an error came up

Servo.cpp:48:21: error: Arduino.h: No such file or directory

I looked up somewhere on the net and saying that the below commands need to be changed from capital letters to small letters

and it compiled, but can never get the servo to work.

#define NUM_SERVOS 1

#define SERVO_ENDSTOPS {-1, -1, 0}

#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 165,70}

Edited 1 time(s). Last edit at 05/04/2014 09:23AM by duckfriedrice.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 04, 2014 02:52PM
Have you defined the servo pin in pins.h?

Also make sure that the servo pin defines, is included in the ifdefine section that matches your motherboard, I overlooked this and wasted a day on debugging. winking smiley
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 05, 2014 06:08AM
Hi Ralf

What do I need to define in the pins.h file ?

Please help, thanks
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 05, 2014 07:43AM
Search for SERVO0_PIN, and you will find pin definitions for where the servo is connected.

But beware that it might not be included for your motherboard type, if it isn't just copy-paste the defines, to the section with pin definitions for your board.

As for pin numbering I am not sure that I can help, as I have failed to see the logic behind the way pins are numbered in Arduino. I have figured it out on Sanguinololu, as this happens to be what I use.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 06, 2014 11:06AM
I have plugged the 3 servo cables to D11 column of Servo pins as shown in the image below

Ramps 1.4 Servo pin

And I've checked the pin.h page, in line 655


#define TEMP_BED_PIN 14 // ANALOG NUMBERING

#ifdef NUM_SERVOS
#define SERVO0_PIN 11

#if NUM_SERVOS > 1
#define SERVO1_PIN 6
#endif

Is the servo pin number been defined correctly ?

The servo is still not moving at all with M280 P0 S150

There has been an incident that the servo cable was next to one of the stepper cable
and causes the servo to shake up and down continuously,
I have to press the reset button on the ramps board in order to stop it

Please kindly help, I've been stuck with the servo for few days, not making any progress sad smiley
Thanks


----------------------------------

I have a curios question about the capital letter issue of RC servo in the bottom of the configuration.h page in Marlin

Does everyone else who has an auto bed leveling servo with ramps 1.4
have to change those NUM_SERVOS lines into small letters like so, to get the firmware to compile.

#define num_servos1

#define servo_endstops {-1, -1, 0}

#define servo_endstop_angles {0,0, 0,0, 165,70}
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 07, 2014 02:01AM
Define statements are case sensitive, so if you have lower case num_servos, #ifdef NUM_SERVOS won't test true, and the servo code won't be included in the firmware.

I had some issues with the newer Marlin on Arduino 0023, so I moved to 1.0.5, where it more or less worked out of the box.

Apart from that pin 11 sounds right, so if you manage to get it to compile, it *should* work.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 08, 2014 12:12PM
thanks for all the help Ralf

All of a suddent, everything works again

Here is what I've done

1. Update arduino software to 1.0.5
2. Changed the servo defines back to capital letters and successfully compile with the new arduino software

The servo occasionally doesn't work and not responding to M280 P0 S160
I move away some of the messy stepper motor cables away from the servo cable
Reset, and the servo works again grinning smiley

Just curious, is there any other more reliable way in keeping the servo cable away from oyher interference from other electronics in the printer
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 08, 2014 01:58PM
That's good to hear.. smiling smiley

Strangely enough I haven't had any problems with at jerky servo, even though the wires for the servo is strapped together in a loom with the extruder motor, hotend and a pwm controlled fan.

I did at some point enable PROBE_SERVO_DEACTIVATION_DELAY, but not because of a jerky servo, it just seemed like a good idea. So if you haven't enabled it yet, it might be worth giving it a try.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 09, 2014 10:34AM
use a shielded cable to eliminate the interference.. but. I find it hard to believe that this could be the problem.. I have my servo cables bundled with the thermistor, heat element and fan wires all in a cable jacket and it works great.

but like I said, you could use a shielded cable for the long run.. just connect the shield to the GND wire on both sides.

J-F
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 10, 2014 04:50AM
Wohoo

Thanks for all the help in this forum, the printer is finally running

But yet there are few more issues that I'd like to share, good news and not so good news

Good news is, the servo is working i.e. The Servo works with Z homing and G29 command (Bed leveling command)

And the not so good news are as follows:

1. After homing the XYZ Axis the nozzle is moved to somewhere in near the center of the bed
(Around 3cm away from the center), I'd like the nozzle to stop at the XYZ min spot automatically after auto homing

2. Then I tried to start a print - after the bed and hotend heat up to the desired temperature, the printer will start printing right away
It doesn't perform the auto bed leveling - then start to print.


Seeking for help again , really appreciate for the help again grinning smiley

Edited 2 time(s). Last edit at 05/10/2014 06:15AM by duckfriedrice.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 11, 2014 02:01PM
Quote
duckfriedrice
1. After homing the XYZ Axis the nozzle is moved to somewhere in near the center of the bed
(Around 3cm away from the center), I'd like the nozzle to stop at the XYZ min spot automatically after auto homing

You'll probably have to hack the firmware to do that, and most often you'll start printing immediately after homing, so the usefullness of that is pretty limited. I have made a button in Pronterface for home and center, which I have been using while calibrating the endstop, the G code for homing and parking the nozzle at 0,0,0 could be something like:
G28                                ; Home all axes
G29                                ; Preform bed pobing
G1 X0 Y0 F10000                    ; Goto X0 Y0
G1 Z0 F10000                       ; Goto Z0


Quote
duckfriedrice
2. Then I tried to start a print - after the bed and hotend heat up to the desired temperature, the printer will start printing right away
It doesn't perform the auto bed leveling - then start to print.

Normally G28 is sufficient to home all axes, but with auto bed leveling you also need to run G29, so you'll need to add som custon G Code. In Slic3r it under the Printer tab.

Something like:
G28                                ; Home all axes
G29                                ; Preform bed pobing
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
May 11, 2014 03:35PM
Quote
duckfriedrice
Wohoo


1. After homing the XYZ Axis the nozzle is moved to somewhere in near the center of the bed
(Around 3cm away from the center), I'd like the nozzle to stop at the XYZ min spot automatically after auto homing

Hi have you set your hotend to probe Offsets in your firmware?

// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
#define X_PROBE_OFFSET_FROM_EXTRUDER -25
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35

(values shown are for show only. Your values will only be these if you have not set them correctly)
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
June 04, 2014 11:03PM
Hi there, apology for the late reply
I've been out of town for the last few weeks

Yes pdavg, I've gone through the G92 X0 Y0 Z0, and M114 calibration a couple of times

But the Z value is not so consistent.

Whenever I start to print, the Z height is sometimes too low or too high.

Normally I'll let the print carry on for a minute to see if the Z bed move while printing, just to make sure auto bed leveling works.

--------------------------------------------------------------------------------------------------------------------------------

P.S. Just to clarify something, I have followed videos on youtube in setting up auto bed leveling

When I start print, the print doesn't start with auto bed leveling function.

I then figure out to add the G29 command at start of a print when slicing in slic3r - Custom G code.

Then everything works.

So, am I doing this right ? In order to activate auto bed leveling, we need to add G29 in Slic3r when slicing the STL model.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
June 05, 2014 04:36PM
Yes that is correct you must have G29 in the g-code before you start the print. You can add the G29 in Slic3r if you like but what i do is just edit the g-code after slicing and add it myself. Ether way works.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
June 26, 2014 03:21AM
Quote
duckfriedrice
But the Z value is not so consistent.

Whenever I start to print, the Z height is sometimes too low or too high.

The presicion or rather lag of presision, of the SG-90, is very dependent on temperature, so when switching between PLA and ABS, I had problems with the Z-height drifting quite a bit. You can try and grap this:
[www.thingiverse.com]

Before it is patented by Makerbot.

With this I have almost elliminated Z-drift caused by temperature.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
June 26, 2014 12:25PM
ok so i gather servo works because you need the 5v and vcc jumpered, i had z offset problem not with pronterface but with other host software i found out that it was going of my eeeprom settings rather than my firmwares so now when i do any changes i always make sure they saved also to eeprom if you have a lcd


Check my rubbish blog for my prusa i3

up and running
[3dimetech.blogspot.co.uk]
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
August 11, 2014 02:41AM
Twist the wires of each stepper motor into pairs (e.g. red/blue and green/black). Then place those into expandable braided metal sleeving (McMaster-Carr. If you're not in the USA I'm sure you can find a comparable product in your country. Then crimp a wire to earth ground.

Also, ensure the wires of any fans are twisted. An electric drill comes in handy for making twisted pairs...but ensure you pinch the wires near the motors/fans to ensure you do not jerk them out.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
December 22, 2014 04:15PM
I am getting connection errors whenever I move the servo motor. It moves but then teh RAMPS wont respond until I reset. Everything else works fine, I have tested on P0 D11 also, same issue. I have checked the pin.h config and it is correct.

Any help is greatly appreciated.

m280 p1 s20

echo: M301 P22.20 I1.08 D114.00
>>>m280 p1 s70
SENDING:M280 P1 S70
[ERROR] Can't read from printer (disconnected?) (OS Error 6): Device not configured


Pins.h Servo config.:

#ifdef NUM_SERVOS
#define SERVO0_PIN 11

#if NUM_SERVOS > 1
#define SERVO1_PIN 6
#endif

#if NUM_SERVOS > 2
#define SERVO2_PIN 5
#endif

#if NUM_SERVOS > 3
#define SERVO3_PIN 4
#endif
#endif
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
December 23, 2014 02:16AM
Ok, The issue was the voltage pull from the steppers was too much for the RAMPS board and caused it to crash. External power source now works fine.
Re: Auto Bed Leveling Servo not responding (M280 P0 S80)
October 13, 2015 12:34PM
can you post or share the Arduno sketch? i have been trying for a couple days myself to get servo function

Edited 1 time(s). Last edit at 10/13/2015 12:35PM by egghead419.
Sorry, only registered users may post in this forum.

Click here to login