Missing pulses!

There might be some minor issues with this code since its stripped from Swedish comments and the reading of other ports etc. But again, it works when going slow.

Some further background is that this instrument is going to be attached to the head of a barrel that's going to be shoved down 3-6 meters into the seafloor to gather a core samle.

#define MAX485_DE       2

char result;
float penetration=0;
float k=0.0025;

void setup() {
  Serial.begin(9600);              
  Serial3.begin(19200);
  pinMode(MAX485_DE, OUTPUT);       
  digitalWrite(MAX485_DE, 0);                   
}

void loop() {
  
 
    if (Serial3.available() > 0)          
    { 
      result = Serial3.read();                                
      if (result == 'A'){                  
        penetration +=k;
      }
      else if(result=='B'){                
        penetration -=k;
      }
      if(penetration< 0){                 
        penetration=0;
      }
      
    }
    Serial.println(penetration, 4);
    
}