Notifications
Clear all

How to add skew correction to MK4?  

  RSS
NORCAL 50
(@norcal-50)
Active Member
How to add skew correction to MK4?

I'm almost certain the M852 g-code is disabled in the firmware. Following was done using VS Code, and all the **** it suggested I install when cloning the github repositories. Also, please no comments about it not being needed. Need is subjective. My XY and XZ skew is near zero (0.01 degrees or less), impressive, but YZ isn't and I'd rather not tinker when (if enabled by default) software would be way easier than dis and re-assembly, until magically you figure out why it's off.

Anyways:

If I'm not mistaken is can be enabled by:

  1. Cloning the Prusa-Firmware-Buddy 6.1.2 gitub repository
  2. Navigating to this file: Prusa-Firmware-Buddy\lib\Marlin\config\default\Configuration.h
  3. Enabling M852 by changing line 1386: //#define SKEW_CORRECTION_GCODE
    1. To: #define SKEW_CORRECTION_GCODE
  4. Enabling EEPROM by changing line 1404: //#define EEPROM_SETTINGS
    1. To: #define EEPROM_SETTINGS
  5. Running the following command in my VS Code terminal from the Prusa-Firmware-Buddy directory:
    1. python utils/build.py --generate-bbf --final --preset MK4
    2. Above command should create a final release version of the firmware specifically for the MK4 printer?
      1. Except it does this: PS C:\Users\NORCAL50\Desktop\Prusa-Firmware-Buddy> python utils/build.py --generate-bbf --final --preset MK4>>Creating needed virtual environment in .venvSwitching to Buddy's virtual environment.You can disable this by setting the BUDDY_NO_VIRTUALENV=1 env. variable.PS C:\Users\NORCAL50\Desktop\Prusa-Firmware-Buddy> C:\Users\NORCAL50\.platformio\python3\python.exe: can't open file 'C:\\Users\\NORCAL50\\Desktop\\Prusa-Firmware-Buddy\\Firmware\\Prusa-Firmware-Buddy\\.venv\\Scripts\\python': [Errno 2] No such file or directory

But assuming:

  1. I didn't get an error.
  2. I made the correct changes to the firmware, and there's nothing else I'm forgetting or doing incorrectly.

 

All is left is to break the appendix on the motherboard, and re-flash my modified firmware? Am I missing anything? I have no idea what I'm doing so, figured it wouldn't be a bad idea to check with the pros.

 

Following photo is after changes were made:

Napsal : 30/08/2024 7:48 pm
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE:

Update, I fixed this error: Prusa-Firmware-Buddy\\.venv\\Scripts\\python': [Errno 2] No such file or directory

By:

  1. Installing virtualenv
  2. Then, from the Prusa-Firmware-Buddy directory, run this command: python -m venv .venv
  3. It should work now, but it still didn't for me, so I had to run this from power shell: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  4. And now you should be able to compile. If it still doesn't work, you'll need to cd over to the .venv directory and run this command: .\Activate

 

But now I got a new error: [Errno 2] No such file or directory: 'C:\\Users\\NORCAL50\\Desktop\\Prusa-Firmware-Buddy\\.dependencies\\gcc-arm-none-eabi-13.2.temp\\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\\arm-none-eabi\\include\\c++\\13.2.1\\arm-none-eabi\\thumb\\v7-a+simd\\softfp\\bits\\messages_members.h'

Napsal : 31/08/2024 4:37 am
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE: How to add skew correction to MK4?

Another update, worked through many more errors, and eventually got everything to compile successfully, these errors happened in this order for me:

 

  1. Error #1: [Errno 2] No such file or directory: 'C:\\Users\\NORCAL50\\Desktop\\Prusa-Firmware-Buddy\\.dependencies\\gcc-arm-none-eabi-13.2.temp\\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\\arm-none-eabi\\include\\c++\\13.2.1\\arm-none-eabi\\thumb\\v7-a+simd\\softfp\\bits\\messages_members.h'
    1. Fix: Manually downloaded python, and disabled path length limit at the end of installation. Also, I don't think I mentioned this, but I'm in Windows 10, just FYI.
  2. Error #2: blahblahblah/Prusa-Firmware-Buddy/src/buddy-esp-serial-flasher/esp_flash.cpp:33:10: fatal error: esp_parts.gen: No such file or directory
    1. Fix: Re-compile? Idk it just went away.
  3. Error #3: blahblahblah/Prusa-Firmware-Buddy/src/resources/esp8266/" --flash partition-table.bin:0x08000 --flash bootloader.bin:0x00000 --flash uart_wifi.bin:0x10000 --memory stub_text.bin:0x4010d000 --memory stub_data.bin:0x3fff01b4"Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
    1. Fix: Installed python from microsoft store, despite existing python install. I'm sure there's probably a more correct way to fix this, but my paths looked good and this worked so..
  4. Error #4: This is more so of a recurring of the aforementioned errors, just make sure when you get the popup for which program to use to open .py files by default (during compilation) you quickly select python and make sure windows remembers to do that.
  5. Error #5: You'll probably get the same errors, but now that you've done the above fix, just compile it one more time and everything should work nicely.

 

I'm sure there's a plethora of things I've done wrong to get it to compile, but I did eventually get here lol.

Napsal : 31/08/2024 2:57 pm
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE: How to add skew correction to MK4?

There's a lot of files in Prusa-Firmware-Buddy\build\mk4_release_boot

 

Do I just need to transfer the firmware.bbf file over to my USB drive to flash?

Napsal : 31/08/2024 3:24 pm
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE: How to add skew correction to MK4?

So, the firmware you want to use, if I understand correctly is located here (after compiling): Prusa-Firmware-Buddy\build\products\mk4_release_boot_6.1.0.bbf

 

I got a new motherboard to do my experimenting on as I don't want to do it (break the appendix) on the stock buddy board that came with my printer. Hope this information helps someone in the future. But as of now, I still need to see if it works or if what I've done is wrong. Will report back once the new board comes in and I flash the firmware.

Napsal : 01/09/2024 11:10 pm
Fil4ment
(@fil4ment)
Trusted Member
RE: How to add skew correction to MK4?

Nothing to add, subbing to thread.

Napsal : 02/09/2024 4:56 pm
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE:

 

Posted by: @norcal-50

Update, I fixed this error: Prusa-Firmware-Buddy\\.venv\\Scripts\\python': [Errno 2] No such file or directory

By:

  1. Installing virtualenv
  2. Then, from the Prusa-Firmware-Buddy directory, run this command: python -m venv .venv
  3. It should work now, but it still didn't for me, so I had to run this from power shell: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  4. And now you should be able to compile. If it still doesn't work, you'll need to cd over to the .venv directory and run this command: .\Activate

 

But now I got a new error: [Errno 2] No such file or directory: 'C:\\Users\\NORCAL50\\Desktop\\Prusa-Firmware-Buddy\\.dependencies\\gcc-arm-none-eabi-13.2.temp\\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\\arm-none-eabi\\include\\c++\\13.2.1\\arm-none-eabi\\thumb\\v7-a+simd\\softfp\\bits\\messages_members.h'

Made an error in the above instruction. You need to cd .venv and then cd Scripts to get into the  correct directory to run .\Activate command from terminal. Assuming you're already in the Prusa-Firmware-Buddy directory.

 

Made another error in the original post as well, you also need to uncomment #define SKEW_CORRECTION and #define SKEW_CORRECTION_FOR_Z. In addition to the other two lines we already uncommented in original post. If this is confusing, I'll give a more clear guide after I figure it out myself (and determine if it even works).

 

 

ALSO, UPDATE: Modified firmware compiled successfully, and flashed to the new buddy board successfully (yay I didn't brick the board). Print is running now, and looks good. Worst case, the skew correction just doesn't work. Will measure part for skew tomorrow and report back if it works.

Napsal : 07/09/2024 5:10 am
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE: How to add skew correction to MK4?

UPDATE: It did not work. I suspect this is because I was editing the incorrect Configuration.h file

  • I was originally modifying: Prusa-Firmware-Buddy\lib\Marlin\config\default\Configuration.h
  • The one I now think is the correct Configuration.h file: Prusa-Firmware-Buddy\include\marlin\Configuration_MK4.h

Firmware is compiled and flashed. Another print running now, will report back how it goes later today.

Napsal : 08/09/2024 4:04 pm
NORCAL 50
(@norcal-50)
Active Member
Topic starter answered:
RE: How to add skew correction to MK4?

Yeah, it doesn't work. I'm going to keep digging. Will update if I manage to make any progress.

Napsal : 11/09/2024 11:50 pm
Fil4ment
(@fil4ment)
Trusted Member
RE: How to add skew correction to MK4?

Damn. I had high hopes. Good luck with this, and please keep us updated!

Napsal : 12/09/2024 12:24 am
Share: