-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve G29 topology report to include topology after corrections. #1978
Comments
G29 T can already be used to see how unflat/warped/bent/curved the bed is! Just increase the probe points and you can easily see the variation in the output. I don't understand how seeing the correction matrix would help anymore than what is already available? Sent from my iPhone
|
It's hard to separate the tilt from the curvature just by looking at On 27 April 2015 at 15:42, brainscan notifications@github.com wrote:
|
I tend to agree. But this is making the assumption that the bed is fairly well leveled and flat. In that case, you get the points with the mean height subtracted off and you can see how much higher or lower a point is from the mean height. In the case where the bed is not very well leveled and/or flat, I can see where this would have value. But I almost wonder if it shouldn't be a separate command. The reason is G29 generates the correction matrix (that is its real purpose in life). To do what is being talked about very well may require many many more points to be probed. In fact, it may be you don't want to do just a grid but instead have the logic to map topographical lines. Also, remember you have measurement and repeatability issues to deal with. For example, when trying to map out topographical lines and follow them, you would have to adjust for the fact that your measurements are not fully trustworthy. That is going to complicate what ever you are trying to accomplish. I don't know... But it certainly is worth some discussion. And it would be an interesting piece of code to write if it really had some value. |
So I tried to do an example in matlab, but am not getting numbers that look correct. What am doing wrong? I was expecting something around 0. % Matlab Code num = 5; x_pos = left:(right-left)/num:right; % Create array of x positions. topology = [+0.72043 +0.14788 -0.41823 -0.96191 -1.49031; ... correction_matrix = [+0.999898 +0.000000 -0.014282; ... topology_cor = topology; for y = 1:num % Here is result. -0.1662 -0.9085 -1.6443 -2.3577 -3.0558 |
As well as the rotation matrix there should also be a Z offset. This is where Marlin gets vague. However, the result doesn't look right even with an offset, but I don't know Matlab. Do array indices start at 1? |
Yes, in MatLab they thought that made sense... |
I don't have a way to write this formatted correctly. But I think your point[] matrix should be 1x3 meaning 1 across and 3 down. If you change point = [x_pos(x); y_pos(y); topology(x,y)]; that might fix the problem. (I'm not a MatLab expert! But I think you want to get point into a 1x3 instead of a 3x1 format) Alternatively... You could invert the sign of the numbers on each side of the diagonal of the correction matrix. I suspect that will get you the right numbers output (but in the wrong format --- instead of giving you a 1x3 you would get a 3x1 with the correct numbers in it). |
Thanks for the suggestions.
|
This doesn't sound correct. I think it is 'correct' to multiply a [1x3] * [3x3] just as it is valid to multiply a [3x1] * [3x3] Please double check this because this doesn't 'correct'.
No! Do not invert the sign of the numbers going down the diagonals. Try inverting the sign of all the numbers off of the diagonal. If you notice, the matrix is symmetrical with the signs of the numbers flipped. |
So I was thinking about this more, and I think I was thinking about it wrong. What what help would be seeing the difference between the topology and the calculated flat plane. |
So I got things working in matlab, and generated a couple of cool plots. The image below shows the difference in mm between the topology and the flat plane. As you can see there is about .4mm difference between highest and lowest points, so I will definitely need to work on this, especially pulling down the front right edge. Second plot is shows flat plane, and the topology points. Next I will try adding this calculation to Marlin |
That is cool! What did you have to change to get the math to work right? |
I had 2 things wrong; First off I had the x/y values were from the front/left even though the topology was from back/left. Also I no longer applied correction to topology, but just to a constant z and then calculate the difference between this calculated z and topology. |
Yeah I stand corrected that is cool. Sent from my iPhone
|
@CptanPanic I have just modified Marlin to output a table of numbers showing the residual error after bed levelling. This helps with improving the mechanics. Looking at your picture, your Y-bars are not parallel. I know because I had the same problem. |
If we had a web site where we could automatically run the code to make the chart that would be very helpful. What I'm thinking is Marlin would output: http://some.website/some_page #1 #2 #3 #4 #5 #6 #7 #8 #9 etc. The user could copy that long line of output and paste it into a web browser. And then the page would magically get displayed with a detailed graph. |
I don't remember where I came across this, but I think it does what you want, though perhaps not with the exact URL "API" you showed: |
I've been playing with THREE.js a bit and I can recommend it for doing custom 3D graphics, but if there's some already-built graphing lib that's your best bet. You can ask @scotty1024 or @boelle (or me, I guess!) to add it to marlinfirmware.org, which is the appropriate place for all this stuff. |
Played a bit with #2444 Made some additions in https://github.com/AnHardt/Marlin_O/pull/11 to print out the Max, Min, Error_sum and Error²_sum of the topology blocks. The exciting part of this is the calculation of the heights, to minimize the errors in the "Corrected Bed Height vs. Bed Topology:"-map.
what means:
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I understand that the auto bed correction can only handle corrections in a flat plane. I would find it useful if as part of the topology report (G29 T) not only displayed raw topology but also the calculated topology utilizing the bed level correction matrix. This way you could easily see if there is not flat plane problem with bed that wouldn't be fixed by matrix, and also the magnitude of the issue.
Is this how it work? You would to loop through each x,y,z position in the topology report, and call apply_rotation_xyz and report the z?
The text was updated successfully, but these errors were encountered: