Calibration code / understanding

Lets try this again, will probably need a few different replies.

Ok, what have I been doing. First, I grabbed a few data sets - sets of cailbration-point-belt-lengths (CPBLs?) taken from my calibration logs. I had:

  • My 3x3 @ 900 force
  • My 7x7 @ 900 force
  • My 7x7 @ 1500 force (more on why later)
  • Another set from another user who had scanned their frame and put their logs in thread.

I had a look at

and

to get some idea of the difference - for my purposes, the simulation is fine as i’m messing with the algorithm. Although I did just pull it locally and mess with the code like that, one nice thing i remembered is you can run webpages github using the html-preview project, like this:

https://html-preview.github.io/?url=https://github.com/BarbourSmith/Calibration-Simulation/blob/main/index.html

Like this.

I had a few hunches about sampling and starting from approximations, but I mostly was putting the data through a few times in different ways to see what it showed me and what speed-ups I might be able to get.

What I tried:

  • I started using ‘rough’ estimates of the frame size for the initial guess - both exact measured ones, and ones within 50mm for each frame corner (I figure anyone building a frame can tape measure it to within 10/20mm reliably, and even if they misunderstand measuring bolt-centre to bolt centre, they’ll get within 50mm.
  • I was using manual measurements, both assuming it was a rectangle, and using:
    http://lang.hm/maslow/maslow4_manual_calibration_simple.html
    to do estimation of the offsets.

My data was a small sample, but I was seeing that:

  • When I played with how close or far away you start, it didn’t make much difference beyond taking longer to find a set with high fitness - and increasing the chance you’ll hit a poor estimate with lower fitness.
  • I played with the initial point randomisation/mutation/sampling, and toned it down to ± 20mm - again, having it much more than that just made it more likely to iterate down to a low fitness answer.

And testing with initialGuess measured to within 50mm of actual, and point randomisation ± 20mm:

  • I would get to a converged or barely-changing estimate of a set of points in 100-1000 steps (ie very quickly).
  • And if I manually re-run it multiple times, I would get similar-but-slightly-different estimated points with similar plausibility (and some with lesser).

And with an output-set of points from that, I am getting good results (though I need more testing):
https://forums.maslowcnc.com/t/hexagons-are-the-bestagons/24123/6
And better estimates than I saw in the logs from the actual calibrations.

Simple steps:

I’m not saying it does make sense, but I could certainly imagine a user flow of:

  • Design frame, use something like http://lang.hm/maslow/maslow4_frame.html to get a feel for what a reasonable work area vs frame size is, but also to work out a reasonable area / size for calibration grid.
  • Build frame, measure the Z Offsets, measure the corners with a tape measure.
  • Put those corner values through http://lang.hm/maslow/maslow4_manual_calibration_simple.html to give a frameGuess
  • Run a calibration step using the grid size worked out earlier, potentially with no calibration calculation, just measuring and logging the CPBLs.
  • Put that frameGuess in as the initialGuess in the calibration simulator, along with the CPBLs and Z Offsets.
  • Have the user run the simulator a few times until they get a feel for what fitness they’re getting (do they need to work on the frame to stiffen it, etc), and then have them pick a sensible set of calibration output to put in the Maslow.yaml to use.

Which would largely just require a PR to pull the initialGuess / ZOffsets / CPBLs to the top of the calibrator file and label them so its easy for the user to find and modify them.

Obviously a lot can be potentially automated in that (and/or input fields in a webpage / generating a maslow.yaml from the calibration page, etc) - that’s just a quick bootstrapping way if people wanted to try it.

Now, that’s a simple step and possibly already been talked about, but I was looking at a bit more and it gets more speculative…

1 Like