Bed Level Visualizer vs actual bed

How do I determine which point on the Bed Level Visualizer corresponds to what corner on my actual printers bed?

Trial and error. Run a report, make adjustments to only one corner, run a report again and see which corner in the surface mesh displayed moved.

Just a suggestions: Would be nice to have in addition to 'Flip X' and 'Flip Y', rotate 90, 180 and 270 degrees options in the settings. That would allow plugin to correctly represent the bed orientation for all firmware flavors.
Even better would be if above settings are linked to particular printer profile.

Thanks

Just saying:


Rotating isn't really needed.

Ok, flipping along X and Y is the same as rotating 180 degree, but 90 degree rotations in either direction cannot be reproduced by flipping.

For simplicity lets call Xmin - '0', Ymin - '0', Xmax - 'X' and Ymax - 'Y'

Initial
===============
0,Y -------- X,Y
|            |
|            |
|            |
|            |
0,0 -------- X,0

Flipped X               Flipped Y                 Flipped X and Y
===============         ===============           ===============
X,Y -------- 0,Y        0,0 -------- X,0          X,0 -------- 0,0
|            |          |            |            |            |
|            |          |            |            |            |
|            |          |            |            |            |
|            |          |            |            |            |
X,0 -------- 0,0        0,Y -------- X,Y          X,Y -------- 0,Y

Rotated 90 clockwise    Rotated 180 clockwise    Rotated 270 clockwise
====================    =====================    =====================
0,0 -------- 0,Y        X,0 -------- 0,0         X,Y -------- X,0
|            |          |            |           |            |
|            |          |   Same as  |           |            |
|            |          | Flip X & Y |           |            |
|            |          |            |           |            |
X,0 -------- X,Y        X,Y -------- 0,Y         0,Y -------- 0,0

I am having this issue with Repetier firmware, I need to rotate the chart to match the bed layout, but there is not such option.

Thanks

I can take a look into the possibility of using a rotation setting rather than a flip setting, but may not be for a while. Basically what the plugin does is process the lines as they are received in the output of the gcode report command and appends them to a list, creating a 2D array basically (list of lists). That is then fed into numpy to be able to use relative offsets. Maybe numpy has a means to rotate the 2d array, I'll have to check.

This might actually be easier than I thought...I'll do some tests tonight.

Great! Sign me up for testing :smiley:

You can try it by using the URL below in plugin manager. My initial virtual testing seems to be functioning as expected.

https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/0.1.12.zip

I run 4 tests before upgrading to new version. In each test I placed small 0.3mm high piece of metal in one of the bed's corners. Both - Flip X and Flip Y options were off. The results were as follows:
When the piece was in 0,0 and Xmax,Ymax corners, the graph was correct. When it was in other 2 corners it was inverse, i.e. flipped along 0,0 - Xmax,Ymax diagonal.

To correct this I was planning to select Flip X and rotate 90 degree clockwise. Another way to reach the same result would be Flip Y and rotate 90 degrees counterclockwise.

I installed new version without removing the old (unsure if this was the right way).

The first thing that caught my eye - Rotate drop down list contains 0, 90, 180 and 270 degree options, but does not say whether it is clockwise or counterclockwise rotation. Would be nice to mention that in little popup appearing from Rotation dropdown list label.

But then I run my z-probing GCode commands (the same as before) and did not get any result. The tab was showing "Please wait, retrieving current mesh." message even after completing z-probing. I tried several times, but the result was the same.
One other thing that I mentioned was that there is no option to cancel ongoing attempt to retrieve the mesh. I ended up restarting Octoprint to get out of retrieving mode.

Here are the extracts from Serial log. These are Distortion correction matrix printouts. I am using 9x9 grid. My printer runs on Repetier firmware version 1.0.

Before upgrade tests.

2020-01-09 17:11:08,792 - Recv: Info:Distortion correction matrix:
2020-01-09 17:11:08,796 - Recv: -40, -43, -179, -77, -55, 24, 201, 149, 158
2020-01-09 17:11:08,800 - Recv: 78, 48, 39, -27, 100, 135, 297, 280, 331
2020-01-09 17:11:08,811 - Recv: 86, 9, 58, 7, 9, 191, 193, 227, 227
2020-01-09 17:11:08,815 - Recv: 112, 105, 81, -10, 148, 82, 264, 149, 354
2020-01-09 17:11:08,819 - Recv: 245, 122, 156, 0, -158, 118, 104, 251, 381
2020-01-09 17:11:08,823 - Recv: 142, 57, 56, 45, 27, 69, 191, 57, 231
2020-01-09 17:11:08,827 - Recv: 218, 68, 2, -50, 25, 3, 69, 56, 55
2020-01-09 17:11:08,832 - Recv: 2262, 2093, -258, -185, -208, -176, -55, -22, -46
2020-01-09 17:11:08,837 - Recv: 1735, -144, -261, -408, -376, -304, -299, -209, -147
------------------------
2020-01-09 17:25:34,087 - Recv: 1648, 1321, -669, -517, -522, -292, -181, -237, -191
2020-01-09 17:25:34,092 - Recv: -290, -321, -374, -457, -205, -133, -94, 1, 64
2020-01-09 17:25:34,097 - Recv: -219, -199, -319, -233, -211, 35, 69, 125, 109
2020-01-09 17:25:34,103 - Recv: -123, -194, -213, -187, 26, -34, 165, 274, 233
2020-01-09 17:25:34,107 - Recv: -29, -90, 100, -200, -198, 120, 71, 187, 354
2020-01-09 17:25:34,112 - Recv: 41, 29, 103, 91, 116, 140, 273, 176, 400
2020-01-09 17:25:34,116 - Recv: 377, 175, 165, -19, 105, 181, 179, 242, 310
2020-01-09 17:25:34,120 - Recv: 215, 243, -41, 30, 10, 160, 205, 116, 243
2020-01-09 17:25:34,124 - Recv: 126, 102, 10, -195, -128, 26, 76, -10, 91
------------------------
2020-01-09 17:36:29,612 - Recv: 76, -6, -82, -43, -126, -30, -8, -66, -51
2020-01-09 17:36:29,622 - Recv: 272, 32, -22, -85, -18, 51, 18, -125, -13
2020-01-09 17:36:29,629 - Recv: 231, 51, 39, -54, -147, 102, -9, -34, -107
2020-01-09 17:36:29,633 - Recv: 221, 53, 85, -165, -108, -115, 36, -181, -3
2020-01-09 17:36:29,636 - Recv: 366, 40, -31, -124, -87, -143, -195, -220, -46
2020-01-09 17:36:29,640 - Recv: 200, -7, -141, -206, -248, -199, -225, -361, -199
2020-01-09 17:36:29,643 - Recv: 289, -84, -131, -247, -161, -231, -396, -446, -495
2020-01-09 17:36:29,647 - Recv: -50, -171, -505, -480, -547, -457, -562, -574, 1203
2020-01-09 17:36:29,652 - Recv: -17, -369, -393, -664, -676, -678, -672, -838, -979
------------------------
2020-01-09 17:46:58,721 - Recv: -255, -82, -307, -276, -206, -53, 5, -86, 1944
2020-01-09 17:46:58,729 - Recv: -27, -116, -62, -191, 1, -5, 160, 96, 104
2020-01-09 17:46:58,737 - Recv: 55, -36, -22, -72, -62, 142, 117, 105, 192
2020-01-09 17:46:58,742 - Recv: 141, 20, 47, -105, 81, 2, 123, 138, 264
2020-01-09 17:46:58,746 - Recv: 312, 168, 82, -86, 50, 149, 121, 89, 304
2020-01-09 17:46:58,750 - Recv: 255, 233, 74, 0, -42, 21, 122, -78, 245
2020-01-09 17:46:58,753 - Recv: 411, 112, 169, 7, 65, 117, 24, -3, 99
2020-01-09 17:46:58,757 - Recv: 235, 175, -80, -158, -235, -73, -32, -72, -116
2020-01-09 17:46:58,762 - Recv: 122, 83, 50, -296, -235, -261, -48, -275, -141
------------------------

After upgrade tests

2020-01-09 18:03:05,664 - Recv: 1218, -449, -571, -530, -445, -273, -167, -137, -147
2020-01-09 18:03:05,673 - Recv: -305, -340, -297, -272, -119, -105, 38, 1, -8
2020-01-09 18:03:05,679 - Recv: -190, -149, -301, -164, -155, 14, 93, 91, 101
2020-01-09 18:03:05,685 - Recv: 4, -26, -24, -109, 23, -6, 114, 198, 235
2020-01-09 18:03:05,688 - Recv: -8, -80, 25, -113, -72, 13, 179, 172, 328
2020-01-09 18:03:05,693 - Recv: 71, 108, 18, 74, 20, -16, 300, 206, 249
2020-01-09 18:03:05,696 - Recv: 386, 179, 131, 21, 34, 61, 156, 159, 127
2020-01-09 18:03:05,701 - Recv: 105, 256, -147, 17, -115, -103, 139, 66, 83
2020-01-09 18:03:05,706 - Recv: 41, -109, -103, -300, -250, -158, -95, -91, -33
-----------------------
2020-01-09 18:27:13,847 - Recv: 1435, -317, -417, -395, -407, -225, -187, -218, -98
2020-01-09 18:27:13,857 - Recv: -162, -227, -248, -290, -133, -56, 3, -10, -16
2020-01-09 18:27:13,862 - Recv: -42, -68, -129, -74, -168, 115, 72, -3, 68
2020-01-09 18:27:13,867 - Recv: 63, 51, 32, 17, 63, -27, 34, 88, 213
2020-01-09 18:27:13,871 - Recv: 262, 129, 104, -61, 32, 28, 119, 112, 160
2020-01-09 18:27:13,875 - Recv: 220, 172, 146, 20, -25, 110, 181, 163, 238
2020-01-09 18:27:13,879 - Recv: 400, 161, 196, -127, 68, -20, 209, 87, 19
2020-01-09 18:27:13,883 - Recv: 170, 225, -68, -20, -160, -40, 51, -68, -32
2020-01-09 18:27:13,887 - Recv: 187, 139, 114, -132, -152, -169, -111, -169, -164
-----------------------
2020-01-09 18:41:18,526 - Recv: -155, -102, -243, -171, -158, -11, 132, 73, 154
2020-01-09 18:41:18,529 - Recv: 30, 38, -26, -208, -11, 123, 199, 95, 251
2020-01-09 18:41:18,533 - Recv: 123, 67, -1, -10, -57, 144, 155, 220, 250
2020-01-09 18:41:18,542 - Recv: 173, 68, 97, -33, 135, 95, 190, 164, 331
2020-01-09 18:41:18,549 - Recv: 227, 22, 44, -18, -26, 26, 32, 242, 249
2020-01-09 18:41:18,554 - Recv: 154, 36, 6, -95, -45, -19, 195, 34, 139
2020-01-09 18:41:18,558 - Recv: 102, -97, -49, -234, -156, -129, -105, -97, 15
2020-01-09 18:41:18,562 - Recv: 2059, 1623, -289, -318, -332, -250, -118, -287, -80
2020-01-09 18:41:18,567 - Recv: 1621, -217, -239, -498, -448, -497, -399, -457, -333

Not sure why the last 3 failed to parse.

Thanks.

There have been similar reports about getting stuck on retrieving mesh. The timeout value should cause that to reset itself. But there was also another issue recent regarding large numbers in the results, which your output definitely falls under. I've never seen anyone using those distortion correction matrix before. I would suspect that if this was working for you before I don't see how it would be displayed in the tab because it would be outside the +/- 2mm range from 0 that is graphed.

So after going back and reviewing the code again I don't see how this ever worked for you even before the upgrade. The regular expression used (below) to match offset distances required a comma separated line of numbers that is composed of a single digit number followed by a decimal point followed by any number of digits.

^((G33.+)|(Bed.+)|(\d+\s)|(\|\s*)|(\[?\s?\+?\-?\d?\.\d+\]?\s*\,?)|(\s?\.\s*)|(NAN\,?))+$

This regex hasn't changed since version 0.1.8.

I am having troubles testing. In most cases I either get failure, due to sensor did not untrigger, or the result is not displayed. The result of one of successful tests is shown below. Test object was at 0,0 corner and with rotation set to 90 appeared in 0,Ymax corner, which means rotation is clockwise.
2020-01-11 00_11_15-OctoPrint
It is past midnight here on West coast. I will try to find time this weekend and run more tests. May need to find the reason of untrigger errors first.

Thanks

Yes, the rotation is clockwise.

So in my case using an Ender3 I managed to map the following:

So without touching the Bed Level view, then pressing "reset camera to default" my points are as follows:

3dprint_bed_level

Hope this helps someone...

Fixed the sensor and run 3 more tests all without test object and with manually leveled bed. First test with flips off and rotation off completed successfully. Another with the same settings and one more with rotation 90 and flip-X failed to parse the result and eventually timed out. Each test in my setup takes about 10 minutes and is rather time consuming.
It is probably a big change, but if you'll ever decide to rewrite this plugin, you may want to consider storing data as it was received from the printer and then apply flip and/or rotation to that stored data. In such case user won't need to re-run measurements every time he/she realizes that chart needs to be flipped or rotated.

Thanks

What is your timeout value set to? If it's not long enough I could see that happening taking into account the 10 minutes to complete. I'm not familiar enough with Repetier firmware to know if there is a reporting option versus having to run the leveling process completely like there is in some Marlin leveling options like UBL. It stores the mesh in EEPROM and you can run separate command to just get the report.

What command are you using in Repetier to run the leveling? I'd like to do some more research. Still not sure how you are getting those large numbers you posted before to display on the graph since they are outside the bounds of the +/- 2mm range. Can you post your settings for the gcode and the responses from the terminal tab for me?

Just took a quick look and it seems that the command G33 L0 would list the offsets stored in EEPROM if that option is enabled and not run the full probing process.

https://reprap.org/wiki/G-code#G33:_Measure.2FList.2FAdjust_Distortion_Matrix_.28Repetier_-_Redeem.29

I usually print with PETG and running measurements with bed heated to 80 degrees. If the bed before the test is at room temperature, to heat it up at complete measurements takes about 10 minutes. My timeout is set to 15 min. Plugin times out few minutes AFTER completing measurements and presents the last chart that it was able to parse.

Below are the details of last successful measurements/parsing.



GCode:

M117 Homing...
G28
M117 Lowering bed 20mm
G1 Z20 F400
M117 Heating bed...
M140 S80 ;Start heating bed
M190 S80 ;Wait for bed to reach temp before proceeding
M117 Activating Z-probe
G1 X100 Y100 F6000 ; center printhead
G1 X-9 S1 F4000 ; Pull probe down Step 1
G1 Y-3 F4000 ; Pull probe down Step 2
G1 Y20 F6000 ; Move head back to bed center Step 3a
G1 X20 S0 F6000  ; Move head back to bed center Step 3b
G1 X0 Y0 F4000  ; Move head back to bed center Step 3c
M117 Phase 1 (G32)
G32 S2 ; S2 Saves in EEPROM
G1 X0 Y0
G1 Z10 F400
M117 Phase 2 (G33)
@BEDLEVELVISUALIZER
G33
M500 ; save config in EEPROM
M117 Deactivating Z-probe
G1 X100 Y100 F6000 ; center printhead
G1 X-9 S1 F4000 ; Pull probe up Step 1
G1 Y204 F4000 ; Pull probe up Step 2
G1 Y100 F6000  ; Move head back to bed center Step 3a
G1 X100 S0 F6000 ; Move head back to bed center Step 3b
M117 Heated bed off
M140 S0 ; Disable heated bed

serial.log (91.6 KB)

Thanks

Just replaced my entire GCode with G33 L0 and received the following output. Unfortunately the plugin was not able to parse it and timed out again. Tried with and without "Remove Row Labels" option.

Send: N7 G33 L0*66
Recv: FIRMWARE_NAME:Repetier_1.0.3 COMPILED:Jul 13 2019 FIRMWARE_URL:https://github.com/repetier/Repetier-Firmware/ PROTOCOL_VERSION:1.0 MACHINE_TYPE:Core_XY EXTRUDER_COUNT:2 REPETIER_PROTOCOL:3
Recv: Cap:PROGRESS:1
Recv: Cap:AUTOREPORT_TEMP:1
Send: N8 M155 S5*108
Recv: Cap:EEPROM:1
Recv: Cap:AUTOLEVEL:1
Recv: Cap:Z_PROBE:1
Recv: Cap:SOFTWARE_POWER:0
Recv: Cap:TOGGLE_LIGHTS:0
Recv: Cap:PAUSESTOP:1
Recv: Cap:PREHEAT:1
Recv: Printed filament:4167.94m Printing time:40 days 19 hours 1 min
Recv: PrinterMode:FFF
Recv: ok 7
Recv: G33 X-12.00 Y5.00 Z0.085
Recv: G33 X-12.00 Y28.12 Z0.122
Recv: G33 X-12.00 Y51.25 Z0.108
Recv: G33 X-12.00 Y74.37 Z0.107
Recv: G33 X-12.00 Y97.50 Z0.089
Recv: G33 X-12.00 Y120.62 Z0.074
Recv: G33 X-12.00 Y143.75 Z0.047
Recv: G33 X-12.00 Y166.88 Z0.030
Recv: G33 X-12.00 Y190.00 Z-0.036
Recv: G33 X10.63 Y5.00 Z0.050
Recv: G33 X10.63 Y28.12 Z0.098
Recv: G33 X10.63 Y51.25 Z0.071
Recv: G33 X10.63 Y74.37 Z0.087
Recv: G33 X10.63 Y97.50 Z0.067
Recv: G33 X10.63 Y120.62 Z0.061
Recv: G33 X10.63 Y143.75 Z0.040
Recv: G33 X10.63 Y166.88 Z0.000
Recv: G33 X10.63 Y190.00 Z-0.032
Recv: G33 X33.25 Y5.00 Z0.022
Recv: G33 X33.25 Y28.12 Z0.024
Recv: G33 X33.25 Y51.25 Z0.071
Recv: G33 X33.25 Y74.37 Z0.035
Recv: G33 X33.25 Y97.50 Z0.050
Recv: G33 X33.25 Y120.62 Z0.048
Recv: G33 X33.25 Y143.75 Z0.011
Recv: G33 X33.25 Y166.88 Z-0.019
Recv: G33 X33.25 Y190.00 Z-0.050
Recv: G33 X55.88 Y5.00 Z-0.038
Recv: G33 X55.88 Y28.12 Z-0.001
Recv: G33 X55.88 Y51.25 Z0.021
Recv: G33 X55.88 Y74.37 Z0.009
Recv: G33 X55.88 Y97.50 Z0.027
Recv: G33 X55.88 Y120.62 Z0.001
Recv: G33 X55.88 Y143.75 Z-0.000
Recv: G33 X55.88 Y166.88 Z-0.030
Recv: G33 X55.88 Y190.00 Z-0.053
Recv: G33 X78.50 Y5.00 Z-0.021
Recv: G33 X78.50 Y28.12 Z-0.023
Recv: G33 X78.50 Y51.25 Z0.011
Recv: G33 X78.50 Y74.37 Z0.018
Recv: G33 X78.50 Y97.50 Z0.017
Recv: G33 X78.50 Y120.62 Z0.009
Recv: G33 X78.50 Y143.75 Z-0.006
Recv: G33 X78.50 Y166.88 Z0.003
Recv: G33 X78.50 Y190.00 Z-0.041
Recv: G33 X101.12 Y5.00 Z-0.042
Recv: G33 X101.12 Y28.12 Z-0.029
Recv: G33 X101.12 Y51.25 Z0.041
Recv: G33 X101.12 Y74.37 Z0.024
Recv: G33 X101.12 Y97.50 Z0.019
Recv: G33 X101.12 Y120.62 Z0.031
Recv: G33 X101.12 Y143.75 Z0.043
Recv: G33 X101.12 Y166.88 Z0.019
Recv: G33 X101.12 Y190.00 Z-0.005
Recv: G33 X123.75 Y5.00 Z-0.046
Recv: G33 X123.75 Y28.12 Z-0.040
Recv: G33 X123.75 Y51.25 Z0.017
Recv: G33 X123.75 Y74.37 Z0.021
Recv: G33 X123.75 Y97.50 Z0.003
Recv: G33 X123.75 Y120.62 Z0.029
Recv: G33 X123.75 Y143.75 Z0.010
Recv: G33 X123.75 Y166.88 Z0.029
Recv: G33 X123.75 Y190.00 Z0.019
Recv: G33 X146.38 Y5.00 Z-0.071
Recv: G33 X146.38 Y28.12 Z-0.038
Recv: G33 X146.38 Y51.25 Z0.014
Recv: G33 X146.38 Y74.37 Z0.015
Recv: G33 X146.38 Y97.50 Z0.017
Recv: G33 X146.38 Y120.62 Z0.024
Recv: G33 X146.38 Y143.75 Z0.038
Recv: G33 X146.38 Y166.88 Z0.013
Recv: G33 X146.38 Y190.00 Z0.002
Recv: G33 X169.00 Y5.00 Z-0.079
Recv: G33 X169.00 Y28.12 Z-0.043
Recv: G33 X169.00 Y51.25 Z-0.017
Recv: G33 X169.00 Y74.37 Z0.015
Recv: G33 X169.00 Y97.50 Z0.023
Recv: G33 X169.00 Y120.62 Z0.051
Recv: G33 X169.00 Y143.75 Z0.036
Recv: G33 X169.00 Y166.88 Z0.043
Recv: G33 X169.00 Y190.00 Z0.032
Recv: ok 8