Problem with encoding asservissement with one motor but not the other.???

Also, when I block my two motors the tension increases and when I let go, they try to force themselves to return to their enslaved speeds.They make
Which is normal.

But when I block the two engines longer until their maximum output value is reached(255), the left engine doesn’t look for returning to it “asservissement speed” enslaved speed. It stop, It doesn’t force anymore wheras the right motor is trying.
It’s only when I let go the right engine that it “unblocks” the left engine which returns to its setpoint.

There I think that the detected speed of the right engine influences the calculation or maybe the input of attachinterrupt of the left engine.

How to get rid off this mistake?

Maybe improve the program in void wheelspeed or using a mask in order the program reads only changes in interrupt 1 for motor with the interrupt 1 and interrupt 0 for motor with interrupt 0 as I have seen in this program below but I don’t know to put it in my program.

void counter()
  byte state=PIND;
  state|=B11101011;  // mask pour ne regarder que les changements sur 2 et 4 
  // Modifier le MASK  B01111011 par BXXXXXXXX mettre des 0 là où sont les pins utilisés par l'encodeur
  if( state!=laststate)
    (((state&(1<< ENCODEURDROITA))>> ENCODEURDROITA)^((state&(1<< ENCODEURDROITB))>>ENCODEURDROITB))?count--:count++;

I attach my program entirely if you see something to improve void wheelspeed.

Thanks a lot for yours highlighting!

A_BUNOPERFECT.4.ino (7.64 KB)

Google translate struggled a bit there, didn't it?

Also posted in the French section.