Prusa Mendel build update #5: installing the electronics, wiring up motors, HBP + thermistor, endstops and tweaking Marlin

Posted on July 16, 2013 in 3D printing

Once the frame had been assembled and tightened, and the build platform was assembled, the next logical step for me in constructing my Prusa Mendel 3D printer seemed to be to install the electronics board and wire up all the stepper motors. This involves attached the electronics board to the frame somehow, then wiring up all of the various electrical bits and pieces using lots and lots of zip-ties.

Installing the RUMBA board

RUMBA boardI chose to go with the RUMBA controller board for the brains of my 3D printer, due to the fact that has a relatively huge potential for future expansion. The “standard” controller boards (RAMPS, Sanguinololu, etc.) work, but are all limited to only a single extruder.

The RUMBA board has the ability to control up to three extruders, as well as read up to 5 thermistors. On top of that, it has tons of extra breakout pins so I can connect an SD card and an LCD display, or even have access to low-level functionality on the on-board ATMega2560 like I2C, PWM and ADC. Pretty tough to beat, in my opinion!

To install my board, I chose to create a really basic 3D-printable frame using OpenSCAD (printed in yellow). I use short M3 bolts and nuts to attach the RUMBA to the frame, then small zip-ties to attach the frame to the printer’s frame. The frame isn’t quite perfect yet, but I will release the files on Thingiverse when I’m happier with it.

Providing power using an ATX power supply

To power my printer, I chose to use a 400W ATX power supply due to their relatively high current capability and low cost. The entire printer runs off +12V, but the board does require two connections to +12V for safety (one is run through a 5A fuse, while the other goes through an 11A fuse).

To get an ATX power supply to provide power without being connected to a computer’s motherboard, you need to use a jumper wire to ground the “PS On” pin of the motherboard connector (pin 14) to ground (pin 15 is one).

Installing the heated build platform’s thermistor

In order for the RUMBA controller to maintain a constant temperature using the heated build platform, a thermistor (temperature sensor) is used to read the temperature in real-time. The heated build platform has a small hold right in the middle of it just big enough for a thermistor to slide into, so I drilled a corresponding small hole in the middle of my wood base (to which the heated build platform is attached) for the thermistor to be secured to.

I soldered a long jumper cable to the two leads of the thermistor and used heat shrink tubing to make sure that the leads don’t touch. Duct tape is then used to hold the thermistor wires in place as the thermistor itself is pushed through the small hole into the heated build platform.

Wiring up the stepper motors

With the RUMBA board strapped onto the frame, each of the 5 stepper motors need to be connected to it. I received a bunch of awesome pre-assembled cables when I purchased the RUMBA, which I used to connect to each of the stepper motors. To make it easier to do maintenance, upgrades and re-arranging in the future, I opted to use terminal blocks to connect these cables to each of the motors.

Each of the steppers that I used had 6 wires, so I had to first find figure out which of the wires were pairs and which of the wires weren’t important. The RepRap wiki has a decent article on how to do this.

Turning everything on for the first time

Once everything was wired up, I turned on the ATX power supply, expecting to need to connect to the printer through my computer to start testing things out. However, the RUMBA board apparently comes pre-loaded with firmware that automatically moves each axis a few millimeters in each direction so you can test everything right out of the box. Very helpful, but would’ve been nice to know this before I turned it all on!

I was pretty excited to see that every motor moved just fine as soon as power was applied, so I made a video!

Customizing the firmware

Obviously I didn’t want my printer to just start moving all on it’s own every time I turned it on, so I grabbed a copy of Marlin, a very popular firmware package that can be uploaded to the RUMBA board (and almost any other 3D printer controller). Marlin is completely open-source and very well supported by the RepRap community, so it turned out to be much easier than I was expecting to dive in and alter settings.

First, I followed the instructions listed on the RepRap wiki to add the RUMBA board to the Marlin source code and tell Marlin that I want to use it. As soon as this was done, I was able to compile and upload Marlin to my board using the Arduino IDE.

I used Repetier Host to connect to the RUMBA board and take manual control of each of the motors. Everything worked! The belts needed to be tightened just a little bit, but I’m very happy with how well it worked anyway. Here’s how that went:

I realized that I want to invert both the Z axis and the X axis to reflect what was intuitive to me using the printer. This was as simple as changing a couple of values in the Marlin configuration.

Next I updated the steps per unit (DEFAULT_AXIS_STEPS_PER_UNIT) using the formulas from the RepRap wiki page for firmware calibration. A user from the RepRap IRC room helped with this, but I forgot his name! This update made sure that every time I told my printer to move 10mm along an axis, it would move 10mm and not some other amount.

Installing the min endstops

To get the printer to understand where each of it’s axes minimum and maximum points are it needs some sort of feedback once it has reached that point. I chose to use mechanical switches that have been strapped onto simple printed clamps that can be easily installed on the smooth rods of each axis. When the axis moves, it eventually hits this switch and tells the machine to stop moving that axis’s motor. I chose to only install the min endstops, as these are almost always used at the very beginning of a print to get the printer to “reset”. The max endstops are just used to prevent catastrophic errors, and I don’t necessarily need them right now.

There are TONS of solutions for mounting endstops, but I particularly liked these super-simple endstop clamps that I can attach my switches to using a zip-tie.

To get the switches to work, I had to modify the Marlin firmware to disable inverting of the switch logic. I was very happy to see that Marlin makes use the ATMega2560’s internal pull-ups, meaning I only had to solder up the jumper cables to the switch directly and didn’t have to fuss with adding a resistor or anything.

After wiring up each endstop, I used Repetier Host to home each axis and stop as soon as they hit their endstops. Success!