Skip to content

Connecting to Agilis by Newport in Python

Instrument Card

Agilis™ Piezo Motion Controllers provide convenient and compact fine positioning control of the Agilis family of piezo motion stages and mounts.

Agilis

Device Specification: here

Manufacturer card: NEWPORT

NEWPORT

Newport provides a wide range of photonics technology and products designed to enhance the capabilities and productivity of our customers’ applications.

  • Headquarters: Irvine, California, United States
  • Yearly Revenue (millions, USD): 3500
  • Vendor Website: here

Demo: Send commands to a Polulu stepper motor driver

Connect to the Agilis in Python

PROTOCOLS > SCPI

To connect to an Agilis Positional Controller using Instrumentkit, you can use the following code:

from instrumentkit import serial
from instrumentkit import newport
# Connect to the controller
port = serial.SerialPort("COM5", baudrate=921600)
controller = newport.AGUC2(port)
# Reset the controller
controller.reset_controller()
# Print the firmware version
print(controller.firmware_version)
# Move the X axis relative by 1000 steps
controller.axis["X"].move_relative(1000)
# Activate jogging in mode 3 for the X axis
controller.axis["X"].jog = 3
# Stop the X axis
controller.axis["X"].stop()
# Query the step amplitude for the X axis
step_amplitude = controller.axis["X"].step_amplitude
print(step_amplitude)
# Set the positive step amplitude to +10 and the negative step amplitude to -20 for the X axis
controller.axis["X"].step_amplitude = (10, -20)
# Close the connection
controller.close()

This code connects to the Agilis Positional Controller on COM5 with a baud rate of 921600. It then performs various operations such as resetting the controller, printing the firmware version, moving the X axis relative by 1000 steps, activating jogging in mode 3 for the X axis, stopping the X axis, querying and setting the step amplitude for the X axis. Finally, it closes the connection to the controller.