Skip to main content

Plesty PCD-M02

A PLESTY device module for the Luna (General Photonics) PCD-M02 polarization controller: four piezo fiber squeezers driven at 0–140 V.

The PCD-M02 has no computer interface of its own. Its digital input — a 17-line TTL bus — is wired to an Arduino running StandardFirmata, and this module drives that bus through plesty-arduino-firmata. You talk to channels and volts; the module turns them into pin writes.

Hardware setup

  1. On the PCD-M02, remove jumper JP1000 to enable digital control, and disconnect the analog input (or hold it at 0 V) — both inputs active at once can drive the board into saturation (manual GP-UM-PCD-M02-14, p. 9).

  2. Upload StandardFirmata to the Arduino (Arduino IDE: File → Examples → Firmata → StandardFirmata).

  3. Wire the PCD-M02's 20-pin digital connector JDD to the Arduino. The module's default wiring is the lab's Arduino Mega:

    JDD pin Line Mega pin
    1 RW 22
    2 /CS 23
    3 /RESET 24
    4 A0 29
    5 A1 28
    6–17 DB0–DB11 (DB0 least significant) 32–43
    18, 19 DGND GND

    A board wired differently passes its own Wiring (see below).

Installation

git clone https://gitlab.com/plesty/hub/devices/luna/plesty-pcd-m02.git
cd plesty-pcd-m02
uv sync

Usage

from plesty.pcd_m02 import Device

with Device(port="auto") as pc:  # or "COM5", "/dev/ttyACM0"
    pc.set_voltage(channel=1, voltage=70.0)  # channels 1–4, 0–140 V
    pc.set_voltages(voltages=[10.0, 20.0, 30.0, 40.0])
    print(pc.get_voltages())  # {'voltages': [9.98, 20.0, 30.02, 40.0]}
    pc.step_voltage(2, -5.0)  # stops at 0 V / 140 V

What to know:

  • Connecting resets the outputs to 0 V. The bus cannot be read back, so the module starts from the one state it can be sure of. To restore a saved polarization state, call set_voltages after connecting.
  • Voltages are reported, not measured. get_voltage answers the value last set in this session, rounded to the 12-bit word (steps of 34 mV).
  • Disconnecting leaves the outputs where they are. The controller holds its voltages while the port is closed; the next connect resets them.

A different wiring:

from plesty.pcd_m02 import Device, Wiring

wiring = Wiring(rw=2, cs=3, reset=4, a0=5, a1=6, data=tuple(range(7, 19)))
with Device(port="COM5", wiring=wiring) as pc:
    ...

port="mock" runs against a simulated Arduino with a simulated PCD-M02 on it; pc.simulator.outputs reads its four output voltages.

Run as TCP server

Copy .env.example to .env and set DEVICE_ADDRESS, then:

uv run python -m plesty.pcd_m02 --tcp-port 5555

Open the control panel

uv sync --extra gui
uv run python -m plesty.pcd_m02 --gui

Metadata

Release files for plesty-pcd-m02 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plesty-pcd-m02 0.1.0
File Size Uploaded Provenance Actions
plesty_pcd_m02-0.1.0.tar.gz 183.1 kB Without provenance Details for plesty_pcd_m02-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plesty-pcd-m02 0.1.0
File Interpreter ABI Platform Actions
plesty_pcd_m02-0.1.0-py3-none-any.whl Python 3 none any Details for plesty_pcd_m02-0.1.0-py3-none-any.whl

Total release size: 213.4 kB

Release files / plesty_pcd_m02-0.1.0.tar.gz

Download URL plesty_pcd_m02-0.1.0.tar.gz
Size 183.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5b478bfae76def85de2fed1526129c4b27ad8beff43ea47b526c20f09b73517b
BLAKE2b-256 checksum
How to use checksums
d159c6c7be55d72d0442c25b5460d080d34d051d1a175187eb9788c6c36fcfe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / plesty_pcd_m02-0.1.0-py3-none-any.whl

Download URL plesty_pcd_m02-0.1.0-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
839bcf1dbf692bc7eb1d2c42835ee485cd6ef76fc6aa2c9d6bc6b8eae897b932
BLAKE2b-256 checksum
How to use checksums
f0e5b82e389e76eeb2f073656bc9fb8c7af5b19dba8a6a4105c72df95922aef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for plesty-pcd-m02 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page