Changeset 13691


Ignore:
Timestamp:
05/13/12 11:58:20 (13 years ago)
Author:
tbretz
Message:
Added temperature and user offset to deviation service.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/feedback.cc

    r13557 r13691  
    182182            fAppliedOffset += dUt;
    183183
    184         vector<float> vec(2*BIAS::kNumChannels);
     184        vector<float> vec(2*BIAS::kNumChannels+2);
    185185        for (int i=0; i<BIAS::kNumChannels; i++)
    186186            vec[i+BIAS::kNumChannels] = fAppliedOffset;
     187
     188        vec[BIAS::kNumChannels*2]   = dUt;
     189        vec[BIAS::kNumChannels*2+1] = fBiasOffset;
    187190
    188191        double avg[2] = {   0,   0 };
     
    255258                // Offset induced by the voltage above the calibration point
    256259                const double dI = U0/Ravg[i]; // [V/Ohm]
    257 
     260 
    258261                // Offset at the calibration point (make sure that the calibration is
    259262                // valid (Im[i]>Iavg[i]) and we operate above the calibration point)
    260                 const double I = Im>Iavg[i] ? Im - Iavg[i] : 0; // [uA]
     263                const double I = Im>Iavg[i] ? Im - Iavg[i] : 0; // [A]
    261264
    262265                // Make sure that the averaged resistor is valid
     
    590593         */
    591594
    592         vector<float> vec(2*BIAS::kNumChannels);
     595        vector<float> vec(2*BIAS::kNumChannels+2);
    593596        for (int i=0; i<BIAS::kNumChannels; i++)
    594597            vec[i] = fPV[2][i]-fSP[i];
     
    725728
    726729        vector<float> vec;
    727         vec.reserve(2*nch);
     730        vec.reserve(2*nch+2);
    728731        vec.insert(vec.begin(),     nch, fPV[2][0]-fSP[0]);
    729732        vec.insert(vec.begin()+nch, nch, correction[0]);
     733        vec.push_back(0);
     734        vec.push_back(0);
    730735
    731736        fDimDeviation.setQuality(fControlType);
     
    928933        fSP = valarray<double>(0., BIAS::kNumChannels);
    929934
    930         vector<float> vec(2*BIAS::kNumChannels);
     935        vector<float> vec(2*BIAS::kNumChannels+2);
     936        vec[2*BIAS::kNumChannels+1] = fBiasOffset;
    931937        fDimDeviation.setQuality(kIdle);
    932938        fDimDeviation.Update(vec);
     
    950956        WarnState(false, true);
    951957
     958        fBiasOffset = 0;
    952959        ResetData(evt.GetShort());
    953960
     
    964971        WarnState(false, true);
    965972
     973        fBiasOffset = 0;
    966974        ResetData(evt.GetShort());
    967975
     
    10041012        WarnState(true, false);
    10051013
     1014        fBiasOffset = evt.GetFloat();
    10061015        ResetData(0);
    1007 
    1008         fBiasOffset = evt.GetFloat();
    10091016        fControlType = kCurrents;
    10101017
     
    12401247                      "Amplitude reference value(s)"
    12411248                      "Vref[mV]:Amplitude reference"),
    1242         fDimDeviation("FEEDBACK/DEVIATION", "F:416;F:416",
     1249        fDimDeviation("FEEDBACK/DEVIATION", "F:416;F:416;F:1;F:1",
    12431250                      "Control loop information"
    12441251                      "|DeltaAmpl[mV]:Amplitude offset measures"
    1245                       "|DeltaBias[mV]:Correction value calculated"),
     1252                      "|DeltaBias[mV]:Correction value calculated"
     1253                      "|DeltaTemp[mV]:Correction calculated from temperature"
     1254                      "|DeltaUser[mV]:Additional offset specified by user"),
    12461255        fDimCalibration("FEEDBACK/CALIBRATION", "F:416;F:416;F:416",
    12471256                        "Current offsets"
Note: See TracChangeset for help on using the changeset viewer.