L298N same pwm input , different voltage output

Hi
I was working on a robot which had to follow a black line as part of its work , but I noticed among countless other problems , my L298N was producing different voltages on two motors with the same pwm input.

So I added a part to my code just to confirm , and it was confirmed. My pwm output value was 100 , which meant around 1.9 volts . I checked with a multimeter and both L298 pins were receiving 1.9 volts.

Then I checked the motor outputs , and they had a difference of about 2 volts , which explained the visible and audible difference in the motors' RPM.

I checked a similar thread on this forum but OP has't mentioned what finally solved the problem.
But he was told to make sure he was using pwm pins with the same frequency , but I believe that is not my problem since I am using D4 and D7 on Mega for my pwm values and 2,3,5,6 for the digital controlling pins on the L298 (Im not using pwm on 2,3,5,6)

the same user had also posted on stackexchange and he was told that L298 itself is "old and unreliable" and this issue could actually be because of that.

after all this I am wondering which one could be the case in my situation as this seems uncommon to me , I have used L298 previously in similar projects and Ive never had such an issue (the very same L298 in some cases) , which makes me dubious on the L298 being the very issue.
On the other hand , everything seems fine before and after the L298 - pwm input is 1.9 volts and somehow output voltage is 2V different which is not minor .

Thanks!

Arman5592:
So I added a part to my code just to confirm , and it was confirmed. My pwm output value was 100 , which meant around 1.9 volts . I checked with a multimeter and both L298 pins were receiving 1.9 volts.

That's an average. The PWM signal is a block wave, 0-5V. Connect a scope and you'll see it.

The L298N is indeed a very old design, and should be considered obsolete. It drops about 2V by itself. So when you have 12V power supply, its output is just 10V.

Get a TB6612FNG or DRV883x H-bridge and you don't have that drop.

Thanks! Ill try to find one.
in the meanwhile the sensors themselves somehow manage to keep the robot on the line , but at some points that 2v difference does make a difference (such as trying to maintain a straight line)

Did you switch the motors right to left to see if there is a difference? One motor may have more or less drag than the other.

thanks!
actually I havent tried that. But right now apparently the robot is working (basically because it removes any error it produces because of the sensors) and the lines it follows are seldom straight so it doesnt make much of a difference in practice.

Arman5592:
it removes any error it produces because of the sensors

Well that's pretty much the purpose of closed-loop control isn't i, and you've obviously done very good job of implementing that.

As a matter of interest, the two different voltages at the L298 outputs, is that loaded with their motors running, or unloaded with the motors disconnected?