Maslow Home Maslow Community Garden

Holey Triangular Calibration


#162

I spent a little bit of time looking, but I didn’t find any nonlinear optimizations in numpy. All the optimizations in numpy are related to linear algebra.


#163

Ok, well, I know it builds and works, so no worries.


#164

I’m trying to understand if this writes or corrects eprom values based on cuts. Is this how this works?
Couple more questions…

  1. What problem is this solving that the original maslow cal doesn’t?
  2. Does the python script write to the eprom/
    I get that I’ll cut the gcode hole pattern out and input my manual measurements into the code, what next?

Thanks!


#165

Couple more questions…

  1. What problem is this solving that the original maslow cal doesn’t?

The stock maslow software doesn’t know about all the variables (chain
stretch/tolerance, etc), so the position it things the sled is in based on how
much it’s rotated the sprockets isn’t quite right.

This approach doesn’t try to calculate where the sled is, instead it creates a
table of ‘at this location the error is X,Y’ and then as you move around it
corrects based on this table

  1. Does the python script write to the eprom/

no, it writes a file that can be uploaded to the firmware to be written to the
eprom.

David Lang


#166

@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.


Calibration Questions
Accurate MaslowCNC manual calibration, how to
#167

@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

#168

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

#169

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.


#170

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?


#171

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.


#173

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,


#174

@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.


#175

That would be great!


#176

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.
  • 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 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


#177

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


#178

Is this in-sync with the latest version?


#179

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


#180

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


#181

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.


#182

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.