You mean one to 3 in a row? If there are too many in a row, the servo signal won't get refreshed in time.the if seems to only be able to ignore one to three 0s
This code will continue to refresh using the last good value:
void loop()
{
readPWM(READ_PIN);
Serial.println(freq);
Serial.println(duty);
if (duty != 0) // if value is non-zero - map to a servo position
{
val = map(duty, 0, 50, 0, 90); // scale the duty cycle to the range of servo motion
}
myservo.write(val); // sets the servo position according to the scaled value
delay(15);
}