diff --git a/motorApp/OmsSrc/MAX_trajectoryScan.st b/motorApp/OmsSrc/MAX_trajectoryScan.st index e261a87a..c812cb71 100644 --- a/motorApp/OmsSrc/MAX_trajectoryScan.st +++ b/motorApp/OmsSrc/MAX_trajectoryScan.st @@ -356,13 +356,41 @@ ss maxTrajectoryScan { /* Get update rate */ sprintf(stringOut, "AX; #UR?;"); %%if (pVar->simMode==0) writeRead(ssId, pVar, pVar->stringOut, pVar->stringOut); - if (debugLevel > 0) printf("Update rate (X)='%s'\n", stringOut); + if (debugLevel > 0) printf("Update rate ='%s'\n", stringOut); + + %%epicsTimeGetCurrent(&eStartTime); /* not actually the start time, getMotorPositions just needs a value */ + %%getMotorPositions(ssId, pVar, pVar->motorCurrent, pVar->motorCurrentRaw, &(pVar->dtime)); + if (debugLevel >= 1) { + printf("\nbefore '#UR': motor=\n"); + for (j=0; jmotorCurrentRaw[pVar->j], (pVar->jsimMode==0) writeOnly(ssId, pVar, pVar->stringOut); + /* reload motor positions to what they were before the #UR command */ + /* Note that LP sets both motor and encoder positions to the same value */ + n = sprintf(stringOut, "AM; LP"); + for (j=0; jsimMode==0) writeOnly(ssId, pVar, pVar->stringOut); + + %%epicsTimeGetCurrent(&eStartTime); /* not actually the start time, getMotorPositions just needs a value */ + %%getMotorPositions(ssId, pVar, pVar->motorCurrent, pVar->motorCurrentRaw, &(pVar->dtime)); + if (debugLevel >= 1) { + printf("\nafter '#UR;': motor=\n"); + for (j=0; jmotorCurrentRaw[pVar->j], (pVar->jdebugLevel >= 10) printf("v_lin=%f, v_spline=%f\n", v_lin, v_spline); /* the acceleration that will get us to the ideal velocity */ - if (0) { + if (pVar->startPulses != 0) { v_ideal = v_spline; } else { v_ideal = v_lin;