Switch off spin flipper if voltage exceeds 34V in voltage control mode

r2939 | ffr | 2010-05-26 13:32:42 +1000 (Wed, 26 May 2010) | 2 lines
This commit is contained in:
Ferdi Franceschini
2010-05-26 13:32:42 +10:00
committed by Douglas Clowes
parent a0923650d9
commit 9926044c35
2 changed files with 25 additions and 14 deletions

View File

@@ -40,6 +40,8 @@ namespace eval ::scobj::rfgen {
variable RAMPSTART 2 variable RAMPSTART 2
variable RAMPBUSY 3 variable RAMPBUSY 3
variable RAMPTOZERO 4 variable RAMPTOZERO 4
variable FLIPOFF 5
variable MAXVOLTAGE 34
} }
## ##
@@ -139,8 +141,8 @@ proc ::scobj::rfgen::rdStatFunc {} {
variable RAMPSTART variable RAMPSTART
variable RAMPTOZERO variable RAMPTOZERO
variable RAMPIDLE variable RAMPIDLE
variable FLIPOFF
set MAXVOLTAGE 34 variable MAXVOLTAGE
set basePath [sct] set basePath [sct]
@@ -155,17 +157,6 @@ proc ::scobj::rfgen::rdStatFunc {} {
set statList [split $statStr "|="] set statList [split $statStr "|="]
mkStatArr stateArr $statList mkStatArr stateArr $statList
if {$stateArr(CV)} {
broadcast "WARNING: spin flipper has switched to voltage control"
if {$stateArr(voltage) >= $MAXVOLTAGE} {
set errMsg "ERROR: Spin flipper switched off voltage exceeds $MAXVOLTAGE in voltage control state, check vacuum"
sct geterror $errMsg
broadcast $errMsg
sct ramping $RAMPSTOP
return stateChange
}
}
if {$statList != [sct oldStateRep]} { if {$statList != [sct oldStateRep]} {
hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}] hset $basePath/flip_current [expr {$stateArr(curr) / 10.0}]
hset $basePath/flip_frequency $stateArr(freq) hset $basePath/flip_frequency $stateArr(freq)
@@ -176,6 +167,13 @@ proc ::scobj::rfgen::rdStatFunc {} {
sct utime readtime sct utime readtime
sct oldStateRep $statList sct oldStateRep $statList
} }
if {$currSuperState != $FLIPOFF && $stateArr(curr) > [sct currTol] && $stateArr(O) && $stateArr(CV)} {
broadcast "WARNING: spin flipper has switched to voltage control, voltage = $stateArr(voltage)"
if {$stateArr(voltage) >= $MAXVOLTAGE} {
sct ramping $FLIPOFF
}
}
return stateChange return stateChange
} }
@@ -187,6 +185,8 @@ proc ::scobj::rfgen::stateFunc {} {
variable RAMPSTART variable RAMPSTART
variable RAMPBUSY variable RAMPBUSY
variable RAMPTOZERO variable RAMPTOZERO
variable FLIPOFF
variable MAXVOLTAGE
set basePath [sct] set basePath [sct]
@@ -233,6 +233,17 @@ proc ::scobj::rfgen::stateFunc {} {
} }
return ramp return ramp
} }
$FLIPOFF {
sct targetCurr 0
sct OutputState 0
if { $stateArr(curr) <= [sct currTol] } {
sct ramping $RAMPSTOP
broadcast "ERROR: Spin flipper switched off voltage exceeds $MAXVOLTAGE in voltage control state, check vacuum"
return idle
} else {
return ramp
}
}
$RAMPSTOP { $RAMPSTOP {
# broadcast RAMPSTOP # broadcast RAMPSTOP
if [string match $currControlStatus "BUSY"] { if [string match $currControlStatus "BUSY"] {

View File

@@ -9,7 +9,7 @@ fileeval $cfPath(beamline)/sct_flipper.tcl
IP 137.157.202.86 IP 137.157.202.86
PORT 4001 PORT 4001
tuning 1 tuning 1
interval 5 interval 2
currtol 1 currtol 1
compCurr 1 compCurr 1
guideCurr 1 guideCurr 1