Skip to content

Commit

Permalink
Merge pull request #25 from guirodrigueslima/dev
Browse files Browse the repository at this point in the history
Bug fix and new Control Loop functionality.

These improvements include some optimizations, bug fixes and new functions such as AnalogInput, Over Flow, On-Targer and Error. These improvements have been running on the Carnauba beamline at Sirius/CNEPM for over a year and have already prevented collision accidents in the past.

Three new PVs were added (Analog Target Input, On-Target and Over Flow). Furthermore, a bug was observed where only the PID configurations for axis 1 were working, so the PIasynAxis::createCLParams() function was removed from the loop and now createParam() is instantiated only once in PIasynController::PIasynController( ), the values are defined by the ADDR variable of each respective axis.

The PV LAST_ERR was removed from PI_SupportCtrl.db, as this database only works for controllers with a coordinate system. The PV was added to the PI_SupportError,db file and a new PV was also created to clear the last CLEAR_ERR error.
  • Loading branch information
kmpeters authored Mar 12, 2024
2 parents cad7ed8 + f52ebb3 commit 60af8bd
Show file tree
Hide file tree
Showing 19 changed files with 309 additions and 497 deletions.
22 changes: 0 additions & 22 deletions iocs/pigcs2IOC/iocBoot/iocPIGCS2/PI_GCS2 _CL.cmd

This file was deleted.

5 changes: 1 addition & 4 deletions iocs/pigcs2IOC/iocBoot/iocPIGCS2/PI_GCS2.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ PI_GCS2_CreateController("C867", "C867_ETH",2, 0,0, 100, 1000)
asynSetTraceMask("C867_ETH",0,1)
asynSetTraceIOMask("C867_ETH",0,0)

#!dbLoadRecords("$(TOP)/db/PI_Support.db","P=pigcs2:,R=m1:,PORT=C867,ADDR=0,TIMEOUT=1")
#!dbLoadRecords("$(TOP)/db/PI_Support.db","P=pigcs2:,R=m2:,PORT=C867,ADDR=1,TIMEOUT=1")

# asyn record for troubleshooting
dbLoadRecords("$(ASYN)/db/asynRecord.db","P=pigcs2:,R=asyn_1,PORT=C867_ETH,ADDR=0,OMAX=256,IMAX=256")
#dbLoadRecords("$(ASYN)/db/asynRecord.db","P=pigcs2:,R=asyn_1,PORT=C867_ETH,ADDR=0,OMAX=256,IMAX=256")
23 changes: 23 additions & 0 deletions iocs/pigcs2IOC/iocBoot/iocPIGCS2/PI_GCS2.substitutions
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,26 @@ pattern
# U-624.03
{pigcs2:, "m2", "asynMotor", "C867", 1, "Motor 2", deg, Pos, 5, 0, .2, 0, 1, .2, 0.0020, 4, 0.0, 0.0, ""}
}

#file "$(TOP)/db/PI_Support.db"
#{
#pattern
#{P, M, PORT, ADDR, TIMEOUT }
#{pigcs2:, "m1:", "C867", 0, 1 }
#{pigcs2:, "m2:", "C867", 1, 1 }
#}

#file "$(TOP)/db/PI_SupportCL.db"
#{
#pattern
#{P, M, PORT, ADDR, TIMEOUT }
#{pigcs2:, "m1:", "C867", 0, 1 }
#{pigcs2:, "m2:", "C867", 1, 1 }
#}

#file "$(TOP)/db/PI_SupportError.db"
#{
#pattern
#{P, PORT }
#{pigcs2:, "C867" }
#}
4 changes: 4 additions & 0 deletions iocs/pigcs2IOC/pigcs2App/Db/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ include $(TOP)/configure/CONFIG

ifdef MOTOR_PIGCS2
### this module was built outside motor
DB_INSTALLS += $(MOTOR_PIGCS2)/db/PI_SupportError.db
DB_INSTALLS += $(MOTOR_PIGCS2)/db/PI_SupportCtrl.db
DB_INSTALLS += $(MOTOR_PIGCS2)/db/PI_SupportCL.db
DB_INSTALLS += $(MOTOR_PIGCS2)/db/PI_Support.db
else
### this module was built inside motor/modules
DB_INSTALLS += $(MOTOR)/db/PI_SupportError.db
DB_INSTALLS += $(MOTOR)/db/PI_SupportCtrl.db
DB_INSTALLS += $(MOTOR)/db/PI_SupportCL.db
DB_INSTALLS += $(MOTOR)/db/PI_Support.db
endif

Expand Down
1 change: 1 addition & 0 deletions pigcs2App/Db/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include $(TOP)/configure/CONFIG
#DB += xxx.db

DB += PI_SupportCtrl.db
DB += PI_SupportError.db
DB += PI_Support.db
DB += PI_SupportCL.db

Expand Down
21 changes: 15 additions & 6 deletions pigcs2App/Db/PI_Support.db
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
record(ai, "$(P)$(R)POSITION")
record(ai, "$(P)$(M)POSITION")
{
field(PINI, "1")
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PI_SUP_POSITION")
field(PREC, "5")
field(SCAN, "I/O Intr")
}

record(ao, "$(P)$(R)TARGET")
record(ao, "$(P)$(M)TARGET")
{
field(PINI, "1")
field(DTYP, "asynFloat64")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PI_SUP_TARGET")
field(PREC, "5")
}

record(bi, "$(P)$(R)SERVO")
record(bo, "$(P)$(M)SERVO")
{
field(DESC, "Set status Servo")
field(DTYP, "asynInt32")
field(ZNAM, "Disable")
field(ONAM, "Enable")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PI_SUP_SERVO")

}

record(bi, "$(P)$(M)RBSERVO")
{
field(PINI, "1")
field(DTYP, "asynInt32")
field(ZNAM, "Disable")
field(ONAM, "Enable")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))PI_SUP_SERVO")
field(SCAN, "I/O Intr")
}
Expand Down
Loading

0 comments on commit 60af8bd

Please sign in to comment.