FTS Aerotech Agent

This agent is used to communicate with the FTS mirror stage for two FTSs with Aerotech motion controllers.

usage: python3 agent.py [-h] [--ip-address IP_ADDRESS] [--port PORT]
                        [--config-file CONFIG_FILE] [--mode MODE]
                        [--sampling_frequency SAMPLING_FREQUENCY]

Agent Options

--ip-address
--port
--config-file
--mode
--sampling_frequency

Configuration File Examples

Below are configuration examples for the ocs config file and for running the Agent in a docker container.

OCS Site Config

To configure the FTS Agent we need to add a block to our ocs configuration file. Here is an example configuration block using all of the available arguments:

{'agent-class': 'FTSAerotechAgent',
  'instance-id': 'Falcon',
  'arguments': [
    ['--ip-address', '192.168.10.13'],
    ['--port', 8000],
    ['--config_file', 'fts_config.yaml'],
    ['--mode', 'acq'],
    ['--sampling_freqency', 1'],
    ]},

FTS Config

The FTS takes a separate YAML config file to specify some inner paramters. Here is an example using all the available arguments.:

translate: [1, 74.87]
limits: [-74.8, 74.8]
speed: 10
timeout: 10

Agent API

class socs.agents.fts_aerotech.agent.FTSAerotechAgent(agent, ip_addr, port, config_file, mode=None, samp=2)[source]

Agent for connecting to the FTS mirror control.

Parameters:
  • ip_addr – IP address of Motion Controller

  • port – Port of Motion Controller

  • mode – ‘acq’: Start data acquisition on initialize

  • samp – default sampling frequency in Hz

  • config_file – File which contains FTS-specific translate, limits, and speed arguments.

init_stage()[source]

Task - Perform first time setup for communication with FTS stage.

home()[source]

Task - Home the stage to its negative limit.

move_to(position)[source]

Task - Move to absolute position relative to stage center (in mm).

Parameters:

position (float) – Position in mm, must be between -74.8 and 74.8.

acq(sampling_frequency=2)[source]
Parameters:

sampling_frequency (float) – Sampling rate in Hz. Defaults to 2 Hz.

Notes

The most recent position data is stored in session.data in the format:

>>> response.session['data']
{"position": {"pos" : mirror position}}

Example Clients

Below is an example client demonstrating full agent functionality. Note that all tasks can be run even while the data acquisition process is running.:

from ocs.ocs_client import OCSClient

# Initialize the Stages
fts_agent = OCSClient('Falcon', args=[])
fts_agent.init.start()
fts_agent.init.wait()

# Home Axis
fts_agent.home.start()
fts_agent.home.wait()

# Move to a specific position
fts_agent.move_to.start( position=0)
fts_agent.move_to.wait()