Skip to content

Commit

Permalink
reset current live position when zeroing the origin, and improved com…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
cbteeple committed Oct 12, 2021
1 parent 3a00187 commit adcb1b5
Showing 1 changed file with 78 additions and 3 deletions.
81 changes: 78 additions & 3 deletions galil_stage_program/2021_07_20_high_accuracy.dmc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ joyhzone = 0.90
debug=0
'
'
'
'===========================================
#LOOP
JG ;' Make sure we are in jog mode.
xangle=(@AN[1]-2.69)/2.38;' Calculate the joystick's x-axis position
Expand Down Expand Up @@ -135,6 +137,8 @@ JP#SETORIG,@IN[6]=0
JP#HOME,@IN[17]=0
'
'
'
'===========================================
#PADLOOP
a3=@AN[3]
IF (a3<0)
Expand Down Expand Up @@ -197,8 +201,11 @@ BG X,Y
JP#LOOP
'
'
' MOVE TO HOME POSITION IN LASER VIEW
'
'===========================================
#HOMELAS
' Move to the home position in laser view
'
homedx=deltax
homedy=deltay
JS#HOMEMOV
Expand All @@ -207,8 +214,11 @@ CB 1 ;' Turn off the "CAM VIEW" light.
EN
'
'
' MOVE TO HOME POSITION IN CAMERA VIEW
'
'===========================================
#HOMECAM
' Move to the home position in camera view
'
homedx=0
homedy=0
JS#HOMEMOV
Expand All @@ -217,7 +227,12 @@ SB 1 ;' Turn on the "CAM VIEW" light
EN
'
'
'
'===========================================
#HOMEMOV
' Move home via a series of overshooting moves
' (This leads to more-precise motion)
'
'LM XY
VS 400000;VA 1000000;VD 1000000;
overx=-500
Expand Down Expand Up @@ -271,8 +286,11 @@ limithit=0
EN
'
'
' MOVE HOME WITH SOME OFFSET
'
'===========================================
#HOMESTP
' Move home with some distance offset
'
MC ;' Wait for motion to stop
actx=_TPA ;' Save current position.
acty=_TPB
Expand Down Expand Up @@ -308,7 +326,13 @@ ENDIF
EN
'
'
'
'===========================================
#HOME
' Move the stage to the home position. If the
' HOME button is pressed for longer than 2 seconds,
' Perform the homing proedure (#HOMEXY)
'
btntime=TIME
ST
MC
Expand Down Expand Up @@ -336,12 +360,18 @@ BG X,Y
JP#LOOP
'
'
'
'===========================================
#HOMEXY
' Perform homing procedure. Move the stage in
' the negative direction until an endstop is hit.
'
homing=1
JG ;' Make sure we are in jog mode.
JP#LOOP,@IN[17]=0
JG -400000,0;
BG X,Y
' If the endstop is not hit, keep moving
JP#HOMEXY,limithit=0
MG "X-Axis is homed"
ST
Expand All @@ -350,6 +380,8 @@ LM XY
cury=_TPB
DP xcamhome,0
DE xcamhome,0
'
' Move to the camera view
JS#HOMECAM
homing=0
limithit=0
Expand All @@ -359,7 +391,15 @@ BG X,Y
JP#LOOP
'
'
'
'===========================================
#SETORIG
' Zero the origin to the current position. If the
' ZERO ORIGIN button is pressed for longer than 2
' seconds, set the origin offsets (#SETDEL)
'
currposx=0 ;' Reset the relative position
currposy=0 ;' Reset the relative position
btntime=TIME
ST
MC
Expand All @@ -386,7 +426,11 @@ usermove=0
loopnum=0
'
'
'
'===========================================
#FLASH
' Flash some lights in response to actions
'
bit2=@OUT[2]
bit3=@OUT[3]
SB 2;SB 3
Expand All @@ -405,7 +449,12 @@ JP#LOOP
EN
'
'
'
'===========================================
#FLASH2
' Flash some lights quickly to indicate
' action complete.
'
bit2=@OUT[2]
bit3=@OUT[3]
SB 2;SB 3
Expand All @@ -420,7 +469,12 @@ WT 300
EN
'
'
'
'===========================================
#FLASH3
' Flash some lights slowly to indicate
' error state.
'
bit2=@OUT[2]
bit3=@OUT[3]
SB 2;SB 3
Expand All @@ -435,7 +489,11 @@ WT 300
EN
'
'
'
'===========================================
#FLASHX
' Flash the x-endstop light.
'
bit2=@OUT[2]
SB 2
WT 300
Expand All @@ -448,7 +506,11 @@ WT 300
EN
'
'
'
'===========================================
#FLASHY
' Flash the y-endstop light.
'
bit3=@OUT[3]
SB 3
WT 300
Expand All @@ -461,7 +523,12 @@ WT 300
EN
'
'
'
'===========================================
#FLASHAL
' Flash both lights slowy to indicate
' error state.
'
bit2=@OUT[2]
bit3=@OUT[3]
SB 1;SB 2;SB 3
Expand All @@ -476,7 +543,11 @@ WT 300
EN
'
'
'
'===========================================
#SETDEL
' Set the values of the origin offset deltas
'
curx=_TPA ;' Save current position.
cury=_TPB
MG ""
Expand All @@ -497,7 +568,11 @@ EN
'
'
'
'===========================================
#LIMSWI
' Handle limit switch hits (stop the stage
' and bounce back)
'
limithit=1
VS 400000;VA 4000000;VD 4000000;
DC 10000000,10000000
Expand Down

0 comments on commit adcb1b5

Please sign in to comment.