Closed luxarts closed 5 years ago
Sorry I hope you figured it out. I rarely log on to Github.
I am using a newton-rasphons method to solve which requires a guess and then goal seeks the solution buy the derivative of the function .
https://en.wikipedia.org/wiki/Newton%27s_method
The fact that you only ran 1 loop means you did not converge on the solution state.
I am still surprised it was that off. You should be getting closer to the answer.
I hard coded it to 5 since it seemed to only take around 3 loops.
Technically you run until error is under a value you find acceptable.
It can loop forever on some functions so its best to pick a hard cut off for iterations and warn the user if it didn't solve.
Purples equations are long because Matlab used an approximation series to solve for a non-linear equation. (Which is the way i would have done it if I didn't have to code it later.) Matlab's long equation is similar to how a polygon line fit or Fourier series works.
I added a test main in the diagonal correction and i get a new rod length of 253.88 for your inputs similar to my spreadsheet on thingiverse.
If you want to see the difference between the methods my spreadsheet has a 2nd tab where i compare the difference between the methods.
Hello! As I commented before I'm implementing the rod calibration into my web interface. I translated you Java code to JavaScript but when I test it and compare the results with Purple's spreadsheet the numbers differs too much.
This is the JavaScript code:
My testing parameters are:
With the code above I get
3.07
while with the spreadsheet I get0.96
.I think the problem is that in the spreadsheet the correction is calculated based in the others measures and not individual. I really dont understand the formulas in the spreadsheet (actually I understand them but they are too long and it's impossible to me to analize what it's doing). I tried to get the formula based on the PDF notes of Purple but I still don't get results.
What do you think? Maybe I'm making a mistake using the function (which I doubt because it's a simple function call and watched how do you use it).
BTW, I tried to put the values in diagonal correction in Repetier but the measurements after calibrating again are nearly the same.