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 phyMotion IO cards #5

Open
kmpeters opened this issue Jun 2, 2022 · 31 comments
Open

Add support for phyMotion IO cards #5

kmpeters opened this issue Jun 2, 2022 · 31 comments
Labels
enhancement New feature or request

Comments

@kmpeters
Copy link
Contributor

kmpeters commented Jun 2, 2022

The support was discussed in this pull request:

#3

and can be found here:

https://github.com/bkuner/ioPhytron.git

@kmpeters kmpeters added the enhancement New feature or request label Apr 13, 2023
@Baokangwen
Copy link

@kmpeters
Dear kmpeters,
If this module can control i1am02 controller.

Regard,
kangwen

@kmpeters
Copy link
Contributor Author

kmpeters commented Oct 9, 2023

@Baokangwen, I don't have any personal experience with phytron controllers, so I can't be 100% certain, but it looks like the primary difference between the I1AM01 and I1AM02 is that the 02 has an integrated amplifier. I would expect the I1AM02 to work with the existing EPICS support.

@Baokangwen
Copy link

Baokangwen commented Apr 27, 2024

@MarkRivers
Dear Rivers,
I've recently configured a phytron controller and I'm having some issues.
Below is my st.cmd file, motor parameter file and execution result.
I think the IOC run is successful, but my medm can't start, can't read the parameters.
medm can not start like attach medm.file.
medm
I hope you can give me some advice.

Best Regards,
Kangwen

--------------------------my st.cmd file---------------------------------------
#!../../bin/linux-x86_64/phytron
< envPaths
##Register all support components
dbLoadDatabase("../../dbd/phytron.dbd",0,0)
phytron_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("testRemote","10.50.10.120:22222",0,0,1)
phytronCreateController ("phyMotionPort", "testRemote", 100, 100, 1000)

#phytronCreateAxis(phytronPort, module, axis)
phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 2, 1)
#phytronCreateAxis("phyMotionPort", 3, 1)
#phytronCreateAxis("phyMotionPort", 4, 1)
#phytronCreateAxis("phyMotionPort", 5, 1)
#phytronCreateAxis("phyMotionPort", 6, 1)
#phytronCreateAxis("phyMotionPort", 7, 1)
#phytronCreateAxis("phyMotionPort", 8, 1)
dbLoadTemplate "motor.substitutions.phytron"
iocInit()
-------------------------------------motor.substitutions.phytron---------------------------------------------------
################################################################################
#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
################################################################################

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, "samplex", "asynMotor", phyMotionPort, 11, "motor samplex", Deg, Pos, 360, 180, 720, .5, 0, 180, .2, 1.8, 0.18, 5, 1440, -1440, ""}
{phytron:, 2, "sampley", "asynMotor", phyMotionPort, 21, "motor sampley", Deg, Pos, 360, 180, 720, .5, 0, 180, .2, 1.8, 0.18, 5, 1440, -1440, ""}

}

################################################################################
#P - MUST MATCH Controller specific name in Phytron_MCM01.db substitution
#pattern (below)
#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
#TIMEOUT - asyn timeout
#SCAN - Periodic scan rate of Power stage temperature and Motor temperature
#records
#INIT - If set to YES, ao records will be initialized with the values defined
#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"
{
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, ":samplex", 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, ":sampley", 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 - Controller specific name
#PORT - asynPort created for the Phytron controller
#ADDR - Arbitrary value between 0 and 255
#TIMEOUT - asyn timeout
################################################################################
file "$(TOP)/db/Phytron_MCM01.db"
{
pattern
{P, DTYP, PORT, ADDR, TIMEOUT}
{phytron, "asynMotor", phyMotionPort, 0, 10 }
}
--------------------------------------------run file start_phytron--------------------------------------------------
epicsEnvSet("EPICS_BASE","/home/guest/EPICS/epics-base")
##Register all support components
dbLoadDatabase("../../dbd/phytron.dbd",0,0)

medmInit: Unable to load font widgetDM_4
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_6
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_8
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_10
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_12
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_14
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_16
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_18
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_20
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_22
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_24
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_30
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_36
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_40
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_48
Trying default (fixed) instead

medmInit: Unable to load font widgetDM_60
Trying default (fixed) instead
MEDM Version 3.1.11: Loading aliased fonts.................
phytron_registerRecordDeviceDriver(pdbbase)
#dbLoadTemplate("motor.substitutions.phytron")
#dbLoadRecords("$(TOP)/db/Phytron_MCM01.db")
#dbLoadRecords("$(TOP)/db/Phytron_I1AM01.db")
#drvAsynIPPortConfigure("testPort","localhost:8000",0,0,1)
drvAsynIPPortConfigure("testRemote","10.50.10.120:22222",0,0,1)
#phytronCreateController (phytronPort, asynPort, movingPollPeriod, idlePollPeriod, timeout)
phytronCreateController ("phyMotionPort", "testRemote", 100, 100, 1000)
#phytronCreateAxis(phytronPort, module, axis)
phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 2, 1)
phytronCreateAxis("phyMotionPort", 3, 1)
phytronCreateAxis("phyMotionPort", 4, 1)
phytronCreateAxis("phyMotionPort", 5, 1)
phytronCreateAxis("phyMotionPort", 6, 1)
phytronCreateAxis("phyMotionPort", 7, 1)
phytronCreateAxis("phyMotionPort", 8, 1)
dbLoadTemplate "motor.substitutions.phytron"
iocInit()
Starting iocInit
############################################################################
##EPICS R3.15.9.1-DEV
##EPICS Base built Jul 26 2022
############################################################################
iocRun: All initialization complete
epics>

@MarkRivers
Copy link
Contributor

MarkRivers commented Apr 27, 2024 via email

@Baokangwen
Copy link

@MarkRivers
Thank you mark.
I'll try it first.

Best Regards,
Kangwen

@Baokangwen
Copy link

@MarkRivers
Dear Mark,
After my IOC starts, I turn on the medm and it keeps showing that my motor is in the limit status, I have turned off the hardware limit parameter of the motor, I don't know why this limit has been there, I can hear the current sound when I drive the motor, but the motor just doesn't rotate.
What should i do.

Best Regard,
Kangwen

image

@MarkRivers
Copy link
Contributor

That means that the driver polling function is setting the limit status of the motors. You need to figure out why. Do you have limit switches connected or cheat those inputs? You will not be able to move the motor until you solve that problem.

@Baokangwen
Copy link

@MarkRivers
I didn't connect the limit switch, but the pythron controller has a mode without a limit switch(called mode 0 picture 1), so I chose the mode without a limit switch, I can drive the motor on other software.

Epics phytron_i1am1O.db file records(picture 2)also can choose mode 0 without limit switch.
But medm still limit exists.That's why I want to find out what the reason is.
picture 1:
image
picture 2:
image

@MarkRivers
Copy link
Contributor

The problem is that the controller may ignore the limit in that mode, but it is still passing the bad limit status to the motor record. The motor record won't let you move the motor if it is at a limit, even if the controller will let it move. You need to connect a switch or just a jumper wire so the EPICS software does not see the limit condition.

@Baokangwen
Copy link

@MarkRivers
Thank you Mark.

I will connect a jumper as soon as possible to see if I can solve the problem.

@Baokangwen
Copy link

@MarkRivers
Dear Mark,

How does epics motor set up the encoder, I turned on the switch of the encoder in medm, clicked run no feedback value, I want to learn how to configure the encoder. At the same time, I haven't learned the linkage of multiple motor shafts, I hope you can give me a direction to learn, I don't know how to do this.

Best Regards,
Kangwen

@kmpeters
Copy link
Contributor Author

kmpeters commented May 9, 2024

The use encoder (UEIP) field of the motor record determines whether the raw motor position (RMP) or the raw encoder position (REP) is used as the raw readback position (RRBV) for the axis. I suggest testing an axis with UEIP to "No" first. If the REP field doesn't change when the motor is moved, UEIP should not be set to "Yes."

@Baokangwen
Copy link

Baokangwen commented May 10, 2024

@kmpeters
Hi kmpeter,
I added the autosave function to my IOC, but there are some errors, can you help me see it.
I've only added 14 PVs to the auto_setting.req file, just to test how I should set them up if I want to use all the PVs.
Here's what I ran and st.cmd.phytron and save_restore.cmd.


----------------------run epiccs ioc---------------------------
MEDM Version 3.1.11: Loading aliased fonts.................
phytron_registerRecordDeviceDriver(pdbbase)
dbLoadTemplate("motor.substitutions.phytron")

drvAsynIPPortConfigure("testRemote","10.50.10.120:22222",0,0,1)

phytronCreateController ("phyMotionPort", "testRemote", 100, 100, 1000)

phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 2, 1)

< save_restore.cmd

save_restoreSet_status_prefix("P=phytron:")

save_restoreSet_Debug(0)

save_restoreSet_IncompleteSetsOk(1)

save_restoreSet_DatedBackupFiles(1)

save_restoreSet_NumSeqFiles(3)

save_restoreSet_SeqPeriodInSeconds(300)

set_savefile_path("/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron", "autosave")

set_requestfile_path("/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron", "")
set_requestfile_path("/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron", "autosave-req")

set_pass0_restoreFile("auto_settings.sav")
iocInit()
Starting iocInit
############################################################################

EPICS R3.15.9.1-DEV

EPICS Base built Jul 26 2022

############################################################################
reboot_restore: entry for file 'auto_settings.sav'
reboot_restore: Found filename 'auto_settings.sav' in restoreFileList.
*** restoring from '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav' at initHookState 6 (before record/device init) ***
save_restore: Can't open file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav'.
save_restore: Trying backup file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.savB'
save_restore: Can't open file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.savB'.
save_restore: Can't figure out which seq file is most recent,
save_restore: so I'm just going to start with '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav0'.
save_restore: Trying backup file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav0'
save_restore: Can't open file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav0'.
save_restore: Trying backup file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav1'
save_restore: Can't open file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav1'.
save_restore: Trying backup file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav2'
save_restore: Can't open file '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav2'.
save_restore: Can't find a file to restore from...save_restore: ...last tried '/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/iocBoot/iocPhytron/autosave/auto_settings.sav2'. I give up.
save_restore: **********************************

save_restore: Can't open save file.iocRun: All initialization complete

create_monitor_set("auto_setting.req",30,"P=phytron:")
epics> save_restore: Can't connect to all status PV(s)
auto_setting.sav: 14 of 14 PV's connected
save_restore: Can't connect to status PV(s) for list 'auto_setting.sav'

-----------------------save_restore.cmd------------------------------
save_restoreSet_status_prefix("P=phytron:")

save_restoreSet_Debug(0)

save_restoreSet_IncompleteSetsOk(1)

save_restoreSet_DatedBackupFiles(1)

save_restoreSet_NumSeqFiles(3)

save_restoreSet_SeqPeriodInSeconds(300)

set_savefile_path("$(TOP)/iocBoot/$(IOC)", "autosave")

set_requestfile_path("$(TOP)/iocBoot/$(IOC)", "")
set_requestfile_path("$(TOP)/iocBoot/$(IOC)", "autosave-req")

set_pass0_restoreFile("auto_settings.sav")
---------------------------st.cmd.phytron------------------------------
#!../../bin/linux-x86_64/phytron

< envPaths

##Register all support components

dbLoadDatabase("../../dbd/phytron.dbd",0,0)

phytron_registerRecordDeviceDriver(pdbbase)

dbLoadTemplate("motor.substitutions.phytron")

drvAsynIPPortConfigure("testRemote","10.50.10.120:22222",0,0,1)

phytronCreateController ("phyMotionPort", "testRemote", 100, 100, 1000)

phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 2, 1)

< save_restore.cmd

iocInit()

create_monitor_set("auto_setting.req",30,"P=phytron:")

Best Regards,
Kangwen

@Baokangwen
Copy link

@MarkRivers
Dear Mark

I'd like to ask, there are 8 motors connected to one controller, and I control them separately with epics, which can be controlled.
If I want to have some other motors work together, I change how to do that in Epics. Is it using the softmotor module?
I haven't learned this knowledge, and I recently wanted to realize the functions of phi, pitch, roll, yaw through the cooperative movement between the motors.

Best Regards,
Kangwen

@kmpeters
Copy link
Contributor Author

The "save_restore: Can't open file" errors are normal the first time the IOC is run after autosave is added to it. The files will eventually be created by the IOC.

If the errors continue after the IOC has been running for more than a minute, write permission to the autosave folder might need to be added.

@MarkRivers
Copy link
Contributor

I recently wanted to realize the functions of phi, pitch, roll, yaw through the cooperative movement between the motors.

There are several ways to do this, depending on the application. The synApps "optics" module (https://github.com/epics-modules/optics) has a "table" record that is designed for tables with up to 6 degrees of freedom. It lets you adjust height, pitch, and roll. It just connects to the real motor records. The "virtual" motors in that case are not motor records, they are different PVs.

You can also use softmotors to do it, and implement the geometry logic yourself. The motor module contains some examples of databases for coordinate transformations:
https://github.com/epics-modules/motor/blob/master/motorApp/Db/coordTrans2D.db
https://github.com/epics-modules/motor/blob/master/motorApp/Db/sumDiff2D.db

This is an example of using an SNL program to implement the geometry code:
https://github.com/CARS-UChicago/GSECARS-EPICS/blob/master/CARSApp/src/IDD_LVP_Detector.st

@Baokangwen
Copy link

@MarkRivers
Dear Mark,
I wrote a converted record file,like this
record(motor,"$(P)Soft_x")
{
field(DTYP,"Soft Channel")
field(DESC,"x Soft motor")
field(OUT,"$(P)Convert_x.A PP MS")
field(RDBL,"$(P)Convert_readback_x.C NPP MS")
field(URIP,"Yes")
field(STOO,"$(P)Stop_x.A PP MS")
field(DINP,"$(P)Dmove_x.C NPP MS")
field(MRES,"0.25")
field(RRES,"1.000")
field(PREC,"4")
field(DHLM,"30000")
field(DLLM,"-30030")
field(TWV,"1")
field(RTRY,"0")
field(EGU,"um")
}

I loaded this db file into my st.cmd file and ran it with two error
image
image

How should I solve this?

@tboegi
Copy link
Contributor

tboegi commented Jun 22, 2024

@Baokangwen

You are missing the transform record, which is part of the epics "calc" module.
What you need is a line with epicsEnvSet("CALC", .....)
in the spirit like BUSY is added to you application

@MarkRivers
Copy link
Contributor

What you need is a line with epicsEnvSet("CALC", .....)

That is not correct.

What you need to do is to add CALC to motorPhytron/iocs/phytronIOC/configure/RELEASE.local.

Then in motorPhytron/iocs/phytronIOC/phytronApp/src/Makefile you need to add these lines:

#ifdef CALC
phytron_DBD += calcSupport.dbd
#endif
...

#ifdef CALC
phytron_LIBS += calc
#endif

@Baokangwen
Copy link

@MarkRivers
Dear Mark,
After I did what you asked, the previous error was indeed gone, but there were some other problems.
############################################################################
devMotorAsyn::init_record phytron:Soft_x bad link invalid INST_IO Must be asyn( )userParams
2024/06/24 09:58:41.412 devMotorAsyn::build_trans: phytron:Soft_x error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
2024/06/24 09:58:41.412 devMotorAsyn::build_trans: phytron:Soft_x error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
devMotorAsyn::init_record phytron:Soft_z bad link invalid INST_IO Must be asyn( )userParams
2024/06/24 09:58:41.413 devMotorAsyn::build_trans: phytron:Soft_z error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
2024/06/24 09:58:41.413 devMotorAsyn::build_trans: phytron:Soft_z error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
iocRun: All initialization complete
#save setting every thirty seconds
#create_monitor_set("auto_settings.req",30,"P=phytron:")
epics>

@MarkRivers
Copy link
Contributor

Please attach the complete output when the IOC starts.

@Baokangwen
Copy link

Baokangwen commented Jun 24, 2024

@MarkRivers
When I load a db file, I get an error Soft Channel, and a few other errors.Here's the output complete output.
(base) [guest@localhost iocPhytron]$ ./st.cmd.test
#!../../bin/linux-x86_64/phytron
< envPaths
epicsEnvSet("IOC","iocPhytron")
epicsEnvSet("TOP","/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC")
epicsEnvSet("EPICS_BASE","/home/guest/EPICS/epics-base")
epicsEnvSet("SUPPORT","/home/guest/EPICS/synApps_6_1/support")
epicsEnvSet("ASYN","/home/guest/EPICS/synApps_6_1/support/asyn-R4-36")
epicsEnvSet("AUTOSAVE","/home/guest/EPICS/synApps_6_1/support/autosave-R5-10")
epicsEnvSet("SSCAN","/home/guest/EPICS/synApps_6_1/support/sscan")
epicsEnvSet("SNCSEQ","/home/guest/EPICS/synApps_6_1/support/seq-2-2-6")
epicsEnvSet("CALC","/home/guest/EPICS/synApps_6_1/support/calc-R3-7-3")
epicsEnvSet("MOTOR","/home/guest/EPICS/synApps_6_1/support/motor-R7-1")
epicsEnvSet("BUSY","/home/guest/EPICS/synApps_6_1/support/busy-R1-7-2")
epicsEnvSet("IPAC","/home/guest/EPICS/synApps_6_1/support/ipac-2-15")
##Register all support components
dbLoadDatabase("../../dbd/phytron.dbd",0,0)
phytron_registerRecordDeviceDriver(pdbbase)
dbLoadTemplate("motor.substitutions.phytron")
#dbLoadTemplate("motor.substitutions.phytron")
#dbLoadRecords("$(TOP)/db/Phytron_MCM01.db")
#dbLoadRecords("$(TOP)/db/Phytron_I1AM01.db")
dbLoadRecords("/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/db/test.db","P=phytron:,M1=m1:,M2=m2:")
Can't set "phytron:Soft_x.DTYP" to "Soft Channel"
Error at or before ")" in file "/home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/db/test.db" line 3
Can't set "phytron:Soft_z.DTYP" to "Soft Channel"
ErrordbLoadRecords: failed to load /home/guest/EPICS/synApps_6_1/support/motor-R7-1/modules/motorPhytron/iocs/phytronIOC/db/test.db
#drvAsynIPPortConfigure("testPort","localhost:8000",0,0,1)
drvAsynIPPortConfigure("testRemote","10.50.10.120:22222",0,0,1)
#phytronCreateController (phytronPort, asynPort, movingPollPeriod, idlePollPeriod, timeout)
phytronCreateController ("phyMotionPort", "testRemote", 100, 100, 1000)
#phytronCreateAxis(phytronPort, module, axis)
phytronCreateAxis("phyMotionPort", 1, 1)
phytronCreateAxis("phyMotionPort", 2, 1)
#phytronCreateAxis("phyMotionPort", 3, 1)
#phytronCreateAxis("phyMotionPort", 4, 1)
#phytronCreateAxis("phyMotionPort", 5, 1)
#phytronCreateAxis("phyMotionPort", 6, 1)
#phytronCreateAxis("phyMotionPort", 7, 1)
#phytronCreateAxis("phyMotionPort", 8, 1)
#< save_restore.cmd
iocInit()
Starting iocInit
############################################################################
##EPICS R3.15.9.1-DEV
##EPICS Base built Jul 26 2022
############################################################################
devMotorAsyn::init_record phytron:Soft_x bad link invalid INST_IO Must be asyn( )userParams
2024/06/24 11:22:48.883 devMotorAsyn::build_trans: phytron:Soft_x error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
2024/06/24 11:22:48.883 devMotorAsyn::build_trans: phytron:Soft_x error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
devMotorAsyn::init_record phytron:Soft_z bad link invalid INST_IO Must be asyn( )userParams
2024/06/24 11:22:48.883 devMotorAsyn::build_trans: phytron:Soft_z error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
2024/06/24 11:22:48.883 devMotorAsyn::build_trans: phytron:Soft_z error calling queueRequest, asynManager::queueRequest asynUser not associated with a port
iocRun: All initialization complete
#save setting every thirty seconds
#create_monitor_set("auto_settings.req",30,"P=phytron:")
epics>

=====================================This is one of my records=================================
record(motor,"$(P)Soft_x")
{
field(DTYP,"Soft Channel")
field(DESC,"x Soft motor")
field(OUT,"$(P)Convert_x.A PP MS")
field(RDBL,"$(P)Convert_readback_x.C NPP MS")
field(URIP,"Yes")
field(STOO,"$(P)Stop_x.A PP MS")
field(DINP,"$(P)Dmove_x.C NPP MS")
field(MRES,"0.25")
field(RRES,"1.000")
field(PREC,"4")
field(DHLM,"30000")
field(DLLM,"-30030")
field(TWV,"1")
field(RTRY,"0")
field(EGU,"um")
}

@MarkRivers
Copy link
Contributor

You need to add these lines to iocs/phytronIOC/phytronApp/src/Makefile

phytron_DBD   += devSoftMotor.dbd
phytron_LIBS  += softMotor

In general your problem is that you are using the Phytron example IOC for features it is not built with (like CALC and Soft Channel). It is better to build your own IOC outside of the motorPhytron directory.

@Baokangwen
Copy link

@MarkRivers

Thank you Mark.
I want to do test in this IOC now, and then compile the IOC outside when it goes online,
because I haven't succeeded in the current motor(pitch,roll..etc),I just control motor lonely, so I've been trying, and I'm also doing the pitch,roll angle control for the first time, so I've encountered a lot of problems, thank you very much for your help all the time, thank you very much really.

Best withes,
Kangwen

@Baokangwen
Copy link

@MarkRivers
Dear Mark,
Attached are my db files,I modified it based on the example you gave me,but I didn't know how to get involved in my project?
test.txt

@MarkRivers
Copy link
Contributor

Attached are my db files,I modified it based on the example you gave me,but I didn't know how to get involved in my project?

I am not sure what you are asking. What happens when you load this db file into the IOC.

@Baokangwen
Copy link

@MarkRivers
Dear Mark,
I build my own IOC outside of the motorPhytron directory.
When i make the ioc have some problems below.

-c ../phytronAxisMotor.cpp
In file included from ../phytronAxisMotor.cpp:33:0:
../phytronAxisMotor.h:160:3: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
phytronStatus sendPhytronCommand(std::string sCommand, std::string* psResponse = nullptr, bool bACKonly = true);
^
../phytronAxisMotor.h:160:84: error: ‘nullptr’ was not declared in this scope
phytronStatus sendPhytronCommand(std::string sCommand, std::string* psResponse = nullptr, bool bACKonly = true);
^
../phytronAxisMotor.cpp: In constructor ‘phytronController::phytronController(const char*, const char*, double, double, double, bool)’:
../phytronAxisMotor.cpp:165:47: error: call to ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string*, bool)’ uses the default argument for parameter 2, which is not yet defined
if (sendPhytronCommand(std::string("CR")))
^
../phytronAxisMotor.cpp: In member function ‘virtual asynStatus phytronController::readInt32(asynUser*, epicsInt32*)’:
../phytronAxisMotor.cpp:260:82: error: ‘to_string’ is not a member of ‘std’
phyStatus = sendPhytronCommand(std::string("M") + pAxis->axisModuleNo_ + "P" + std::to_string(iParameter) + "R",
^
../phytronAxisMotor.cpp: In member function ‘virtual asynStatus phytronController::writeInt32(asynUser*, epicsInt32)’:
../phytronAxisMotor.cpp:290:53: error: call to ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string*, bool)’ uses the default argument for parameter 2, which is not yet defined
phyStatus = sendPhytronCommand(std::string("CR"));
^
../phytronAxisMotor.cpp:295:54: error: call to ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string*, bool)’ uses the default argument for parameter 2, which is not yet defined
phyStatus = sendPhytronCommand(std::string("STC"));
^
../phytronAxisMotor.cpp:371:77: error: call to ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string*, bool)’ uses the default argument for parameter 2, which is not yet defined
phyStatus = sendPhytronCommand(const_cast<const char*>(this->outString_));
^
../phytronAxisMotor.cpp: In member function ‘virtual asynStatus phytronController::poll()’:
../phytronAxisMotor.cpp:638:20: error: ‘class std::vector<phytronAxis*>’ has no member named ‘emplace_back’
apTodoAxis.emplace_back(std::move(pAxis));
^
../phytronAxisMotor.cpp:638:33: error: ‘move’ is not a member of ‘std’
apTodoAxis.emplace_back(std::move(pAxis));
^
../phytronAxisMotor.cpp: In member function ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string&, bool)’:
../phytronAxisMotor.cpp:711:8: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = sCommand.begin(); it != sCommand.end(); ++it)
^
../phytronAxisMotor.cpp:711:13: error: ‘it’ does not name a type
for (auto it = sCommand.begin(); it != sCommand.end(); ++it)
^
../phytronAxisMotor.cpp:711:36: error: expected ‘;’ before ‘it’
for (auto it = sCommand.begin(); it != sCommand.end(); ++it)
^
../phytronAxisMotor.cpp:711:36: error: ‘it’ was not declared in this scope
../phytronAxisMotor.cpp:732:3: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
auto it(sResponse.find_first_of('\x02'));
^
../phytronAxisMotor.cpp:732:11: error: ISO C++ forbids declaration of ‘it’ with no type [-fpermissive]
auto it(sResponse.find_first_of('\x02'));
^
../phytronAxisMotor.cpp:733:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (it == std::string::npos)
^
../phytronAxisMotor.cpp:737:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (it == std::string::npos)
^
../phytronAxisMotor.cpp:758:23: error: ‘std::string’ has no member named ‘front’
switch (sResponse.front()) { // answer should start with ACK or NAK
^
../phytronAxisMotor.cpp: In member function ‘phytronStatus phytronController::sendPhytronMultiCommand(std::vector<std::basic_string >, std::vector<std::basic_string >&, bool, bool)’:
../phytronAxisMotor.cpp:818:10: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = asCommands.begin();
^
../phytronAxisMotor.cpp:818:15: error: ‘it’ does not name a type
for (auto it = asCommands.begin();
^
../phytronAxisMotor.cpp:819:10: error: expected ‘;’ before ‘it’
it != asCommands.end() && iCount < iMaxCmdCount; ++it, ++iCount) {
^
../phytronAxisMotor.cpp:819:10: error: ‘it’ was not declared in this scope
../phytronAxisMotor.cpp:834:10: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto it = asCommands.begin();
^
../phytronAxisMotor.cpp:834:15: error: ‘it’ does not name a type
for (auto it = asCommands.begin();
^
../phytronAxisMotor.cpp:835:10: error: expected ‘;’ before ‘it’
it != asCommands.end() && sCommand.size() < iMaxLen && iCount < iMaxCmdCount;
^
../phytronAxisMotor.cpp:835:10: error: ‘it’ was not declared in this scope
../phytronAxisMotor.cpp:855:21: error: ‘class std::vector<std::basic_string >’ has no member named ‘emplace_back’
asResponses.emplace_back(sResponse.substr(1, i - 1));
^
../phytronAxisMotor.cpp:858:21: error: ‘class std::vector<std::basic_string >’ has no member named ‘emplace_back’
asResponses.emplace_back(sResponse.substr(0, i));
^
../phytronAxisMotor.cpp: In member function ‘phytronStatus phytronAxis::setVelocity(std::vector<std::basic_string >, double, double, int)’:
../phytronAxisMotor.cpp:1034:71: error: ‘to_string’ is not a member of ‘std’
pCmdList->push_back(std::string("M") + axisModuleNo_ + "P14=" + std::to_string(maxVelocity));
^
../phytronAxisMotor.cpp:1035:71: error: ‘to_string’ is not a member of ‘std’
pCmdList->push_back(std::string("M") + axisModuleNo_ + "P04=" + std::to_string(minVelocity));
^
../phytronAxisMotor.cpp:1038:71: error: ‘to_string’ is not a member of ‘std’
pCmdList->push_back(std::string("M") + axisModuleNo_ + "P08=" + std::to_string(maxVelocity));
^
../phytronAxisMotor.cpp:1039:71: error: ‘to_string’ is not a member of ‘std’
pCmdList->push_back(std::string("M") + axisModuleNo_ + "P10=" + std::to_string(minVelocity));
^
../phytronAxisMotor.cpp: In member function ‘phytronStatus phytronAxis::setAcceleration(std::vector<std::basic_string >
, double, int)’:
../phytronAxisMotor.cpp:1068:14: error: ‘to_string’ is not a member of ‘std’
std::to_string(acceleration);
^
../phytronAxisMotor.cpp:1070:44: error: call to ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string*, bool)’ uses the default argument for parameter 2, which is not yet defined
return pC_->sendPhytronCommand(sCommand);
^
../phytronAxisMotor.cpp: In member function ‘virtual asynStatus phytronAxis::setEncoderRatio(double)’:
../phytronAxisMotor.cpp:1309:83: error: ‘to_string’ is not a member of ‘std’
phyStatus = pC_->sendPhytronCommand(std::string("M") + axisModuleNo_ + "P39=" + std::to_string(1. / ratio), sResponse);
^
../phytronAxisMotor.cpp: In member function ‘virtual asynStatus phytronAxis::setPosition(double)’:
../phytronAxisMotor.cpp:1330:79: error: call to ‘phytronStatus phytronController::sendPhytronCommand(std::string, std::string*, bool)’ uses the default argument for parameter 2, which is not yet defined
phyStatus = pC_->sendPhytronCommand(const_cast<const char*>(pC_->outString_));
^
make[3]: *** [phytronAxisMotor.o] Error 1
make[3]: Leaving directory /home/bl17b/Epics/synApps_6_1/support/motor-R7-1/modules/motorPhytron/phytronApp/src/O.linux-x86_64' make[2]: *** [install.linux-x86_64] Error 2 make[2]: Leaving directory /home/bl17b/Epics/synApps_6_1/support/motor-R7-1/modules/motorPhytron/phytronApp/src'
make[1]: *** [src.install] Error 2
make[1]: Leaving directory `/home/bl17b/Epics/synApps_6_1/support/motor-R7-1/modules/motorPhytron/phytronApp'
make: *** [phytronApp.install] Error 2
[bl17b@localhost motorPhytron]$

@Baokangwen
Copy link

@MarkRivers
Dear Mark

How to add Renishaw's readhead and encoder to this control module.
Whether additional IOCs are required.

Best Regards,
kangwen

@MarkRivers
Copy link
Contributor

If the driver supports encoders then no additional software should be needed. It is just a hardware connection and configuration setting.
Are these incremental or absolute encoders?

@Baokangwen
Copy link

If the driver supports encoders then no additional software should be needed. It is just a hardware connection and configuration setting. Are these incremental or absolute encoders?

incremental encoder

@MarkRivers
Copy link
Contributor

Incremental encoders don’t require any other software. However I a not an expert on the Phytron controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants