Installing endstops

It’s time for me to document how I wire and test simple mechanical endstops. This is the fourth time I do this, I’ve installed endstops on two Prusa Mendels (i2), on my steel adapto and this time I’m installing them on an aluminium frame single plate Prusa i3.

Reprap FAQ #1

Q: Help! My reprap only moves in one direction!

A: Fix your endstops!

This is by far the most common question I hear from (impatient) new reprappers. If your endstops are misconfigured, installed incorrectly or (most usually) missing most firmware will by default limit the effected axes to only move away from the endstops. It is MUCH easier to just install endstops than to disable them in firmware.

Parts and Equipment


You will need

  • 3 mechanical endstops, mine are the bare bones kind without any PCB or fancy LEDs.
  • Three wire endstop plugs (two wire also work fine). Mine came with my ramps and wiring kit, the wires are 26AWG. If you’re looking to make your own I think the plugs are called 3×1 Dupont pin headers and are .1″ (ugh, inches, that’s 2.54mm).
  • Optional cable wrap to make them look nicer.
  • Printed endstop holders
  • Six M2.5 x 16mm machine screws with nuts and washers or zip ties or glue (hot glue should work nicely) to attach the endstops to the endstop holders. If you use glue it has to work on whatever plastic your parts are printed in, cyanoacrylate (super glue) does not always work on PLA.
  • Soldering equipment and basic tools.
  • Reprap electronics (I used RAMPS) with firmware installed. Marlin or Sprinter are the ones I’ve used.


Useful information about endstops can be found at and,64189

I find mechanical endstops more than good enough for reprap use. Opto endstops (I hear) are prone to errors and fail easily from stray light beams. Hall sensor endstops are high tech but cost more and I’ve never felt the need to test them (donate a set to me if you want me to!).

My endstops have three connectors. They are marked C (common), NC (normally closed) and NO (normally open). You can connect all three or C and one of NC and NO. I recommend always connecting NC. This is because with NC there is a circuit with  signal through it while the reprap is running and not at the endstop. If for any reason the circuit is broken (wire fails or falls off etc.) the endstop is triggered and the reprap should stop (or at least stop moving towards the endstop). Endstops are very simple switches that connect either NC or NO to C depending on whether the switch is triggered or not.

RAMPS has six connectors for endstops, max and min each for X, Y and Z. I recommend only using min endstops and using software endstops (in firmware) to limit movement at the other end of each axis. The endstop pins are grouped on the top right of RAMPS and are clearly marked endstops, X-, Y- and Z- (these are the min endstops, the equivalent max endstops pins aren’t marked and are between/after these). Each has three pins marked S,, +.


If you connect the endstops incorrectly you will end up sending 5V up the USB data line to your computer. This is easily done if you plug the 3-pin plug in reversed. I don’t think this is dangerous (it’s just a signal, not a lot of power) and I also think the USB port is supposed to handle this kind of thing but it will give your computer an error and you will lose the USB port (COM port on windows, /dev/ttyACM0 or similar on linux).

 If you get this wrong on linux run dmesg, you should see an error message maybe something like

[10025599.475353] usb 3-3: USB disconnect, device number 4

On Windows the COM port just vanishes (for me at least) with no error message or anything but pronterface won’t/can’t connect to ramps. If the plugs are wired correctly this is fixed by reversing the endstop plug (your computer might need some time or reconnecting the USB plug to rediscover the port).

What goes where?

Common on the endstop goes to S on ramps and NC goes to minus. With my equipment this is the whole setup:

switch     ramps     wires
1    C      S     blue
2    NC     -     black
3    NO     +     red

The numbers aren’t arbitrary, they are printed on the switch on the corresponding reverse side from NC etc.

Test with firmware first

If you aren’t sure of what goes where or which connector is which on your endstops it’s easy enough to test. Make sure you have marlin installed and that your endstops are set up correctly. In short near you want

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.

Marlin inverts the logic of endstops by default, a pitfall that easily catches the unwary.


Plug in one of your endstop wires to one of the minimum endstop pins (I used X- in the picture) and hook the wires into the endstop (without soldering). Connect to ramps and marlin with pronterface (or whatever host software you prefer) and using the send box at the bottom right (or a custom button with “Endstops” M119, see ) send M119, the gcode command to check endstops. Depress the little lever on the endstop and send M119 again. You should see the status change on the endstop that is plugged in.


You can see that x_min went from open to TRIGGERED. Note the wire colours and orientation of the plug in ramps. If I hadn’t changed X_MIN_ENDSTOP_INVERTING in marlin these would be reversed.

Soldering the wires

Before soldering you might want to measure how long your wires should be and cut them to length. I usually just leave the full 1m of wire on and have loose wires in a bundle near ramps.


Fix the endstop in your third hand, bend the ends of the wires and hook them into the correct connectors. Solder each wire in place.


I don’t use heatshrink here but you can insulate the connectors if you want to. Optionally use 6mm spiral cable wrap around the wires for a prettier look and easier cable management.


The spiral cable wrap is tedious to install, I want to try a different kind to see if that’s any easier.

M3 screws will not fit in the holes in endstops. I’ve tried measuring and suspect that the holes and spacing are in inches (urk, ) but M2.5 screws fit. These are hard to find even here in metric country but I ordered 16mm long ones online, luckily they’re cheap. I like using screws to attach the endstops to endstop holders (these are from the i3 github repo ). Test where you want to install your endstops to choose optimal placement and orientation on the holders.


Testing placement on my alu i3, the Y endstop goes at the rear, see for how and why to place them.Image

The corner of the nateplate will hit the switch nicely!

Posted in Uncategorized | Tagged , , , , | 5 Comments

Bad belt! Bad!

I finally found the cause of my latest reprap woes. My X axis has been acting up and when moving it manually I felt some strange tugging and friction once in a while. This was obvious in some but not all prints where layers were misaligned in X. I had suspected bad lm8uu linear bearings because I’ve found ball bearing balls on the desk near a different reprap with similar issues, changing the lm8uu fixed that one. I lubed the X axis again to see if that would fix the bearings. Extra lube doesn’t hurt as long as it doesn’t drip but no significant improvement.

I’ve been putting off fixing it because the X axis is the biggest pain to disassemble and because I wasn’t sure of the cause. Today by chance I noticed something that hopefully will save me the bother:Image

When I first assembled this i2 I had to pull the X ends apart to get the Z rods aligned. I forgot that the X belt was already installed and pulling them apart tightened it even more. As you can see from the picture I seem to have damaged the T2.5 belts quite badly. These are PU belts with steel core on metal pulleys so they can take quite a bit of punishment but obviously not everything. I clearly have a lot more failure modes to discover in reprap, this one was quite unexpected.

Here’s a final close up of the teeth: Image

Posted in Uncategorized | Tagged , , | Leave a comment

Summer is time to cool down – with marlin’s new parameter

A recent short discussion on irc with EvdZ, marlins lead maintainer led quickly to a nice new change in marlin. Other people have wanted this too so I think it’s time to spread the good news.

We discussed cooling down the bed and hotend after a print. This is something that is typically handled in end gcode, which is configurable in most slicers I know of. In slic3r you can find this in Printer settings -> Custom G-code -> End G-code. My first attempt at cooling the bed and hotend (a year or so ago) was quite simple. From memory:

M106; fan on (you could use M106 S255)
M104 S0; bed off
M140 S0; hotend off
M109 S30; cool the nozzle to 30C
M190 S30; cool the bed to 30C
M104 S0; bed off
M140 S0; hotend off
M107; fans off

The problem with this approach is that while M109 and M140 are documented on the reprap wiki to block until they reach temp the definitive resource for how gcode works is your firmware. It turns out that M109 S30 and M190 S30 only block if temperature is below the target (in this case 30C). I ended up using G4 (dwell, ) for a few minutes before turning the fan off but this was far from optimal.

I’ve only recently started using marlin and noticed first the parameter CoolDownNoWait which would change this behaviour so marlin would block and wait to reach temp also when cooling with these two commands. I considered using it but quickly thought of why not:

It is common to use a slightly higher temperature for the first layer(s) on both bed and hotend to help adhesion. When printing the subsequent layers temperature is set lower (typically at least 5C lower but some use more, YMMV). If I changed CoolDownNoWait this would make firmware wait after the first layer until the new temps were reached. This would make a print take longer and probably cause issues with ooze.

Marlin also has settings to run fans for cooling when temperatures are above configurable levels. I only run fans on D9 on ramps because, as far as I know, you need extra hardware to run fans off other pins. Also I don’t want any fans on for the first layer so even with this hardware that wouldn’t work. Finding more about this is on my long todo list, it would be nice especially for fans designated to cool ramps and the peek on my jheads.

So I had no way to run a fan until everything had cooled down enough in the way I wanted.

EvdZ to the rescue! Luckily I wasn’t the only marlin user with this issue. In no time he published this change “M109 and M190 now wait when cooling down if R is used instead of S.” Under the hood this uses the aforementioned CoolDownNoWait (which I can’t find in the config any more either but I’m not quite sure where it was!).

Before I share my new (experimental) end G-code some tips and warnings: The R parameter to M109 and M190 block until the temperature is reached. This means your reprap will be unresponsive until the command has finished (just like heating up). Make sure you use a temperature you can reach! I recommend a temperature at least 5C above room temp, maybe more. You typically want to wait until the bed is cool enough for your prints to pop off. Do NOT use M190 R0 – unless your bed is in a freezer it probably won’t hit 0C any time soon. Also remember that M109 and M190 are powered in the sense that firmware might turn your heaters on when you get close to the target temp. End G-code is part of your gcode file so this cooling will count as part of your print so you should expect pronterface to report longer print times (even though the actual print takes the same time as before). Worst case you can always reset your electronics with the hardware reset button.

That said this is my new end G-code:

M106; fans on
M104 S0 ; turn off temperature
M140 S0; turn off bed
G28 X0  ; home X axis
G1 Y100; centre Y
M84     ; disable motors
M190 R30; cool down to 30C
M140 S0;
M107; fans off
G1 Y200; deliver unto me my print
M84; motors off

Copy it and revamp as you wish, test it first and use at your own risk. Remove the G28 if you don’t use endstops. The G-codes to use are documented in your firmware, for marlin look here

I would still like to see a G-code that runs fans until a target temperature is reached (from above, for cooling of course). I’m no firmware or G-code expert but something like M106 S255 R30 with the R30 analogous to M109 etc. would be nice (possibly with E-1 to indicate bed temp etc.). The advantage of this is it would more directly adress what I want to do (run fan until cooled down) and the bed can be off while it runs. This isn’t a well thought out proposal but I hope I at least can inspire some improvements in future firmware.

I’d like to finish by thanking EvdZ and all the other open source and open hardware developers whose efforts make reprap the awesome hobby it is!

Posted in Uncategorized | Tagged , , , , , , | 1 Comment

Drinking straws on a reprap?!

Threaded rod can be very abrasive – so much so that I recommend using it as a rasp if you want to smoothen or expand holes (put it in a drill and run the drill ackwards for best effect). One of the major drawbacks of this rasping effect (apart from regular bloodshed when you carelessly brush into it) is to file at any filament that runs against it. On a Prusa Mendel i2 the filament typically runs between the two top horisontal threaded rods. The X carriage drags it back and forth and it rubs against the threaded rod, potentially damaging the filament, creating dust and making an unnecessary noise.


A nice trick I learned almost a year ago (can’t remember from who, kudos anonymous stranger) is to cut drinking straws to size, slit them along the length and put them over the threaded rod as a colourful protection. If you’re lucky you can even get straws in the right colour scheme for your printer though this is much easier if your scheme is red and white!

The picture shows an i2 I’m building. RoTorIT combo Z top (red) and blddk X end motor (white). You can see two of the lm8uu for the x carriage and the 608zz holding the Z drive threaded rod.

Posted in Uncategorized | Tagged , , , | Leave a comment

The current focus for advancing 3D printing

Recently on irc tootights asked: What is the focus currently for advancing 3d printing?

This is a question I’ve asked in different shapes several times. Here is a rehash of answers given on irc, most of them mine. This is opinion, feel free to comment!

i3 was focused on lower cost, lower part count and a simpler, faster build. This is typical of the continuing movement to improve our existing designs in speed, cost and quality. i3 does not deliver any significant improvements in the printable parts even though they can be taller than its predecessors.
Some focus on better part quality, things like vapor treatment and lower layer heights

Aluminatus focuses on higher print speed and “better” linear components (sacrificing cost) for a printer targeted at the more affluent home buyer or cost sensitive business user. I havn’t tried one though I would love to.

4pi is the highest quality latest electronics that I know of targeted at reprap though it has yet to unseat the all but ubiquitous ramps. Smoothie deserves a mention here but I’m not too knowledgeable about smoothie. Its creator describes it as easy to hack to add things in the firmware is the big thing in smoothie, it’s modular, it’s made so you can take parts out, add parts in, very easily it has ethernet too and file-based config, no need to recompile to change your config. This is one aspect I agree with: config changes should NOT require recompile. Current developments in marlin and sprinter are moving in this direction via EEPROM (the M50x gcodes). Rumba explicitly supports 3 extruders.

Lots of people focus on multihead/multicolour/multiextruder options, reprappro is the company I know of that has these commercially available on a reprap.

Very few have tried significantly larger build volume with our current materials, thermoplastics warp even when printing large objects on a “standard” 200x200mm build plate. We see 300x300mm heated beds more often (mendelmax comes to mind) but i would advise to think of these as an option to print large plates (which can lead to costly fails in my experience) rather than large objects.

Some are trying new thermoplastics, taulman nylon, anything with a TLA starting with P (PVA, …) seems to be the rage.

Some people are trying nontraditional materials, ping Eran about clay, jmil for chocolate, sugar and biomedical stuff.

Mendelmax 2.0 brings faster easier assembly compared to MM1.5 and/or MMpro, printers known for sturdiness and rigidity.

I’m fond of the non-cartesian bots, rostock / kossel and reprap Morgan really deserve a mention. There’s a printer that uses polar coords that I like (the idea, not the silly patent) but it’s not a reprap and I havn’t checked if it has succeeded.
I’m guessing the biggest gains can be made in software, not least the software tool chain. There are several competing solutions out there though i so far have stuck to pronterface, slic3r and sprinter.

My pet peeve is an electronics set that does not require soldering skills, preferably with easy connectors not unlike a pc, not to mention better thermistors and hotends that do not require kapton *tape* for mounting. This is maybe one of the hardest issues to communicate to #reprap at least. Soldering is (apparently) easy and doesn’t cost much. Some people don’t want to use the time and money to aquire this skill and I for one consider it an inhibitor to the spread of reprap.
My last big wish would be fireproofing, lots of fireproofing.

This is how i see things in april 2013. Reprap moves very fast, who knows where we’ll be in just a few months. I look forward to finding out!

Posted in Uncategorized | Leave a comment

(0,0,0) – where is the origin?

People who are new to reprap often ask where is the origin on the printer. The correct answer is to follow the right hand rule. Since most people (myself included!) don’t really know what that means and/or tend to then use their left hand to work it out I thought I’d try and explain. My basis for this is my Reprap Prusa Mendel though this should apply to most cartesian bots.Image

Note the blob of PLA ooze at the origin where the head rests when homing.

Z is easy

Z=0 is the point where the hotend is closest to the bed. An acknowledged method to check this is to use a sheet of normal printer paper and get it between the nozzle and the bed until it can be moved with some friction. Preferably in combination with

Back to front or front to back? Y is the problem

The Y axis is the one the print bed is on. The bed moves in Y, the print nozzle doesn’t. This is the cause of most of the confusion around this topic: for the nozzle to move forward the bed must move backwards. The front of the printer is the side where Y is closest to you. Y=0 is where the nozzle is at the front of the bed. This is when the bed is at the back of the printer. Your Y min endstop is at the rear of the printer. It doesn’t matter whether your Y motor is at the front or the back. Some people like it at the rear so they can route the motor wires with the endstop wires. If the Y motor is at the front it’s easier to access to check for overheating etc.

X axis

X=0 is on the left when you are looking at the printer from the front. This is also where your X min endstop belongs. Traditionally this is where the X motor is. Doing this means your X belts are behind the extruder.

Mirrored parts

If you get your X or Y axis wrong your parts will come out mirrored. This can take a while to discover since a lot of prints are symmetric. The best fix for this is to set your printer up correctly. An easier solution if you’re in this predicament is to power off and swap the motor and endstop wires between X and Y. I havn’t tested this, good luck with any ensueing confusion!


Posted in Uncategorized | Tagged , , , , , | 1 Comment

Testing bridge acceleration in slic3r 0.9.9

slic3r 0.9.9 is out ( ) and since I’ve had issues bridging for a long time I thought it was time to methodically test and improve my bridges and to see if I could coax improvements out of my reprap using the new bridge acceleration settings.

Test rig:
Reprap Prusa Mendel i2
jhead mkIVb 0.5mm nozzle (with non-standard thermistor after I broke the original)
3mm natural PLA
heated bed
two 80mm fans across the bed to cool the print
one 40mm fan on the x carriage to cool the vents on the jhead
slic3r 0.9.9
xubuntu 12.04 LTS

It’s still quite cold here in Norway, this winter the room my printer in has been between 14 and 18C, quite a bit colder than is usual in the summer. I’ve had bed adhesion issues because of this and have increased my starting temps from summer values of 175C and 65C to 189C and 69C. Normally I drop down to 170C/60C for the rest of the print.

It’s important to remember that temperature is relative. Temp readings in reprap don’t need to be accurate but we do want precise relative readings. Eg. it’s important that my thermistor can tell the difference between 171C and 173C with decent repeatability but it’s almost irrelevant whether it’s 10C off from the correct temperature. Keep this in mind if you compare with my results!

The standard bridge calibration piece is Triffid Hunters infamous Bridge Torture Test which I absolutely hate :-p

If you read the scad you can see that it is designed for 0.1mm layer heights (aintnobodygottimeforthat.gif) while I print (and test) pretty much everything at 0.3mm. It is tempting (and I’ve done it before) to create an stl of it for 0.3mm LH but everyone uses the provided stl so anything else would be “cheating”.

My first surprise was finding that lowering my temperature to 160C dramaticly improved bridging. At this temperature a few of the strands didn’t droop down immediately. This is way below the “standard” 186C PLA is supposed to print well at but still above my all time low of 140C from my last failed efforts at getting good bridges.

ImageMy acceleration in firmware is set at 1500, down from the default of 2000 (from memory, I hope I’m not mixing things up). After testing with bridge acceleration at 0 (autocompute) I iterated through a choice of values, aiming for something lower than default in firmware (use binary search) to end up at what looks like a good value for me of

bridge acceleration 700

The picture shows some of the test pieces (yes, this took almost a day to do). They are lying on their sides so you can see the numbers I wrote on the feet. Temperature on the right foot, bridge acceleration on the left. The right column were my first tests at my default settings and 170C – where I pretty much wanted to give up and just concede that I can’t bridge. Now I’m quite happy with my 50mm bridges and just hope that no nasty surprises show up in slic3r 0.9.9. I’ve been using 0.9.8 for a while – 0.8.4 was the only version that worked for me before that – and 0.9.9 looks promising so far.

I’m happy with this for now and have no intention of emulating Gibbedy’s mind-boggling bridge:

Posted in Uncategorized | Tagged , , , | 4 Comments