     
     if (results[RC_ESTP] == HIGH)
     {
-        E_Stop();
+        E_Stop();  // already done at interrupt level
         if ((results[RC_AUTO] == LOW)  && (NUMBER_CHANNELS > 5)) // under RC control
             steer(results[RC_TURN]);
         Serial.println("Exiting processRC due to E-stop.");

            + D_tune * extrapolated_error;
  if (PID_error > speed_tolerance_mmPs)
  {  // too fast
    long throttle_decrease = (FullThrottle - MinimumThrottle) * PID_error / max_error_mmPs;
    throttle_control -= throttle_decrease;
    if (throttle_control < MinimumThrottle)
        throttle_control = MinimumThrottle;
    moveVehicle(throttle_control);
    
    long brake_increase = (NoBrake - FullBrake) * PID_error / max_error_mmPs;
    // NoBrake = 207; FullBrake = 167; 
    brake_control -= brake_increase;
    if (brake_control < FullBrake)
        brake_control = FullBrake;
    brake(brake_control);
  }
  else if (PID_error < speed_tolerance_mmPs)
  {  // too slow
    long throttle_increase = (FullThrottle - MinimumThrottle) * PID_error / max_error_mmPs;
    throttle_control += throttle_increase;
    if (throttle_control > FullThrottle)
        throttle_control = FullThrottle;
    moveVehicle(throttle_control);
    
    // release brakes
    long brake_decrease = (NoBrake - FullBrake) * PID_error / max_error_mmPs;
    // NoBrake = 207; FullBrake = 167; 
    brake_control += brake_decrease;
    if (brake_control > NoBrake)
        brake_control = NoBrake;
    brake(brake_control);
  }
  // else maintain current speed
  Serial.print("\tThottle Brake \t");  // csv for spreadsheet
  Serial.print(throttle_control);
  Serial.print("\t");
  Serial.print(brake_control);
  Serial.print("\t");
  Serial.print(drive_speed_mmPs);  Serial.print("\t");
  Serial.println(sensor_speed_mmPs); 
}

/*---------------------------------------------------------------------------------------*/


    //Serial.print("loop elapsed time = ");
    //Serial.println(elapsedTime);
    
    LogData(local_results, &Results);  // data for spreadsheet
    
    calibrationTime_ms += LOOP_TIME_MS;
    straightTime_ms = (steer_control == STRAIGHT_TURN_OUT)? straightTime_ms + LOOP_TIME_MS: 0;
    stoppedTime_ms = (throttle_control == MIN_ACC_OUT)? stoppedTime_ms + LOOP_TIME_MS: 0;
    if (calibrationTime_ms > 40000 && straightTime_ms > 3000 && stoppedTime_ms > 3000)
    {
         int oldBrake = brake_control;
         brake(MAX_BRAKE_OUT);  // put on brakes
         CalibrateTurnAngle(16, 10);  // WARNING: No response to controls while calibrating
         brake(oldBrake);       // restore brake state
         calibrationTime_ms = 0;
    }
    
    // Did we spend long enough in the loop that we should immediately
    // start the next pass?
