PWM frequency on pin 11 is about 490Hz, on pin 6, about 980Hz, that could cause your speed difference. Did you do what jim-p told you?
I see you have the motor driver 5V input connected to the Arduino Vin.
That is completely wrong, I don't know how it ever worked and maybe you damaged all your boards.
It would be best to power the Arduino via Vin or the barrel jack with 9V or with 5V through he USB connector.
I swapped out the motors that are connected to motor a and motor b and motor a is still slower than motor b
Yes i have tried using pin 3 instead of 6 still the same problem
I have powered previous line following robots this way with no problem
So what is different beween this current set-up and the ones that worked?
Motor speed depends on friction, torque etc. I'd look into the car mechanics.
Only the battery and motors
I can't see how a diferent batery could cause the problem, so it must have something to do with the motors.
One of the motors has to run clockwise and the other counterclockwise when you want to go forwards or backwards. So maybe those motors run at different speeds depending on the direcion of rotation.
Tested the motors directly to the battery it spins the same what ever direction
Update i have figured out what is the cause of the problem its in the motor driver pins what ever pin i plug into ena its the pin that slows down for example if i plug pin 6 in which is motor a in the code motor a slows down if i plug pin 11 in ena which is motor b it slows down
Edit: after switching up my pins the issue still remains i can control which side of motor is slower than the other but i cannot sync them
Replaced the wires connecting the Arduino to the motor driver now it works just fine lol