Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions GalilSup/Db/galil_motor_extras.template
Original file line number Diff line number Diff line change
Expand Up @@ -1018,24 +1018,27 @@ record(stringout,"$(P):$(M)_MOVE_CMD")

##
## calculate the live difference between motor and encoder position
## only calculate if UEIP is true and an encoder is actually
## only calculate if UEIP is true and an encoder is also actually
## present (as per relevant MSTA bit)
## In addition only calculate when moving to avoid noisy
## encoder post move triggering recording
##
record(calcout,"$(P):$(M)_MTRENC_DIFF")
{
field(DESC, "Encoder motor difference")
field(DESC, "In motion encoder motor difference")
field(INPA, "$(P):$(M).RMP CP")
field(INPB, "$(P):$(M).MRES CP")
field(INPC, "$(P):$(M).REP CP")
field(INPD, "$(P):$(M).ERES CP")
field(INPE, "$(P):$(M).UEIP CP")
field(INPF, "$(P):$(M).MSTA CP")
field(CALC, "(E&&(F&256))?(ABS(A*B)-ABS(C*D)):0")
field(INPG, "$(P):$(M).DMOV CP")
field(CALC, "H:=(G=0?((E&&(F&256))?(ABS(A*B)-ABS(C*D)):0):H);H")
}

##
## calculate the difference between motor and encoder position
## when not in motion
## determine the difference between motor and encoder position
## when motion complete
##
record(calcout,"$(P):$(M)_MTRENC_DRIFT_")
{
Expand All @@ -1050,7 +1053,7 @@ record(calcout,"$(P):$(M)_MTRENC_DRIFT_")
}

##
## difference between motor and encoder position when not in motion
## record difference between motor and encoder position when motion complete
##
record(ai,"$(P):$(M)_MTRENC_DRIFT")
{
Expand Down