Skip to main content

Python interface to Newport XPS motion controllers

Project description

newportxps

This module provides code for using Newport XPS motor controllers from Python.

While Newport Corp. has provided a basic socket and ftp interface to the XPS controller for a long time, this interface is very low-level. In addition, there are some incompatibilities between the different generations of XPS controllers (generations C, Q, D in that chronological order), and a lack of support for Python 3 in the Newport-provided interface. The newportxps module here aims to provide a simple, user-friendly interface for the Newport XPS that works uniformly for all three generations of XPS and for both Python 2 and 3.

As an example, connecting to and reading the status of an XPS controller may look like this:

 >>> from newportxps import NewportXPS
 >>> xps = NewportXPS('164.54.160.000', username='Administrator', password='Please.Let.Me.In')
 >>> print(xps.status_report())
 # XPS host:         164.54.160.000 (164.54.160.000)
 # Firmware:         XPS-D-N13006
 # Current Time:     Sun Sep 16 13:40:24 2018
 # Last Reboot:      Wed Sep 12 14:46:44 2018
 # Trajectory Group: None
 # Groups and Stages
 DetectorZ (SingleAxisInUse), Status: Ready state from motion
    DetectorZ.Pos (ILS@ILS150CC@XPS-DRV11)
       Hardware Status: First driver powered on - ZM low level
       Positioner Errors: OK
 SampleX (SingleAxisInUse), Status: Ready state from motion
    SampleX.Pos (UTS@UTS150PP@XPS-DRV11)
       Hardware Status: First driver powered on - ZM high level
       Positioner Errors: OK
 SampleY (SingleAxisInUse), Status: Ready state from motion
    SampleY.Pos (UTS@UTS150PP@XPS-DRV11)
       Hardware Status: First driver powered on - ZM high level
       Positioner Errors: OK
 SampleZ (SingleAxisInUse), Status: Ready state from motion
   SampleZ.Pos (UTS@UTS150PP@XPS-DRV11)
       Hardware Status: First driver powered on - ZM low level
       Positioner Errors: OK

 >>> for gname, info in xps.groups.items():
 ...     print(gname, info)
 ...
 DetectorX {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
 SampleX {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
 SampleY {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
 SampleZ {'category': 'SingleAxisInUse', 'positioners': ['Pos']}
 >>>
 >>> for sname, info in xps.stages.items():
 ...     print(sname, xps.get_stage_position(sname), info)
 ...
 DetectorX.Pos 36.5 {'type': 'ILS@ILS150CC@XPS-DRV11', 'max_velo': 100, 'max_accel': 400, 'low_limit': -74, 'high_limit': 74}
 SampleX.Pos 1.05 {'type': 'UTS@UTS150PP@XPS-DRV11', 'max_velo': 20, 'max_accel': 80, 'low_limit': -74, 'high_limit': 74}
 SampleY.Pos 0.24 {'type': 'UTS@UTS150PP@XPS-DRV11', 'max_velo': 20, 'max_accel': 80, 'low_limit': -74, 'high_limit': 74}
 SampleZ.Pos 2.5 {'type': 'UTS@UTS150PP@XPS-DRV11', 'max_velo': 20, 'max_accel': 80, 'low_limit': -74, 'high_limit': 74}

 >>> xps.move_stage('SampleZ.Pos', 1.0)

 >>> xps.home_group('DetectorX')

On creation and initialization of the NewportXPS, the Groups and status of the controller are read in and Stages defined so that they can be queried or moved.

The NewportXPS class has a number of methods to interact with the controller including:

  • reboot controller
  • get status, hardware errors, etc.
  • save and upload new system.ini and stages.ini files.
  • enable and disable Groups.
  • initialize and home Stages and Groups of Stages.
  • read Stage positions.
  • move Stages and Groups to new positions.
  • set Stage velocity.
  • define simple linear trajectories (using PVT mode), both 'forward' and 'backward'.
  • upload any PVT trajectory.
  • arm PVT trajectory.
  • run PVT trajectory.
  • read and save Gathering file for a trajectory.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newportxps-2026.1.0.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

newportxps-2026.1.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file newportxps-2026.1.0.tar.gz.

File metadata

  • Download URL: newportxps-2026.1.0.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.10

File hashes

Hashes for newportxps-2026.1.0.tar.gz
Algorithm Hash digest
SHA256 7e0f6a83268ae78d0f6089ec3b68a2ff34de869d5bc7f08fa53d2accf4a393d2
MD5 9b4b825d951a14006ae4bdea1257e92f
BLAKE2b-256 674f2c85d29a073886e5fb477d6353b1c8960fb0832723b849cb2353fb2b11a5

See more details on using hashes here.

File details

Details for the file newportxps-2026.1.0-py3-none-any.whl.

File metadata

  • Download URL: newportxps-2026.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.10

File hashes

Hashes for newportxps-2026.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01b990551d5c7f5e285605aef6c6db700aeac48a405f9327a823577ccc2d6ff8
MD5 d757a51a56d204c60a94d80a96281221
BLAKE2b-256 19fcbb75c5751b923e3abe02e6dfab3d2f4b66f3ec7b0533a635af338f85aca7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page