fabric-analyser

Public

@jerome-graves

Share fabric-analyser

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading…

README

Fabric Analyser

An automated, gimbal-based cross-polarised optical scanner for measuring the crystal orientation fabric (COF) of ice-core thin sections. Despite the name, "fabric" here is the glaciological term for the distribution of ice-crystal c-axes, not textiles (the firmware identifies itself as ICEGIMBAL).

A thin section held in a 100 mm registration ring is imaged between crossed polarisers while a three-axis gimbal rotates it in-plane in 5 degree steps (72 positions). Each ice grain reaches optical extinction at an angle that encodes its c-axis orientation. An image-processing pipeline segments the grains, extracts a per-grain extinction azimuth, and reduces them to a specimen-level predominant azimuth and 2-D eigenvalues. The instrument was built to give a co-registered, non-destructive 2-D optical reference for validating ultrasonic (P-wave) fabric measurements on the same specimen.

Developed as part of PhD research at London South Bank University.

CAD model (left) and the built instrument imaging an ice thin section over the LED light box (right).

What's in this repo

FolderContents
firmware/ICEGIMBAL firmware for the Raspberry Pi Pico 2 W (RP2350): three TMC2209 stepper axes, ADC angle feedback, PWM lighting, LittleFS-stored calibration, text serial protocol.
software/Python control + acquisition + calibration stack (serial client, camera pipeline, five-stage calibration, scanning, two Tk GUIs).
hardware/KiCad PCB (Pico + 3x TMC2209 + LED MOSFET driver), AS5600 encoder daughter board, CNC DXF/job files, STEP models, and a schematic/PCB PDF.
mechanical/Gimbal frame, mounts and light-box CAD. (Placeholder: files to be added from cloud storage.)
docs/Full technical dossier (DOSSIER.md) and figures drawn from the thesis write-up.

System at a glance

  • MCU: Raspberry Pi Pico 2 W (RP2350), USB serial at 115200 baud.
  • Motion: 3x TMC2209 (UART) driving yaw (specimen azimuth), pitch (+/-45 deg) and roll (+/-45 deg). Two-phase fast-then-creep moves with ADC/encoder feedback.
  • Optics: crossed polarisers, diffused LED light box, USB camera imaging downward.
  • Measurement: 72-position in-plane rotation, per-grain extinction azimuth, doubled-angle circular mean for the predominant azimuth, 2-D eigenvalues for fabric strength.

Functional layout: a camera with a polarising lens images the thin-section sample on the three-axis rotational stage, backlit by a polarised light box; a control unit and host computer drive the scan.

Three-axis gimbal: yaw rotates the section in-plane; pitch and roll tilt it for the optional 3-D extension. The specimen sits in a 100 mm ring above the LED light box, imaged from above.

See docs/DOSSIER.md for the complete write-up: measurement principle, mechanical design, electronics, the serial command set, a file-by-file software guide, the calibration procedure, the image-processing workflow, and validation results.

How it works

The section is imaged between crossed polarisers while it rotates through 72 positions (0-355 deg in 5 deg steps). Each grain darkens (reaches extinction) at an angle set by its c-axis orientation. A temporal-clustering pipeline segments the grains and reduces them to a per-grain extinction azimuth and a specimen-level predominant orientation.

Raw crossed-polariser frameSegmented grain map

Left: one of 72 frames of specimen B003 at 45 deg. Right: the resulting grain map, coloured by per-grain extinction angle (0-90 deg).

Optical fabric-extraction pipeline, from the raw rotation stack to specimen-level metrics.

Grain maps for three specimens (each coloured by per-grain extinction angle):

Calibration and scanning

The instrument is calibrated in five stages (camera intrinsics, ring-boundary detection, dense homography, mechanical axis zeroing, and a merged full-system build). Each raw scan frame is then undistorted, homography-warped into the specimen plane, and masked to the 100 mm ring boundary. The full step-by-step procedure, with process images, is in docs/CALIBRATION.md.

Calibration (checkerboard corners)Processed frame (rectified + masked)

Left: symmetric checkerboard-corner detection on the tilted target during intrinsics calibration. Right: a processed scan frame after undistortion, homography warp, and ring masking. See docs/CALIBRATION.md for all five stages and the scan pipeline.

Software quick start

cd software
python -m venv .venv && . .venv/Scripts/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Requires Python 3, numpy, opencv-python, pyserial (GUIs use the standard-library tkinter). Typical workflow:

python calibrate_machine.py --mode full   # motion tuning + geometry zeroing
python run_calibration.py --mode all      # camera intrinsics, boundary, homography
python run_scan.py                        # batch scan from config/scan_config.json
# or drive it interactively:
python GUI_OM.py                          # acquisition GUI
python GUI_Process.py                     # offline post-processing GUI

Acquisition and calibration parameters live in software/config/*.json.

Firmware

firmware/Fabric_Analyser_2_Firmware.ino builds for the Raspberry Pi Pico 2 W (Arduino-Pico core) with the TMCStepper library. It exposes a line-based serial protocol (PING, STATUS, M <pitch> <roll> <yaw>, L <percent>, CAL ..., etc.); the full command reference is in the dossier.

The control board: a Raspberry Pi Pico 2 W and three TMC2209 stepper-driver modules on a hand-milled copper PCB (yaw, pitch, roll).

Status and caveats

  • This is research hardware. Calibration data and raw/processed scan image stacks are intentionally excluded from the repo (see .gitignore).
  • The mechanical CAD and some manufacturing outputs are not yet committed; see mechanical/README.md and the "Gaps" section of the dossier.
  • The PCB and CAD here are the v1 design that the current build inherits; confirm any v2 revisions before relying on them.

License

Code is released under the MIT License (LICENSE). Hardware design files are provided for reference; if you intend to share the hardware under an open licence, consider a CERN-OHL variant.

Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.