Changeset 140 for drsdaq


Ignore:
Timestamp:
12/16/09 08:30:44 (15 years ago)
Author:
ogrimm
Message:
Removed automatic gain control in feedback
Location:
drsdaq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/HVFeedback.cc

    r110 r140  
    6464    ReadCard("DefaultResponse",      Response,           'f', File, m->NumBoards*kNumberOfChips*kNumberOfChannels);
    6565    ReadCard("DefaultTarget",        Target,             'f', File, m->NumBoards*kNumberOfChips*kNumberOfChannels);
     66    // Add also initial gain to configuration parameters
    6667    fclose(File);
    6768  }
     
    6970 
    7071  // Initial state
    71   Gain = 1;
     72  Gain = 0.2;
    7273  SetFBMode(FB_Off);
    7374  SetNumAverages(fDefaultNumAverage);
     
    112113bool HVFeedback::ProcessEvent() {
    113114  int i,j,k,q;
    114   float Correction, Integral, Difference, EffectiveGain;
     115  float Correction, Integral, Difference;
    115116 
    116117  // Check for LED trigger channel on given channel and if feedback running
     
    153154          case FB_Active:   // Determine correction from response maxtrix and change voltages
    154155            Difference = Target[i][j][k] - Average[i][j][k];
    155             EffectiveGain = Gain*pow(0.5*(1+(Difference/Sigma[i][j][k]-1)/(Difference/Sigma[i][j][k]+1)),2);
    156             Correction = -Difference*Response[i][j][k]*EffectiveGain;
    157             if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1;   // Limit changes to 100 mV
     156            Correction = -Difference*Response[i][j][k]*Gain;
     157            //if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1;   // Limit changes to 100 mV
    158158            if(Correction!=0 && Target[i][j][k]!=0 && !PixMap->DRS_to_Pixel(i,j,k).empty()) {
    159159              printf("Average of board %d, chip %d, channel %d is %.2f +/- %.2f    Correction %.3f\n",i,j,k,Average[i][j][k],Sigma[i][j][k],Correction);
  • drsdaq/History.txt

    r110 r140  
    565623/9/2009   Fixed bug in RawDataCTX.cc: sequential event number in a file is only
    5757            the same as the event number in the run for the first file part
     5816/12/2009  Removed automatic gain adaption in feedback (caused spikes in the correction)
Note: See TracChangeset for help on using the changeset viewer.