EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <20252026  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <20252026 
<== Date ==> <== Thread ==>

Subject: Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux
From: "Peterson, Kevin M. via Tech-talk" <[email protected]>
To: "Pearson, Matthew" <[email protected]>, "[email protected]" <[email protected]>, Dariush Hampai <[email protected]>
Date: Thu, 10 Jul 2025 18:00:17 +0000
Matt,

If you send me the local version of motorPIGCS2 that supports daisy-chaining (or point me to a git repo with the custom code in it), I'll work on merging it into motorPIGCS2.

Kevin

________________________________________
From: Tech-talk <[email protected]> on behalf of Dariush Hampai via Tech-talk <[email protected]>
Sent: Wednesday, July 9, 2025 10:15 AM
To: Pearson, Matthew; [email protected]
Subject: Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux

Hi Matt,
following your message, PIGC2 is not allowed to work in daisychain mode.
by this way, is it better to come back to motorPI module? in drvPIC663.cc there is the possibility to work in daisy chain mode:

PIC663Config(int card,         /* card being configured */
         const char *name,     /* asyn port name */
         int addr)         /* asyn address ( device address for daisy chaining */

@Mark, can you confirm my idea?

Dariush

Il 08/07/2025 21:40, Pearson, Matthew ha scritto:
Hi,

Apologies, I realized I was working under the assumption that the PI daisy chain support had been added to the upstream repository (motorPIGCS2), but I found out today it never was. The original developer sent me that daisy chain support to test, and we’ve just been maintaining a local version of that code ever since.

This means that motorPIGCS2 doesn’t currently support the daisy chain configuration. Those IOC shell functions I pasted below don’t exist (PI_GCS2_CreateDaisyChainController).

The daisy chain support that we have adds a new class called PIDaisyChainInterface that prefixes the controller address onto each command sent, and strips it off for the replies. And there’s a change to the API for PIasynController to support setting a controller address, which also defines the PI_GCS2_CreateDaisyChainController function.

I don’t want to attempt to merge this myself after so long. I’m not fully sure what it might break, and we only have one daisy chain configuration to test with. But I’m happy to send the old files as a tar file.

Cheers,
Matt

From: Pearson, Matthew <[email protected]><mailto:[email protected]>
Sent: Thursday, July 3, 2025 11:01 AM
To: Dariush Hampai <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Mark Rivers <[email protected]><mailto:[email protected]>
Subject: RE: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux

Hi Darisuh,

It really depends on which stages are connected and how the controller is configured, so one set of parameters in use by somebody else might not be correct for your setup. Also some of those parameters listed are specific to the motor record logic, such as backlash correction (BDST, BVEL and BACC) which wouldn’t have an equivalent setting in the PI software (unless it happened to implement the same feature).

Most of time setting reasonable default parameters can work, and they don’t have to match what the vendor has as a default configuration.

Cheers,
Matt

From: Dariush Hampai <[email protected]<mailto:[email protected]>>
Sent: Thursday, July 3, 2025 10:38 AM
To: Pearson, Matthew <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>
Cc: Mark Rivers <[email protected]<mailto:[email protected]>>
Subject: Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux

Hi Matt, all these informations are stored in the PIMikroMove software: however the list of parameters is really huge (about 30 voices), so I ask if someone in the community has already found the right values to fill in epics db. Dariush Il

Hi Matt,
all these informations are stored in the PIMikroMove software: however the list of parameters is really huge (about 30 voices), so I ask if someone in the community has already found the right values to fill in epics db.

Dariush


Il 02/07/2025 19:46, Pearson, Matthew ha scritto:
Hi,

You have to figure out most of those parameters yourself, based on the controller settings and motor specification. I assume you’ve read the motor record documentation to find out what they mean?

I’m not fully sure what PI_GC2.substitues is. I usually use basic_asyn_motor.db (or a custom variation of that). Here’s a default set that will likely work:

VELO=1
VBAS=0
ACCL=1
BDST=0
BVEL=1
BACC=1
MRES <- you need to figure out how many controller steps will move 1mm
PREC=3
DHLM=1000
DLLM=-1000
INIT <- it’s unlikely you need this, so just set to “”

Cheers,
Matt

From: Dariush Hampai <[email protected]><mailto:[email protected]>
Sent: Tuesday, July 1, 2025 12:06 PM
To: Pearson, Matthew <[email protected]><mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Mark Rivers <[email protected]><mailto:[email protected]>
Subject: Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux

Hi Matt, Hi Community, following your help, I'm able to create the right IOC. however in the PI_GC2. substitues I have to fill the table with the right parameters. I don't know these values, but I can access to the controller parameters list

Hi Matt,
Hi Community,
following your help, I'm able to create the right IOC.
however in the PI_GC2.substitues I have to fill the table with the right parameters. I don't know these values, but I can access to the controller parameters list by the PI software (PIMikroMove).
As those parameters are a lot, does someone know which parameters I have to consider?
In particulare the parameters requested are

VELO ->
VBAS ->
ACCL ->
BDST ->
BVEL ->
BACC ->
MRES ->
PREC ->
DHLM ->
DLLM ->
INIT ->

thank you in advance
Dariush


Il 27/06/2025 17:48, Pearson, Matthew ha scritto:
Hi Dariush,


Hi Matt,

after 10 years i'll reply to this thread...



The good news is that I’m still here!



In my lab I have 3 PI-Mercury controller C-663 (one for a rotative motor

and 2 linear stages) in daisy chain mode.

I have some questions regarding this setup (up to now I used Labview

successfully... so I know that it works fine).

I start from the module "motorPI" (or have I to use motorPIGCS2?)



It’s been a while (+5 years) since I dealt with those PI controllers, but I suspect you have to use motorPIGCS2 for all the newer controllers that support the GCS2 command set.



I’m pasting some examples below, from an IOC which uses C-663 and C-863 controllers all daisy chained together (5 total) on a serial line via a Moxa.



In the st.cmd file I have:



#Connect to the Moxa

epicsEnvSet("PI_IP","10.112.2.4")

drvAsynIPPortConfigure("PI1","$(PI_IP):4001",0,0,0)



# Setup the motor drivers

PI_GCS2_CreateDaisyChainController("PIC1", "PI1", 1, 1, 0, 0, 500, 1000)

PI_GCS2_CreateDaisyChainController("PIC2", "PI1", 2, 1, 0, 0, 500, 1000)

PI_GCS2_CreateDaisyChainController("PIC3", "PI1", 3, 1, 0, 0, 500, 1000)

PI_GCS2_CreateDaisyChainController("PIC4", "PI1", 4, 1, 0, 0, 500, 1000)

PI_GCS2_CreateDaisyChainController("PIC5", "PI1", 5, 1, 0, 0, 500, 1000)



So it must be the 3rd argument which is the address on the serial bus. I seem to remember setting those addresses via DIP switches on the controllers.



In the IOC src/Makefile I have:



bl1a-piezo1_DBD += base.dbd

bl1a-piezo1_DBD += asyn.dbd

bl1a-piezo1_DBD += drvAsynIPPort.dbd

bl1a-piezo1_DBD += PI_GCS2Support.dbd

bl1a-piezo1_DBD += motorSupport.dbd



and:



bl1a-piezo1_LIBS += asyn

bl1a-piezo1_LIBS += motor

bl1a-piezo1_LIBS += PI_GCS2Support



Then, for the IOC database, you should just need to instantiate a single motor record per controller, defining the Asyn port as PIC1, PIC2, etc and leaving the Asyn address as 0.



Hope that helps.



Cheers,

Matt



1) following the ioc in motorNewport, I included in piIOC/piApp/Db/Makefile



# Create and install (or just install) into <top>/db

# databases, templates, substitutions like this

#DB += xxx.db



DB_INSTALLS += $(MOTOR)/db/asyn_motor.db

DB_INSTALLS += $(MOTOR)/db/asyn_motor_positions.req

DB_INSTALLS += $(MOTOR)/db/asyn_motor_settings.req

DB_INSTALLS += $(MOTOR)/db/basic_asyn_motor.db

DB_INSTALLS += $(MOTOR)/db/profileMoveController.template

DB_INSTALLS += $(MOTOR)/db/profileMoveController_settings.req

DB_INSTALLS += $(MOTOR)/db/profileMoveAxis.template

DB_INSTALLS += $(MOTOR)/db/profileMoveAxis_settings.req



2) in motor/module/motorPI there is a template to start. However there

isn't the C-663 option in st.cmd. So, it is right to create a

PI_C663.cmd/.substitution (similar to PI_C844)? Looking for the driver

of C-663  in sources it seems that the functions are the same.



3) in PI_C663.cmd, how I set the setup?

PIC663Setup(1, 10) -> change 1 to 3 as I have three controllers?



4) PIC663Config(0, "serial_pi_1"), the 0 is "controller# being

configured". Have I change it?



5) regarding the daisy chain, how can I manage it? in .substitution file?





thank you in advance



 > Hi,

 >

 > The C-663 uses the PI General Command Set, and there's also Asyn

based support in the motor support module:

 >

 > https://urldefense.us/v3/__https://urldefense.us/v2/url?u=http-3A__www.aps.anl.gov_bcda_synApps_motor_&d=DwIDaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=aEDRFW1J1RKf3L4Vy5iLgaY2FJpZ2TV1XDtc_tKxW00&m=ybmxs2lyUrRLADSk15B8Jy1lLkFSkeSQbvo4mhec8z_4xVeRqZsCJdj8vaRw4nMc&s=DEJkRdVwoCOBm9uCPAbPPqGCKM6QNTszI63d94b2mtA&e=__;!!G_uCfscf7eWS!dw-JKG3RL1cLynXqte1VXXfIHV7z9MamN-AXCLsGaMIxdgOkm3t0NJO1FJlzoMuuRI1XNbpUnoT2hwXei5L_v68$ <https://urldefense.us/v3/__https://urldefense.us/v2/url?u=http-3A__www.aps.anl.gov_bcda_synApps_motor_&d=DwIDaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=aEDRFW1J1RKf3L4Vy5iLgaY2FJpZ2TV1XDtc_tKxW00&m=ybmxs2lyUrRLADSk15B8Jy1lLkFSkeSQbvo4mhec8z_4xVeRqZsCJdj8vaRw4nMc&s=DEJkRdVwoCOBm9uCPAbPPqGCKM6QNTszI63d94b2mtA&e=__;!!G_uCfscf7eWS!frNI3zCAxsbTQrhG-GcaM1J0gWJlE2hg3Ti_1hmkzVPK0gttFLtKyxcPNwUgpx70aec_02KPguIiCMb00Pmka0BDHZV44PAVeg$>

 >

 > I'm currently using two C-663 controllers in a RS232 daisy chain

configuration via a Moxa. The motor module doesn't contain the daisy

chain support, but does work point-to-point.

 >

 > The IOC startup file would contain the following commands:

 >

 > drvAsynIPPortConfigure("PI1","10.112.2.4:4001",0,0,0)

 > PI_GCS2_CreateController("PIC1", "PI1", 1, 0, 0, 500, 1000)

 >

 > Then the motor record would use the "PIC1" asyn port.

 >

 > Cheers,

 > Matt





 > On Mar 13, 2015, at 8:00 AM, Heinz Junkes <[email protected]<mailto:[email protected]>>

wrote:



 > Hi Enrico,

 >

 > I run a similar controller C-663 Mercury Step but using the serial

(RS232) port.

 > I can send to you the proto and db - files to use the controller with

streamdevice.

 >

 > Best regards,

 > Heinz

 >

 >> On 13.03.2015, at 10:59, Enrico Virgilli <[email protected]<mailto:[email protected]>> wrote:

 >>

 >> Dear staff,

 >>

 >> I have a PI C-863 Mercury motor controller

 >> https://urldefense.us/v3/__https://urldefense.us/v2/url?u=http-3A__www.physikinstrumente.com_en_products_prdetail.php-3Fsortnr-3D900605&d=DwIDaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=aEDRFW1J1RKf3L4Vy5iLgaY2FJpZ2TV1XDtc_tKxW00&m=ybmxs2lyUrRLADSk15B8Jy1lLkFSkeSQbvo4mhec8z_4xVeRqZsCJdj8vaRw4nMc&s=U8c3Q_pgvB3PR9EdmDe0-PBJJboV-I8sLDs-676FjtQ&e=__;!!G_uCfscf7eWS!dw-JKG3RL1cLynXqte1VXXfIHV7z9MamN-AXCLsGaMIxdgOkm3t0NJO1FJlzoMuuRI1XNbpUnoT2hwXeqZUf5vg$ <https://urldefense.us/v3/__https://urldefense.us/v2/url?u=http-3A__www.physikinstrumente.com_en_products_prdetail.php-3Fsortnr-3D900605&d=DwIDaQ&c=v4IIwRuZAmwupIjowmMWUmLasxPEgYsgNI-O7C4ViYc&r=aEDRFW1J1RKf3L4Vy5iLgaY2FJpZ2TV1XDtc_tKxW00&m=ybmxs2lyUrRLADSk15B8Jy1lLkFSkeSQbvo4mhec8z_4xVeRqZsCJdj8vaRw4nMc&s=U8c3Q_pgvB3PR9EdmDe0-PBJJboV-I8sLDs-676FjtQ&e=__;!!G_uCfscf7eWS!frNI3zCAxsbTQrhG-GcaM1J0gWJlE2hg3Ti_1hmkzVPK0gttFLtKyxcPNwUgpx70aec_02KPguIiCMb00Pmka0BDHZVlkIQUdA$>

 >> that I would like to control with linux. The connection is

 >> USB, and at the moment I am successfully using it with a desktop with

 >> windows.

 >>

 >> I have not found drivers or references on how to do it and I am a really

 >> newbye in this sense. Can you help me giving some reference or

 >> free software to test it?

 >>

 >> SIncerely,

 >>

 >> Enrico



--

************************************



Dr. Dariush Hampai, PhD



INFN - LNF

X-Lab Frascati

Via E. Fermi, 54 (ex 40)

I-00044 Frascati (RM)

Italy



Mail Address:

XLab-Frascati

LNF-INFN

Casella Postale 13

Frascati (RM)

Italy



Room:      +39.06.9403.5248

Lab.:        +39.06.9403.2286

Mob.:       +39.06.9403.8025

Fax.:        +39.06.9403.2597



************************************





--

************************************



Dr. Dariush Hampai, PhD



INFN - LNF

X-Lab Frascati

Via E. Fermi, 54 (ex 40)

I-00044 Frascati (RM)

Italy



Mail Address:

XLab-Frascati

LNF-INFN

Casella Postale 13

Frascati (RM)

Italy



Room:    +39.06.9403.5248

Lab.:    +39.06.9403.2286

Mob.:    +39.06.9403.8025

Fax.:    +39.06.9403.2597



************************************

--

************************************



Dr. Dariush Hampai, PhD



INFN - LNF

X-Lab Frascati

Via E. Fermi, 54 (ex 40)

I-00044 Frascati (RM)

Italy



Mail Address:

XLab-Frascati

LNF-INFN

Casella Postale 13

Frascati (RM)

Italy



Room:    +39.06.9403.5248

Lab.:    +39.06.9403.2286

Mob.:    +39.06.9403.8025

Fax.:    +39.06.9403.2597



************************************

--
************************************

Dr. Dariush Hampai, PhD

INFN - LNF
X-Lab Frascati
Via E. Fermi, 54 (ex 40)
I-00044 Frascati (RM)
Italy

Mail Address:
XLab-Frascati
LNF-INFN
Casella Postale 13
Frascati (RM)
Italy

Room:   +39.06.9403.5248
Lab.:   +39.06.9403.2286
Mob.:   +39.06.9403.8025
Fax.:   +39.06.9403.2597

************************************

References:
Re: using PI C-863 Mercury motor controller with linux Dariush Hampai via Tech-talk
RE: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Pearson, Matthew via Tech-talk
Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Dariush Hampai via Tech-talk
RE: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Pearson, Matthew via Tech-talk
Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Dariush Hampai via Tech-talk
RE: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Pearson, Matthew via Tech-talk
RE: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Pearson, Matthew via Tech-talk
Re: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Dariush Hampai via Tech-talk

Navigate by Date:
Prev: Re: Help operating ADHamamatsuDCAM IOC Mark Rivers via Tech-talk
Next: Re: Help operating ADHamamatsuDCAM IOC Marco Filho via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <20252026 
Navigate by Thread:
Prev: RE: [EXTERNAL] Re: using PI C-863 Mercury motor controller with linux Mark Rivers via Tech-talk
Next: AreaDetector Collaboration Meeting - July 3rd Érico Nogueira Rolim via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <20252026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·