# Calibration pattern for triangular kinematics

I have been mulling over ideas for calibration for triangular kinematics and wanted to run an idea past folks

we measure the horizontal distance between motors.

we may want to add some check for frame flexibility here. pull the chain snug with low motor power and then ramp up to max power and see if the motors move ‘too much’ (i.e. more than chain sag accounts for)

someone with a frame that has a solid beam between the motors should check for chain sag. measure the height of the chain from the beam near the motors and in the middle while under stress.

we can have the person find the center of the work area by snapping lines from the corners. move the sled down to this midpoint and see if it’s where we expect it to be (this, with the horizontal spacing will let us calculate the distance from the top of the work area to the motors)

move the sled up and down a known amount (say 1.5 ft for a stock size work area) and cut a short horizontal line at each place. If the distances between these points don’t match what they are supposed to be, that means that the chains do not have the effective length that we think they do. We should be able to re-calculate to figure out the correct offset and try again.

so, if motor spacing was 3000mm, yoffset was 500mm, and the work area was 1200mm high (rounding real dimensions to nice round numbers)

the center of the work area should be a triangle 1500x1100 (chain length 1860 mm)

say the bracketry is off by ~10mm, so the real chain length is 1850mm. we move the router into position at the center and will then ‘know’ that since the triangle is 1500x 1850hypot, then the y distance must be 1082.8mm (so the y offset was wrong, 482.8 instead of 500)

so we then try to move up 500mm, so we think we have a triangle of 1500x 682.8y and chain length 1648.1

but instead we really have a triangle of 1638.1, which results in a y of 658.3.

so an error of 10mm on the chain has resulted in an error of 24.5mm on the wood.

if we were to move down 500mm, we would think that we have a triangle of 1500x 1582.8y and chain lengths 2180.7
but chain lengths would really be 2170.7 so y would be 1560mm, an error of 22.8mm

with three cuts, we will have the following formulas to solve

D distance between motors
y distance from motors to the home position (roughly the center of the work area)
coff difference between chain moved from the motor and effective chain length due to the bracketry
C1 chain length for center
C2 chain length for top cut
C3 chain length for bottom cut

(d/2)^2 + y^2 = (C1 +coff)^2
(d/2)^2 + (y-500mm)^2 = (C2 +coff)^2
(d/2)^2 + (y+500mm)^2 = (C3 +coff)^2

D, C1, C2, C3 are all considered ‘known values’ as they are the result measuring chain movement.

This leaves us with two unknowns (coff, y) and three formulas. That’s enough to solve for the actual values of the variables (it’s too late tonight for me to do that right now).

since the error in chain length gets multiplied by >2x for the vertical moves, I think we should be able to measure with a tape measure (max 1/2mm accuracy) and get very accurate results.

Note that I combined error in measuring the height of the work area with error in measuring the distance from the work area to the motors. The only place this matters is in avoiding running off the top/bottom edge, so the (0,0) point in the center of the wood is only approximate. Once we have the machine calibrated to position accurately, you can then set the travel limits to whatever point you want away from this 0,0 point.

note2, there is an additional source of error not included in the simple calculation above, and that’s the amount of chain wrap around the sprockets and therefor the exact coordinates of where the chain becomes tangential to the sprocket.I don’t think that this matters (the difference in angle between a triangle 1500x, 658y and a triangle 1500x, 882y is probably not enough to be measurable), but it should be included in the calculation.

3 Likes

This sounds very workable.
The present chain calibration extends a known amount of chain, 1650mm, using that would remove one measurement to do.
Another way to get the motor distance above the workarea is when the chain is tensioned between the motors, one could measure between it and the top of the workarea. That’s probably not much more accurate than the present method, though. As you point out, accuracy of this measurement really doesn’t matter for this calibration.
That sets Cx and (d/2) known, and measuring between the upper and lower test cuts will vary from the calculated amount if the sled-measurement is off. Using the same approach of successive cuts and measurements used in the quad Kinematics calibration should work. I’ve done a crude spreadsheet model and it seems to home in with three iterations.

2 Likes

I like it!

I’m working on getting an automatic calibration process going for the triangular kinematics so we should be able to test this pretty soon

I’m thinking that this shouldn’t be a matter of multiple iterations, if we can do the correct calculations, we should be able to do this once (even with a pen instead of having to cut) and ‘fix’ things, so the second pass would be accurate.

actually, it’s a little messier than I thought
knowns:
D distance between motors
C1 chain length for center
C2 chain length for top cut
C3 chain length for bottom cut
y1 distance from the center cut to the top cut (500 if calibrated)
y1 distance from the center cut to the bottom cut (500 if calibrated)

unknowns:
y distance from motors to the home position (roughly the center of the work area)
coff difference between chain moved from the motor and effective chain length due to the bracketry

formulas

1. (d/2)^2 + y^2 = (C1 +coff)^2
2. (d/2)^2 + (y-y1)^2 = (C2 +coff)^2
3. (d/2)^2 + (y+y2)^2 = (C3 +coff)^2

solve #1 for y
4. y=sqrt((c1+coff)^2-(d/2)^2)

plug 4 into 2

1. (d/2)^2 + (sqrt((c1+coff)^2-(d/2)^2)-y1)^2 = (C2 +coff)^2
2. (d/2)^2 + (c1+coff)^2-(d/2)^2 + y1^2 -sqrt((c1+coff)^2-(d/2)^2) * y1 = (C2 +coff)^2
3. (d/2)^2 + c1^2 + coff^2 +c1coff - (d/2)^2 + y1^2 -sqrt((c1+coff)^2-(d/2)^2) * y1 = c2^2 +coff^2 +c2coff
4. c1^2 - c2^2 + y1^2 = c2coff -c1coff + sqrt((c1+coff)^2-(d/2)^2) * y1
5. c1^2 - c2^2 + y1^2 = (c2 - c1)*coff + sqrt((c1+coff)^2-(d/2)^2) * y1
6. c1^2 - c2^2 + y1^2 - (c2 - c1)*coff = sqrt((c1+coff)^2-(d/2)^2) * y1

let a = c1^2 - c2^2 + y1^2

1. a - (c2 - c1)*coff = sqrt((c1+coff)^2-(d/2)^2) * y1
2. a^2 - a*(c2 - c1)coff + (c2-c1)^2 * coff^2 = y1^2(c1+coff)^2-y1^2*(d/2)^2)
3. a^2 + y1^2*(d/2)^2) = y1^2*(c1+coff)^2 + a*(c2 - c1)*coff - (c2-c1)^2 * coff^2
4. a^2 + y1^2*(d/2)^2) = y1^2*(c1^2+coff^2 +c1coff) + a(c2 - c1)*coff - (c2-c1)^2 * coff^2
5. a^2 + y1^2*(d/2)^2) = y1^2c1^2 + y1^2coff^2 +y1^2c1coff + a*(c2 - c1)*coff - (c2-c1)^2 * coff^2
6. a^2 + y1^2*(d/2)^2) - y1^2c1^2 = (y1^2- (c2-c1)^2) * coff^2 +(y1^2c1 + a*(c2-c1))*cofff
replacing a again
7. (c1^2 - c2^2 + y1^2 )^2 + y1^2*(d/2)^2) - y1^2c1^2 = (y1^2- (c2-c1)^2) * coff^2 +(y1^2c1 + (c1^2 - c2^2 + y1^2)*(c2-c1))*cofff

so this is a ‘simple’ quadratic equation with a *coff^2 + b * coff = c

solve this for coff, plug coff into #4 and you have y

done in 2 cuts, then cut the bottom one (getting y2) to verify accuracy.

I’ll do this and report back.

The ‘workarea’ sheet isn’t necessarily exactly centered between the motors, or exactly square to them. Errors in that part of construction would introduce error in the calibration. Better to use the motors to eliminate those construction vagaries by having the motors pay out fixed amounts of chain.

It might be hard to be accurate centering a router bit over a snapped location. What we really want are two known points on the vertical line centered between the motors. The error scales with the distance between the cuts, so using an upper and lower cut would double the error and make an accurate measurement easier. The check cuts could be in the y direction, or in the x direction, but slightly longer to differentiate them from the first set. It may well be that we can do the necessary calculation from one set of cuts.

yes, the ‘move to center’ would not allow the user to move the sled left/right, only up down (where both motors are paying out the same amount of chain).

If the motors are not centered over the work area, the user can opt to move one or the other, or set the center to be offset horizontally from the physical center. But in any case, the user should know where (0,0) is on their machine.

at some point we and the user need to know and agree where (0,0) is, and from the other posts, I think we can compute the distance down and chain length error with just two cuts. I think it makes sense to make one of those cuts be at the origin so that the user has a reference for later, and I think it makes sense to let them define where this is.

We don’t know if we are working on a 2’ high x 4’ wide machine, or a 8’ high x 4’ wide machine at this point in the calibration, after measuring the distance between the motors, we should feed out enough chain to meet in the middle, plus enough to get us down to below the tension limit. Then let the user run additional chain out from both motors at the same time (or retract it if needed) to position the bit at the center.

The most accurate way to do this would be to drill a hole in the center, and then move the sled until the bit drops into the hole, but since different sheets of plywood vary by a small amount, and (0,0) is not a critically important location for safety or accuracy, I think we are just fine having the user move into position.

If this is off by 1/2", what does it hurt? the user will later on need to run the router up/down/left/right to define “I don’t want to go beyond this point” limits, and it doesn’t hurt anything to have them be different in opposite directions.

While I agree that a user selectable absolute 0,0 point is desirable, it should be done with as much accuracy as possible. I think that defining an absolute 0,0 point should wait until after the calibration is complete. It would simplify the calibration calculations, and calibrating to an arbitrary location would introduce unneeded complexity.

I don’t think this should happen until after calibration, if at all. If we drill before calibration there is a good chance the hole will be in the wrong location. Too, I prefer not to have a hole at 0,0. Let the user mark the center as desired. As for setting the absolute 0,0 point, there’s a gcode for that (though it remains to be written…). After all, differences in stock thickness will affect the router location; absolute 0,0 should be adjustable for that.

To sum up, we agree that the calibration probably can be accomplished in two cuts, but the method and placement of those cuts remains a topic for discussion .

1 Like

I measure 10.4mm of chain sag on a motorspacing of 3008.17mm Several tensionings don’t seem to make a measurable difference. The motor spacing does not change visibly when tension is released.
FWIW I tensioned dental floss between the chain link rollers on top of the sprockets and measured between the floss and the roller in the middle.

wish it were possible to cancel out of the calibration process without losing the chain calibration Note to self: after using ‘Manual Chain Calibration’ it seems to be necessary to use ‘Return to Center’ or the calibration is not registered.

10.4mm seems like more than we really want to see. I’m going to repeat that process and work on tightening that process up as soon as I’ve got a general calibration for triangular working (hopefully by the end of today)

I thought 10mm over 3000mm seemed pretty good. What does that much chain weigh? Wouldn’t want to overheat the drivers or damage the frame

1 Like

I think it is pretty good, but I’m worried that maybe we need to take it into account.

You are right that we should be careful not to break the drivers or bend the frame

One could hang the sled and run down into a bottom corner, then do the floss sag measurement. I’m tied up just nmow, I could try later tonight if you think it would be useful.

IIRC, the chain calibration runs the motors at fairly low power, can we make a quick hack that will ramp this up to 100% power to see how much this changes?.

That’s more than I was thinking.

using these figures and going to
https://www.spaceagecontrol.com/calccabm.htm which is a chain sag calculator it looks like we are applying ~135N of force (~30 pounds) to the chain

with a cable length of 3008.26828mm vs a straight-line distance of 3008.17, or an error of ~.1mm in length, sagging 10.53mm for an error of 0.003267%

using the calculator to bump up to full power (300N, ~66 pounds)
the cable length would be 3008.19050mm for an error of .02mm sagging 4.81mm for an error of 0.000681%

so it looks like there is a measurable difference between stretching the chain a part power and at full power. I don’t know if 0.1mm of error is worth the difference, but it’s easy to do.

please do. There the tension will be far lower and so the sag will be more. I think I did a guestimate calculation and found that it would give me an error of 1/32" or so in the bottom corner, but if you can do the floss measurement, I can reverse engineer the actual numbers.

by the way, reverse engineering things a bit more accurately

139N of force across an actual distance of 3008.075mm will result in a measured chain length of 3008.17mm with a sag of 10.38mm

This seems to match your measurements. https://www.spaceagecontrol.com/calccabm.htm?F=139&a=3.008075&q=0.13&g=9.81&Submit+Button=Calculate

if you do two marks at arbitrary positions, you will calibrate the chain length error introduced by the linkages/ring/whatever. but you still have no way of defining the center of the work area. You have no idea how far above the work area the motors are.

Yes, you can measure it and enter it to the nearest mm, but is that any more accurate than having the user move the router to what they think the center of the work area is?

the cut can be in a waste board if you don’t want it in your main frame, just like the calibration cuts today.

There isn’t a ‘more accurate way’ to find the center, we don’t have any other knowns or measurable things to work with.

Thanks for calculating that out. The .1mm seems pretty tolerable for now. 10mm felt like a lot, but I guess the physics of chain sag are working in our favor

We probably have more error in chain stretch. The per link clearances add up over many links

1 Like

I moved the sled to X-1133 Y-413 and measured ~48mm of sag.

I meant to say that setting the 0,0 point should be done after the sled is calibrated in the same way as in the quad calibration process. One change at a time.