diff --git a/Makefile b/Makefile
index 935f6da..6e6a76b 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ include /ioc/tools/driver.makefile
MODULE = $(notdir $(shell pwd))
BUILDCLASSES = Linux
ARCH_FILTER = eldk42% SL6-x86_64
-EXCLUDE_VERSIONS = 3.14.8
+EXCLUDE_VERSIONS = 7
#SCRIPTS+=$(wildcard add_EXPMX*.cmd cfg/*.cfg cfg/*.py cfg/*.pbi python/*.py)
SCRIPTS+=$(wildcard add_EXPMX*.cmd cfg/*.cfg cfg/*.py cfg/*.pbi)
#SOURCES+=src/DHVSaSub.cpp
diff --git a/SAR-EXPMX3.subs b/SAR-EXPMX3.subs
index 105eacb..295a21e 100644
--- a/SAR-EXPMX3.subs
+++ b/SAR-EXPMX3.subs
@@ -15,15 +15,16 @@
file PPMACMotor.template {
pattern
-{ DESC , P , M , PORT , ADDR, DIR, VELO, MRES , PREC, EGU }
-{ "Girder 1", "$(P_M)", "MOT_GIR_1", "$(PORT_M)", 1 , 0 , 40 , 0.001, 3 , "deg" }
-{ "Girder 2", "$(P_M)", "MOT_GIR_2", "$(PORT_M)", 2 , 0 , 40 , 0.001, 3 , "deg" }
-{ "Girder 3", "$(P_M)", "MOT_GIR_3", "$(PORT_M)", 3 , 0 , 40 , 0.001, 3 , "deg" }
-{ "Girder 4", "$(P_M)", "MOT_GIR_4", "$(PORT_M)", 4 , 0 , 40 , 0.001, 3 , "deg" }
-{ "Girder 5", "$(P_M)", "MOT_GIR_5", "$(PORT_M)", 5 , 0 , 40 , 0.001, 3 , "deg" }
-{ "Girder X", "$(P_M)", "MOT_GIR_X", "$(PORT_M)", 9 , 0 , 40 , 0.001, 3 , "mm" }
-{ "Girder Y", "$(P_M)", "MOT_GIR_Y", "$(PORT_M)", 10 , 0 , 40 , 0.001, 3 , "mm" }
-{ "Girder U", "$(P_M)", "MOT_GIR_U", "$(PORT_M)", 11 , 0 , 40 , 0.001, 3 , "mrad"}
-{ "Girder V", "$(P_M)", "MOT_GIR_V", "$(PORT_M)", 12 , 0 , 40 , 0.001, 3 , "mrad"}
-{ "Girder W", "$(P_M)", "MOT_GIR_W", "$(PORT_M)", 13 , 0 , 40 , 0.001, 3 , "mrad"}
+{ DESC , P , M , PORT , ADDR, DIR, VELO, MRES , PREC, EGU }
+{ "Girder 1", "$(P_M)", "MOT_GIR_1", "$(PORT_M)", 1 , 0 , 40 , 0.001, 3 , "deg" }
+{ "Girder 2", "$(P_M)", "MOT_GIR_2", "$(PORT_M)", 2 , 0 , 40 , 0.001, 3 , "deg" }
+{ "Girder 3", "$(P_M)", "MOT_GIR_3", "$(PORT_M)", 3 , 0 , 40 , 0.001, 3 , "deg" }
+{ "Girder 4", "$(P_M)", "MOT_GIR_4", "$(PORT_M)", 4 , 0 , 40 , 0.001, 3 , "deg" }
+{ "Girder 5", "$(P_M)", "MOT_GIR_5", "$(PORT_M)", 5 , 0 , 40 , 0.001, 3 , "deg" }
+{ "Girder X", "$(P_M)", "MOT_GIR_X", "$(PORT_M)", 9 , 0 , 40 , 0.001, 3 , "mm" }
+{ "Girder Y", "$(P_M)", "MOT_GIR_Y", "$(PORT_M)", 10 , 0 , 40 , 0.001, 3 , "mm" }
+{ "Girder U", "$(P_M)", "MOT_GIR_U", "$(PORT_M)", 11 , 0 , 40 , 0.001, 3 , "mrad"}
+{ "Girder V", "$(P_M)", "MOT_GIR_V", "$(PORT_M)", 12 , 0 , 40 , 0.001, 3 , "mrad"}
+{ "Girder W", "$(P_M)", "MOT_GIR_W", "$(PORT_M)", 13 , 0 , 40 , 0.001, 3 , "mrad"}
+{ "Detector Z", "$(P_M)", "MOT_DET_Z", "$(PORT_M)", 6 , 0 , 2 , 0.001, 3 , "mm" }
}
diff --git a/add_EXPMX3.cmd b/add_EXPMX3.cmd
index 28f141c..8493ee3 100644
--- a/add_EXPMX3.cmd
+++ b/add_EXPMX3.cmd
@@ -13,7 +13,7 @@ powerPmacCreateAxis($(PORT), 2)
powerPmacCreateAxis($(PORT), 3)
powerPmacCreateAxis($(PORT), 4)
powerPmacCreateAxis($(PORT), 5)
-#powerPmacCreateAxis($(PORT), 6)
+powerPmacCreateAxis($(PORT), 6)
#powerPmacCreateAxis($(PORT), 7)
#powerPmacCreateAxis($(PORT), 8)
diff --git a/cfg/MX3_setup.cfg b/cfg/MX3_setup.cfg
index 4dbf5f1..8271625 100644
--- a/cfg/MX3_setup.cfg
+++ b/cfg/MX3_setup.cfg
@@ -27,6 +27,16 @@
//!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=93168.)
+// PKP266D14BA2 1.4A 1.8deb/step
+//!encoder_sim(enc=6)
+//!motor(mot=6,dirCur=1400,JogSpeed=40,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
+// #6j=102400 -> 1 rev
+//#6j=102400 == 1 rev == 102400 enc_cnt == 2000*1um
+//servoSf : motorusteps/user_units = 102400./2000
+//posSf : user_units/encoder_steps = 2000./102400
+//!encoder_sim(enc=6,posSf=2000./102400,pos2Sf=0)
+!encoder_sim(enc=6,posSf=2000./102400)
+!motor(mot=6,dirCur=1400,servoSf=102400./2000,invDir=False,JogSpeed=2,InPosBand=1,FatalFeLimit=1000,HomeOffset=0.)
define(SP_RelBrk='15',SP_LockBrk='16')
@@ -89,13 +99,3 @@ open subprog SP_LockBrk
close
-//for motor #2
-//PowerBrick[0].GpioData[0].17=1
-//#2j:360000
-//PowerBrick[0].GpioData[0].17=0
-//#2k
-//!cm_brake(mot=2,curOn=1000,cs=1,delay=200,gpio=17)
-
-
-
-
diff --git a/cfg/SAR-EXPMX3.cfg b/cfg/SAR-EXPMX3.cfg
index e0d1c6e..7aadec4 100644
--- a/cfg/SAR-EXPMX3.cfg
+++ b/cfg/SAR-EXPMX3.cfg
@@ -38,7 +38,7 @@ Motor[5].IdCmd=0;Motor[5].InPosBand=10
&1
//initialization code
-open plc 0
+open plc 1
homez1..5
L0 = Sys.RunTime + .1
while (Sys.RunTime < L0){} //wait .1 sec
@@ -55,9 +55,13 @@ open plc 0
Motor[4].HomePos=Motor[4].HomePos-360000
if (Motor[5].ActPos-Motor[5].HomePos<-180000)
Motor[5].HomePos=Motor[5].HomePos-360000
- disable plc 0
-close // plc 0
+ disable plc 1
+close // plc 1
-enable plc 0
+enable plc 1
+
+
+//motor 1..5 use custom code to kill motor and use brake
+!holding_current(m6=[0,700])
diff --git a/qt/ESB_MX_exp.ui b/qt/ESB_MX_exp.ui
index 57fb708..7300c89 100644
--- a/qt/ESB_MX_exp.ui
+++ b/qt/ESB_MX_exp.ui
@@ -7,7 +7,7 @@
0
0
776
- 681
+ 706
@@ -49,37 +49,17 @@
20
70
725
- 480
+ 504
-
-P=$(P),M=MOT_FY;
-P=$(P),M=MOT_FX;
-P=$(P),M=MOT_ROT_Y;
-P=$(P),M=MOT_CX;
-P=$(P),M=MOT_CZ;
-P=$(P),M=MOT_WEDGE1;
-P=$(P),M=MOT_WEDGE2;
-P=$(P),M=MOT_WEDGE3;
-P=$(P),M=MOT_WEDGE4;
-P=$(P),M=MOT_WEDGEX;
-P=$(P),M=MOT_WEDGEY;
-P=$(P),M=MOT_WEDGEA;
-P=$(P),M=MOT_WEDGEB;
-P=$(P),M=MOT_BLGT;
-P=$(P),M=MOT_CRYO;
-P=$(P),M=MOT_GIR_X;
-P=$(P),M=MOT_GIR_Y;
-P=$(P),M=MOT_GIR_U;
-P=$(P),M=MOT_GIR_V;
-P=$(P),M=MOT_GIR_W
+ P=$(P),M=MOT_FY;P=$(P),M=MOT_FX;P=$(P),M=MOT_ROT_Y;P=$(P),M=MOT_CX;P=$(P),M=MOT_CZ;P=$(P),M=MOT_WEDGE1;P=$(P),M=MOT_WEDGE2;P=$(P),M=MOT_WEDGE3;P=$(P),M=MOT_WEDGE4;P=$(P),M=MOT_WEDGEX;P=$(P),M=MOT_WEDGEY;P=$(P),M=MOT_WEDGEA;P=$(P),M=MOT_WEDGEB;P=$(P),M=MOT_BLGT;P=$(P),M=MOT_CRYO;P=$(P),M=MOT_GIR_X;P=$(P),M=MOT_GIR_Y;P=$(P),M=MOT_GIR_U;P=$(P),M=MOT_GIR_V;P=$(P),M=MOT_GIR_W;P=$(P),M=MOT_DET_Z
ESB_MX_motor.ui
- 20
+ 21
@@ -215,7 +195,7 @@ P=$(P),M=MOT_GIR_W
20
- 590
+ 620
121
22
@@ -237,7 +217,7 @@ P=$(P),M=MOT_GIR_W
160
- 590
+ 620
121
24
@@ -266,7 +246,7 @@ P=$(P),M=MOT_GIR_W
170
- 560
+ 590
100
22
@@ -288,7 +268,7 @@ P=$(P),M=MOT_GIR_W
30
- 620
+ 650
100
22
@@ -307,7 +287,7 @@ P=$(P),M=MOT_GIR_W
20
- 560
+ 590
121
22
@@ -329,7 +309,7 @@ P=$(P),M=MOT_GIR_W
160
- 620
+ 650
151
30
@@ -371,7 +351,7 @@ P=$(P),M=MOT_GIR_W
340
- 620
+ 650
151
30
@@ -413,7 +393,7 @@ P=$(P),M=MOT_GIR_W
340
- 580
+ 610
151
30
@@ -455,7 +435,7 @@ P=$(P),M=MOT_GIR_W
510
- 580
+ 610
151
30