Index: drsdaq/HVFeedback.cc
===================================================================
--- drsdaq/HVFeedback.cc	(revision 132)
+++ drsdaq/HVFeedback.cc	(revision 140)
@@ -64,4 +64,5 @@
     ReadCard("DefaultResponse",      Response,      	 'f', File, m->NumBoards*kNumberOfChips*kNumberOfChannels);
     ReadCard("DefaultTarget",        Target,      	 'f', File, m->NumBoards*kNumberOfChips*kNumberOfChannels);
+    // Add also initial gain to configuration parameters
     fclose(File);
   }
@@ -69,5 +70,5 @@
  
   // Initial state
-  Gain = 1;
+  Gain = 0.2;
   SetFBMode(FB_Off);
   SetNumAverages(fDefaultNumAverage);
@@ -112,5 +113,5 @@
 bool HVFeedback::ProcessEvent() {
   int i,j,k,q;
-  float Correction, Integral, Difference, EffectiveGain;
+  float Correction, Integral, Difference;
   
   // Check for LED trigger channel on given channel and if feedback running
@@ -153,7 +154,6 @@
 	  case FB_Active:   // Determine correction from response maxtrix and change voltages
     	    Difference = Target[i][j][k] - Average[i][j][k];
-	    EffectiveGain = Gain*pow(0.5*(1+(Difference/Sigma[i][j][k]-1)/(Difference/Sigma[i][j][k]+1)),2);
-	    Correction = -Difference*Response[i][j][k]*EffectiveGain;
-    	    if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1;   // Limit changes to 100 mV
+	    Correction = -Difference*Response[i][j][k]*Gain;
+    	    //if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1;   // Limit changes to 100 mV
             if(Correction!=0 && Target[i][j][k]!=0 && !PixMap->DRS_to_Pixel(i,j,k).empty()) {
               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);
Index: drsdaq/History.txt
===================================================================
--- drsdaq/History.txt	(revision 132)
+++ drsdaq/History.txt	(revision 140)
@@ -56,2 +56,3 @@
 23/9/2009   Fixed bug in RawDataCTX.cc: sequential event number in a file is only
     	    the same as the event number in the run for the first file part
+16/12/2009  Removed automatic gain adaption in feedback (caused spikes in the correction)
