Adding a Raspberry Pi to my 3D printer

Now that I have my 3D printer running reliably and the RAMPS 1.4 mounted I want to disconnect it from my laptop. At the moment every time I want to print something I need to connect my laptop and leave it connected for the duration of the print. There is an option to add an SD card reader to the RAMPS but that would also require adding a control panel to the printer. It is cheaper to add a Raspberry Pi.

I have been using OctoPrint software on my laptop which also has a pre-made Raspberry Pi ROM called OctoPi that can be loaded directly onto a Pi. OctoPi is designed for a Raspberry Pi 2B or 3B and offers camera support out of the box. Since I am on a budget I decided to just use a Raspberry Pi Zero W. There is several reports of OctoPi not running on a Zero W mostly because the single core processor can’t support running the server and the camera streamer simultaneously. Since I don’t even have a suitable camera I don’t think this is a problem.

After loading OctoPi and running through the setup the printer worked first time exactly as it did from my laptop. The next problem is that I wan’t to print directly from my phone. OctoPi has an option of adding a slicer plugin on the Pi and while looking through the options I came across AstroPrint. AstroPrint is a cloud-based 3D printing system that includes a selection of slicers. Files are uploaded to AstroPrint, sliced in the cloud and then sent to OctoPi via a plugin.

For quick prints of simple models AstroPrint works well enough but if the model needs some fancy slicing then it is better to use a desktop slicer. AstroPrint also does not include many options to control the printer so I still need to use the OctoPi web interface or an android app.

The next problem created by adding the Raspberry Pi is that it needs a seperate 5V power supply as the RAMPS cannot supply enough current for the Raspberry Pi and the Arduino. Now I have 3 power supplies plugged into the printer, a 19V, 12V and now 5V.

Converting Up Plus 2 to run off of a RAMPS 1.4

With the mechanical repairs done to the old Up Plus 2 I was given I can start on replacing the controller board. The old board had a faulty Y stepper motor driver and wasn’t compatible with the thermistor in my new hot end so I am fitting the printer with the controller from my old printer.

There are several guides on the internet about how to setup and commision a RAMPS 1.4 board in a new 3D printer and I don’t feel like writing my own so I will go over the basic steps here. If you need a more comprehensive guide I would suggest starting here.

  1. Load the latest Marlin firmware onto the Arduino and load OctoPrint onto my laptop and verify that the two can connect to each other so I can use OctoPrint to control the printer.
  2. Connect the endstops to the RAMPS and use the M119 Endstop Status command in the OctoPrint terminal to verify that the endstops work. The Z endstop was connected to the Upper Z Endstop port and the Z probe connected to the Lower Z Endstop.
  3. Connect the motors (while powered off) and check motor direction is correct. I manually moved to carriages to their centers by hand and then jogged the motors 10mm using the OctoPrint controls to check the direction. Since the Z axis is belt driven and falls under its own weight if the motor is off I had to hold it in my hand before driving it. The directions were corrected in the Marlin firmware configuration.h file before reflashing the firmware and trying again.
  4. Check the motors home correctly. This was done with the Ups original magnetically attached Z probe stuck onto the X carriage bracket. I had my hand on the power switch before triggering the home button so I could power off the machine if the motors started homing in the wrong direction. Only the Z axis was wrong and this was corrected in the configuration.h file.
  5. Check each axis Steps/mm setting is correct by measuring starting distance of each axis’s carriage in relation to the printers fame and then using OctoPrint to move the axis 50mm and measuring the real world movement. I found that the Marlins default 80 steps/mm matched the X and Y perfectly and didn’t need adjusting so I set the Z axis to the same 80 steps/mm.
  6. Added the dimensions of the bed into the firmware.
  7. Set Z-probe pin to be the same as the Z endstop and measured and entered the Z probe offset from the nozzle. I also enabled Safe_Z_Homing at the center of the bed as the Z probe was not homing over the bed. Verified with G28 command.
  8. Set Auto_Bed_leveling_Linear in the firmware using 3 points per axis.Verified with G29.
  9. After running G28-G29 I used OctoPrint controls to move to the center of the bed and lowered the nozzle close enough to the bed surface so that a piece of paper could barely fit between the nozzle and the bed. Then I used M114 to read the current position and calculate the correct Z-Probe Z offset and updated the firmware. I like to keep the firmware up to date rather than using EEPROM commands as this means I have a backup of the configuration and if the controller blows up I can reflash a new controller and skip most of these steps.
  10. Connect the extruder drive and verify the drives direction and feed rate with the hotend removed. The rate is checked by feeding a few cm of filament through the extruder and wrapping some tape around the filament where it exits the extruder. I then use OctoPrint to extrude 50mm and measure how much was really extruded using the tape as a reference. I then calculate the error as a percentage and adjust the steps/mm in the firmware by this error. I then repeat the test until the error is as low as possible.
  11. I refitted the hotend and switched it on to check that it heats up. I no longer have an IR thermometer to verify if the thermistor table is correct as the kids wrecked it thinking it was a hammer so I have to presume that the reported temp is accurate. Next I ran M303 C5 E0 S200 to auto tune the PID values and updated them in the firmware.
  12. Test print time!
The first print on the Up Plus 2 was a new E3D fan shroud

Rebuilding an Up Plus 2 3D printer

I have had to pause work on my robots as I have not been able to get any reliable prints out of my old Prusa Mendel 3D printer. The frame of the printer had twisted again making auto bed leveling impossible while the extruder drive was failing. After moaning to my brother about the troubles he gave me a “new” printer. The “new” printer being an old Up Plus 2 that had previously been written off and stripped for parts.

The 2nd hand Up Plus 2 with covers removed to assess needed repairs

The first thing I did when it arrived was pull all the covers off to see how bad it was. The mechanical faults seemed to be limited to a broken Y belt clamp and a destroyed hotend. The Y belt clamp had been broken when the printer was pushed against a wall while opperating and there may be an accompanying electrical fault that I can’t assess without first fixing the mechanical issues. So first I designed and printed a new belt clamp using the old printer. Fortunately it worked the first try.

Next I needed to replace the hotend. The only hotend I had available was the E3D V6 on my current printer. So I downloaded some drawings of the E3D V6 and measured the Ups hotend and extruder and made a new mount for the hotend. The trick was to try and get the nozzle of the new hotend to be in the same position as the original nozzle. Since the E3D hotend is much higher than the Up hotend the new mount needed to raise the extruder a fair way. This new mount was the last print ever done on the old Prusa Mendel as I pulled the hotend out after it was finished.

With the mechanicals sorted I could test the electronics. I downloaded the Up software and connected the printer to my laptop. The first problem came when homing the motors. The X and Z axis worked fine but the Y axis whould crash into the front after homing to the rear. It seemed that the Y stepper driver IC was damaged and was stepping a different distance when moving one way than the other. That was very strange but not worth looking into after finding out about the thermistor problem.

The E3D V6 comes with a very common 100k ohm thermistor. A 100k thermistor is used on just about all 3D printers everywhere, except for the Up. The Up uses a much more uncommon 100 ohm thermistor. The different thermistors require different pull up resistors on the control electronics for them to work. Because of this the Up software would report a hotend temperature of over 300 degrees and refuse to run. To fix this I would need to replace the pull up resistor and then work on the Y stepper driver fault. Or replace the control board with my own. So I pulled the RAMPS 1.4 board out of my old printer to replace the Ups damaged controller.

The next step was to completly re-wire the printer and setup the firmware from scratch.

Fixed Prusa Mendel 3D printer auto bed leveling problems

After struggling to get auto bed levelling working on my Prusa Mendel I have fixed the problem.

This is the latest in the never ending series of repairs and upgrades to my Prusa Mendel 3D printer. The previous upgrade was to add auto bed leveling after replacing the X carriage to mount the new hot end. The auto bed leveling is Z probe “micro switch on the end of a servo” type. The problem was that it never seemed to work. 

When I say it didn’t work I mean that it would successfully probe the bed and calculated the plane of the bed and then adjust the Z height during X and Y movements but the calculated plane did not match the bed. The calculated plane was always higher on the left rear and lower front right. After the printer had probed the bed I would need to adjust the bed height for the printer to work. No matter how many times I adjusted or measured the Z probe or checked the firmware settings the calculated plane was always off. I kept using the printer and manually adjusted the bed height after probing. But now several months later I had an idea and fixed the problem.

While watching the printer go about its probing yesterday I had a look at the X rails and noticed that the two rails were not parallel but we’re twisted. The motor end was sagging under the weight of the stepper motor and causing the X rails to warp. The warping meant that the X carriage would roll as it traversed its axis. The rolling did not affect the hot end nozzle noticeably but the Z probe is a fair way off centre to the rear of the carriage and this would cause the probe height to vary by several millimetres over the length of the X axis. This variation accounted for the difference in the calculated plane at the Z probe and the plane of the bed at the nozzle.

I immediately printed up a new pair of X ends from Thingiverse and swapped them over. Once I had removed the old motor X End it became very obvious what the problem was. The clamps for the linear bearings had cracked and was allowing the weight of the stepper motor the twist the X End. After installing the new X ends the auto bed leveling worked perfectly the first time.