Holey Triangular Calibration

@Jay_Settle, this (holey triangular calibration that @Joshua has picked up on) is a proposed evolution of the current triangular calibration process. The current process attempts to determine three parameters (height of motors above workspace, rotational radius, and chain sag coefficient) that the controller uses to calculate how much chain to feed out for a given target coordinate. Those three parameters are sent to the controller and is saved in the eeprom. @joshua has added other parameters and forumulae to the calibration process for use with the controller and has changed how measurements are made the calibration process. The goal is to account for things like chain sag and chain stretch better than they currently are and trying to improve the accuracy of the measurement methodology so we end up with better/more accurate calibration values.

What @joshua is doing is different than what I’m working on (optical calibration) which produces an error matrix that the controller uses to change target coordinates so you achieve better accuracy… it’s a totally different approach, not an evolutionary change.

3 Likes

@Jay_Settle, thanks for the interest. I think @dlang and @madgrizzle answered your questions.

There is a fork on GitHub which is functioning. If you would like to use it, you will have to be willing to open a python script and modify text as part of the calibration process, and install the Python scipy package (which is pretty straight forward). Otherwise, it is very similar to going through the current triangular calibration. I would like to get one or more other individuals using it, to further demonstrate its viability and create some interest, to get it into the main distribution.

Calibration Process

  • Download and install GC and the Firmware from the above locations
  • Install the Firmware on the Arduino.
  • Run Ground Control from the new folder
  • There is a file, SixHoleCalibrationCut.nc in the folder, GroundControlUpdate/gcodeForTesting which drills the holes for the calibration. Set it up on your machine and run it.
  • Measure the distance-between holes as is shown in Post 160
  • There is a file in the Ground Control download named RunHoleyCalibration.py.
    • Open it.
    • There is a section where the measurements are entered as text starting at line 24. Units are in inches. Enter your measurements, top to bottom, where M1 is on top and M12 is on bottom.
    • Run the script.
  • It will print out a calibration result. It will report optimized values for: Distance Between Motors, Motor Y Offset, Left Chain Tolerance, Right Chain Tolerance.
  • Copy-paste the values from the report, into the appropriate GC settings.
  • Force the firmware to update
    • Disconnect and reconnect the arduino by unplugging the USB cable, and re-plugging it in
4 Likes

I must have done something wrong?

groundcontrol.ini (1.5 KB)

RunHoleyCalibrationmishle.py (1.2 KB)

python /home/mishle6/Documents/GroundControlUpdate/RunHoleyCalibrationmishle.py
Optimized Errors
Index : 0
Points Span : 1 to 2
Measured Distance : 720.725
Calibrated Distance: 572.155382324
Distance Error : 148.569617676
Index : 1
Points Span : 2 to 3
Measured Distance : -242.8875
Calibrated Distance: 535.871819262
Distance Error : -778.759319262
Index : 2
Points Span : 4 to 5
Measured Distance : 719.1375
Calibrated Distance: 561.580789747
Distance Error : 157.556710253
Index : 3
Points Span : 5 to 6
Measured Distance : 703.2625
Calibrated Distance: 535.46320962
Distance Error : 167.79929038
Index : 4
Points Span : 1 to 4
Measured Distance : 467.51875
Calibrated Distance: 453.317204033
Distance Error : 14.2015459666
Index : 5
Points Span : 2 to 5
Measured Distance : 466.725
Calibrated Distance: 537.416992633
Distance Error : -70.6919926328
Index : 6
Points Span : 3 to 6
Measured Distance : 465.1375
Calibrated Distance: 560.633744604
Distance Error : -95.4962446042
Index : 7
Points Span : 2 to 4
Measured Distance : 856.45625
Calibrated Distance: 812.37330377
Distance Error : 44.0829462302
Index : 8
Points Span : 1 to 5
Measured Distance : 834.23125
Calibrated Distance: 685.573663974
Distance Error : 148.657586026
Index : 9
Points Span : 3 to 5
Measured Distance : 847.725
Calibrated Distance: 782.501679643
Distance Error : 65.2233203567
Index : 10
Points Span : 2 to 6
Measured Distance : 833.4375
Calibrated Distance: 751.104842685
Distance Error : 82.3326573155

Distance Between Motors:
2295.85126221

Motor Y Offset:
39.8006501011

Left Chain Tolerance:
74.7719824322

Right Chain Tolerance:
60.0049657937
1 Like

That is awesome! I am glad you gave it a try. I apologize that it looks like it didn’t work the first-time. Hopefully there is some information which can help you work through it.

Looking at your initial machine parameters

  • The cal.SP_* properties are SP = Starting Point. They should be equivalent to the machine parameters, as they were in GC when you ran the 6-point cut.
  • I haven’t read the groundcontrol.ini file before, so I may misinterpret the parameter name/values, but here is how I understand your machine’s starting point. This would go in lines 6 to 13 in RunHoleyCalibrationmishle.py
    cal.kin.isQuadKinematics=False
    cal.SP_D=3164.8 #from motorspacingx
    cal.SP_motorOffsetY=544.4 #from motoroffsety
    cal.SP_rotationDiskRadius=140.5 #from rotationradius
    cal.SP_sledWeight=19.375869 #from chainsagcorrection
    cal.SP_leftChainTolerance=0
    cal.SP_rightChainTolerance=0
    cal.SP_chainOverSprocket=1 #from chainoversprocket. I believe this is Top.

Looking at your measurements

When I evaluate your measurements, lines 24 through 37, here is what I get:
[720.7249999999999,
-242.8875,
719.1374999999999,
703.2624999999999,
467.51874999999995,
466.72499999999997,
465.1375,
856.45625,
834.2312499999999,
847.7249999999999,
833.4375,
238.125]

  • The first four measurements are the horizontal measurements, measurements 1-4 in the figure on post 159, here: Holey Triangular Calibration. They should be around 965.2 mm. This is subject to the accuracy of your initial calibration. Yours are all around 700.
  • I am thinking there is a typo in your second measurement, because it is negative.
  • Measurements 5-7 are the vertical measurements. They should be around 711.2 mm. Yours are closer to 465.
  • Measurements 8-11 are the diagonal measurements, and should be around 1199 mm. Yours are around 840 mm.
  • The last measurement, measurement 12, should be the distance between hole 2 and the top-edge of the 4x8 sheet of plywood. It looks like this was not changed from my original measurement.

I am thinking there was some misinterpretation of the format of the measurements and the initial machine parameters.

Format of the Measurements

In the RunHoleyCalibration.py script, each measurement was taken by taping the tape-measure to the plywood and reading the position of the two holes in question. That is why the measurements are typed like (47.+1./8.)-(14.+5./16.). The (x)-(y) is the position of the second hole minus the position of the first hole. Evaluating this expression results in one number, the measured distance between the two holes. If you evaluate everything in the brackets, you should get a list of numbers, sized 12x1, where each number in the list corresponds to one measurement.

Recommendation

Update the initial machine parameters, and update the distance measurements. If the updated distance measurements are still far-off from the ideal measurements, this should correspond to very inaccurate initial machine parameters, and the initial cut pattern would appear very skewed. This very skewed initial cut pattern could also be caused by a failing motor or connection.

Could you confirm that you’ve downloaded the entire GroundControlUpdate and MaslowFirmwareUpdate repositories from https://github.com//schmittjoshc/? There are modifications to the kinematics calculations which require that this branch of both repositories is used.

I gave a try at the gcode and modified RunHoleyCalibration.py with my parameters and measured values.

Note: Post 159 does not talk about measurement M12 and I had to search for that which I found into your most recent reply (to @mishle)

I slightly modified the SixHoleCalibrationCut.nc file to score only 1mm deep and raise 2mm above surface. And I got 500mm/min feedrate there but there is no reason to limit it like that.

Test A: I ran the Gcode on my best tuned setup including a residual correction table where I had tweaked the last bit of variation I was able to measure.

Test B: I ran the Gcode again (with a home position 10mm shifted on the right to avoid overlaping) but this time with no correction table values (a correction table value set to all (0,0))

Test A results:
HoleyWithCorrTable.txt (1.9 KB)

File excerpt:
Distance Between Motors:
3502.7721908125895

Motor Y Offset:
614.6604519032018

Left Chain Tolerance:
0.09665037105115712

Right Chain Tolerance:
-0.0034118505071166205

Test B results:
HoleyWithoutCorrTable.txt (1.9 KB)

File excerpt:
Distance Between Motors:
3501.0317012524947

Motor Y Offset:
613.9010867482021

Left Chain Tolerance:
0.0887578997135775

Right Chain Tolerance:
-0.01716041546873097

Now what do you think of that?

1 Like

They both look very good.

In your WithoutCorrTable result, the highest error is ~0.54 mm. Considering how difficult it is to measure within 0.5 mm accuracy, I think that is very good. In my calibration, the highest error was ~1.3 mm. So, your calibration looks is better than mine.

Your two calibrations resulted in very similar machine parameters. I would typically use that as a gut-check. You shouldn’t get substantially different machine parameters, as long as the machine doesn’t change. So, this is a good thing.

All evidence suggests you have a very good machine calibration. I would like to see how it does with the Zipper Tree Challenge.

Further, looking at your initial measurements, they were very close to the ideal lengths. Your initial calibration was very good, too. It looks like this calibration only adjusted measured length errors by ~0.5 mm.

Thanks for doing this. I would really like to see my work positively impact others. Your successful calibration is a big step toward that.

2 Likes

170 posts on this topic. What a journey!

I suggest to summarize the Holey Calibration approach as a list of improvements (currently under test) that could eventually make it to the current firmware and GroundControl.

a) An improved firmware taking into account previously missing but important machine parameters to get accurate sled positioning: chain elasticity, sled and chain weight. Once included, it is believed the machine tuning space would now cover the solution space.

b) An improved firmware now computing chain sag compensation based on catenary equilibrium and actual physical weight properties of the suspended apparatus. That is instead of using a parabola approximation. That might ease sag adjustment by eliminating one parameter.

c) A new standard workspace scoring cnc path to reveal the Maslow positioning errors on the workspace. (SixHoleCalibrationCut.nc). in a way that enable efficient measurements collection and parameters optimization function.

d) A standardized 12 points tape measurement operation to assess and list observations of the Maslow positioning errors from the scoring cnc path. This to translate the scoring path into a suitable input to the parameters optimization function.

e) A calculation tool (python script) to generate optimized MaslowCNC settings from the 12 points measurement.

And as a future feature, the calculation output could eventually be automatically proposed to the cnc operator then, upon acknowledgement, pushed to Ground Control’s settings pane and to the firmware for storage.

Do I miss one?

Now, as we can expect, demonstrating each feature fitness to the community needs, execution reliability of the implementation, and providing code improvement modularity to be pulled separately into the MAslowCNC repository, are a few of the important steps to get into the release.

One step at a time,

4 Likes

@c0depr1sm, I think all those comments are pretty much right on.

I keep thinking we can let the results speak for themselves. I consider your story a success, especially in comparison to the current standard calibration. It may be a little early, but one could say that you’ve achieved the Maslow goal of 0.5 mm accuracy. I think that is a huge step, and opens up quite a few doors for Maslow users. I have seen several threads where the Maslow was used for this part, but not that part, because the Maslow was considered inaccurate, not fit for the cuts that required accuracy.

It is difficult to glean any information about fitness or robustness without community trial. There are some additional things we can do to enable that. I wonder if it makes sense to enter this as an alternative calibration process in the Wiki.

1 Like

That would be great!

Here are updated and consolidated instructions.

There is a fork on GitHub which is functioning. If you would like to use it, you will have to be willing to open a python script and modify text as part of the calibration process, and install the Python scipy package (which is pretty straight forward). Otherwise, it is very similar to going through the current triangular calibration. I would like to get one or more other individuals using it, to further demonstrate its viability and create some interest, to get it into the main distribution.

Calibration Process

  • Download and install GC and the Firmware from the above locations
  • Install numpy and scipy Link to Instructions
  • Install the Firmware on the Arduino.
  • The sled-weight is measured using a scale (lbs).
  • Run Ground Control from the new folder
  • Enter the sled-weight (lbs) into the “Advanced System Settings => Chain Sag Correction Value for Triangular Kinematics”
  • You should start with a reasonable calibration based on physical measurements. Your machine should know a reasonable home position before starting the calibration cut.
    • Measure the motor-to-motor distance by with a tape-measure. Enter the value into “Maslow Settings => Distance Between Motors”
    • Measure the distance between the top of the worksheet and the motor-centers. Enter the value into “Maslow Settings => Motor Offset Height MM”
    • Go through the “Actions => Set Chain Lengths - Automatic” exercise.
  • There is a file, SixHoleCalibrationCut.nc in the folder, GroundControlUpdate/gcodeForTesting which drills the holes for the calibration. Set it up on your machine and run it.
  • Measure the center-to-center distance between holes as is shown in the figure in this post
  • There is a file in the Ground Control download named RunHoleyCalibration.py .
    • Open it.
    • There is a section where the initial machine parameters are entered as text, from lines 6 to 13. Type your initial machine parameters in the appropriate locations.
    • There is a section where the measurements are entered as text starting at line 24. Units are in inches. Enter your measurements, top to bottom, where M1 is on top and M12 is on bottom.
    • Run the script.
  • It will print out a calibration result. It will report optimized values for: Distance Between Motors, Motor Y Offset, Left Chain Tolerance, Right Chain Tolerance.
  • Copy-paste the values from the report, into the appropriate GC settings.
  • Force the firmware to update
    • Disconnect and reconnect the arduino by unplugging the USB cable, and re-plugging it in

6 Likes

Got my acrylic today for my new ‘low CGZ’ c-beam spindle sled. Can’t wait to try this! Thanks!

2 Likes

Is this in-sync with the latest version?

I just got back to the shop today so I’m going to read through these posts and see what I can do thanks for all your help

not all 4 by 8 sheets are 48 in tall so would it be better to do our measurements off the bottom for M12. For an example I have just put a piece of MDF in which is 49 in

I believe so.

Regarding Ground Control, when I look at the revision history of my repository, I see the latest commit from the main trunk was a version number bump by @bar on Nov 1, 2018. Since then, there has been one commit to the main fork which was another version number bump by @bar on Dec 2, 2018.

Regarding the Firmware, the only revision that has been made to the main fork is a version number bump on Dec 2 by @bar.

Whatever you measure to is going to become the top-edge of your machine. If the 49" width puts your calibration 1" higher than the machine’s edge, I recommend subtracting 1" from your measurement.

This particular measurement does not interact with the other parameters. It just results in the calibrated top-beam height being shifted up or down.

These are my results.

cal.SP_chainOverSprocket=0 I did not know what to set this as so left it default my chain is over the top then down the side

My sled weight is 21lb 14.1Oz. I put this at 22lb because of the vac hose weight.

RunHoleyCalibrationmishle2.py (1.0 KB)

mishle6@openbox:~$ python /home/mishle6/Documents/GroundControlUpdate/RunHoleyCalibrationmishle2.py
Optimized Errors
Index : 0
Points Span : 1 to 2
Measured Distance : 957.659375
Calibrated Distance: 960.41531595
Distance Error : -2.75594095023
Index : 1
Points Span : 2 to 3
Measured Distance : 957.659375
Calibrated Distance: 959.780032929
Distance Error : -2.12065792933
Index : 2
Points Span : 4 to 5
Measured Distance : 959.64375
Calibrated Distance: 960.413809634
Distance Error : -0.770059634469
Index : 3
Points Span : 5 to 6
Measured Distance : 959.64375
Calibrated Distance: 959.784713788
Distance Error : -0.1409637879
Index : 4
Points Span : 1 to 4
Measured Distance : 703.2625
Calibrated Distance: 703.938865093
Distance Error : -0.676365093027
Index : 5
Points Span : 2 to 5
Measured Distance : 701.675
Calibrated Distance: 703.502821741
Distance Error : -1.82782174126
Index : 6
Points Span : 3 to 6
Measured Distance : 704.05625
Calibrated Distance: 705.036766522
Distance Error : -0.980516522331
Index : 7
Points Span : 2 to 4
Measured Distance : 1191.815625
Calibrated Distance: 1190.21767503
Distance Error : 1.59794997213
Index : 8
Points Span : 1 to 5
Measured Distance : 1193.00625
Calibrated Distance: 1191.05839771
Distance Error : 1.94785229198
Index : 9
Points Span : 3 to 5
Measured Distance : 1194.196875
Calibrated Distance: 1191.91986869
Distance Error : 2.27700631203
Index : 10
Points Span : 2 to 6
Measured Distance : 1189.89230769
Calibrated Distance: 1188.98366025
Distance Error : 0.908647441925

Distance Between Motors:
3136.7468286

Motor Y Offset:
541.244889642

Left Chain Tolerance:
0.767578164982

Right Chain Tolerance:
0.65662622933

1 Like

I am not sure how to interpret this. I am just going to type as I think.

  • The calibration is better than the first one I got with the TriangularCalibration.
  • Overall, if this accurately represents the quality of the calibration, it might not be all that bad.
  • All your measurements are short in comparison to “Ideal”
    • This could be due to the machine’s starting calibration/setup, or it could be due to your measurements.
  • What concerns me is:
    • The measurements are short, AND the calibration defined a positive left and right chain tolerance.
    • I would think the calibration should go the other way. If all the measurements are short, it should define a negative chain tolerance, so that the controller would feed out more chain.

I am having a difficult time with this one. I would like to see if I can reproduce the result. Then I will get back.

Should I measuring between the holes or from the center to center of the holes

The intent is to measure the distances, center-to-center. The most practical way to do this is to measure to the edges of the holes (left-edge to left-edge) or (right-edge to right-edge) or (top to top) or (bottom to bottom)