Skip to main content
FixturFab

FixturCtrl

Documentation for the FixturCtrl programmable USB hub with built-in cycle counter. Serial commands, GPIO control, and fixture switch integration.

FixturCtrl is a programmable USB hub with a built-in cycle counter, commonly used to connect instruments in test systems alongside fixture switches for detecting fixture closure.

Features#

  • 6 Programmable USB 2.0 Ports — Independent power and data control for automated device management
  • Fixture Switch/Cycle Counter Input — Compatible with Ingun inductive switch models
  • Dual I2C Expansion Ports — Qwiic-compatible for Sparkfun and Adafruit peripherals
  • Digital I/O Expansion Port — Customizable interfaces like buttons and LEDs

Serial Interface#

Connect via the upstream USB-C port. The device appears as a serial port with these settings:

ParameterValue
Baud rate57600
Data bits8
Stop bits1
ParityNone
Flow controlNone

Commands terminate with \r\n and return either OK\r\n or ERROR\r\n.

Command Reference#

General Commands#

CommandDescriptionResponse
helpDisplay available commandsCommand list
whoShow firmware version and serial numberDevice info
fixtureRead fixture switch state0 or 1
cyclesRead cycle counter (registers 1-3)Count values

GPIO Commands#

CommandDescription
gptype {pin} {mode}Set pin mode (input/output)
gpset {pin} {state}Set output pin state
gpget {pin}Read pin state
gpallRead all GPIO states

GPIO pins 21-25 are available for custom I/O.

Analog Input#

CommandDescription
anget {pin}Read analog value from pins 0-3

USB Port Control#

CommandDescription
allusb {state}Control all 6 ports simultaneously
usb {port} {state}Control individual port (1-6)

State values: on, off, power (power only, no data), data (data only, no power)

Example Session#

> who
FixturCtrl v1.2.3
Serial: FC-0001234
OK

> fixture
1
OK

> usb 1 off
OK

> usb 1 on
OK

> cycles
1: 15234
2: 0
3: 0
OK

Cycle Counter#

The fixture switch input tracks closure events:

  • Register 1 — Primary cycle count
  • Registers 2-3 — Available for custom counting applications

The cycle counter persists through power cycles, enabling lifetime tracking for fixture maintenance scheduling.

Python Integration#

A Python module is available within f3ts-hardware-utils for programmatic control:

from f3ts_hardware_utils import FixturCtrl
 
ctrl = FixturCtrl('/dev/ttyUSB0')
 
# Check fixture state
if ctrl.fixture_closed():
    # Run test
    ctrl.usb_port(1, 'on')
    # ... test code ...
    ctrl.usb_port(1, 'off')
 
# Get cycle count
cycles = ctrl.get_cycles()
print(f"Total cycles: {cycles}")

I2C Expansion#

The Qwiic-compatible I2C ports support:

  • Sparkfun Qwiic sensors and displays
  • Adafruit STEMMA QT devices
  • Custom I2C peripherals

Multiple devices can be daisy-chained on each I2C bus.

Digital I/O Expansion#

The expansion port provides GPIO pins for:

  • Operator interface buttons
  • Status LEDs
  • Custom sensors
  • External triggers

Pin configuration is software-controlled via the gptype command.

Last updated:January 25, 2025