Following on from my earlier post about installing the hardware for a Viki LCD controller (and in light of several people asking for more info on the QU-BD forum), I decided to go ahead and write up some guidelines on configuring and installing Repetier firmware. This write-up specifically covers the Revolution XL 3D printer, although it should generalize pretty well to the non-XL version of that printer, and indeed to pretty much any other machine running Repetier firmware, although you’ll need to be sure and use the correct configuration parameters in those cases, and not the RXL-specific ones that I used.
Getting the Tools
In order to compile and install the firmware onto your printer, all you need is the Arduino Integrated Development Environment (IDE), which is available here. I recommend version 1.0.5 which is the current release version. Download and install the correct version for your computer, and review the basic overview of the tools online.
This walk-through that you already have all the necessary drivers etc installed, so that you are able to communicate with your printer over USB from Repetier Host or other print spooling and control application. If not, you may want to review the getting started instructions on QU-BD’s web site.
Obtaining the Firmware Source Code
QU-BD makes available a version of the source code on their product page in the store. If you download and unzip that, you will see that it contains two sub-folders of particular interest – the one named ‘Repetier’ is the main source code for the firmware. The ‘Revolution_XL’ folder is a copy, with tweaks for use on the RXL. In particular, the Configuration.h file includes the altered settings that work with the RXL. You should compare that with the Configuration.h file in the Repetier folder to see what is different. I highlight some of the key changes I made, in a later post.
I also suggest that you download the latest official version of Repetier Firmware from the project’s github page – look on the right side of the page for the ‘Download ZIP’ option if you don’t want to go to the trouble of creating your own fork of the project, and just want a snapshot of the code. Once you have that, then you can update the configuration file that comes with that, to match the key settings in QU-BD’s ‘RXL’ version. That way you have the latest greatest version of the firmware, set up correctly for the QU-BD printer, rather than relying on an older copy of the whole source code that may contain bugs, or not have been updated to the latest functionality.
My Version of the Firmware
Alternatively, you can download the version of the firmware that I am currently running from github, or create your own forked copy there to work from. This has already merged a recent official version of Repetier with the necessary QU-BD configuration. The ‘Master’ branch contains all the settings that I am using. One thing to note is that it’s specifically set up to work with the Viki LCD panel and Azteeg X3. I believe it will work ok still without the Viki panel, but I’m not entirely sure (feedback is welcome). Even in the worst case, you should be able to just upload new firmware to fix anything that doesn’t work right on your machine with that firmware, or any other. But of course, once you start messing with your machine’s firmware, whatever version you use, you do so at your own risk. While it’s usually easy to recover from a bad firmware file, by installing a new one, it is possible (although fairly unlikely) that you may damage your hardware if the settings in the firmware are wrong.
Whichever version of the source code you decide to use, you can open it in the Arduino IDE by double clicking the .pde or .ino file in the ‘Repetier’ folder (pde and ino are equivalent; the former was the extension used in the pre-1.0 versions of the IDE; later versions can open either). Alternatively, run the IDE application, and open the file from the ‘File -> Open’ menu. If you want to build directly from QU-BD’s version downloaded from their website, then be sure to open the files in the ‘Revolution_XL’ folder rather than the ‘Repetier’ folder. However, I recommend working from the latest Repetier source code from github, and simply copying over the relevant lines of the Configuration.h file: do not just copy the entire config file across, as that might delete some other non-RXL related changes. (Or just try using my version, which already has the merge done, but is specific to, and only tested on, the RXL/X3/Viki hardware combination).
Go ahead and hook your printer up to the USB port on your computer, and turn it on. Make sure you aren’t running Repetier Host, or some other application that is communicating with the printer. From the tools menu in the IDE, you need to set the board as ‘Arduino Mega 2560 or Mega ADK’. Also set the serial port for your printer under ‘Tools -> Serial Port’. On my Mac, the port looks like ‘/dev/tty.usbserial-DA005U6F’: yours will be different, depending on your OS and computer hardware configuration.
Using the IDE
You can click on the tabs in the IDE to see the various source files that make up the firmware. In particular, you will want to look at the Configuration.h file, as noted above. You don’t actually have to use the IDE to edit the files; you can open them in another text editor instead if you prefer, or even use a fully-featured C/C++ IDE such as Eclipse (getting Eclipse to understand the Arduino code is pretty straightforward, and it offers a lot of benefits in terms of understanding and working with the code. I will post an article about doing that in the next few days, but in the meantime, this post about using Eclipse as a Marlin firmware editor may be helpful). Of course, if you just need to review the file or make a few simple changes, then the Arduino IDE will be sufficient.
When you have the code ready, you can click on the first icon on the top left corner of the IDE toolbar, to perform a test compilation. The IDE will show ‘Compiling Sketch’ in the blue bar under the source code text (a ‘Sketch’ is an Arduino program), and a progress bar. If there are syntax errors in the code, then diagnostic messages will appear in the black console area under the source code. If all is well, you will see something like this (albeit the size info may vary slightly, depending on the version of the source code that you have:
If there are errors reported, you will need to fix them, but once you get a successful completion of the test compilation, then you can go ahead and upload the firmware to the printer. Click the ‘Compile and Install’ button, and the IDE will repeat the compilation and then go ahead and write the firmware to the printer. Once it is complete, the printer will reboot, and be ready for testing.
Testing the Firmware
I recommend that you start testing new firmware with some fairly modest first steps. Exit the IDE, and connect to the printer over USB as you normally do, using Repetier Host, or similar. Make sure that the connection happens correctly, and then try moving the head in small steps on each axis in turn, to make sure that it seems to move roughly the right distance, in the right direction, and the right speed. If that works, try homing each axis in turn (be ready to kill the power, if it become clear that something has gone wrong – e.g., the head moves the wrong way, or doesn’t respect the limit switches). If that works, then try heating the bed and head, and make sure they reach the correct temperature.
If you have an LCD controller such as a Viki installed, then you should also put that through its paces, paying attention to responsiveness, sensitivity of the controls, direction of cursor movement, as well as the ability to actually control the printer as expected.
Once all the basics seem to be in place, only then should try a print. If something seems wrong, then pay careful attention to the Configuration.h file, adjust it as needed, and then re-upload corrected firmware, and re-test until everything seems good.
I made several changes to the Configuration.h file in order to set it up the way that I want it for my RXL. I discuss those in more detail in my next post.