Introduction: Replace Monoprice Select Mini Controller With Arduino Mega & Ramps 1.4

About: I'm a technology tinkerer. I like electronics, 3d Printing, woodworking and arcades.

The Monoprice Select Mini is an inexpensive solid little printer. I have used mine for many hours and made lots of custom improvements to it. At some point the the controller board failed. I contacted Maylan the original manufacturer of the board for a replacement and was quoted at $66 for a replacement ($45 board, $16 shipping, $5 currency conversion). Rather than buy another board that might fail for a third of the cost of the printer I started researching my options.

Step 1: Parts

Many of the kit 3D printers use Marlin on the Arduino Mega and a Ramps 1.4 board to control them. I decided to buy the parts and see if I could set Marlin up to talk to the Monoprice's existing hardware. Marlin is an open source firmware that is easily compiled and deployed to an Arduino compatible board. The configuration in Marlin is well documented and easy to update. You can find many people selling the parts you need in a single kit in the $30 - $40 dollar range on Amazon (http://amzn.to/2kXxSRq) or Ebay and if you part out the individual pieces you need on places like aliexpress.com you can often get it for even less but you will wait since most of these will be shipped to you via China Post.

These are the basic parts you need to do this project:

Step 2: Wiring the Endstops and Thermistors

The spacing of the headers on the ramps board matches the spacing of the holes in the connectors for the Monoprice controller. I was able to use the existing connectors on the stepper motors but things were too cramped for the connectors on the endstops and the thermistors. I clipped the connectors off and soldered in some breadboard connectors I had from other projects (http://amzn.to/2kXJeoz). I retained the yellow cable labels and used the same colors for the wires. I used some shrink wrap tubing (http://amzn.to/2kXD5Zp) to keep everything looking nice. Using the longer wires also had the advantage of extending the board out so I can figure out a way to mount it next to the printer.

The ramps board can support having and endstop at the origin and the end of the run. They are arranged on the ramps boards as X-Origin, X-End, Y-Origin, Y-Origin, Y-End, Z-Origin, Z-End. The Monoprice printer only has origin endstops so you will want to put the X,Y,Z endstops at the 1st, 3rd, and 5th positions on the ramps board. The ramps boards supports powered 3 pin normally closed endstops but the Monoprice uses normally open 2 wire endstops. So you will be wiring just the top 2 pins for your endstops.

The thermistors on my board are wired T0 T1 T2. The A thermistor is the hotend thermistor and goes to T0, the B thermistor is the bed thermistor and goes to T1.

Step 3: Wiring the Stepper Drivers

The steps are configurable on the ramps board with jumpers. If you don't set them to match the Monoprice stepper motors you will get scaled prints. You can see how much smaller the raft for the cat print was before I fixed the jumper settings for my DRV8825 stepper drivers.

By trial and error I've determined that the Monoprice board had the steps set to 1/16th steps. Depending on which stepper drivers you picked or got with your kit you will need to adjust the jumpers. The jumpers are located under the where the stepper drivers go. The jumpers are numbered 123 from left to right when the blue and green connectors are on the left. For the A4988 drivers you need all 3 jumpers in for 1/16th steps, and for the DRV8825 stepper drivers I used just the 3rd jumper is set for 1/16th steps.

There is a variable resistor on the drivers (potentiometer). We will use this later to limit the current to the motors. The A4988 potentiometer faces away from the potentiometer and with the DRV8825 they face towards the power supply.

Step 4: Wiring the High Current Bus

I clipped the connectors off of the fan, heated bed, and the hotend cartridge and they get wired on the blue bus connectors. The top is the hot end, the middle is the fan, and the bottom is the bed. I needed to extend the wires of the heated bed as well. Be sure to splice in some wire with the same gauge or higher if you do that. I also left the yellow labels to help know which is which.

If you want to use the same power supply you can also cut the connector and splice in some longer wires to the ramps board. I didn't trust the cheap power supply that came with the printer so I've been using the 203W Xbox 360 power supply I found at Goodwill for $3.99. (You can also find them at GameStop for about $7 - $15) The green connector is the input power. The bottom and top are paired ground and power. Starting with the bottom as ground it's ground, power, ground, power. With my power supply I have multiple power and ground and have both wired. The Monoprice power supply only has two wires. You maybe be able to only wire the bottom two but if you want to put power on both rails you could wire the bottom two and jumper over the other rail.

Step 5: Wiring the Stepper Motors

I just pushed the existing pins into the X,Y,X & EO headers with the green wire facing the power supply side. There was plenty of room for these connectors so I didn't have to clip them.

Step 6: Marlin

To install Marlin on the Arduino board I used a Windows 10 compter. I'm guessing that doing the same on a different OS is going to be similar. The Marlin software is hosted on GitHub and is easily deployed to your Arduino Mega via a free development tool Arduino IDE. Get the Arduino IDE from here https://www.arduino.cc/en/main/software and install it.

You will need to select the Arduino/Genuino Mega or Mega 2560 board from the Tools -> board drop down. You should check mark icon (verify) to verify it compiles. My Ardiono IDE was all setup to do this but you may need to install some things to get to this point. There is plenty of Instructables to help you do that.

Next you will need to get the Marlin code to edit in Arduino IDE. I forked the latest release from Marlin so that I could submit my changes and get them later if I need to. You can do one of 2 things, you can download the source from Marlin and make the same edits that I did or download my copy of the source and use my edits.

My version: https://github.com/JeffInMadison/Marlin

Marlin source repo: https://github.com/MarlinFirmware/Marlin

If you download the latest from Marlin these are my edits. Be aware the line numbers will likely change.

In Configuration.h: (Line numbers are approximate)

  • Ln. 133 Make sure MOTHERBOARD is BOARD_RAMPS_14_EFB
  • Ln. 252 Set TEMP_SENSOR_0 to your extruder sensor type. The stock bead thermister should be 11 (I have an E3D v6 with a cartridge thermistor so mine is set to 5)
  • Ln. 256 Set TEMP_SENSOR_BED to 11 for the stock bed thermister
  • Ln. 289 Set HEATER_0_MAXTEMP to somthings smaller than 275 to not destroy your hotend. I used 250
  • Ln. 293 Set BED_MAXTEMP to something smaller to keep the bed from getting too hot. I used 100
  • Ln. 456 X_MIN_ENDSTOP_INVERTING, Y_MIN_ENDSTOP_INVERTING, Z_MIN_ENDSTOP_INVERTING to true. Leave others false
  • Ln. 489 #define DEFAULT_AXIS_STEPS_PER_UNIT { 93, 93, 1097.5, 97 } from http://mpselectmini.com/extruder_calibration
  • Ln. 690 INVERT_X_DIR false, INVERT_Y_DIR false, INVERT_Z_DIR true Ln. 723 Set X_MAX_POS 120, Y_MAX_POS 120, Z_MAX_POS 120 to match the size of the Monoprice bed size so we don't travel past the limits
  • Ln. 915 uncomment the #define EPROM if you want to be able to update and write to the EPROM.
  • Ln. 1109 uncomment #define SDSUPPORT to enable the SD Card
  • Ln. 1091 uncomment #define DOGLCD if you bought a 128x64 LCD panel
  • Ln. 1267 uncomment #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER if you bought the same LCD I did

Now to enable the full graphic display you need to add another library to your Marlin sketch to draw to the screen. Download the .zip file on this page: https://bintray.com/olikraus/u8glib/Arduino

In Arduino IDE go to Sketch -> Include Library -> Add Zip Library... and pick the zip file you downloaded.

The high power D9 pin on the Ramps board seems to be intended for a parts fan blowing on the printed part and not an extruder fan in their default setup. If you have a setup with an extruder fan like the stock hotend or the E3d v6 like I have you'll want to change this a little.

In pins_RAMPS.h:

  • Ln. 168, change FAN_PIN to -1 to disable it.

In Configuration_adv.h:

  • Ln. 220 #define E0_AUTO_FAN_PIN 9 instead of -1

This will turn on the fan on D9 when the temperature of the hotend gets to 50c and will turn off when it falls below 50c.I would keep compiling with the verify button as you go to make sure you didn't break anything and can easily back up and check.Now press the upload button to deploy the firmware to the Mega board.

Step 7: PID Auto Tuning

Once I got to the point where the firmware was flashed to the board, I wanted to run the M303 command to autotune the PID instead of taking the default Ultimaker settings. I used Pronterface (http://www.pronterface.com/) to connect to the printer and run M303 to auto tune the hotend. After it runs it will output a Kp, Ki, and Kd for you to put in the Configuration.h like this:

  • #define DEFAULT_Kp 26.15
  • #define DEFAULT_Ki 2.74
  • #define DEFAULT_Kd 62.35

Then I ran the "M303 E-1 C8 S60" to auto tune the heat bed. By default the bed was in a bang bang mode that turned it on when it was below the set temp and off when it went above the set temp. In Pronterface you could see a pretty ugly saw wave it made. Once I ran the autotune and used those values it was a nice slope to the value and stayed right on the temp. My stock bed values looked like this:

  • #define DEFAULT_bedKp 231.09
  • #define DEFAULT_bedKi 45.21
  • #define DEFAULT_bedKd 295.34

Step 8: Final Tweaks

After publishing this Instructable and using the setup for a while I have a few more tweaks to post.

First is that to enable the SD Card you have to uncomment the #define SDSUPPORT around ln 1120 in Configuration.h to be able to print from the SDCard. There is also a #define SPEAKER too to use the speaker next to the knob.

I also discovered the default direction and steps of the rotary encoder were kind of wonky. You can still get around but it doesn't exactly behave as you'd expect with respect to direction. For the LCD that I bought I needed to change the direction of the encoder and the menu to get things to move in a logical direction. I also added individual axis homing.

  • uncomment #define REVERSE_ENCODER_DIRECTION

  • uncomment #define REVERSE_MENU_DIRECTION

  • uncomment #define INDIVIDUAL_AXIS_HOMING_MENU

Printing higher temperature filament like ABS would trigger the max temperature fail safe so I had to adjust that to a higher temp. I chose 260 in Configuration.h with this line.

  • #define HEATER_0_MAXTEMP 260

I upgraded my extruder assembly with this all metal one (http://amzn.to/2omeYEI) and the gear was a different size so I had to adjust my extruder steps. I extruded and measured filament several times and did the math to zero in on 99 steps for my extruder and gear and updated this code in Configuration.h to reflect that:

  • #define DEFAULT_AXIS_STEPS_PER_UNIT { 93, 93, 1097.5, 99 }

The heater bed in the Mini isn't the fastest at getting up to speed and I found that Marlin would detect an error happened fairly often so I increased the time it waited to detect a problem a little with this line in Configuration_adv.h

  • #define THERMAL_PROTECTION_BED_PERIOD 45 // Seconds

Lastly I printed the parts for this LCD Cover http://www.thingiverse.com/thing:2133588 and moved the LCD into the machine. The pints on the bottom of the new controller didn't fit the pins of the Monoprice controller so I found some bushings to attach to the bottom of the Arduino Mega to keep the pins off the metal plate and found a enough space to put everything in and re-attach the bottom plate.

I have a Raspberry Pi mounted on the back of the printer that I use Octoprint with to control my printer. I drilled out a hole in the back by the power connector to run the USB cable out of the new controller up to the Pi. If you make the same modification I would disconnect the whole controller and move it away from the printer to make sure you don't drop metal shavings into your new controller.

After all this the printer is back in business. And to be honest I think it prints better prints than before and there are more protections from thermal runaway in the Marlin firmware than the one that shipped with the Mini.

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017