Changeset 17190 for trunk/FACT++


Ignore:
Timestamp:
09/19/13 16:23:59 (11 years ago)
Author:
tbretz
Message:
Adapted script to new feedback states, take the slower ramping into account, also adapted the condition for the feedback being stable, it is stable when all patches have reached their nominal overvoltage.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/Main.js

    r17179 r17190  
    221221        return;
    222222
    223     this.ok = cnt==0;
    224 
    225     console.out("  DeltaUov=%.3f [N(>0.033V)=%d]".$(avg, cnt));
    226 }
    227 
    228 // DN:  Why is voltageOff() implemented as
    229 //      a method of a Subscription to a specific Service
    230 //      I naively would think of voltageOff() as an unbound function.
    231 //      I seems to me it has to be a method of a Subscription object, in order
    232 //      to use the update counting method. But does it have to be
    233 //      a Subscription to FEEDBACK/DEVIATION, or could it work with other services as well?
     223
     224    this.ok = cnt==0;// || (this.last!=undefined && Math.abs(this.last-avg)<0.002);
     225
     226    console.out("  DeltaUov=%.3f (%.3f) [N(>0.033V)=%d]".$(avg, Math.abs(this.last-avg), cnt));
     227
     228    this.last = avg;
     229}
     230
    234231service_feedback.voltageOff = function()
    235232{
     
    247244    {
    248245        dim.log("Switching voltage off.");
    249 
    250         this.ok = undefined;
    251246
    252247        // Supress the possibility that the bias control is
     
    260255    }
    261256
    262     dim.wait("BIAS_CONTROL", "VoltageOff", 60000);
     257    dim.wait("BIAS_CONTROL", "VoltageOff", 60000); // FIXME: 30000?
    263258
    264259    // FEEDBACK stays in CurrentCtrl when Voltage is off but output enabled
     
    305300
    306301    // Wait until voltage on
    307     dim.wait("BIAS_CONTROL", "VoltageOn", 60000);
    308 
    309     if (isOff)
    310         this.ok = false;
     302    dim.wait("BIAS_CONTROL", "VoltageOn", 60000); // FIXME: 30000?
     303
     304//    if (isOff)
     305//        this.ok = false;
    311306}
    312307
     
    324319    var now = new Date();
    325320
    326     v8.timeout(60000, func, this);
     321    this.last = undefined;
     322    this.ok = false;
     323    v8.timeout(4*60000, func, this); // FIMXE: Remove 4!
     324    this.ok = undefined;
    327325
    328326    if (irq)
     
    330328    else
    331329        dim.log("Voltage stable within limits");
    332 
    333     this.ok = undefined;
    334330}
    335331
     
    378374    //dim.send("FEEDBACK/STOP");
    379375    dim.send("FTM_CONTROL/STOP_TRIGGER");
     376
     377    dim.wait("FTM_CONTROL",  "Valid",        3000);
     378    dim.wait("FEEDBACK",     "Calibrated",   3000);
     379
    380380    dim.send("BIAS_CONTROL/DISCONNECT");
    381 
    382     dim.wait("FTM_CONTROL",  "Valid",        3000);
    383381    dim.wait("BIAS_CONTROL", "Disconnected", 3000);
    384     dim.wait("FEEDBACK",     "Calibrated",   3000);
    385382
    386383    var report = sub.get();
     
    808805        // It is unclear what comes next, so we better switch off the voltage
    809806        service_feedback.voltageOff();
     807
    810808        system_on = true;
    811809        dim.log("Task finished [STARTUP]");
     
    909907        console.out("");
    910908        break; // case "RATESCAN"
    911 
    912909
    913910    case "DATA":
Note: See TracChangeset for help on using the changeset viewer.