A Comedy of Errors - Printrboard Rev F5 Firmware Editing How-To
Preface: I am writing this after the fact, and narrating events as they happened to me. I will (somewhat shamefully) admit that this took me about a day and a half to figure out. Hopefully it helps someone figure out how to do this, if I am correct it is a fairly niche problem as there is very little information for this specific board (rev F5). The process I went through to program the board starts several paragraphs down, feel free to skip around and control F, you will probably find something that is relevant to your particular situation.
As a gearhead, I am enthused by almost all things machines, and love to make. Naturally, I have a 3D printer (a Printrbot Simple Metal with heated bed from Dec. 2015).
It comes with a Ubis hotend. Over its life, it slowly became more and more averse to having filament pushed through it, and eventually rendered the printer slightly better than unusable. It was time for a change, as you can see...
Melted plastic had permanently cemented itself around the nozzle, rendering it hoopajooped. I had heard plenty about the E3D V6, so I got one and began the upgrade.
The build is fairly self explanatory, and E3D gives excellent instructions on how to do it. If you have the same Printrbot as me, be warned--the heater block WILL COLLIDE WITH THE BASE OF THE PRINTER IF YOU HOME X Y AND Z AND HAVE THE LONG SIDE OF THE BLOCK TOWARDS THE REAR OF THE PRINTER! And this WILL bend the heat brake--ask me how I know! If you scroll down you can see the orientation of the heater block that I ended up using.
With that done, it was time to modify the firmware so that the printer would recognize the new thermistor in the new hotend.
This is where things got dicey. There is almost no information on how to perform this modification with this exact board, the Printrboard rev F5. And if you’re like me (a somewhat boneheaded mechanical), this poses a great challenge.
There are quite a few ways to perform these upgrades. If you just need to flash your firmware, you can use Atmel Flip to flash the Printrboard (I had done this before, there are a few guides on how to do this, such as this one https://printrbot.zendesk.com/hc/en-us/articles/202457834-How-to-Flash-Printrboard-Firmware). However, we don’t want to use a pre-baked firmware for this because we need to CHANGE the firmware. How the hell does one do that? This is about where I was at, and boy was I lost.
I had remembered watching a video by Thomas Sanladerer, an excellent YouTube content creator that makes informational videos about 3D printing. It shows the exact process of how to upgrade your firmware for a general 3D printing control board, such as a RAMPS or RAMBO board (Link: https://youtu.be/3gwWVFtdg-4). But I didn’t have one of those, so when I tried it, I uh... had some problems.
First, Tom recommends to use the Arduino IDE to flash the board. Now you might say, “This is a non problem! You can just tell the Marlin firmware to use the Printrboard Rev F in Configuration.h by specifying that it’s a printrboard and then hit upload. Easy!” Well, maybe for you, my microcontroller-familiar friend. Let me tell you a story of honest confusion, hunger induced frustration, and general disorientation as a hardcore mechanical tries to figure out how to do basic things with microcontrollers and C++ configuration files.
At first, I was confident. I had watched Tom’s video and thought that there was no way I could mess this up. And it would have been, if the Printrboard was based on the Arduino Mega like basically every other 3D printer control board. Haha, guess what, it doesn’t.
What the hell is that? And why is the Arduino IDE telling me that it doesn’t recognize a Printrboard when it’s one of the supported options? What does it mean Unknown CPU?
Later I would realize that these error messages were telling me exactly what I needed to do. But, in the moment, I was baffled and frustrated that it wasn’t working. More importantly, I was neck-deep in the names of different microcontrollers that were clearly reluctantly created by computer engineers who really didn’t care what the hell they called their new product, and just decided to use the seventh thing that came to their mind.
At this point I thought that the Arduino IDE was telling me that it couldn’t identify the printrboard. While it was true that it couldn’t identify the printrboard, it wasn’t telling me that. Nevertheless I soldiered on, and figured out that I needed to install another stupidly named piece of software (link https://www.pjrc.com/teensy/td_download.html). This let the IDE actually recognize the printrboard, and the fact that it doesn’t actually use an Atmega 328 processor, but an AT90USB1286.
So that was a revelation. At this point, for the first time in four hours, the IDE could actually see the damn board. Keep in mind that I still had made no progress on the actual errors that the IDE was spitting at me. So I set off there.
The compiler kept claiming that this was an “unknown board” and that it didn’t have the pins for the board. I didn’t understand since I had done exactly as it asked and put “BOARD_PRINTRBOARD_REVF” and that the board was explicity listed in pins.h. After trying the number of the board, 811, in exasperation, I finally read what the IDE was actually telling me, saying that it lacked an identifier. I don’t know what I expected, this being C++, but you have to not just #define 811, you have to #define MOTHERBOARD 811.
And now the momentum built (or so I thought). The verifier progress bar advanced a little bit more. Next it complained that it wanted the ”traditional marlin” pin layout instead of the “AT90USB1286.” So I looked in the pins_PRINTRBOARD_REVF.h, and once again actually read the error message, directing me to fastio.h and comment out _AT90USBxx_TEENSYPP_ASSIGNMENTS. Now I felt like I was on to something! Next was something about DAC stepper current. I am writing all of this after the fact, but it was somewhere, I think in configuration_adv.h. The change should be similar to the previous ones, but I’m not sure, it could be something else.
By the way, if you’re installing the E3D v6, the steps for modifying the firmware are well detailed in the installation manual you can find by googling “e3d v6 install.” These changes are much easier by comparison.
The verifier finally completed successfully, and with the board I was using recognized, I selected the USBtinyISP programmer in the “Tools” tab of the Arduino IDE and uploaded it to the board. I fired up the printer and to my amazement, it seemed to work. Seemed to work.
The hotend performed very well. I didn’t have much of a way to check if the temperature was correct (i.e., the firmware changes worked). I touched a piece of scrap PLA to the block at about 60c and it seemed to go into glass transition, and heated it up all the way to see if it would melt. It did, so it must have been in the ball park.
So I used the printer for a while until I was ready to try enabling mesh bed leveling (which isn’t even possible on a printrbot that doesn’t have an LCD screen). At this point i noticed the little teensy board programmer that keeped popping up saying that the “Marlin.ino.hex” file was too large. I had completely ignored this thing up until now, simply reading that the arduino IDE had “Uploaded Successfully” and assuming the teensy programmer was redundant.
I had somehow figured out that most 3rd party AT90USB1286 programmers could only write 64 kilobytes of program to the chip, even though it has 128 kilobytes of memory. Why? I have absolutely no idea. Regardless, I remembered that I had used Atmel FLIP to install a new prefab printrbot firmware onto my printrboard a while back. You can find a link to that above in the first part of this post. So, I tried that, and it worked.
I then went to test the unified bed leveling and the printer instantly crashed as I tried to raise the Z height and it crashed the print head into the bed. Sure enough, NONE OF THE PREVIOUS FIRMWARE CHANGES I HAD EVER MADE WORKED. NONE OF THEM AT ALL. So, suddenly, all of the changes I had progressively thought i had made happened at once, and all of the default settings in Marlin that were wrong showed up, and everything went to shit.
But now I had completely figured out how to change firmware settings on my printrboard. And you too can figure it out if you read this... hopefully.
Something I repeated to myself a lot during this is that if you’re not making mistakes, you’re not learning. As you can see from this article, I learned a lot in the past few days.
Here’s the hotend on the printer! It makes a huge difference. No more roasty Ubis for me.
Email me if this doesn’t make any sense and I’ll try to help.