Skip to content

About

A Matlab toolbox to plot and to analyze (nano)scratch data

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

ScratchPlot

This Matlab toolbox has been developed to plot and to analyze scratch resistance and mechanical deformation of material from (nano)scratch results.

To get started with the ScratchPlot toolbox, clone the repository, then run Matlab, and cd into the folder containing this README file.

You can start the launcher by typing "demo" at the Matlab command prompt.

For MATLAB Online, upload or clone the complete repository, including all subfolders. If path2cell is missing, check that matlab_code/util/path2cell.m exists inside the ScratchPlot folder rather than adding a similarly named folder from another project.

In version 2.0, use Select files to choose one or more .xls or .xlsx workbooks from the same folder. The selected files replace the previous selection and are plotted together, with each workbook analyzed using its own experimental parameters. The plot-number menu offers test numbers present in every selected workbook; Mean Values averages tests within each workbook, not across workbooks.

For an exploratory surface estimate, choose 3D plot and enable Interpolate surface. Natural-neighbor interpolation smoothly estimates heights between the uncorrected residual longitudinal and lateral profiles, only within their convex hull; there is no extrapolation. The horizontal axes are normalized to their respective spans when calculating interpolation neighbors. Set Reference z (um) to the height representing the undeformed surface (zero by default). The GUI lists separate positive estimated groove and pile-up volumes below and above that plane in µm³ for each workbook; scroll the list for additional files. The MATLAB command window also reports these values and the projected area. The volumes are approximations obtained by integrating the displayed triangles, sampled on an 81-by-81 grid and at measured points, not measured full-groove volumes. The surface axes and reference use µm regardless of the length-unit selector, which changes labels rather than converting the underlying data.

The two profiles alone cannot uniquely determine the surface between them, the unmeasured area outside their convex hull, or the true material volume. A smooth surface is a mathematical estimate, not evidence of the actual groove or pile-up shape. Measurements should share a horizontal and vertical datum; duplicate positions are averaged. At their intersection the interpolated heights of the two profiles may disagree: the estimate uses their average there and reports the signed difference (longitudinal minus lateral) in µm. Missing values are omitted and gaps are bridged by interpolation, so results can be especially uncertain for sparse or incomplete profiles. Consider a measured 3D topography for quantitative volume measurements.

Python plotting notebook

For a lightweight Python plotting workflow, open python/ScratchPlot.ipynb in Jupyter or VS Code. It loads a single ramp-program test sheet from an Excel workbook and provides the main 2D and 3D plot types. Set PLOT_TYPE to "3D residual groove" and INTERPOLATE_SURFACE to True to show the estimated groove and pile-up volumes on the plot and in a table; set REFERENCE_Z_UM for the undeformed surface height. The notebook uses a smooth additive-profile model, not MATLAB's natural-neighbor interpolation, so the two estimates can differ. Both are exploratory estimates limited to the profiles' convex hull.

Install the notebook dependencies from the repository root with python -m pip install -r python/requirements.txt. The notebook uses the bundled example workbook by default; see its setup cells to select another workbook and test sheet.

Features

The ScratchPlot toolbox has been developed to plot and to analyze (nano)scratch dataset.

With this Matlab toolbox, it is possible:

  • to load .xls file with scratch results;
  • to plot 2D scratch profiles as a function of horizontal displacement;
  • to plot 2D scratch profiles as a function of applied normal load;
  • to plot pre- and post-profiles (or initial and residual topographies);
  • to plot cross profile;
  • to get statistical values (min, mean and max).

Matlab version

Developed with Matlab R2014a.

Author

Author:David Mercier [1]

[1] CRM Group, Avenue du Bois Saint-Jean 21, B27 – Quartier Polytech 4, 4000 Liège, Belgium

Reference papers

Keywords

Matlab toolbox; GUI;nanoscratch; scratch resistance; groove; pre-scratch; residual scratch; cross profile; critical load.

Acknowledgements

Screenshots

data_image/ScratchPlot_SG1300nmGlass.png

Scratch performed on a 1300nm thick sol gel coating on a glass substrate.

doc/_pictures/ScratchPlot_3Dprofiles.png

ScratchPlot GUI with a 3D plot of residual scratch profiles.

About

A Matlab toolbox to plot and to analyze (nano)scratch data

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages