- Updated drivers for delta tau, dornier choppers

- Fixed scan mode issue in hdbutil.tcl
- Added driver for the FOCUS Pfeiffer vacuum thing
This commit is contained in:
koennecke
2009-04-17 12:58:57 +00:00
parent f5a0744080
commit ab8c3dd720
5 changed files with 303 additions and 46 deletions

View File

@@ -7,6 +7,8 @@
# sendpmacread code -- pmacreadreply
# -- For setting standard parameters
# sendpmacwrite code -- pmacreadreply
# -- For reading limits
# sendpmaclim -- readpmaclim
# -- For reading the status
# pmacsendaxer --- pmacrcvaxerr -- pmacrcvpos -- pmacrcvstat
# This means we check for an axis error first, then update the position,
@@ -18,10 +20,7 @@
#
# copyright: see file COPYRIGHT
#
# TODO: after axiserror: terminate, when OK, again error where from
#
#
# Mark Koennecke, December 2008
# Mark Koennecke, December 2008, March 2009
#---------------------------------------------------------------
proc translatePMACError {key} {
set pmacerr(ERR001) "Command not allowed while executing"
@@ -61,6 +60,7 @@ proc translateAxisError {key} {
10 {return "MCU lim reached"}
11 {return "following error triggered"}
12 {return "EMERGENCY STOP ACTIVATED"}
13 {return "Driver electronics error"}
default { return "Unknown axis error $key"}
}
}
@@ -80,7 +80,9 @@ proc evaluateAxisStatus {key} {
9 -
10 -
11 {return run}
-4 {error "emergency status activated"}
-6 {error "Controller aborted"}
-5 {error "Axis is deactivated"}
-4 {error "emergency stop activated, please release"}
-3 {error "Axis inhibited"}
- 1
-2 {error "Incoming command is blocked"}
@@ -112,6 +114,22 @@ proc pmacreadreply {} {
}
return idle
}
#----------------------------------------------------------------------
proc sendpmaclim {code} {
sct send $code
return pmacreadlim
}
#-----------------------------------------------------------------------
proc pmacreadlim {motname} {
set status [catch {checkpmacresult} data]
if {$status != 0} {
sct geterror $data
} else {
set scale [hval /sics/${motname}/scale_factor]
sct update [expr $data * $scale]
}
return idle
}
#------------------------------------------------------------------------
proc sendpmacwrite {code} {
set value [sct target]
@@ -228,7 +246,7 @@ proc configurePMACStatus {motname num sct} {
proc pmacsendhardpos {motname num} {
hupdate /sics/$motname/status run
set value [sct target]
sct send "Q${num}01=$value M${num}=1"
sct send [format "P%2.2d23=0 Q%2.2d01=%12.4f M%2.2d=1" $num $num $value $num]
return rcvhardpos
}
#-------------------------------------------------------------------------
@@ -295,8 +313,16 @@ proc pmacrefrun {motorname sct num} {
#--------------------------------------------------------------------------
proc MakeDeltaTau {name sct num} {
MakeSecMotor $name
configurePMACPar $name hardlowerlim "Q${num}09" $sct
configurePMACPar $name hardupperlim "Q${num}08" $sct
hsetprop /sics/${name}/hardupperlim read "sendpmaclim I${num}13"
hsetprop /sics/${name}/hardupperlim pmacreadlim "pmacreadlim $name"
$sct poll /sics/${name}/hardupperlim 180
hsetprop /sics/${name}/hardlowerlim read "sendpmaclim I${num}14"
hsetprop /sics/${name}/hardlowerlim pmacreadlim "pmacreadlim $name"
$sct poll /sics/${name}/hardlowerlim 180
# configurePMACPar $name hardlowerlim "Q${num}09" $sct
# configurePMACPar $name hardupperlim "Q${num}08" $sct
configurePMACPar $name hardposition "Q${num}10" $sct
configurePMAChardwrite $name $num $sct
hfactory /sics/$name/numinmcu plain internal int
@@ -309,15 +335,16 @@ proc MakeDeltaTau {name sct num} {
makePMACPar $name offset "Q${num}07" $sct mugger
makePMACPar $name axisstatus "P${num}00" $sct internal
makePMACPar $name axiserror "P${num}01" $sct internal
makePMACPar $name poshwlimitactive "M${num}21" $sct internal
makePMACPar $name neghwlimitactive "M${num}22" $sct internal
makePMACPar $name liftaircushion "M${num}96" $sct internal
configurePMACStatus $name $num $sct
$name makescriptfunc halt "pmacHalt $sct $num" user
$name makescriptfunc refrun "pmacrefrun $name $sct $num" user
set parlist [list hardlowerlim hardupperlim hardposition scale_factor maxspeed \
commandspeed maxaccel offset axisstatus axiserror status]
set parlist [list scale_factor hardposition maxspeed \
commandspeed maxaccel offset axisstatus axiserror status poshwlimitactive \
neghwlimitactive liftaircushion hardlowerlim hardupperlim]
foreach par $parlist {
$sct queue /sics/$name/$par progress read
}
}
#===============================================================================
# Old stuff
#===============================================================================