Pfeiffer TC 400 Agent
The Pfeiffer TC 400 Agent is an OCS Agent which controls the Pfeiffer TC 400 electronic drive unit, which control the turbos used for the bluefors DR. The communcation is done over serial, and should be integrated into OCS using a serial-to-ethernet converter.
usage: python3 agent.py [-h] [--ip-address IP_ADDRESS]
[--port-number PORT_NUMBER]
[--turbo-address TURBO_ADDRESS] [--mode MODE]
Agent Options
- --ip-address
Serial-to-ethernet converter ip address
- --port-number
Serial-to-ethernet converter port
- --turbo-address
Internal address used by power supplies
- --mode
Set to acq to run acq on startup
Description
Serial Configuration
baudrate=9600
data bits=8
stop bits=1
parity=None
Flow control=RTS/CTS
FIFO=Enable
Interface=RS-485-2-Wire
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 Pfeiffer TC 400 Agent we need to add a PfeifferTC400Agent block to our ocs configuration file. The IP address and port number are from the serial-to-ethernet converter. The turbo address is visible on the power supply front panel. Here is an example configuration block using all of the available arguments:
{'agent-class': 'PfeifferTC400Agent',
'instance-id': 'pfeifferturboA',
'arguments': [['--ip-address', '10.10.10.129'],
['--port-number', '4002'],
['--turbo-address', '1']]},
Docker Compose
The agent should be configured to run in a Docker container. An example docker-compose service configuration is shown here:
ocs-pfeiffer-turboA:
image: simonsobs/socs:latest
<<: *log-options
hostname: manny-docker
network_mode: "host"
environment:
- INSTANCE_ID=pfeifferturboA
volumes:
- ${OCS_CONFIG_DIR}:/config
Since the agent within the container needs to communicate with hardware on the
host network you must use network_mode: "host"
in your compose file.
Agent API
- class socs.agents.pfeiffer_tc400.agent.PfeifferTC400Agent(agent, ip_address, port_number, turbo_address)[source]
Agent to connect to a pfeiffer tc400 electronic drive unit controlling a turbo pump via a serial-to-ethernet converter.
- Parameters:
ip_address (str) – IP address for the serial-to-ethernet converter
port_number (int) – Serial-to-ethernet converter port
turbo_address (int) – An internal address used to communicate between the power supplies and the tc400. Found on the front screen of the power supplies.
- init(auto_acquire=False)[source]
Task - Initialize the connection to the turbo controller.
- Parameters:
auto_acquire (bool, optional) – Default is False. Starts data acquisition after initialization if True.
- acq(wait=1, test_mode=False)[source]
Process - Continuously monitor turbo motor temp and rotation speed and send info to aggregator.
The
session.data
object stores the most recent published values in a dictionary. For example:session.data = { 'timestamp': 1598626144.5365012, 'block_name': 'turbo_output', 'data': { "Turbo_Motor_Temp": 40.054, "Rotation_Speed": 823.655, "Error_Code": "Err001", } }
- Parameters:
wait (float, optional) – time to wait between measurements [seconds]. Default=1s.
Example Clients
The turbo agent can start and stop a turbo, acknowledge an error (this is required to start again after an error occurs), and acquire turbo data. This example client shows all of this functionality:
from ocs.ocs_client import OCSClient
client = OCSClient("pfeifferturboA)
# Start data acq
status, message, session = client.acq.start()
print(session)
# Stop data acq
client.acq.stop()
client.acq.wait()
# Start the turbo
client.turn_turbo_on()
# Stop the turbo
client.turn_turbo_off()
# Acknowledge errors
client.acknowledge_turbo_errors()
Driver API
- class socs.agents.pfeiffer_tc400.drivers.PfeifferTC400(moxa_ip_address, moxa_port, turbo_address)[source]
Initiates a TCP connection with the Moxa serial to ethernet converter to send serial communications.
- Parameters:
moxa_ip_address (str) – The IP address of the moxa box
moxa_port (int) – The port number of the Moxa box that the turbo is connected to. (e.g. 4001 for the first port)
turbo_address (int) – The serial address of the turbo controller (e.g. 94) Check the turbo for the address.
- ser
The TCP connection with the Moxa used to send and receive communication.
- Type:
serial.Serial Object
- turbo_address
The serial Address of the Turbo Controller.
- Type:
int
- get_turbo_motor_temperature()[source]
Gets the temperatures of the turbo rotor from the turbo controller.
- Returns:
The rotor temperature of the turbo in Celsius.
- Return type:
int
- get_turbo_actual_rotation_speed()[source]
Gets the current rotation speed of the turbo from the turbo controller.
- Returns:
The current rotation speed of the turbo in Hz.
- Return type:
int
- get_turbo_set_rotation_speed()[source]
Gets the the rotation speed that the turbo is set to from the turbo controller. This is the speed in Hz that the turbo motor will spin up to if turned on.
- Returns:
The rotation speed that the turbo is set to in Hz
- Return type:
int
- get_turbo_error_code()[source]
Gets the current error code of the turbo from the turbo controller.
- Returns:
The current error code of the turbo.
- Return type:
str
- unready_turbo()[source]
Unreadies the turbo. Does not cause the turbo to spin up. :returns: True for successful, False for failure. :rtype: bool
- ready_turbo()[source]
Readies the turbo for spinning. Does not cause the turbo to spin up.
- Returns:
True for successful, False for failure.
- Return type:
bool
- turn_turbo_motor_on()[source]
Turns the turbo motor on. The turbo must be readied before the motor will turn on. This is what causes the turbo to actually spin up.
- Returns:
True for successful, False for failure.
- Return type:
bool