Notifications
Clear all

Modifying mesh-bed levelling positions  

  RSS
AnandPR
(@anandpr)
New Member
Modifying mesh-bed levelling positions

Hello Prusa Community,

We are modifying a Prusa MK3S+ for R&D purposes and we are also in the process of modifying the Prusa Firmware (based on the original firmware version 3.10.0). In this process, we are trying to modify the mesh-bed levelling functionality.

Essentially, we want to print on a substrate that we place on the print-bed. So, we want to perform mesh-bed levelling on this bespoke substrate (i.e., not the full print-bed).

Steps tried:

1. In the Configuration_prusa.h file, we changed the MESH_MIN_X, MESH_MIN_Y, MESH_MAX_X, MESH_MAX_Y values corresponding to the dimensions and the location of our substrate on the print-bed, but mesh-bed levelling was done on the default positions (i.e., across the entire print-bed).

2. We also tried changing the X_MIN_POS, Y_MIN_POS, X_MAX_POS, Y_MAX_POS values to update the size of the print-bed to match the substrate. However, the mesh-bed levelling positions were not automatically updated to fit the new print area. Any point of calibration outside of our defined print area was simply performed at the edges (i.e., at the MIN_POS or the MAX_POS values).

3. Additionally, we also tried changing the number of mesh points from 3x3 to 7x7, but that of course, did not change how the default positions were calculated.

Any help on how we can adapt the mesh-bed levelling positions would be greatly appreciated! Thank you very much in advance!

Best Answer by AnandPR:

We seem to have managed to figure out how to change the coordinates of the mesh-bed levelling points. Please see below for what we've tried and how we fixed it. (Please note that Prusa has updated the Marlin base firmware, so of course, some functions are obsolete and replaced by Prusa's own functions).

1 - In case you are not familiar with the firmware, the Prusa firmware can be downloaded from GitHub. In the Firmware folder, go to the variants sub-folder, choose the correct '.h' file based on your board and create a copy of it on the parent Firmware folder. Rename this file to "Configuration_prusa.h".

2 - In the Configuration_prusa.h file, the number of points (the grid) for mesh-bed levelling can be changed by updating the values of MESH_MEAS_NUM_X_POINTS and MESH_MEAS_NUM_Y_POINTS. This is similar to the settings found on the LCD screen. The locations are estimated automatically using a bilinear interpolation function (using Lagrangian polynomials), which we believe is what is coded in the mesh_bed_leveling.cpp and mesh_bed_leveling.h files.

3 - In the Configuration_prusa.h file, we tried updating the MESH_MIN_X, MESH_MAX_X, MESH_MIN_Y, MESH_MAX_Y values, but this did not result in any observable change to the mesh-bed levelling behaviour (i.e., mesh-bed levelling was performed on the default locations) even though they seem to be referred to in the mesh_bed_leveling.cpp and mesh_bed_leveling.h files.

4 - We then tried updating the X_MIN_POS, X_MAX_POS, Y_MIN_POS, Y_MAX_POS values, in the Configuration_prusa.h file. Here, the mesh-bed levelling still occurred at the default positions, but if any given location is outside the MIN_POS, MAX_POS values, it just performs levelling at the limits.

Solution:

5 - The area defining the mesh-bed levelling points is actually located in the mesh_bed_calibration.h file, defined as BED_X0, BED_Y0, BED_Xn, BED_Yn. You can update the values here to control the area within which mesh-bed levelling is performed. We guess this seems to be a Prusa addition, making the original bilinear interpolation function in the mesh_bed_leveling.cpp and mesh_bed_leveling.h files redundant/not used (we think!).

Hope this helps anyone wanting to update the mesh-bed levelling area down to just the print area (for a high-resolution topography scan)...

Posted : 10/08/2021 2:03 pm
cwbullet
(@cwbullet)
Member
Mesh leveling

I am trying to understand why you want to do this.  Can you explain further?

You could put a feature request on GitHub.  

--------------------
Chuck H
3D Printer Review Blog

Posted : 11/08/2021 1:52 am
Swiss_Cheese
(@swiss_cheese)
Noble Member

Who's We?

The Filament Whisperer

Posted : 11/08/2021 3:08 am
AnandPR
(@anandpr)
New Member
Topic starter answered:
Slurry Doser project

Hi, 

Thanks for the quick response. We are essentially trying to replicate the Slurry Doser -  (academic publication).

In short - in the above publication, the printer has a bespoke extruder carriage, where the extruder motor drives a leadscrew that pushes the plunger of a plastic syringe to dose controlled amounts of silica slurry onto a substrate. 

In our case, we use the MK3S+ with the SuperPINDA sensor and have designed our own extruder carriage. We want to exploit the sensitivity of the SuperPINDA sensor and perform mesh-bed levelling on the substrate to have a high spatial resolution.

Are you suggesting that the mesh-bed levelling parameters cannot be modified and that we should request a feature update? My concern is that changing the mesh-bed levelling parameters on Configuration_prusa.h didn't seem to change anything. We have successfully modified the firmware to adapt to the changes we've made, for e.g., switching off the extruder heater, temp sensor, updating the E_AXIS motor's pitch, steps/mm, etc. But we can't seem to modify the mesh-bed params.

Posted : 11/08/2021 11:00 am
AnandPR
(@anandpr)
New Member
Topic starter answered:
Academic group

We are an academic group based in London. Please see my reply above for the project we are trying to build/replicate.

Posted : 11/08/2021 11:01 am
AnandPR
(@anandpr)
New Member
Topic starter answered:
Updating Mesh-bed levelling area

We seem to have managed to figure out how to change the coordinates of the mesh-bed levelling points. Please see below for what we've tried and how we fixed it. (Please note that Prusa has updated the Marlin base firmware, so of course, some functions are obsolete and replaced by Prusa's own functions).

1 - In case you are not familiar with the firmware, the Prusa firmware can be downloaded from GitHub. In the Firmware folder, go to the variants sub-folder, choose the correct '.h' file based on your board and create a copy of it on the parent Firmware folder. Rename this file to "Configuration_prusa.h".

2 - In the Configuration_prusa.h file, the number of points (the grid) for mesh-bed levelling can be changed by updating the values of MESH_MEAS_NUM_X_POINTS and MESH_MEAS_NUM_Y_POINTS. This is similar to the settings found on the LCD screen. The locations are estimated automatically using a bilinear interpolation function (using Lagrangian polynomials), which we believe is what is coded in the mesh_bed_leveling.cpp and mesh_bed_leveling.h files.

3 - In the Configuration_prusa.h file, we tried updating the MESH_MIN_X, MESH_MAX_X, MESH_MIN_Y, MESH_MAX_Y values, but this did not result in any observable change to the mesh-bed levelling behaviour (i.e., mesh-bed levelling was performed on the default locations) even though they seem to be referred to in the mesh_bed_leveling.cpp and mesh_bed_leveling.h files.

4 - We then tried updating the X_MIN_POS, X_MAX_POS, Y_MIN_POS, Y_MAX_POS values, in the Configuration_prusa.h file. Here, the mesh-bed levelling still occurred at the default positions, but if any given location is outside the MIN_POS, MAX_POS values, it just performs levelling at the limits.

Solution:

5 - The area defining the mesh-bed levelling points is actually located in the mesh_bed_calibration.h file, defined as BED_X0, BED_Y0, BED_Xn, BED_Yn. You can update the values here to control the area within which mesh-bed levelling is performed. We guess this seems to be a Prusa addition, making the original bilinear interpolation function in the mesh_bed_leveling.cpp and mesh_bed_leveling.h files redundant/not used (we think!).

Hope this helps anyone wanting to update the mesh-bed levelling area down to just the print area (for a high-resolution topography scan)...

Posted : 18/08/2021 2:15 pm
Share: