Fit Circle to Profile
Description
This Step is used to fit a circle to the input profile and output various features of the fitted circle.
Fits a circle to the entire profile |
Workflow
The process of configuring this Step is shown below.
-
Configure the input. Connect the Step ports in the graphical programming workspace or select the input under Input in the parameter configuration panel.
-
Determine whether to use a feature region.
-
Select the fitting method and set relevant parameters.
-
Select the desired output(s) under Output. For an expandable output item, click ▶ and configure the Min and Max values of the acceptable range.
Parameter Description
- Use Feature Region
-
When this option is selected, this Step only uses data within the feature region to fit a circle.
When this option is unselected, this Step uses the entire profile to fit a circle.
For parameter settings of the feature region, please refer to Set the Feature Region.
- Fitting Method
-
This parameter specifies the method of fitting the circle to the profile.
-
Iterative robust least squares
This method uses iterative least squares fitting to reduce the influence of outliers. When selecting this method, you need to set the Outlier Fraction parameter.
-
RANSAC
This method uses random sampling to reduce the influence of outliers. When selecting this method, you need to set the Tolerance and Number of Iterations parameters.
In general, the iterative robust least squares method is applicable to cases where there are few outliers in the dataset, while RANSAC is applicable to cases where there are many outliers. -
- Outlier Fraction
-
This parameter defines the proportion of outliers to be removed during circle fitting, thus resulting in a better result.
Default setting: 0.0%
- Tolerance
-
This parameter refers to the distance threshold used in the RANSAC algorithm when determining the adequacy of a data point for fitting a model. If the distance between a data point and the fitted circle is less than or equal to the tolerance, the data point is considered an inlier, i.e., a point suitable for fitting the model, while points with a distance greater than the tolerance are considered outliers that will cause interference. By adjusting Tolerance, it is possible to control the sensitivity of the RANSAC algorithm to noise and outliers. The larger the value, the more easily the noise are recognized as inliers, and vice versa.
Default setting: 0.001 mm
- Number of Iterations
-
In RANSAC, this parameter defines how many times the algorithm will randomly sample the data and fit a model to the sampled points.
In general, increasing the number of iterations can lead to more robust results, but this comes with the trade-off of increased computational costs.
Default value: 1000
Output Description
Select the output item(s) according to the actual measurement requirements. Then, the corresponding data will be output after the Step is run.
If you select an expandable output item, you must expand it by clicking ▶, and then set the Min and Max values to determine the acceptable range. If the output value falls within the acceptable range, the measurement item is judged as passing (OK), or else it is judged as failing (NG). |
Output Item | Description |
---|---|
Circle Center X |
X value of the center of the fitted circle. |
Circle Center Z |
Z value of the center of the fitted circle. |
Radius |
The radius of the fitted circle. |
Standard Deviation |
The standard deviation of the data points with respect to the fitted circle. |
Min Error |
The minimum error of the data points with respect to the fitted circle. |
Max Error |
The maximum error of the data points with respect to the fitted circle. |
Min Error X |
The X value of the point with the minimum error. |
Min Error Z |
The Z value of the point with the minimum error. |
Max Error X |
The X value of the point with the maximum error. |
Max Error Z |
The Z value of the point with the maximum error. |
Center of Fitted Circle |
The center point of the fitted circle. |
Fitted Circle |
The fitted circle obtained. |
Troubleshooting
See Common Errors and Solutions for error messages that may occur in all Steps and the corresponding solutions. |
Invalid Parameter
No. | Error | Error Description | Possible Causes | Solution |
---|---|---|---|---|
1 |
Inappropriate outlier fraction |
When Fitting Method is set to Iterative robust least squares, Outlier Fraction is not set properly. |
The set outlier fraction is not within [0, 1]. |
Reset Outlier Fraction to ensure that the value is within [0, 1]. |
2 |
Inappropriate number of iterations (RANSAC used) |
When Fitting Method is set to RANSAC, Number of Iterations is not set properly. |
The set number of iterations is not greater than 0. |
Reset Number of Iterations and ensure that it exceeds 0. |
3 |
Inappropriate tolerance (RANSAC used) |
When Fitting Method is set to RANSAC, Tolerance is not set properly. |
The set tolerance is not greater than 0. |
Reset Tolerance and ensure that it exceeds 0. |