What's New In The 3D Printer World
Flashing firmware on to stock TronXY X5S control board
This tutorial will help you flash some real firmware on to your stock TronXY X5S control board, using a separate Arduino Uno board as the programmer. It’s not meant for any other board, period. Just the stock one specifically. No others. If you try it on a different board and it doesn’t work, don’t say I didn’t warn you.
It is also written under the assumption that you're running Windows. If you're on a different operating system you'll need to take the appropriate equivalent steps. If you don't know how to do that you'll need to find a different set of instructions. :)
You'll need:
-Your printer control board
-An Arduino Uno. Using other Arduino board variants is possible, but will require different hardware connections as well as some software changes. Non-Uno boards will not be covered here.
-The Arduino IDE, which is currently at version 1.8.5:
https://www.arduino.cc/en/Main/Software
-Two USB A to B cables
-Four male-to-female jumper wires
-The Marlin 1.1.X (currently 1.1.8) firmware:
https://github.com/MarlinFirmware/Marlin
(click the green “Clone or download” button, then “Download ZIP”)
-The U8glib library for Arduino
https://github.com/olikraus/U8glib_Arduino
-The X5S/Marlin configuration files, Version 4, graciously put together by Harald Gutsche and available in the TronXY X5S/X3S Facebook group for download:
https://www.facebook.com/groups/169728600253557/184255938800823/
-You might need an additional USB driver if your OS doesn't automatically detect the printer control board
http://www.wch.cn/download/CH341SER_EXE.html
-Patience, in case things don’t go right the first time. :)
The first thing we need to do is get all of the software installed, and all of the requisite libraries in place inside of the Arduino environment. Go ahead and run the Arduino 1.8.5 installer now, following all of the prompts and leaving everything at their defaults. Start the program when the installation is done so we can add a couple of things to it.
Import the U8glib library (this makes your LCD screen work) into the Arduino IDE. Go to the Sketch menu, hover your mouse over the Include Library option, and then select Add .ZIP Library… from the remaining options. Use the file dialog box that opens up to select the U8glib Zip file that you downloaded from Github, and the library will now be imported and made available for use.
We also have to make sure that the Arduino IDE has the right stuff under the hood to talk to the printer control board. First, go to File menu and select Preferences. At the bottom of the window, you’ll see an option called Additional Boards Manager URLs with a text input box next to it. Paste the following line into that text box:
https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json
Hit the OK button to save the changes and close the Preferences window.
Next, go to the Tools menu, hover your mouse over the Boards: option (it may or may not have a specific board name next to it, don’t worry about this) and then select Boards Manager… from the remaining options. In the new dialog box that opens, type Sanguino into the search field. It should return one option, “Sanguino by Kristian Sloth Anderson, version 1.0.2”. Click on this to select it and then hit the Install button. The Sanguino will now be available as a board selection. We’ll need this later.
Minimize or close the Arduino IDE for the moment, it’s time to have a look at the firmware files now.
Unzip the Marlin firmware that you downloaded from Github into its own separate folder.
Unzip the configuration file that you downloaded from the Facebook group into its own folder too.
Open the configuration file folder you just made, select all five files inside of it, and right click->Copy or hit CTRL+C. Now navigate to the Marlin firmware folder you made, open the subfolder inside that’s named Marlin, and then right-click-Paste or hit CTRL+V. Overwrite the existing files in the Marlin folder with the new ones.
Now it’s time to go back to the Arduino IDE. We’re going to open up the Marlin firmware project file and make a couple of small configuration changes. Go to the File menu, select Open, and navigate to your Marlin folder. Scroll down the file list until you find the Marlin.ino file and select it.
A new Arduino IDE window will open up, and you’ll see a number of tabs with different file names. Select the configuration.h tab.
Hit CTRL+F to open the Find dialog, type K1 into the search box, and hit the “Find” button. The screen should jump to the correct line of the file and highlight what you just searched for. The line should read:
#define K1 0.95 //smoothing factor within the PID
Change this line so it reads:
#define PID_K1 0.95 //smoothing factor within the PID
That’s it for the first change. Next, hit CTRL+F again to open the Find dialog, type default_axis (make sure to use the underscore) into the search box, and hit the “Find” button. The line should read:
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
Change this line so it reads:
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 95 }
The change from 500 to 95 puts the extruder steps per millimeter much, much closer to where they actually need to be and will save you a lot of aggravation later when you calibrate your extruder steps.
Go to the File menu and select Save. You won’t see any confirmation, but this will preserve the changes.
Now it’s time to configure our Arduino board so we can use it to program the printer control board!
Connect your Arduino board to the computer with one of the USB A to B cables.
In the Arduino IDE, go to the Tools menu, hover your mouse over the Boards: option, and then select Arduino/Genuino Uno from the remaining options. Also under Tools-> Boards is a Port option. There should be a single COM port listed there. Select it, and make a careful note of the port number. It will be important to know which port number is associated with each particular board when we have them both connected.
Next, go to the File menu, hover your mouse over Examples, hover again over ArduinoISP, and then finally select ArduinoISP as the remaining option. This will open a new IDE window with the ISP sketch loaded up.
Unless something’s wrong, at this point you should be able to hit the Upload button (it’s the arrow next to the check mark button) and the ArduinoISP sketch will be verified and uploaded to the Arduino board. If something is wrong, troubleshooting basic Arduino connectivity is outside the scope of this tutorial.
From the Tools menu, hover your mouse over the Programmer: option, and select Arduino as ISP.
OK, now that we’ve got our Arduino Uno loaded up with the software it needs to act as a programmer, we need to make some connections between it and our printer control board. Grab your four jumper wires, and maybe a magnifying glass because the silk screening on the control board is very, very small.
Locate the six pin programming connector on the control board. It’s toward the middle near a capacitor and the 16Mhz crystal (a silver, oval component). Connections are from the printer board to the Arduino, as follows:
Connect a jumper from the printer board pin labeled RESET to pin 10 on the Uno.
Connect a jumper from the printer board pin labeled MOSI to pin 11 on the Uno.
Connect a jumper from the printer board pin labeled MISO to pin 12 on the Uno.
Connect a jumper from the printer board pin labeled SCLK to pin 13 on the Uno.
Now connect the printer control board to the computer with your second USB A to B cable.
Back in the Arduino IDE, we need to set our board options a little differently now. This configuration will be critical to success, so double-check that everything is correct.
Go to the Tools menu, hover your mouse over the Board: option, and select Sanguino. A new Processor option will appear on the Tools menu now, and from there you need to select
ATmega 1284 or ATmega1284P (16MHz).
Do not change the port number. That needs to stay selected for the Arduino Uno board, whose COM port number you should have previously noted. Check to see if a different port has been selected, and change it back to the Uno’s port number if it has.
Everything is now configured, both software and hardware. Are you ready? Let’s burn a bootloader so all of this actually works!
Tools menu, Burn Bootloader.
That’s it. Unless you see an error of some sort at the bottom of the screen, it worked. The printer control board is now capable of receiving new firmware, and also of saving any future firmware settings that you change from the printer’s control panel. Neat, huh? We probably ought to feed it some actual firmware now.
In the Arduino IDE, open the Marlin.ino file again just like you did earlier, and once it’s open just hit the Upload button. This will take some time, as the computer needs to compile all of the human-readable files into stuff that the control board can use. The length of time really depends on how fast your computer is, so don’t be alarmed if it takes 3 or 5 or even 10 minutes or more. You’ll know it’s ready when the progress bar disappears and you see a message at the bottom of the window detailing how much storage space the files are using.
And…that’s it. You now have a proper, non-proprietary installation of Marlin 1.1.8 on your control board. Disconnect the four jumper wires, disconnect the control board from the computer, and fire the printer up! Any further settings and calibration are also outside the scope of this tutorial, so you’re on your own from here. J Have fun!
Related Posts
Comments 23
Hi All, Thanks Rick,
Having tried about six (6) unsuccessful Tronxy X5S firmware upgrades so far, I find this one the most clear and comprehensive. I actually got off the starting block and way through the compiling process.
I get and "Config.h out of date" compiling error which prevents me from completing.
Please advise. Many thanks in advance.
Paul
there is a new way to update this board posted and even easier to do... http://customize-3d.com/flashing-tronxy-x5s-factory-control-board-usb-cable-only.html