Discussion Regarding Triangular Calibration

This page sets up a couple calculators and the general formulas, it does look like that would eliminate the trig functions. Certainly, avoiding the Arduino trig functions would be an improvement, it could make fixed point calculations easier to do and avoid the Arduino floating point limitations.

1 Like

you still need to figure out the angle because the chains don’t pivot at the top corners, they are wrapped around sprockets and depart the sprocket at a different place depending on the angle.

as long as the locations are stored in floats we will have problems,our range of positions is just too large.

Could you make a stationary slot/gate for the chain to pass through so the feed point stays stationary? Two rollers perhaps an inch or so from the sprocket?

no, it will always have some variation of here it bends, you can’t have a chain
bend at a perfect point.

David Lang

I will try to explain my understanding of the “geometric chain length”.

Knowing the “distance” from the “bit center” to the center of the “sprocket”, or intended distance, is the first part of the calculation. This is expressed as the horizontal distance (run) and the vertical distance (rise) in the attached spreadsheet.

This spreadsheet is set at 120" between sprocket centers, 24" above a 48" by 96" sheet, which is “centered”.

You can change these two values to whatever your machine is.

This spreadsheet calculates the 9 key points of corners, sheet edge centers, and center of sheet.

So for any of the 9 points the distance between centers is the hypotenuse of the rise and run, (columns F and G) and the angle to horizontal is the atan of those values (Columns H radians and I degrees). Column J is the distance from the center of the bit to the center of the sprocket (Line A)

Looking at the attached sketches, the hypotenuse is the long dotted line, and the angle is shown.

The sprocket has a pitch diameter of 0.809, radius of 0.4045 for the standard Maslow 10T sprocket.

We can calculate the length of the (line B) from knowing the hypotenuse, radius, and that the chain is tangent (90 degrees) to the sprocket . This is done in column K.

Just for the fun of it Column L is the difference in the lengths of those two distances. Not too much, but counts in the totals.

Next to calculate the angle between the Line A and line B using the asin, knowing the hypotenuse, radius of the sprocket is shown in Column M in radians, Column N in degrees.

Column O shows the angle in degrees of the tangent line B to horizontal.

Looking at the sketch this is the same angle value as the number of degrees of chain wrap around the sprocket below horizontal on the left side of the sprocket. Add to that value 90 degrees for the top left quadrant (always covered with chain) and take that summed value as a ratio to 360 degrees on the circumference and you get the length of chain wrapped around the sprocket from top dead center to the tangent departure point. This is Column Q. At the bottom of column Q I show the difference in max and min chain wrap, for this example -.4794". almost a half an inch. It counts as a significant calculation when the tolerances we are trying to achieve is so much less than that.

Next Column R sums the straight length and wrapped length to give the desired result, the geometric distance of the chain from top dead center to the center of the bit. (all inclusive of various parameters in the code, such as rotational radius, and whatever else is in there. I don’t know code.)

And again just for the fun of it, Column R is the difference between the center to center distance (Hypotenuse) and the derived value for chain distance.

Column U simply shows that if you say the top left corner is “0” inches of chain, how much more chain needs paid out to reach the other 8 points.

Hope this helps to understand the “distance” of the chain.

This does NOT include any of the values that the guys are trying to calculate for chain sag, chain stretch, etc. This is just geometry FYI.

PS. You can play around with varying the height and width dimension a little bit, and you can see the errors it would create if these were wrong. On a piece of plywood, where you are approximating the center to start, would not be a big deal, but when we put a grid on the sheet, and run all of those optical measurements, it really counts to be correct with the settings.

Maslow Chain Lengths Study 2.xlsx (17.1 KB)

Let me know if you see any errors.

1 Like

The biggest sources of errors are the things we haven’t addressed. We are trying to solve the issue using the same knobs that we’ve already mastered. The current triangular calibration calibrates the known measurements to compensate for unknown measurements. It is no wonder we are getting unpredictable results.

Here is my list of the biggest sources of variation that haven’t been correctly addressed by the current calibration:

  1. Chain Tolerances
    • It is my understanding that the chains are ± 6 mm over their length. This is a huge source of variation.
  2. Distance Between Motors
    • The reason this is on the list is because this needs to be measured to within 0.2 mm to achieve 1 mm accuracy
  3. Chain Sag
    • Even though this is addressed in the calibration, I don’t think the calibration of this parameter is working.
  4. Chain Stretch
  5. Frame Flex
2 Likes

That’s why @johnboiles and I spent time on the optical calibration. It can potentially mitigate all those sources of variation.

2 Likes

or at least measure them to make sure our other corrections are working.

David Lang

The biggest sources of errors are the things we haven’t addressed. We are
trying to solve the issue using the same knobs that we’ve already mastered.
The current triangular calibration calibrates the known measurements to
compensate for unknown measurements. It is no wonder we are getting
unpredictable results.

yep.

Here is my list of the biggest sources of variation that haven’t been correctly addressed by the current calibration:

  1. Chain Tolerances
    • It is my understanding that the chains are ± 6 mm over their length. This is a huge source of variation.

-0 to +1.5% IIRC. It varies from chain to chain and the ‘normal’ recommendation
is to replace the chain when it gets to 3%.

  1. Distance Between Motors
    • The reason this is on the list is because this needs to be measured to within 0.2 mm to achieve 1 mm accuracy

we should be able to get to ~.5mm with a tape measure

  1. Chain Sag
    • Even though this is addressed in the calibration, I don’t think the calibration of this parameter is working.

we know that the formula used for chain sag in incorrect, so this is a known
problem.

IMHO, this is probably the biggest problem we still have.

  1. Chain Stretch

this is the same as #1

  1. Frame Flex

the top beam goes a long way to eliminating this, but it is still a potential
source of error. But I think it’s a minor thing now.

measuring the motor distance with a slack chain and while under tension will
tell us how much this is.

and measuring the motor distance manually and comparing it to the measurement by
chain can tell us the chain tolerance/stretch for that length of chain. Do it
for both chains to find out if they are the same.

It would be useful for someone to loop their chains and check every few inches
to see how much it varies over the lenth of the chain. My guess is that a batch
of chain is going to be pretty consistant, but that’s just a guess.

David Lang

2 Likes

If one of the Programmers could make a short script to feed out chain in mm for one motor, vertically with a tape measure behind, I would do it with a 15kg dumbbell. It’s not a the width of the Maslow but could serve as an indicator. On full chain length the stretch is ~2mm.

@Gero, I can do that, which motor would you choose? I can give you a macro the extends the chain a set amount each time it is clicked (how much to extend?) or a .nc file the extends the increment, then waits a set number of seconds, then extends again, wait, extend, etc (how many times, how long to wait between? I guess you could use the ‘Hold’ button to extend the wait time…

I was planning on doing the measurements with the motors, I posted roughtly the
commands recently, but can dig that up and turn it into a g-code file.

the idea was to hook the two chains together with the master links to make a
loop, do the normal chain measurement, and then cycle through doing the same
thing again and again every few inches.

we would need to log file to see the results.

David Lang

1 Like

go through the same routine that measures the motor distance now.

then roll both motors in the same direction 3-4 inches, pull tight again just
like the motor distance measurement does, report current position (just like the
motor distance does), then release tension and repeat

David Lang

oh yes, the encoder positions should be zeroed as the chain is pulled tight each
time so that the numbers reported are since the last test, not ever growing
numbers

I think you’d run out of chain, and only actually test the slack tail of the chain spanning the motors?

hook the two chains together into a loop, when you run out of the first chain,
you are now testing part of both chains, then you are only testing the second
chain, then testing both until you loop all the way around.

what we are looking for is to see if the various steps all return very similar
values, or if they drift up and down over the different parts of the chains.

David Lang

Here’s a start for you, it moves both motors 100mm and then waits 60 seconds for you to make a measurement then repeats. This isn’t the ‘two chains hooked together’ arrangement, just a way to make measurements on one or both chains. You’ll need to recalibrate your chains after it’s done, and there’s no way to show any progress numbers on screen. I think I put enough comments in so you could change the distances and wait times (shorter wait times, and click ‘Hold/Resume’ might work).

G21                  ( metric mode )
B06 L0 R0            ( zero the axes )  

G91                  ( set relative mode )
B09 L100 R100 F1000  ( move both motors 100 mm, fast )
G90                  ( return to absolute mode )
G4 S60               ( wait 60 second - edit to repeat these four lines as many times as you want )
  
G91
B09 L100 R100 F1000
G90
G4 S60

G91
B09 L100 R100 F1000
G90
G4 S60

G91
B09 L100 R100 F1000
G90
G4 S60

G91
B09 L100 R100 F1000
G90
G4 S60

B06 L0 R0            ( zero the axes )
G90                  ( return to absolute mode )
M30                  ( all done )

1 Like

There is a B code that will return the motor positions

so I think it would be something like:

G91 ( set relative mode )
B09 L100 R100 F1000 ( move both motors 100 mm, fast )

B-code to apply power to the right motor (I’d do it in two steps, first at
low-medium power to take up the slack, then high power to pull it tight)

B-code to report motor positions (shows up in the logs)

B06 L0 R0 ( zero the axes )
B09 R10 (release tension on the system

G90 ( return to absolute mode )
G4 S60 ( wait 60 second - edit to repeat these four lines as many times as you want )

why bounce back and forth between relative and absolute modes?

David Lang

That’s right, B10. I was looking on screen (doesn’t show there), and my log grep was hiding the line.

@Gero, here’s a version that will show the chain measurements in the log, like this:

Sent: B10 L   
B10 L
[Measure: 199.94]
Sent: B10 R   
B10 R
[Measure: 199.76]

G21                  ( metric mode ) 
B06 L0 R0            ( zero the axes )   
 
G91                  ( set relative mode ) 
B09 L100 R100 F1000  ( move both motors 100 mm, fast ) 
G90                  ( return to absolute mode ) 
B10 L                ( measure the left axis chain length ) 
B10 R                ( measure the right axis chain length ) 
G4 S60                ( wait 60 second, repeat these four lines as many times as you want ) 
   
G91 
B09 L100 R100 F1000 
G90 
B10 L 
B10 R 
G4 S60 
 
G91 
B09 L100 R100 F1000 
G90 
B10 L 
B10 R 
G4 S60 
 
G91 
B09 L100 R100 F1000 
G90 
B10 L 
B10 R 
G4 S60 
 
G91 
B09 L100 R100 F1000 
G90 
B10 L 
B10 R 
G4 S60 
 
B06 L0 R0            ( zero the axes ) 
G90                  ( return to absolute mode ) 
B10 L 
B10 R 
M30                  ( all done ) 

I like to stay in absolute mode unless I’m currently making a relative movement. Belt and suspenders.

That script would make quite a few hard pulls. There have been enough users who’ve damaged driver chips and gears that I don’t want to publish a script that would do that many high power pulls in so short a time.

don’t pull that hard then, but there’s more stress on the gears rotating under
tension than there would be to release tension, roll a bit, then snug things up.

As long as we are pulling at the same strength every time, the results should be
consistant.

The script as currently written will always return the same values, because you
are always telling it to move a particular distance, so it will move that
amount, even if the chain sags in the meantime (or will pull the chain really
tight trying to move that distance if the chain is shorter)

so even if you don’t want to pull tight at full power, you do need the back-off
and tighten for each move.

try the tighten at 25% power to start with.

David Lang