I have an arduino mega and 2 dc motors and my problem is that when I set PWM_right in value=200 and PWM_left in value=255 ,both motors rotate in value=200(I'm sure about it ,beacuse when I set both of them in value=255 ,motors rotate faster).For example this is my code:
I tested the circuit and the code many times,but I do not know what is happenning.
It would be a good idea if you make a simple pencil drawing derived from your own system and post a photo of the drawing. Don't worry if you are not an artist. See this Simple Image Guide
Often when making a drawing things get shown up that might help with the problem.
Details of exactly what components you are using and what you are using to power the motors will also be important.
When I set value=255 in PWM_left and value=0 in PWM_right and call FORWARD in void loop() ,then left motor rotate in max speed and right motor stop ,but when when I set value=0in PWM_left and value=255 in PWM_right and call FORWARD in void loop() ,then both motors rotate in max speed (value=255).
What sort of 9v battery are you using? If it is one of the small PP3 style smoke alarm batteries it is quite useless - they cannot provide enough current. Try a pack of 6 x AA alkaline cells.
Exactly what motors are you using? How much current do the motors need?
When I set value=255 in PWM_left and value=0 in PWM_right and call FORWARD in void loop() ,then left motor rotate in max speed and right motor stop(works good) ,but when when I set value=0in PWM_left and value=255 in PWM_right and call FORWARD in void loop() ,then both motors rotate in max speed (value=255).It's irrational...
You're calling FORWARD() over and over again very rapidly in loop() which may not be letting the PWM get started properly. Try either putting the call at the end of setup() or at least putting a 2 or 3 second delay() after it in loop() and see if that changes anything.