In my previous post, I showed off one of my latest acquisitions, which is a Da Vinci JR 3D printer. I purchased this 3D printer as broken, sold for parts. The main issue with this machine was a broken part in the Y carriage, which will not allow the machine to home the axis at startup, which in turn will make the machine go into an error mode. Although I was able to fix the machine and I was able to navigate the menus and such, there was still a lot of work to be done in order to get the machine to a state in which I would enjoy using it on the daily basis. This post will be the continuation of my odyssey with the Da Vinci JR.
In this post, we will be delving into a considerably challenging process which was overtaken in order to get this machine functional, this was the process of removing the original motherboard, and replacing it with another motherboard, along with the addition of a single board computer and a new power supply.
So, why would you want to change the original motherboard? Well, it turns out that this machine uses a proprietary motherboard made by XYZ, and although it might look like a piece of art to any electronic engineer, it is fairly lacking on the software end. This board cannot be reflashed with any other firmware such as Marlin or Smoothie due to lack of documentation of the layout of the board, and components. Not only that, but the firmware installed by default requires you to only use XYZ slicing software (Which does not have a version for Linux), as well as to use spools of filament sold by XYZ, which contain a NFC chip. If you, like me are not willing to put up with the XYZ software, or the overpriced XYZ filament, then the machine becomes a 20 lbs paperweight. The easiest way to solve this problem is by replacing the motherboard for an open source motherboard such as the well known Arduino Mega + Ramps combo, or any other motherboard which is compatible with the Marlin firmware, Smoothie or Repetier Firmware.
For my build I decided to use an MKS Gen L as the motherboard of the printer since it is fairly well supported by Marlin, as well as it is very inexpensive. I also installed a Orange Pi Zero in order to be able to control the printer using Octoprint wireless over my Wi-Fi network. This makes it much easier for me to deal with the printer since I can just place it in a corner of my room and control it over the network. I also added a 150W 12V power supply, mainly because I wanted to have a lot more overhead in comparison to the original power supply. I would like to add some more features later on and I want to be able to power them from the same supply. I also did end up having some browning out issues that made me change my mind about using the original supply. The power supply also powers the Orange Pi Zero using a buck converter.
- 1x MKS GEN L
- 1x Orange Pi Zero
- 1x 150W 12V Power Supply
- 1x MH-Mini-360 Buck Converter
- 1x 220 ohm resistor
- 2x 10k ohm resistors
- 4x Female DuPont Connector 4 Pins (Stepper Motors)
- 3x Female DuPont Connector 3 Pins (Endstops)
- 2x Female DuPont Connector 2 Pins (Thermistor & Orange Pi)
- 1x Female DuPont Connector 1 Pin (LED)
- 1x Power Switch
Now that we have introduced the problem and the equipment to be used, lets see how I was able to solve the problem. Below there is an image of the original motherboard of the XYZ Da Vinci JR. The connections at the top of the board (from left to right) are the connections for the filament sensor, X axis motor, Y axis motor, Z axis motor, XYZ optical endstops, Extruder motor and Led strip. To the right we have the power switch, power connector and USB connector, none which are important to us. At the bottom from (from left to right) we have the front LCD connector, SD card, and Hotend ribbon cables. At the left side we have the NFC connector and back fan. We need to know what these cables are and what do they belong to now since we will have to create new wiring with all of them which will be compatible with the board that we will be using.
The first thing that I needed to do in order to add the new board was to remove the old one. Since I had images for reference of what each connector was, and where it belonged, I did not need it anymore.
Next it was time to drill holes in order to mount the MKS GEN L as well the Orange Pi Zero. I used simple templates made with paper in order to lay out the holes where I needed them to be. Positioning these boards was fairly crucial due to the fact that the original cables for motors and endstops have specific lengths which would have been fairly time consuming to try to extend if I mounted the boards far from them. I also made sure that any large connectors could be easily accessible, such as USB cables, power cables, etc.
Next, I mounted the boards with the help of some M3 screws and 3D Printed spacers. The spacers are fairly helpful because you need to get the boards at a level higher than the molding pattern of the electronics compartment of the Da Vinci JR.
After mounting the boards, I began labeling all the cables in order to keep them organized. This did help a lot because there are a large amount of wires, which look exactly the same. Labeling is also good in case you might need to do any maintenance later on to the machine. I also cut the heads of the cables because I would need to solder new heads which would be compatible with the MKS GEN L.
Now comes the challenging and most time consuming task, adding new connectors to the wires. Since XYZ used some fairly non-standard connectors which have a smaller pitch, they all need to be replaced for connectors which are compatible with the board that you would like to use. In my case I have fairly large sets of pin headers, I cut them to have 4 pins and sanded their cut ends. This is a fairly inexpensive way of making connectors which are compatible with the MKS board but it can be fairly time consuming. I would have purchased properly locking connectors and done some good crimping on them, but this method still worked fairly well.
Using the original picture as reference I soldered the stepper motor wires to the connectors in the same manner as they were attached to the original connector. Before soldering them of course, I added some heat shrink tubing which was cut to a short length in order to cover the solder joints.
I repeated the same process for all the stepper motor connectors. Once they were done, I connected them to the board to test that they could fit properly in the MKS connectors.
If you would like to keep track of the pinout of the MKS Gen L board, an image displaying all the connectors and pins used for the connectors is shown below. It will be fairly helpful through this build.
Next, it was time to deal with the optical endstop connectors. Making proper connectors for these little guys is a bit messy, I had to re-do the process more than once. These endstops are 3V optical endstops, however the MKS board can only supply 5V signals, this means that you will need to drop some of the voltage going into the endstop. We also need to add a resistor in order to pull-up our signal to 5V when the endstop is not being triggered. Use the diagram shown at the begging of the post in order to label the wires used for the endstops. We are going to need to put a 220 Ohm resistor on the 5V+ connector, and the 12k resistor between 5V+ and Signal as a pull-up resistor.
I would recommend that before you cut the wires of the endstops, make sure to label them properly and also find a way of color coding the wires as well, It can be fairly confusing to try to figure out what wire does what after you cut them. In order to keep the soldering as neat as possible I soldered the resistors directly to the connectors and then to the wires. I heat shrunk the ground cable only to make sure the resistors could not short to it, and then I added a large piece of heat shrink tubing over the whole connector in order cover all connections as shown in both of the images below.
After dealing with all the connectors I moved on to dealing with power distribution. The original idea was to add a connector that came with a power supply that I purchased for this project, however after testing it with the machine I soon realized that the power supply didn’t have enough current to deal with all the systems running at the same time. Luckily I had a 150W power supply which was perfect for the application. Sadly, I realized this after super gluing the connector in place. I used a spacer glued to the base of the electronics compartment in order to mount it and have it stick out through the side of the machine, in the same manner as the original one did. I also added a power switch in the same place as the original one which ended up staying in the same place and being useful for turning on and off the machine.
The main idea of the power distribution system was to first have the power come from the power supply, then have the positive end go to the switch and from the switch to a small block which would distribute both ground and 12V for different components. To connect all the components together, I used some 18 gauge speaker wire.
I used a small screw terminal block in order to distribute power to different electronics. From this block I also used 18 gauge speaker wire to supply power to the MKS board.
After connecting power to the board, I connected the large fan which located at the back of the machine. I connected this fan to the heated bed port of the MKS board. I will most likely end up using this fan for things related to lasers later on, mainly due to the fume extraction requirements of this application.
Next I moved to dealing with the LEDs which are located at the top of the machine. These have three wires, 12V, Ground and Signal. I connected 12V and Ground to my power distribution block. The signal cable needs be connected to the board.
The signal cable of the LEDs cannot be connected as is to the board. We need to add a resistor to it. We can use a 10k to 12k ohm resistor in series to the cable, and solder a connector to it. I used a random female header in order to connect it to the board.
This pin was then connected to pin D66 on the MKS GEN L. We must remember this pin since it needs to be used to be added to the configuration of the firmware. Any other digital pin will work fine, as long as it does not have some specific purpose that would conflict with the LEDs functionality.
Now it is time to deal with the hotend, hotend fan and thermistor. I used some speaker wire in order to connect the fan and hotend back to the main board. This is slightly overkill and you would get away with using higher gauge wire here, however I did not have suitable higher gauge wire. I used some thin 24 gauge wire that I salvaged from some phone cords to wire the re-wire the thermistor.
Because there is no real way to get the wires out of the casing of the extruder system, I had to drill a hole through the top right corner of it and feed the wires out of it. These wires were then routed through the left side of the printer (close to the extrusion) and fed through the panel which covers the wiring going to the z axis motor and other places. This access panel is to the left of the Y axis carriage.
In order to be able to connect the thermistor to the MKS board, we need to once more solder a connector to it, but this time it has to be done for a 2 pin connector. This cable will be connected to the TH1 connector on the MKS board.
At this point I also connected the hotend and fan wires to the board. The hotend was connected to the E0 connector and the fan was connected directly to the power 12V and GND of the power distribution system. In the end I ended up having to connect the fan to the power input of the MKS board because I ended up cutting the cables too short.
I used some conduit tubing in order to hide the mess of wires that now comes out of the extruder.
This is the most depressing part of the build itself, and you might not have to do this depending on your layout of the board, etc. Because of where I ended up placing the MKS board, I did not have access to the USB port of the MKS, which I needed for uploading firmware, as well as for the Orange Pi to control the printer. I ended up having to make a hole on the frame of the machine in order to accommodate for the large USB B cable. If you are smart enough to account for the size of the cable while you’re doing the planning and layout of the electronics you should be fine.
It was at this point also that I added the new power supply. I also extended the wires that were going to the socket in order for the wires to reach the power supply. I also added a power cord which enters the machine through the square hole which was previously used for the USB B port of the original motherboard. I then snaked the power cord through some internal channels of the frame in order to get it to the power supply and connected it to it’s respective terminals. This method worked fairly well, however in the future I will be replacing this setup for a properly fused socket.
Next it is time to deal with everything related to the Orange Pi Zero. In order to be able to give power to the Orange Pi, I needed some way of dropping the 12V from the power supply down to 5V. I used one of these tiny buck converters which can handle up to about 2A (3A peak). The Orange Pi Zero does not draw more than 1A of of current, so this solution worked fairly well. I added some capacitors in order to deal with some of the switching transients of the board, however it did not seem to work well since the Orange Pi did not like the voltage delay added by the charging of the large capacitor, sometimes when the machine is turned on, the Pi will not turn on at the same time and I would have to manually disconnect and connect power to it. I have used this same setup in some other machines without the capacitors and it seems to work fairly well, so I would recommend against using the capacitors.
After soldering the capacitors, I needed to solder some cables to it to the input and output connections. The input will go directly to the power supply and the output will go to a connector which will then connect to the 5V and GND GPIO of the Orange Pi Zero.
The easiest way to power the Orange Pi Zero using the MH-Mini-360 is by powering the board using the GPIO of it. A diagram showing the pinout of the Orange Pi Zero is shown below. I used pins 4 (5V) and 6 (GND) to supply power to the board.
And this completes the electronics setup of the reloaded Da Vinci JR. After mounting back the Orange Pi Zero into the electronics compartment and adding (and tunning) stepper motor drivers to the MKS GEN L board, we are ready to flash the firmware onto MKS board, as well as to install the Ambian and Octoprint on the Orange Pi Zero.
In order to install Octoprint on the Orange Pi Zero I first flashed Armbian on the SD card. To find more information about how to download and flash Armbian visit this link: https://www.armbian.com/orange-pi-zero/
Next, after going through the whole system setup of Armbian (which is great by the way), I followed DELOARTS guide on how to install Octoprint Armbian for the Orange Pi Zero. The setup is not too long and it is fairly straight forward. I am sure it could be easily replicated in any other Armbian compatible board. The tutorial can be found here: http://deloarts.com/en/3d-printing/octoprint-on-orange-pi-zero/
After setting everything up on the Orange Pi Zero, I configured Marlin for this setup. I did have to go through do a lot of research in order to figure out the values which needed to be used for steps/mm, dimensions, etc. I also performed some modifications to the firmware, such as having the LEDs turn on automatically when the machine starts up, etc. If you end up making any changes which you believe could be beneficial to other people, submit them back to me and I’ll add them to the firmware. The firmware can be found here: https://drive.google.com/drive/folders/13VjIQ_B6ZkgfOjRsTw0GR1xKfibsy5Hq?usp=sharing
And that is about it. So far the machine is working fairly well. I am having some issues with skipping on the Y axis, which are most likely due to the current settings on the drivers. Otherwise everything is working fine. I added a surface to the piece of glass that came with the bed of the Da Vinci JR. This surface allows prints to stick properly to it without the use of tapes or other things. At some point I would also like to add some other modifications, such as a decent part cooling fan, BLTouch, and figure out a way of getting the original LCD to work with most of the open source boards. If you have any questions or concerns please feel free to leave a comment or to email me directly using information in the contact tab of the website.
Sources used for the build:
http://www.soliforum.com/topic/16797/xyz-da-vinci-jr-mks-14-board-modification/ http://www.soliforum.com/topic/15273/howto-convert-da-vinci-jr-to-ramps-14/ http://deloarts.com/en/3d-printing/octoprint-on-orange-pi-zero/