Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Phytron MCC-1/MCC-2 integrated stepper motor controllers, add I/O support for all Phytron controllers #8

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-scripts-build-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
name: "Win2019 MSC-19, static"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: Automatic core dumper analysis
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
- name: Run main module tests
run: python .ci/cue.py test
- name: Upload tapfiles Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: tapfiles ${{ matrix.name }}
path: '**/O.*/*.tap'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-scripts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
name: "3.15 Win VS2019, static"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: Automatic core dumper analysis
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Run main module tests
run: python .ci/cue.py test
- name: Upload tapfiles Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: tapfiles ${{ matrix.name }}
path: '**/O.*/*.tap'
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# Local configuration files
/configure/*.local
/iocs/*IOC*/configure/*.local

# iocBoot generated files
/iocBoot/*ioc*/cdCommands
Expand All @@ -24,6 +25,7 @@
/iocs/*IOC*/iocBoot/*ioc*/dllPath.bat
/iocs/*IOC*/iocBoot/*ioc*/envPaths
/iocs/*IOC*/iocBoot/*ioc*/relPaths.sh
/iocs/*IOC*/iocBoot/*ioc*/.iocsh_history

# Build directories
O.*/
Expand All @@ -43,3 +45,10 @@ O.*/
auto_settings.sav*
auto_positions.sav*
phytronMotors.*
motorPhytron.cflags
motorPhytron.config
motorPhytron.creator
motorPhytron.creator.user
motorPhytron.cxxflags
motorPhytron.files
motorPhytron.includes
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# motorPhytron
EPICS motor drivers for the following [Phytron GmbH](https://www.phytron.eu/) controllers: I1AM01 Stepper Motor Controller
EPICS motor drivers for the following [Phytron GmbH](https://www.phytron.eu/) controllers: phyMOTION I1AM01, I1AM02, I1EM01, I1EM02 or MCC-1, MCC-2 Stepper Motor Controller

[![Build Status](https://github.com/epics-motor/motorPhytron/actions/workflows/ci-scripts-build.yml/badge.svg)](https://github.com/epics-motor/motorPhytron/actions/workflows/ci-scripts-build.yml)
<!--[![Build Status](https://travis-ci.org/epics-motor/motorPhytron.png)](https://travis-ci.org/epics-motor/motorPhytron)-->
Expand All @@ -9,3 +9,5 @@ motorPhytron is a submodule of [motor](https://github.com/epics-modules/motor).
motorPhytron can also be built outside of motor by copying it's ``EXAMPLE_RELEASE.local`` file to ``RELEASE.local`` and defining the paths to ``MOTOR`` and itself.

motorPhytron contains an example IOC that is built if ``CONFIG_SITE.local`` sets ``BUILD_IOCS = YES``. The example IOC can be built outside of driver module.

SPDX-License-Identifier: EPICS
69 changes: 57 additions & 12 deletions iocs/phytronIOC/iocBoot/iocPhytron/motor.substitutions.phytron
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# SPDX-License-Identifier: EPICS
################################################################################
# PORT - asynPort created for the Phytron controller
# ADDR - Address of the axis - right digit represents the index of the axis
# of a I1AM01 module, the remaining digit(s) on the lef represent the
# index of the I1AM01 module
################################################################################

# phyMOTION
#file "$(TOP)/db/Phytron_motor.db"
#{
#pattern
#{P, N, M, PORT, ADDR, DESC, EGU, SREV, UREV, ERES, UEIP, DIR, VELO, VBAS, VMAX, ACCL, BDST, BVEL, BACC, PREC, RDBD, RTRY, PREC, OFF, DHLM, DLLM, OFF, MDEL, INIT}
#{TEST:, 1, "m$(N)", phyMotionPort, 11, "motor $(N)", mm, 400, 0.25, 0.00005, No, Pos, 2.5, 1, 25, .5, 0, 25, .2, 5, 0, 0, 5, 0, 1440, -1440, -0.49, 0.001, ""}
#{TEST:, 2, "m$(N)", phyMotionPort, 21, "motor $(N)", mm, 400, 0.25, 0.00005, No, Pos, 2.5, 1, 25, .5, 0, 25, .2, 5, 0, 0, 5, 0, 1440, -1440, -0.49, 0.001, ""}
#}

# MCC-2
file "$(TOP)/db/Phytron_motor.db"
{
pattern
{P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, VMAX, ACCL, BDST, BVEL, BACC, MRES, ERES, PREC, DHLM, DLLM, INIT}
{phytron:, 1, "m$(N)", "asynMotor", phyMotionPort, 11, "motor $(N)", Deg, Pos, 360, 180, 720, .5, 0, 180, .2, 1.8, 0.18, 5, 1440, -1440, ""}
{phytron:, 2, "m$(N)", "asynMotor", phyMotionPort, 21, "motor $(N)", Deg, Pos, 360, 180, 720, .5, 0, 180, .2, 1.8, 0.18, 5, 1440, -1440, ""}

{P, N, M, PORT, ADDR, DESC, EGU, SREV, UREV, ERES, UEIP, DIR, VELO, VBAS, VMAX, ACCL, BDST, BVEL, BACC, PREC, RDBD, RTRY, DHLM, DLLM, OFF, MDEL, INIT}
{TEST:, 1, "m$(N)", phyMotionPort, 11, "motor $(N)", Deg, 400, 0.25, 0.00005, No, Pos, 360, 180, 720, .5, 0, 180, .2, 5, 0, 0, 1440, -1440, -0.49, 0.001, ""}
{TEST:, 2, "m$(N)", phyMotionPort, 12, "motor $(N)", Deg, 400, 0.25, 0.00005, No, Pos, 360, 180, 720, .5, 0, 180, .2, 5, 0, 0, 1440, -1440, -0.49, 0.001, ""}
}

################################################################################
Expand All @@ -28,12 +38,19 @@ pattern
# in the macros that follow INIT. If set to NO, records will not be
# initialized - this option is useful if auto save/restore is used
################################################################################
file "$(TOP)/db/Phytron_I1AM01.db"
#file "$(TOP)/db/Phytron_I1AM01.db"
#{
#pattern
#{P, N, M, PORT, ADDR, SCAN, TIMEOUT, INIT, HOMING, MODE, POS_OFFSET, NEG_OFFSET, INIT_TIME, POS_TIME, BOOST, SWITCH_TYP, PWR_STAGE, ENC_TYP, ENC_SFI, ENC_DIR, STOP_CURR, RUN_CURR, BOOST_CURR, CURRENT_DELAY, STEP_RES, PS_MON, BRAKE_OUTPUT, DISABLE_MOTOR, BRAKE_ENGAGE_TIME, BRAKE_RELEASE_TIME }
#{TEST:, 1, "m$(N)", phyMotionPort, 11, "1 second", 1, YES, 0, 1, 0, 0, 20, 20, 0, 0, 1, 1, 0, 1 20, 80, 100, 20, 0, 1, 1.1, 1, 10, 10 }
#{TEST:, 2, "m$(N)", phyMotionPort, 21, "1 second", 1, YES, 0, 1, 0, 0, 20, 20, 0, 0, 1, 1, 0, 1 20, 80, 100, 20, 0, 1, 1.2, 1, 10, 10 }
#}
file "$(TOP)/db/Phytron_MCC.db"
{
pattern
{P, N, M, PORT, ADDR, SCAN, TIMEOUT, INIT, HOMING, MODE, POS_OFFSET, NEG_OFFSET, INIT_TIME, POS_TIME, BOOST, SWITCH_TYP, PWR_STAGE, ENC_TYP, ENC_SFI, ENC_DIR, STOP_CURR, RUN_CURR, BOOST_CURR, CURRENT_DELAY, STEP_RES, PS_MON }
{phytron, 1, ":m$(N)", phyMotionPort, 11, "1 second", 3, YES, 0, 1, 0, 0, 20, 20, 0, 0, 1, 1, 0, 1 20, 400, 500, 20, 0, 1}
{phytron, 2, ":m$(N)", phyMotionPort, 21, "1 second", 3, YES, 0, 1, 0, 0, 20, 20, 0, 0, 1, 1, 0, 1 20, 400, 500, 20, 0, 1}
{P, N, M, PORT, ADDR, SCAN, TIMEOUT, INIT, HOMING, MODE, POS_OFFSET, NEG_OFFSET, INIT_TIME, POS_TIME, BOOST, SWITCH_TYP, PWR_STAGE, ENC_TYP, ENC_SFI, ENC_DIR, STOP_CURR, RUN_CURR, BOOST_CURR, CURRENT_DELAY, STEP_RES, PS_MON, BRAKE_OUTPUT, DISABLE_MOTOR, BRAKE_ENGAGE_TIME, BRAKE_RELEASE_TIME }
{TEST:, 1, "m$(N)", phyMotionPort, 11, "5 second", 1, YES, 0, 1, 0, 0, 20, 20, 0, 0, 1, 0, 0, 1 20, 80, 100, 20, "1/16", 1, 1.1, 1, 10, 10 }
{TEST:, 2, "m$(N)", phyMotionPort, 12, "5 second", 1, YES, 0, 1, 0, 0, 20, 20, 0, 0, 1, 0, 0, 1 20, 80, 100, 20, "1/16", 1, 1.2, 1, 10, 10 }
}

################################################################################
Expand All @@ -42,9 +59,37 @@ pattern
# ADDR - Arbitrary value between 0 and 255
# TIMEOUT - asyn timeout
################################################################################
file "$(TOP)/db/Phytron_MCM01.db"
#file "$(TOP)/db/Phytron_MCM01.db"
#{
#pattern
#{P, DTYP, PORT, ADDR, TIMEOUT}
#{phytron, "asynMotor", phyMotionPort, 0, 10 }
#}

################################################################################
# P - Controller specific name
# PORT - asynPort created for the analog controller
################################################################################
file "$(TOP)/db/Phytron_AIO_MCC.db"
{
pattern
{P, DTYP, PORT, ADDR, TIMEOUT}
{phytron, "asynMotor", phyMotionPort, 0, 10 }
pattern{P,PORT}
{"phyA1", "phyA1"}
{"phyA2", "phyA2"}
#{"phyA3", "phyA3"}
#{"phyA4", "phyA4"}
}
file "$(TOP)/db/Phytron_DIO.db"
{
pattern{P,PORT}
{"phyD1", "phyD1"}
}
#file "$(TOP)/db/Phytron_DIO_MCC1.db"
#{
#pattern{P,PORT}
#{"phyD1", "phyD1"}
#}
file "$(TOP)/db/Phytron_CMD.db"
{
pattern{P,PORT}
{"phy", "phyMotionPort"}
}
1 change: 1 addition & 0 deletions iocs/phytronIOC/iocBoot/iocPhytron/st.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!../../bin/linux-x86_64/phytron
# SPDX-License-Identifier: EPICS

< envPaths

Expand Down
68 changes: 68 additions & 0 deletions iocs/phytronIOC/iocBoot/iocPhytron/st.cmd.mcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!../../bin/linux-x86_64/phytron
# SPDX-License-Identifier: EPICS

< envPaths

## Register all support components
dbLoadDatabase("../../dbd/phytron.dbd",0,0)
phytron_registerRecordDeviceDriver(pdbbase)

#drvAsynIPPortConfigure("testPort","localhost:8000",0,0,1)
#drvAsynIPPortConfigure("testRemote","10.5.1.181:22222",0,0,1)
#drvAsynSerialPortConfigure("testRemote","/dev/ttyUSB0",0,0,1)
#asynSetOption("testRemote", -1, "baud", "115200")
#asynSetOption("testRemote", -1, "bits", "8")
#asynSetOption("testRemote", -1, "parity", "none")
#asynSetOption("testRemote", -1, "stop", "1")
#asynSetOption("testRemote", -1, "clocal", "N")
#asynSetOption("testRemote", -1, "crtscts", "N")
drvAsynIPPortConfigure("testRemote","192.168.167.116:22222",0,0,1)

#eraseFile("device-comm.log")
#asynSetTraceFile("testRemote", 0, "device-comm.log")
#asynSetTraceMask("testRemote", 0, 0x2F) # error, device, filter, driver, warning, !flow
#asynSetTraceIOMask("testRemote", 0, 2)
#asynSetTraceInfoMask("testRemote", 0, 0x0F)

#phytronCreateMCC(phytronPort, asynPort, address, movingPollPeriod, idlePollPeriod, timeout, do-not-reset
phytronCreateMCC("phyMotionPort", "testRemote", 0, 10, 10, 1000)
asynSetOption("phyMotionPort", 0, "fakeHomedEnable", "true")

#phytronCreateAxis(phytronPort, module, axis)
phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 1, 2)

dbLoadTemplate "motor.substitutions.phytron"

# open listening server part
#drvAsynIPServerPortConfigure(asynPortServer,"localhost:port",maxClients,priority,disableAutoConnect,noProcessEos)
drvAsynIPServerPortConfigure("testRemote2","127.0.0.2:22222",10,0,0,0)
#drvAsynIPServerPortConfigure("testRemote2","localhost:22222",10,0,0,0)
#drvAsynIPServerPortConfigure("testRemote2",":22222",10,0,0,0)
#drvAsynIPServerPortConfigure("testRemote2","0.0.0.0:22222",10,0,0,0)
#drvAsynIPServerPortConfigure("testRemote2","192.168.167.254:22222",10,0,0,0)

# create analog and digital I/O for MCC-2
phytronCreateAnalog("phyA1", "phyMotionPort", 1, 1, "")
phytronCreateAnalog("phyA2", "phyMotionPort", 1, 2, "")
phytronCreateDigital("phyD1", "phyMotionPort", 1, 1, "")

## configure AUTOSAVE
#epicsEnvSet("SAVE_DIR","$(TOP)/iocBoot/$(IOC)")
#epicsEnvSet("IOCNAME","$(IOC)-autosave")
#dbLoadRecords("$(AUTOSAVE)/asApp/Db/save_restoreStatus.db", "P=$(IOCNAME):")
#save_restoreSet_status_prefix("$(IOCNAME):")
#set_requestfile_path("$(SAVE_DIR)")
#set_savefile_path("$(SAVE_DIR)")
## Schedule a maximum of 3 sequenced backups of the .sav file
## every 10 minutes - .sav0, .sav1, .sav2
#save_restoreSet_NumSeqFiles(3)
#save_restoreSet_SeqPeriodInSeconds(600)
#set_pass0_restoreFile("$(IOCNAME).sav")
#set_pass1_restoreFile("$(IOCNAME).sav")

iocInit()

## Create request file and start periodic 'save’
#makeAutosaveFileFromDbInfo("$(SAVE_DIR)/$(IOCNAME).req", "autosaveFields")
#create_monitor_set("$(IOCNAME).req", 5)
40 changes: 39 additions & 1 deletion iocs/phytronIOC/iocBoot/iocPhytron/st.cmd.phytron
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!../../bin/linux-x86_64/phytron
# SPDX-License-Identifier: EPICS

< envPaths

Expand All @@ -8,14 +9,51 @@ phytron_registerRecordDeviceDriver(pdbbase)

#drvAsynIPPortConfigure("testPort","localhost:8000",0,0,1)
drvAsynIPPortConfigure("testRemote","10.5.1.181:22222",0,0,1)
#drvAsynSerialPortConfigure("testRemote","/dev/ttyUSB0",0,0,1)
#asynSetOption("testRemote", -1, "baud", "115200")
#asynSetOption("testRemote", -1, "bits", "8")
#asynSetOption("testRemote", -1, "parity", "none")
#asynSetOption("testRemote", -1, "stop", "1")
#asynSetOption("testRemote", -1, "clocal", "N")
#asynSetOption("testRemote", -1, "crtscts", "N")

#phytronCreateController (phytronPort, asynPort, movingPollPeriod, idlePollPeriod, timeout)
phytronCreateController ("phyMotionPort", "testRemote", 100, 100, 1000)
phytronCreateController ("phyMotionPort", "testRemote", 10, 10, 1000)
asynSetOption("phyMotionPort", 0, "pollMethod", "parallel")
asynSetOption("phyMotionPort", 0, "fakeHomedEnable", "true")

#phytronCreateAxis(phytronPort, module, axis)
phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 2, 1)
phytronCreateAxis("phyMotionPort", 3, 1)

# create analog I/O with a AIOM01.1
phytronCreateAnalog("phyA1", "phyMotionPort", 1, 1, "")
phytronCreateAnalog("phyA2", "phyMotionPort", 1, 2, "")
phytronCreateAnalog("phyA3", "phyMotionPort", 1, 3, "")
phytronCreateAnalog("phyA4", "phyMotionPort", 1, 4, "")

# create digital I/O with a DIOM01.1
phytronCreateDigital("phyD1", "phyMotionPort", 1, 1, "")

dbLoadTemplate "motor.substitutions.phytron"

## configure AUTOSAVE
#epicsEnvSet("SAVE_DIR","$(TOP)/iocBoot/$(IOC)")
#epicsEnvSet("IOCNAME","$(IOC)-autosave")
#dbLoadRecords("$(AUTOSAVE)/asApp/Db/save_restoreStatus.db", "P=$(IOCNAME):")
#save_restoreSet_status_prefix("$(IOCNAME):")
#set_requestfile_path("$(SAVE_DIR)")
#set_savefile_path("$(SAVE_DIR)")
## Schedule a maximum of 3 sequenced backups of the .sav file
## every 10 minutes - .sav0, .sav1, .sav2
#save_restoreSet_NumSeqFiles(3)
#save_restoreSet_SeqPeriodInSeconds(600)
#set_pass0_restoreFile("$(IOCNAME).sav")
#set_pass1_restoreFile("$(IOCNAME).sav")

iocInit()

## Create request file and start periodic 'save’
#makeAutosaveFileFromDbInfo("$(SAVE_DIR)/$(IOCNAME).req", "autosaveFields")
#create_monitor_set("$(IOCNAME).req", 5)
13 changes: 13 additions & 0 deletions iocs/phytronIOC/phytronApp/Db/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: EPICS
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
Expand All @@ -8,11 +9,23 @@ include $(TOP)/configure/CONFIG
#DB_OPT = YES

ifdef MOTOR_PHYTRON
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_AIO.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_AIO_MCC.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_CMD.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_DIO.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_DIO_MCC1.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_I1AM01.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_MCC.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_MCM01.db
DB_INSTALLS += $(MOTOR_PHYTRON)/db/Phytron_motor.db
else
DB_INSTALLS += $(MOTOR)/db/Phytron_AIO.db
DB_INSTALLS += $(MOTOR)/db/Phytron_AIO_MCC.db
DB_INSTALLS += $(MOTOR)/db/Phytron_CMD.db
DB_INSTALLS += $(MOTOR)/db/Phytron_DIO.db
DB_INSTALLS += $(MOTOR)/db/Phytron_DIO_MCC1.db
DB_INSTALLS += $(MOTOR)/db/Phytron_I1AM01.db
DB_INSTALLS += $(MOTOR)/db/Phytron_MCC.db
DB_INSTALLS += $(MOTOR)/db/Phytron_MCM01.db
DB_INSTALLS += $(MOTOR)/db/Phytron_motor.db
endif
Expand Down
8 changes: 8 additions & 0 deletions iocs/phytronIOC/phytronApp/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: EPICS
TOP=../..

include $(TOP)/configure/CONFIG
Expand All @@ -22,6 +23,10 @@ phytron_DBD += base.dbd
#ifdef ASYN
phytron_DBD += asyn.dbd
phytron_DBD += drvAsynIPPort.dbd
phytron_DBD += drvAsynSerialPort.dbd
#endif
#ifdef AUTOSAVE
phytron_DBD += asSupport.dbd
#endif
phytron_DBD += motorSupport.dbd
phytron_DBD += phytronSupport.dbd
Expand All @@ -32,6 +37,9 @@ phytron_LIBS += motor
#ifdef ASYN
phytron_LIBS += asyn
#endif
#ifdef AUTOSAVE
phytron_LIBS += autosave
#endif
#ifdef SNCSEQ
phytron_LIBS += seq pv
#endif
Expand Down
1 change: 1 addition & 0 deletions iocs/phytronIOC/phytronApp/src/phytronMain.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: EPICS */
/* phytronMain.cpp */
/* Author: Marty Kraimer Date: 17MAR2000 */

Expand Down
7 changes: 7 additions & 0 deletions phytronApp/Db/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: EPICS
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
Expand All @@ -11,7 +12,13 @@ include $(TOP)/configure/CONFIG
# Create and install (or just install) into <top>/db
# databases, templates, substitutions like this
#DB += xxx.db
DB += Phytron_AIO.db
DB += Phytron_AIO_MCC.db
DB += Phytron_CMD.db
DB += Phytron_DIO.db
DB += Phytron_DIO_MCC1.db
DB += Phytron_I1AM01.db
DB += Phytron_MCC.db
DB += Phytron_MCM01.db
DB += Phytron_motor.db

Expand Down
Loading
Loading