How to Compile and Modify Prusa Firmware

How to Compile and Modify Prusa Firmware

I was thinking of different ways to make the build of the Prusa Firmware easy for everyone. Ane idea was to build a virtual car or a docker container with everything you need. Only I noticed that the way Prusa describes by using the arduino IDE is the easiest, if yous know what is not described in the Prusa ReadMe file.
By the way, I am using a Mac. I don’t use Windows and cannot requite you lot any platform specific help for Windows. But the tools and process should exist the same.

There are different versions of the arduino IDE that you tin can download at
https://world wide web.arduino.cc/en/main/software
 .
There have been bug in the past and you might encounter people using the 1.6.x versions as they could non go it to work with 1.8.ten. Even Prusa recommend to apply “i.8.5”.
But as far every bit I can say those problems are fixed. I could become the latest version (one.eight.viii) to compile the Prusa firmware without whatsoever issues.



Once yous have installed the Arduino IDE, y’all need to install some definitions for the Prusa Einsy board. This is besides described in the ReadMe from Prusa.
Showtime you need to add the URL that should be used to fetch board definitions. Go to “Preferences” in the Bill of fare and you get this popup window.



Nether settings there is the entry “Boosted Lath Managing director URLs”. When you click on the icon right next to the text field a new popup window appears.



Add the line “https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json” to the list and click ok. Then click ok on the previous window.
Every bit you can see from my screenshot I practice have some other Prusa entry in my list, this is what you need for the MMU2 board, non for the Einsy Rambo.

When we navigate to Tools->Board->BoardsManager a new popup window will open up.





Select the “RepRap Arduino-uniform Mother Board (RAMBo) by UltiMachine” in the latest version (i.0.ane as I am writing this guide) and install it.
Again you lot see the Entry from Prusa research in my list, this is for the MMU2 board, not the Einsy Rambo.

The next pace from the Prusa ReadMe says you should change the compiler flags in the “platform.txt” file. Many people fail here because they don’t know which file to modify, then they search and find, depending on the platforms installed in the arduino IDE, many “platform.txt”.

c. modify platform.txt to enable bladder printf support:

add “-Wl,-u,vfprintf -lprintf_flt -lm” to “compiler.c.elf.flags=” before existing flag “-Wl,–gc-sections”

Offset go to the arduino IDE primary folder. If you don’t know how to get there, get to preferences in the menu, at that place is a line “” click on information technology and the binder will open. But make sure yous close the arduino IDE while y’all are editing those files!



But if you lot look at the “platform.txt” file that is in the Rambo folder, it does not contain annihilation similar the line you lot should change.

Read:  How to Update Firmware on Linkstation 420





Next you lot open the ultimachine folder and edit this “platform.txt”.



You notice the line and add the “-Wl,-u,vfprintf -lprintf_flt -lm” to information technology. That should work correct?



NO, it does not!




When you compile the lawmaking will go no errors, merely the firmware will not work properly. Y’all can easily spot this problem on the Prusa start screen when you have flashed a firmware with those flags not enabled. The z acme is showing a “?” instead of a value.



The only identify the compiler changes worked for me are in the arduino->hardware->avr->[version] folder.



Edit the “platform.txt” in here as described in the ReadMe and it volition work. I did for me at least.



Save the file and when y’all start the arduino IDE next fourth dimension this is active.

Hint!
With every arduino IDE update this will be overwritten and you have to edit information technology again. Or create a “platform_local.txt” for persistent changes.

At present that we have setup our environment to compile the lawmaking, we need the lawmaking itself.
As Prusa publishes everything as open source on GitHub we can become the lawmaking from there.

https://github.com/prusa3d/Prusa-Firmware

If you lot are not familiar with Git and have no Git or Git Desktop installed, the easiest way to get the code is to download a zip file.



In that naught file is all the code yous need.



The side by side step is to re-create the file “1_75mm_MK3-EINSy10a-E3Dv6full.h” from the sub directory “variants” to the enclosing directory “firmware” and rename it to “Configuration_prusa.h”.





Now we are prepared to make modifications to the code. Delight us an editor that does not change the format of the files. On Mac the TextEdit works fine, other tools might transform the files in some rich text format which makes them unusable. Be careful if yous utilize Windows, Windows tools by default change the text format past adding a railroad vehicle return to each line. Become a tool like Notepad++ if you utilise Windows.
As yous may see from the adjacent screenshots I am using Eclipse, a developer IDE. You don’t accept to use Eclipse and if you don’t know how to use it, it may be too difficult for you. I utilise it as I am used to it as I exercise other software projects.

Prusa recommends to disable multi-language support in the “config.h” file. I have no thought why they still accept it enabled in the source files, if they recommend to change it. Merely comment out( add together “//” in forepart) the line the value “#define LANG_MODE 1” and uncomment (remove the “//” from the front) the line with the “#define LANG_MODE 0”. You find those line pretty much at the end of the “config.h” file.





If you don’t programme to make any other changes to the original Prusa firmware you are good to go now and compile the code. Maybe information technology is not a bad idea to give it a try at present, while you have not inverse anything. That could rule out any problem you could accept fabricated and then far.

Read:  Cara Flash Redmi Note 3

Ok, at present nosotros need to tweak some settings in the code. In my example I am not using the E3D V6 or a clone of it. Instead I am using a Titan Aqua Clone from China.
The nozzle from this different hot-terminate and mount is not at the same position as I would have used an E3D V6. The other changes we have to make are the extruder steps. Because this is a 3:1 geared extruder we have to change the steps per mm and the management of the motor.

I am using the values that Chris Vahi posted on Thingiverse for this Titan Aqua mount. I remixed his mount for me every bit I wanted to take the hoses directly upwardly from the hot-end. But I did not change whatsoever other geometry from his pattern. So in theory his values should work for me.

We need to modify the “Configuration_prusa.h” file that we copied and renamed before.
Showtime we alter the steps per millimeter for the extruder motor from the default 240 to 840. Look for the line “#define DEFAULT_AXIS_STEPS_PER_UNIT”.



It is the terminal value in the line, I just commented out (//) the original and copied it to a new line with the new value.



Now nosotros need to change the direction of the extruder motor. Observe line “#define INVERT_E0_DIR”.



The comment seems to be the reverse of what this line value does. Then I changed it to “i”.



The side by side step is to adjust the z axis. As the nozzle is higher as on the usual MK3 we have more z peak. But as the nozzle is more towards the front end of the printer, we have less space on the y centrality for press. Expect for line “Travel limits later on homing”



Then change the value for the z axis from 210 to 218 and for the y axis from 215.v to 170.five. Everything else stays the same.



In my instance the z scale always failed, the motors did non motion just kept humming. As Prusa does not use end finish switches, but rather the stall guard characteristic on the TMC2130 motor drivers I need to conform the sensitivity for the z axis from 4 to five. I guess the root crusade is that the motor I git from bluerolls just need more than current as the LDO motors that Prusa uses.





We too have to tell the firmware that the offset between the nozzle and the P.I.N.D.A probe is different now. Await for line “#define X_PROBE_OFFSET_FROM_EXTRUDER”.



Then nosotros change the value for the x axis from 23 to 30 and for the y centrality from 5 to 45.



That is it for the”Configuration_prusa.h”, you can now save it.

In the “Configuration.h” you find starting time for the P.I.N.D.A probe every bit well. Merely they don’t match with the values in the “Configuration_prusa.h”. Seems like they are not used anyway. The whole department is an “ifdef” and the value “ENABLE_AUTO_BED_LEVELING” is commented out before.

Read:  Samsung Galaxy J1 2016 Sm-j120g Firmware Download





For at present this is all I want to modify. Once I have tested the printer I desire to implement some more enhancements to the code, like the 7×7 mesh bed leveling.

Now we can compile our code. Open up the arduino IDE. Then go to File->Open and open the “Firmware.ino” file in the Firmware directory.



Then go to Tools->Lath and select the RAMBo board.





Now you can go to Sketch-Verify/Compile to see if y’all can compile without whatever issues.



The compiler will now take a few seconds to verify and compile the code.



If that was successful you should see a message like this.



Then get to Sketch->Export compiled Binary and it will compile once again and consign the hex file we need.



Then a new file should appear in our firmware directory.



You lot may notice that the file size is smaller than the hex files you go from Prusa. The only caption I have for this is that Josef Prusa mentioned onetime that they link the bootloader now together with the firmware.
This is why I would recommend to first install the latest Firmware from Prusa on any new board you become from Ultimachine or chinese sellers.

The next pace is to flash the firmware to the printer. I used Slic3r PE for it. Information technology is exactly the aforementioned process equally with every firmware update from Prusa.
Use the USB cable to connect your printer to the computer and turn the printer on.
Go to Configuration->Flash printer firmware in Slic3r PE.



Open the file and hit rescan if y’all cannot run into the printer detected.



Then hitting Wink! and look for the firmware to be flashed to the eeprom.



In one case it is completed y’all printer will reboot and you can shut the popup from Slic3r.



So far everything looked well. First thing to cheque was if at that place is a proper value for the z meridian on the commencement screen. This proves that the compiler flags worked. Then I moved the axis effectually and everything seemed to work fine.



But I still accept bug with the XYZ calibration. For some reason the first calibration point is found with no issues, but the 2nd 1(front right) fails every time. Sometimes I had to hit the reset push every bit the nozzle was scratching on the paper.

As you can see the sensor is about + 30-40 mm off from the calibration signal on the y axis.



So I thought about the change on the Y-axis and changed the value back to 215.v mm for the Y_MAXPOS and this is pretty much the amount that the sensor if off on the 2nd calibration point. Simply that did not alter anything, It too would non explain why the first calibration bespeak works.

I guess will need some time to sort out what the consequence is here. Simply I thought I share this mail anyhow every bit I get asked a lot how to compile the Prusa Firmware.

How to Compile and Modify Prusa Firmware

You May Also Like