Interesting stuff to investigate more - calibration force
On a hunch, I tested 7x7 with force 900, and 7x7 force 1500. I need to do some more testing modelling, but it definitely seemed like:
- The frame estimation at force 900 comes in as slightly smaller than my measured frame (~5-10mm). The frame estimation at force 1500 comes in slightly smaller again (~5-10mm smaller again).
Now that’s not actually surprising I don’t think - stretch / flex would show up like that. On the one hand, that could be from belt stretch, or frame flex, or unit flex, and the internal friction of each arm could differ, and being sure which could be tricky. On the other, as long as it’s measurable and contributes to accuracy, the actual cause doesn’t matter (I’d argue).
While motor-current / calibration force isn’t seen as a good proxy for tension, I also think it’s not to be ignored.
I think that it would be interesting to investigate both:
- Running calibration with different tensions and noting the tension associated with each CPBL set.
- Possibly running the machine up and down tl<->br and bl<->tr with differing tensions (so only one pair of belts is tense) - I’m not as certain about this being useful, but it feels interesting enough to investigate more and / or model a bit to see what it might tell us.
Interesting stuff to investigate more - sampling
Ok, so from running the above, I saw:
Ok, so I have thoughts on the calibration algorithm - and this is heavily influenced by what I’ve done in the past with ray-tracing and machine learning stuff.
I think the method in the code is good (I think it’s described as a genetic algorithm, but I think it’s a variant of gradient descent). But my take on it is that it is based on an assumption that there’s a single right / perfect answer - that the frame/belts/unit are all perfectly stiff.
The measure of the currently-estimated set of frame points is termed fitness, and that does make sense, but I think it is also useful to think of it as a measure of plausibility - how plausible is it that the estimated set of points match the frame.
However I would suggest that, in the real world, the frame / belt / unit all flex. And that should mean you can get multiple sets of points that are all plausible - there could be lots of theoretical sets of output points that all have similar plausibility / fitness. Or even not the same plausibility, but the gradient descent will, if it gets close to a reasonably high plausibility, settle on a set of points quite far from the reality.
And I believe that matches the user experiences we’re seeing.
Conjecture time.
My gut feeling is we should be treating this as a weighted-sampling problem instead.
If we take a step back from plausibility-maximisation, and instead of treating a single set of output points as the result we use, we could treat it as a single sample amongst many. We also could also weight each sample by the plausibility/fitness. I suspect we can get a much better estimate of the actual points that way.
So, one could:
- Take a rough-measured estimate of the frame and use that as a starting point for our sampling.
- For 10/100/1000 times:
- Do a single sample ± 20mm from the rough-measurelike we currently do.
- Run the gradient descent probably with cut-off of 1000 iterations, but possibly less.
- Use the resulting set of points as a single sample, weighted by plausibility in some fashion.
You could even do a continuously accumulated estimate that you keep sampling until it converges. 
From my experiences I noted in the previous post (that assuming you start with measured values, the iterations are quick) mean this shouldn’t be too time consuming - and comparable to some current experiences but with a better outcome.
The global context for all this
I’ve talked about both the calibration force and sampling together because I think they’re interrelated. I want to restate what I see as the problem we’re trying to solve:
Calibration - We want to come up with a model (specific to a specific frame) that gives us a number of belt-teeth to pull in on each belt, at a certain motor-current, to move the centre of the router to every XY position possible in our cutting area.
So - I’m very specifically calling out that what we care about is the number of belt teeth to pull in and at a specific motor-current.
We appear to see that calibration generates a frame size estimation that is slightly too small, and will be smaller the greater the force used (tbc). But the reality is that doesn’t actually matter if using that frame size estimation effectively includes / offsets the belt-stretch, etc - we just need to calibrate such that for a specific frame + maslow, we need to pull in specific belts to a specific length at a specific motor-force.
Now we might have to include motor-force as a proxy and / or sample at different motor-forces during calibration to achieve that - and that’s the kind of thing I want to look into at some point.