Skip to content

Commit

Permalink
Remove HVEL in driver and Db
Browse files Browse the repository at this point in the history
There are 2 velocities in the MCU, towards the home sensor and
from the home sensor (or "off the cam"), therefore HVEL is not
really ideal for us.

Remove it from the Db.
Rename  4-JAR-ACCL-HVEL-VAL-JOGF-HOMF.py -> 400-JAR-ACCL-VAL-JOGF-HOMF.py
and remove the commented-out code
  • Loading branch information
tboegi committed Jun 2, 2016
1 parent 86fc9fd commit b755d21
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 75 deletions.
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m1.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 1, m1, m1-, "asynMotor", MCU1, 1, "motor 1", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 1, m1, m1-, "asynMotor", MCU1, 1, "motor 1", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m2.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 2, m2, m2-, "asynMotor", MCU1, 2, "motor 2", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 2, m2, m2-, "asynMotor", MCU1, 2, "motor 2", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m3.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 3, m3, m3-, "asynMotor", MCU1, 3, "motor 3", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 3, m3, m3-, "asynMotor", MCU1, 3, "motor 3", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m4.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 4, m4, m4-, "asynMotor", MCU1, 4, "motor 4", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 4, m4, m4-, "asynMotor", MCU1, 4, "motor 4", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m5.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 5, m5, m5-, "asynMotor", MCU1, 5, "motor 5", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 5, m5, m5-, "asynMotor", MCU1, 5, "motor 5", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m6.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 6, m6, m6-, "asynMotor", MCU1, 6, "motor 6", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 6, m6, m6-, "asynMotor", MCU1, 6, "motor 6", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m7.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 7, m7, m7-, "asynMotor", MCU1, 7, "motor 7", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 7, m7, m7-, "asynMotor", MCU1, 7, "motor 7", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/Sim8-m8.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 8, m8, m8-, "asynMotor", MCU1, 8, "motor 8", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
pattern {P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 8, m8, m8-, "asynMotor", MCU1, 8, "motor 8", mm, Pos, 24.9, 5.05, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -140, 13, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/SolAxis.substitutions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file "eemcu.template" {
pattern {P,N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 1, m1, m1-, "asynMotor", MCU1, 1, "motor 1", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -25, 135, ""}
pattern {P,N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 1, m1, m1-, "asynMotor", MCU1, 1, "motor 1", mm, Pos, 24.9, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875 0.01754386 3, -25, 135, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/TwoAxis-m1.substitutions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
file "eemcu.template"
{
pattern
{P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 1, m1, m1-, "asynMotor", MCU1, 1, "motor 1", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875, 0.01754386, 3, 10000, 100000, ""}
{P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 1, m1, m1-, "asynMotor", MCU1, 1, "motor 1", mm, Pos, 24.9, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875, 0.01754386, 3, 10000, 100000, ""}
}
4 changes: 2 additions & 2 deletions epics/m-epics-eemcu/eemcuApp/Db/TwoAxis-m2.substitutions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
file "eemcu.template"
{
pattern
{P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, HVEL, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 2, m2, m2-, "asynMotor", MCU1, 2, "motor 2", mm, Pos, 24.9, 5.05, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875, 0.01754386, 3, 12000, 120000, ""}
{P, N, M, R, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, JVEL, JAR, VBAS, ACCL, BDST, DLY, BVEL, BACC, MRES, ERES, PREC, DLLM, DHLM, INIT}
{"IOC:", 2, m2, m2-, "asynMotor", MCU1, 2, "motor 2", mm, Pos, 24.9, 10, 10.2, 0, 1, 0, 0.3, 1, .2, 0.0046875, 0.01754386, 3, 12000, 120000, ""}
}
1 change: 0 additions & 1 deletion epics/m-epics-eemcu/eemcuApp/Db/eemcu.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ record(motor,"$(P)$(M)")
field(DTYP,"$(DTYP)")
field(DIR,"$(DIR)")
field(VELO,"$(VELO)")
field(HVEL,"$(HVEL)")
field(JVEL,"$(JVEL)")
field(VBAS,"$(VBAS)")
field(ACCL,"$(ACCL)")
Expand Down
14 changes: 2 additions & 12 deletions epics/m-epics-eemcu/eemcuApp/src/eemcuAxis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,17 +706,13 @@ asynStatus eemcuAxis::home(double minVelocity, double maxVelocity, double accele
asynStatus status = asynSuccess;
int motorHomeProc = -1;
int nCommand = NCOMMANDHOME;
double homeVeloTowardsHomeSensor = 0;

if (status == asynSuccess) status = pC_->getDoubleParam(axisNo_,
pC_->eemcuJVEL_,
&homeVeloTowardsHomeSensor);
if (status == asynSuccess) status = pC_->getIntegerParam(axisNo_,
pC_->eemcuProcHom_,
&motorHomeProc);
asynPrint(pC_->pasynUserController_, ASYN_TRACE_INFO,
"home() motorHomeProc=%d homeVeloTowardsHomeSensor=%g status=%s (%d)\n",
motorHomeProc, homeVeloTowardsHomeSensor,
"home() motorHomeProc=%d status=%s (%d)\n",
motorHomeProc,
pasynManager->strStatus(status), (int)status);

/* The controller will do the home search, and change its internal
Expand All @@ -728,12 +724,6 @@ asynStatus eemcuAxis::home(double minVelocity, double maxVelocity, double accele
if (status == asynSuccess) status = setValueOnAxis("nCommand", nCommand );
if (status == asynSuccess) drvlocal.nCommand = nCommand;
if (status == asynSuccess) status = setValueOnAxis("nCmdData", motorHomeProc);
/* Use JVEL as velocity towards the home sensor, in EGU */
if (status == asynSuccess) status = setADRValueOnAxis(501, 0x4000, 0x6,
homeVeloTowardsHomeSensor);
/* Use HVEL as velocity off the home sensor, in steps/sec */
if (status == asynSuccess) status = setADRValueOnAxis(501, 0x4000, 0x7,
maxVelocity * drvlocal.mres);
if (status == asynSuccess) status = setValueOnAxis("bExecute", 1);
drvlocal.waitNumPollsBeforeReady += 2;
return status;
Expand Down
6 changes: 6 additions & 0 deletions epics/m-epics-eemcu/iocBoot/ioceemcu/SolAxis-48-1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ setADRdouble 501 0x7000 0x101 600
#Maximum velocity
setADRdouble 501 0x4000 0x27 100

# Homing velocity towards home sensor
setADRdouble 501 0x4000 0x6 10

# Homing velocity off the home sensor
setADRdouble 501 0x4000 0x7 5

#Manual Velocity Slow
setADRdouble 501 0x4000 0x8 5

Expand Down
51 changes: 11 additions & 40 deletions epics/test/4-JAR-ACCL-HVEL-VAL-JOGF-HOMF.py → epics/test/400-JAR-ACCL-VAL-JOGF-HOMF.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def tearDown(self):


# 10% dialPosition
def test_TC_301(self):
tc_no = "TC-301-10-percent-dialPosition"
def test_TC_401(self):
tc_no = "TC-401-10-percent-dialPosition"
print '%s' % tc_no
dval = (self.saved_DHLM + 9 * self.saved_DLLM) / 10
ret = self.motm1.move(dval, dial=True, wait=True)
Expand All @@ -97,8 +97,8 @@ def test_TC_301(self):
assert calcAlmostEqual(self.motm1, tc_no, dval, drbv, 2)

# 20% dialPosition
def test_TC_302(self):
tc_no = "TC-302-20-percent-dialPosition"
def test_TC_402(self):
tc_no = "TC-402-20-percent-dialPosition"
print '%s' % tc_no
motm1 = self.motm1
saved_ACCL = motm1.get('ACCL')
Expand All @@ -121,9 +121,9 @@ def test_TC_302(self):
assert calcAlmostEqual(self.motm1, tc_no, dval, drbv, 2)


# 30% dialPosition
def test_TC_303(self):
tc_no = "TC-303-30-percent-dialPosition"
# 40% dialPosition
def test_TC_403(self):
tc_no = "TC-403-30-percent-dialPosition"
print '%s' % tc_no
motm1 = self.motm1
saved_ACCL = motm1.get('ACCL')
Expand All @@ -147,8 +147,8 @@ def test_TC_303(self):


# Jog, wait for start, stop. check fAcceleration
def test_TC_304(self):
tc_no = "TC-304-JOG-fAcceleration"
def test_TC_404(self):
tc_no = "TC-404-JOG-fAcceleration"
print '%s' % tc_no
motm1 = self.motm1
saved_ACCL = motm1.get('ACCL')
Expand All @@ -171,8 +171,8 @@ def test_TC_304(self):
assert calcAlmostEqual(self.motm1, tc_no, expacc, resacc, 2)

# Jog, wait for start, stop. check fAcceleration
def test_TC_305(self):
tc_no = "TC-305-JOG-fAcceleration"
def test_TC_405(self):
tc_no = "TC-405-JOG-fAcceleration"
print '%s' % tc_no
motm1 = self.motm1
saved_JAR = motm1.get('JAR')
Expand All @@ -194,32 +194,3 @@ def test_TC_305(self):
print '%s expacc=%f resacc=%f' % (tc_no,expacc,resacc)
assert calcAlmostEqual(self.motm1, tc_no, expacc, resacc, 2)

# # HOMF
# TODO: Send acceleration when homing in Axis.cpp and test it here
#
# def test_TC_306(self):
# tc_no = "TC-306-20-HOMF-acceleration"
# print '%s' % tc_no
# motm1 = self.motm1
# saved_ACCL = motm1.get('ACCL')
# used_ACCL = saved_ACCL + 1.5 # Make sure we have an acceleration != 0
# motm1.put('ACCL', used_ACCL)
# motm1.put('HOMF', 1)
# ret = waitForStart(self.motm1, tc_no, 2.0)
# self.assertEqual(True, ret, 'waitForStart return True')
#
# time_to_wait = 180
# ret = waitForStop(self.motm1, tc_no, time_to_wait)
# self.assertEqual(True, ret, 'waitForStop return True')
# motm1.put('HOMF', 0)
#
# motm1.put('ACCL', saved_ACCL)
# saved_ACCL = None
#
# used_HVEL = motm1.get('HVEL')
# expacc = used_HVEL / used_ACCL
# resacc = float(getAcceleration(tc_no))
# print '%s ACCL=%f HVEL=%f expacc=%f resacc=%f' % (tc_no,used_ACCL,used_HVEL,expacc,resacc)
# assert calcAlmostEqual(self.motm1, tc_no, expacc, resacc, 2)


0 comments on commit b755d21

Please sign in to comment.