smathis 844ea3085d Integrated low level IP Port driver from DLS
Integrated the low level asyn IP Port driver from the Diamond Light
Source so that StreamDevices can use it as well.
2025-04-10 15:44:05 +02:00
2025-01-21 13:07:09 +01:00
2024-11-20 12:02:33 +01:00

turboPmac

Please read the documentation of sinqMotor first: https://git.psi.ch/sinq-epics-modules/sinqmotor

Overview

This is a driver for the Turbo PMAC motion controller with the SINQ communication protocol. It is based on the sinqMotor shared library (https://git.psi.ch/sinq-epics-modules/sinqmotor). The header files contain detailed documentation for all public functions. The headers themselves are exported when building the library to allow other drivers to depend on this one.

User guide

This driver is a standard sinqMotor-derived driver and does not need any specific configuration. For the general configuration, please see https://git.psi.ch/sinq-epics-modules/sinqmotor/-/blob/main/README.md.

The folder "utils" contains utility scripts for working with pmac motor controllers. To read their manual, run the scripts without any arguments.

  • writeRead.py: Allows sending commands to and receiving commands from a pmac controller over an ethernet connection.
  • analyzeTcpDump.py: Parse the TCP communication between an IOC and a MCU and format it into a dictionary. "demo.py" shows how this data can be easily visualized for analysis.

Developer guide

Usage in IOC shell

turboPmac exports the following IOC shell functions:

  • turboPmacController: Create a new controller object.
  • turboPmacAxis: Create a new axis object.

The full turboPmacX.cmd file looks like this:

# Define the name of the controller and the corresponding port
epicsEnvSet("NAME","turboPmacX")
epicsEnvSet("ASYN_PORT","p$(NAME)")

# Create the TCP/IP socket used to talk with the controller. The socket can be adressed from within the IOC shell via the port name
drvAsynIPPortConfigure("$(ASYN_PORT)","172.28.101.24:1025")

# Create the controller object with the defined name and connect it to the socket via the port name.
# The other parameters are as follows:
# 8: Maximum number of axes
# 0.05: Busy poll period in seconds
# 1: Idle poll period in seconds
# 1: Socket communication timeout in seconds
turboPmacController("$(NAME)", "$(ASYN_PORT)", 8, 0.05, 1, 1);

# Define some axes for the specified MCU at the given slot (1, 2 and 5). No slot may be used twice!
turboPmacAxis("$(NAME)",1);
turboPmacAxis("$(NAME)",2);
turboPmacAxis("$(NAME)",5);

# Set the number of subsequent timeouts 
setMaxSubsequentTimeouts("$(NAME)", 20);

# Configure the timeout frequency watchdog: A maximum of 10 timeouts are allowed in 300 seconds before an alarm message is sent.
setThresholdComTimeout("$(NAME)", 300, 10);

# Parametrize the EPICS record database with the substitution file named after the MCU.
epicsEnvSet("SINQDBPATH","$(sinqMotor_DB)/sinqMotor.db")
dbLoadTemplate("$(TOP)/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
epicsEnvSet("SINQDBPATH","$(turboPmac_DB)/turboPmac.db")
dbLoadTemplate("$(TOP)/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
dbLoadRecords("$(sinqMotor_DB)/asynRecord.db","P=$(INSTR)$(NAME),PORT=$(ASYN_PORT)")

Versioning

Please see the documentation for the module sinqMotor: https://git.psi.ch/sinq-epics-modules/sinqmotor/-/blob/main/README.md.

How to build it

Please see the documentation for the module sinqMotor: https://git.psi.ch/sinq-epics-modules/sinqmotor/-/blob/main/README.md.

Description
Driver for the Turbo PMAC motion controller (PSI CNM version)
Readme 561 KiB
Languages
C++ 60.2%
C 27.4%
Python 10.9%
Makefile 0.8%
Shell 0.7%