Using an MKS GEN 1.4 Board for a Tronxy X1 3D Printer

I have a Da Vinci 3-in-1 Pro and an Ender 3 Pro (with BLTouch and an All Metal Hot-End) ... so when I tell you I recently purchased a Tronxy X1 3D Printer from eBay for less than $90, it wasn't because I needed it.   I just wanted to see how well a < $100 3D Printer actually works ... plus I thought the size of it would make it pretty good to lug along on camping trips, etc.

So, after receiving it, putting it together and printing a couple sample prints the motherboard went out.   I considered griping about it and trying to get a replacement (but frankly, it wasn't worth the effort to me), then I thought about just getting a duplicate replacement motherboard (but after the bad luck with the first one, I decided against it), my final decision was to grab a MKS GEN 1.4 board (basically an Arduino Mega 2560 prepared specifically for 3D Printing).

Since I already had experience with Keyestudio Mega 2560 boards (and was very pleased with their stability and compatibility), I decided to opt for the Keyestudio MKS GEN 1.4 that can be found on Amazon here.   In addition, I picked up some DRV8825 stepper drivers here (I know I only needed four, but there's nothing wrong with having an extra one on hand), a 12V 10Amp power supply here (I just used the power cable from the old board), and a Display Controller (with SD Card Drive) here.   This effectively gave me everything I needed to get started.


After Printing out a box (found on Thingiverse here) on my Ender 3 Pro which holds the board and display, and finding that it had a place for a board cooling fan, I decided it wouldn't be a bad idea to also grab a fan (and some Mosfet Driver Modules).   

As you will probably also notice, I purchased a part fan and printed a mount for it (again, on my Ender 3 pro) ... admittedly, I'm not totally happy with the mount ... and I think the fan may be a little too small and I may be replacing it ... so I'm not going to share which one I have.   But, just so you know, even though not out-of-the-box standard equipment, it is possible to add a part fan pretty easily.   Everything that is a mint green on the printer are suggested additions which you can find easily on the internet (check youtube)... there are some mint green additions that are about stabilization (some you can see a little, some you can't see at all).  I also used the mint green for the Display Mount, I though it was a nice highlight and matches the additions to the printer.  Even though not shown in the picture, I now have a glass bed plate too ... but other than changing the z-position, it doesn't have any bearing on setting up the MKS GEN 1.4 board to work with the Tronxy X1 hardware. 

So, let's get started on the Marlin changes made to get this thing to work.   I'll go through each of the changes I made, but also keep in mind, some of them may not be appropriate for your needs. 

First off, I started with the Marlin firmware provided in a link from the Keyestudio MKS GEN 1.4 Wiki.  I think the wiki goes through the requirements of getting this setup ... so I'm not going to repeat what's there.

There are a couple things to be aware of if you are using newer versions of the Arduino IDE.  First, you will get some errors during a compile ... here are the changes I made to get it to compile ...

SDBaseFile.h  ... change the fpos_t to fpos_tsd in two places ... highlighted below:

struct fpos_tsd {
  /** stream position */
  uint32_t position;
  /** cluster for position */
  uint32_t cluster;
  fpos_tsd() : position(0), cluster(0) {}
};

SDBaseFile.cpp ... again, change the fpos_t to fpos_tsd in the three places it is used. Just search for fpos_t and add sd to the end.

Why did we have to do that?   Well, fpos_t is already defined.   So, we want to define a new struct and use that where required.

Next ...

DOGMbitmaps.h ... the errors pettty much tell you what you have to do ... add a const in front of each line ... so for example when you see this ...

unsigned char start_bmp[574] PROGMEM = { //AVR-GCC, WinAVR

change it to this ...

const unsigned char start_bmp[574] PROGMEM = { //AVR-GCC, WinAVR

There are a total of three places this needs to be done.

That's it to get things compiling properly.   Note:  You may not actually see the above errors until you make some of the changes to Configuration.h below ... but once you do, you will have the info to fix them. 


Now let's talk about a required addition (if you want the Extruder Fan to actually work) ... I'm not sure why this isn't already in the code, but the function call to turn on the Extruder Fan isn't ever called.   We're going to fix that right now...

Marlin_main.cpp ... add the highlighted (missing) lines to the manage_inactivity() function.

  #ifdef CONTROLLERFAN_PIN
    controllerFan(); //Check if fan should be turned on to cool stepper drivers down
  #endif
 
  #ifdef EXTRUDERFAN_PIN
    extruderFan();  //Check if fan should be turned on to cool extruder
  #endif

 
  #ifdef EXTRUDER_RUNOUT_PREVENT
    if( (millis() - previous_millis_cmd) >  EXTRUDER_RUNOUT_SECONDS*1000 )

So, now, if there's an EXTRUDERFAN_PIN defined (and there should be since it's the only fan included on the Tronxy X1 out of the box), the extruderFan() function will actually get called to determine whether it should be turned on or off ... and actually turn it on or off.


Ok ... we are now ready to actually make changes so the Tronxy X1 will print...

Configuration.h changes.

// This determines the communication speed of the printer
//#define BAUDRATE 250000
#define BAUDRATE 115200
.
.
.
#define TEMP_SENSOR_0 // SingYu
#define TEMP_SENSOR_1 // SingYu
#define TEMP_SENSOR_2 // SingYu
#define TEMP_SENSOR_BED // SingYu
.
.
.
#define EXTRUDERFAN_PIN 5
#define EXTRUDERFAN_DEC 30
.
.
.
#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR true    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR false     // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR true   // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
.
.
.
#define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops false  //If true, axis won't move to coordinates greater than the defined lengths below.
// Travel limits after homing
#define X_MAX_POS 150
#define X_MIN_POS -5
#define Y_MAX_POS 150
#define Y_MIN_POS -10
#define Z_MAX_POS 150
#define Z_MIN_POS 0
.
.
.
#define DEFAULT_AXIS_STEPS_PER_UNIT   {100,100,1600,90} // {160,160,200.0*32/8,200*32/35.54}  // default steps per unit for ultimaker
#define DEFAULT_MAX_FEEDRATE          {150, 150, 4, 25}    // {500, 500, 5, 25} (mm/sec)
#define DEFAULT_MAX_ACCELERATION      {3000,3000,1000,5000}   // {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.

#define DEFAULT_ACCELERATION          1000 // 3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for r retracts
.
.
.
#define SDSUPPORT // Enable SD Card Support in Hardware Console
.
.
.
// #define REPRAP_DISCOUNT_SMART_CONTROLLER  // SingYu
.
.
.
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

So, just a quick review.   

115200 baud works well.

We only have 1 extruder and no heated bed, so those sensors are 0.   The single extruder sensor type I set to 5 ... seems to work well.

The EXTRUDERFAN_PIN is 5 and I used a MOSFET DRIVER MODULE connected to 12 V output and pin 5 on the MKS GEN 1.4 board.  I also indicated to turn on after it reaches 30 degrees or off once it goes below 30 degrees (EXTRUDERFAN_DEC value) ... remember that is in Celsius.

Make sure everything goes the correct direction (the _DIR values).

Setup the actual print size the bed is 150mmx150mm and it can print 150mm tall ... so pretty easy ... we set X and Y minimums to some negative numbers for homing.

The next section are for the Stepper Driver Motors (note:  I set the Stepper Driver Motor Configuration on the Board to 16 microsteps / step).  Take a look here to figure out which jumpers are need ... and which can be removed.

Next I wanted to make sure SDSupport was enabled.

and finally we are using the FULL GRAPHIC SMART CONTROLLER.   So comment the one we aren't using (which actually gets redefined later), comment out one we are using.


Configuration_adv.h changes.

#define CONTROLLERFAN_PIN 6 //Pin used for the fan to cool controller, comment out to disable this function

Note: the above is the fan in the case.   Again, I connected to a MOSFET driver module, 12V output, and to pin 6 on board.


pins.h changes.

#ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
      #define BEEPER -1

I absolutely hate the beeping every time I push the control to select a menu option.   So I disabled it.   if you like the beeping, don't set BEEPER to -1 ... just leave it as is.

One more note:  Remember the Part Fan ... it's already defined as Pin 4.   Again, I connected a MOSFET driver module, 12V output, and to pin 4 on board.


Language.h changes.

Finally ...totally optional ... I named my printer a Tronxy X1+ and pointed the URL to the Keyestudio firmware location provided on the Keyestudio WIKI (originally these values were #defined for a Mendel printer).

#else
    #define MACHINE_NAME "Tronxy X1+"
    #define FIRMWARE_URL "https://drive.google.com/file/d/1psja_6BQYEzf2SA9aaTMJ4OvF9POoGHD/view"
#endif

Board Connections 

I think the board connections for motors, end stops, etc. should be pretty self-explanatory ... but here's a couple things to keep in mind.


1. The motors just plug in exactly where you think they should.
2. The End Stops connections are (from left to right) X-Min, X-Max, Y-Min, Y-Max, Z-Min, Z-Max ... you want to plug in the End Stops in to the -Min connections.   There is nothing to plug in to the -MAX connections.
3. The Thermistor for the E0 hot-end is self-explanatory.   The E0 hot-end heater is self-explanatory.
4. The Fans, using the MOSFET Driver Modules I bought, required that I clip off the ends to get to the bare wires.   There may be modules that can use the ends that are present on the fans.  Don't know, didn't look.   The fans were the only items that required connector modifications.  Everything else plugged in as-is.
5. The Stepper Driver Modules plug in where you would think ...DON'T FORGET to set the current limit on all of the Stepper Driver Modules you use ... they come set way higher than needed and will likely overload your power supply and possibly even damage your MKS GEN 1.4 board (and modules) if you don't.  I found this article to be very helpful.   I have mine set between .52V and .55V.   Also make sure they are facing the correct direction... there are plenty of places on the internet to find this information (with pictures) if you have any doubt.



Final Notes:

I have had some pretty decent success with these settings so far.  But that's not to say they couldn't be improved either.

Remember, the slicer software you use should probably have Starting and Ending Scripts ... (the Ending Script is most important since the hot nozzle will just set where it stops printing and melt whatever you print if you don't manually move it pretty quickly).

I use Simplify3d and the ending script is this:

G28 X0 ; home X axis
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M84 ; disable motors


My starting script does a wipe towards the front of the bed before prints.  Similar to what the Ender 3 Pro script does.

G28 ; home all axes
G1 X5 Y10 Z0.2 F3000 ; get ready to prime
G92 E0 ; reset extrusion distance
G1 X90 E15 F600 ; prime nozzle
G1 X100 F1000 ; quick wipe

Note:  These are pretty much interchangeable with Cura ... they are just standard Marlin commands which get put in the .gcode file regardless of which slicer you use.

I also changed the default speed from 60 mm/sec to 30 mm/sec ... I don't know if it's because the bed is smaller than my other printers, but 60 mm/sec seemed too fast.   All up to your needs and requirements though. 

I will say, I will probably be tweaking things for a while until I get things just right.  But, if you are trying to swap out your Tronxy X1 board with a MKS GEN 1.4 board ... this should give you a good start.


Updates

03-07-2020 - Changed Extruder DEFAULT_MAX_FEEDRATE from 50 to 25 ... seems to smooth things out a little. 


Comments

Popular posts from this blog

Fun with the SolidDigi Color Image LCD Shield

Parallax Smart Card Reader - Revisited

Parallax Smart Card Reader Samples for Arduino