Logarithmic Material Test (suggestion posted)

So, as I was working on frying more rocks, I found myself with some that just didn’t behave nicely on the fiber laser. My usual settings which work like a charm on slate or some black landscaping rocks just turned the surface to grainy marshmallow with terrible resolution and texture. I’m going to need to hunt through the entire parameter space of my laser to see if anything gives me some kind or other of interesting or useful results.

It occurred to me that one small option added to the LightBurn Material Test function could make parameter searches like mine significantly more efficient. The option? A toggle to use logarithmic spacing instead of linear spacing for the steps for an axis in the Material Test.

Zapping things in my fiber laser, I’ve used speeds from the scanning limit all the way down to very slow. Being able to use a logarithmic search instead of a linear search would make for an efficient search to find a general baseline parameter even when the search space spans orders of magnitude (such as speed on a fiber laser, which could be under 100mm/s or up to 10,000mm/s).

I figure it’s likely a fairly straightforward request to implement if it’s found worthy, and I, for one, believe it would be a significant improvement for those of us in the “Eh, I wonder what this would do?” camp. :smiley:

I’ve posted it as a feature suggestion, but I’m also curious to know if anyone else here thinks this might be peachy…

1 Like

I’ve zipped, renamed, and attached an Excel spreadsheet that lets you set a Min, Max, Steps, and Scaling and then calculates the resultant steps. That way if anyone wants to play around to see for themselves how it would be helpful, they can. (If someone really wants to play around with it but doesn’t have Excel, I can port it to a Google Sheets spreadsheet. Just ask.)

StepSpacing.RenameTo.zip.NotReallyA.txt (12.8 KB)

So, let’s say I’ve got a value (speed in mm/s? fiber laser frequency in kHz? whatever) that’s somewhere between 20 and 4000. I want to find an approximate target value for it, as I have no idea where it’s going to lie within that range. I’ll arbitrarily choose a few correct answers and show how the search would go with each approach (linear and logarithmic spacing), and the result doesn’t have to be exact, just close enough – this is for searching, not necessarily final fine tuning.

Case 1: Final answer will be 1500.

Min Max Steps Scaling 1 2 3 4 5
20 4000 5 Linear 20 1015 2010 3005 4000
1015 2015 5 Linear 1015 1265 1515 1765 2015
20 4000 5 Log 20 75 283 1064 4000
1064 4000 5 Log 1064 1482 2063 2873 4000

For values in the “middle” to top of the range, there may not be much benefit for a logarithmic search. A linear search does give more points over the top of the range, after all.

Case 2: Final answer will be 50.

Min Max Steps Scaling 1 2 3 4 5
20 4000 5 Linear 20 1015 2010 3005 4000
20 1015 5 Linear 20 269 518 766 1015
20 269 5 Linear 20 82 145 207 269
20 82 5 Linear 20 36 51 67 82
20 4000 5 Log 20 75 283 1064 4000
20 75 5 Log 20 28 39 54 75

Thanks to the math, a logarithmic search will work basically identically regardless of where in the range the final answer may be. On the other hand, the linear search pattern is drastically worse for values the closer they are to the bottom of the range.

Think about a logarithmic search as being akin to hunting for a ballpark by choosing an arbitrary starting point and then either doubling or halving your value until something different happens. (That is, after all, a logarithmic search.) No matter what your answer is, you’ll get to it very quickly.

Anyway, it’s not universe-altering or anything, but the utility is indisputable for initial parameter searches. As one more illustration, consider a parameter that has a possible range of 10 to 10,000:

Scaling 1 2 3 4 5 6 7 8 9 10
Linear 10 1120 2230 3340 4450 5560 6670 7780 8890 10000
Log 10 22 46 100 215 464 1000 2154 4642 10000

If your first 10-step scan is logarithmic, you’ll have a decent range for your second scan no matter where in the range the parameter ends up. If your first 10-step scan is linear and the parameter ends up near the bottom of the range, life stinks.

Well, there’s my bit more background to support my case. This reminds me of back in college for my ChemE degree, hehe. :nerd_face:

3 Likes

Hi,

I’ve implemented an alternative material test in python using galvoplotter. It was primarily to fulfil my request of a randomised order for material tests, but I wrote it with alternative algorithms in mind for parameters. I’ll clean up and annotate the code, add the log stuff, test it on windows and post it to github.