|
1 | 1 | --- |
2 | | -title: 'PICA: Python-based Instrument Control and Automation Software Suite' |
| 2 | +title: 'PICA: A Python-based Instrument Control and Automation Suite for Material Characterisation' |
3 | 3 | tags: |
4 | | - - Python |
5 | | - - experimental physics |
6 | | - - laboratory automation |
7 | | - - instrument control |
8 | | - - materials science |
9 | | - - PyVISA |
| 4 | + - python |
| 5 | + - hardware control |
| 6 | + - automation |
| 7 | + - pyvisa |
| 8 | + - condensed matter physics |
| 9 | + - cryogenics |
| 10 | + - scpi |
10 | 11 | authors: |
11 | | - - name: Prathamesh Keshao Deshmukh |
| 12 | + - name: Prathamesh Deshmukh |
12 | 13 | orcid: 0009-0008-3278-0837 |
13 | | - affiliation: 1 |
| 14 | + affiliation: "1,2" |
14 | 15 | - name: Sudip Mukherjee |
15 | | - affiliation: 1 |
| 16 | + orcid: 0000-0003-4734-9157 |
| 17 | + affiliation: "1,2" |
| 18 | + corresponding: true |
| 19 | + email: sudipm@csr.res.in |
16 | 20 | affiliations: |
17 | 21 | - name: UGC-DAE Consortium for Scientific Research, Mumbai Centre, India |
18 | 22 | index: 1 |
19 | | -date: 21 November 2025 |
| 23 | + - name: Savitribai Phule Pune University, Pune, India |
| 24 | + index: 2 |
| 25 | +date: 27 November 2025 |
20 | 26 | bibliography: paper.bib |
| 27 | + |
21 | 28 | --- |
22 | 29 |
|
23 | 30 | # Summary |
24 | 31 |
|
| 32 | +PICA (Python-based Instrument Control and Automation) is a modular, open-source software suite designed to automate complex characterisation experiments in condensed matter physics. Developed to operate a custom laboratory-built measurement system, PICA provides a unified graphical user interface (GUI) for orchestrating high-precision instruments, specifically Keithley SourceMeters/Nanovoltmeters, Lakeshore Temperature Controllers, and Keysight LCR metres. The suite regulates the cryogenic environment to perform automated protocols such as temperature-dependent resistivity, current voltage (I-V) characteristics, and pyroelectric current measurement. |
| 33 | + |
| 34 | +<figure> |
| 35 | +<img src="pica-architecture-schematic.png" width="70%" /> |
| 36 | +<figcaption>System architecture of PICA</figcaption> |
| 37 | +</figure> |
| 38 | + |
| 39 | +# Statement of need |
| 40 | + |
| 41 | +Advancements in experimental physics depend on the precise characterisation of material properties under extreme physical conditions. Researchers have to choose between expensive proprietary software like LabVIEW or developing a custom measurement script from scratch. While Python libraries such as PyVISA [] and PyMeasure [] provide excellent low-level driver support. They function as a primary developer toolkit. They often require significant boilerplate code to handle data visualisation and error handling, effectively forcing physicists to become software engineers. |
| 42 | +PICA fills this niche by providing a **"lab-ready" application layer** built on top of these libraries. It differentiates itself through. |
| 43 | +* **Accessibility:** A professional dashboard that allows researchers without coding experience to configure and run a complex measurement protocol immediately. |
| 44 | +* **Physical Validation:** Unlike general-purpose drivers, PICA's protocols are actively used for cryogenic transport measurements (80K - 320K) at the UGC DAE Consortium for Scientific Research, Mumbai Centre.Ensuring that the protocols are physically accurate and lab tested |
| 45 | +* **Process Isolation:** PICA deploys a `multiprocessing` architecture that runs instrumentation control logic in an isolated process. This ensures that hardware timeouts or driver crashes do not freeze the main dashboard, a common problem in single-threaded Python scripts. |
| 46 | +* **Modular CLI Architecture:** As demonstrated in the repository, measurement modules also contain a CLI measurement module, which allows researchers to utilise PICA's measurement protocol and logic for headless automation or integration into other workflows without GUI overhead |
| 47 | +* **Operational Transparency:** Unlike a Black box solution, PICA exposes the real-time command logs, aiding in debugging and ensuring scientific reproducibility. |
| 48 | + |
| 49 | + |
| 50 | +# Design and Implementation |
25 | 51 |
|
26 | | -[Your Summary Here] |
| 52 | +PICA is built on a modular architecture characterised by self-contained modules, ensuring future extensibility. This design allows individual measurement protocols to be modified independently or added without impacting the core system stability. |
27 | 53 |
|
28 | | -# Statement of Need |
| 54 | +### Process Isolation and Concurrency |
29 | 55 |
|
30 | | -[Your Statement of Need Here] |
| 56 | +Unlike simple script-based automation, PICA decouples the User Interface (UI) from the instrumentation control logic. It utilises Python's standard 'multiprocessing' libraries to spawn isolated processes for measurement tasks. |
| 57 | +* **Stability:** If an instrument hangs or a communication bus times out, the isolated process can be terminated safely without freezing the main GUI or losing previous data. |
| 58 | +* **Responsiveness:** The `tkinter`-based frontend remains responsive for live data plotting (using `matplotlib` [@hunter2007matplotlib] with blitting) even while the backend waits for hardware triggers. |
| 59 | +* **Data Integrity:** Experimental data integrity is prioritised through a "write on acquisition" strategy. Data is structured using `pandas` [@pandas2025] and is saved to a CSV file immediately after every acquisition point, preventing data loss in the event of a power failure or program/system crash. |
31 | 60 |
|
32 | | -# Features |
| 61 | +### Hardware Abstraction Layer |
33 | 62 |
|
| 63 | +PICA utilises **PyVISA** [@grecco2023pyvisa] to abstract the low-level communication protocols (GPIB, USB, Ethernet). The software implements a strict initialisation routine: |
| 64 | +1. **Connection Verification:** A built-in "VISA Instrument Scanner" queries the bus ('*IDN?) to map the connected instrument addresses. |
| 65 | +2. **State Sanitisation:** To eliminate the influence of all previous experiments, any stored data, cache in buffers, and existing settings or configurations, the instruments are explicitly reset (`*RST`) and buffers are cleared (`TRAC:CLE`), thereby providing a clean initial state before each measurement. |
| 66 | +3. **Graceful Shutdown:** A "Safety Shutdown Routine" logic ensures that sources are ramped down to zero and heaters are disabled safely, even if the software is interrupted unexpectedly. |
34 | 67 |
|
35 | | -[Your Features Here] |
| 68 | +### Operational Transparency |
36 | 69 |
|
37 | | -# Software Architecture |
| 70 | +To support the scientific reproducibility of experimental results, PICA rejects hidden automation and replaces the "black box" paradigm with real-time console logs. Each measurement module has a console that records time-stamped actions (e.g., `[10:05:25] Keithley 6221: Ramping current to 10 mA`), |
| 71 | + showing every command sent to the instrument. This allows researchers to verify measurement protocols and troubleshoot hardware instantly. |
38 | 72 |
|
| 73 | + ### Testing and Simulation |
39 | 74 |
|
| 75 | +To ensure measurement reliability, all of these modules were thoroughly tested with the corresponding hardware. Additionally, to facilitate development without constant access to physical instruments, PICA includes a testing suite that uses `pytest`. The suite employs `unittest.mock` to simulate VISA resources, allowing for the verification of backend logic streams, class structure, and command sequences in a continuous integration environment. |
40 | 76 |
|
41 | | -[Your Architecture Description Here] |
42 | 77 |
|
43 | 78 | # Acknowledgements |
44 | 79 |
|
45 | | -We acknowledge the financial support provided under the SERB-CRG project grant No. CRG/2022/005676 from the Anusandhan National Research Foundation (ANRF), a statutory body of the Department of Science & Technology (DST), Government of India. |
| 80 | +We acknowledge the financial support provided under the SERB-GRG project grant No. CRG/2022/005676 from the Anusandhan National Research Foundation (ANRF), a statutory body of the Department of Science and Technology (DST), Government of India. |
| 81 | +PD would also like to thank Akshay Kamble for his valuable discussions on instrument control and for his effective assistance in resolving technical issues. |
46 | 82 |
|
47 | 83 | # References |
48 | 84 |
|
0 commit comments