   }
 
   //to reduce AMP spikes, smooth large power adjustments out
-  if (controltime.elapsed (100)) {
+  if (controltime.elapsed (50)) {
     if (p<c_motorp) c_motorp--;
     if (p>c_motorp) c_motorp++;
     if (v<c_motorv) c_motorv--;

// the more the readings will be smoothed, but the slower the output will
// respond to the input.  Using a constant rather than a normal variable lets
// use this value to determine the size of the readings array.
const int numReadings = 100;

int readings[numReadings];      // the readings from the analog input
int index = 0;                  // the index of the current reading

int s = MIDPOINT;

void setup(){

  Serial.begin(115200);

