I have built a fast Line follower Robot using pololu qtr-8a sensor array, arduino mega and l293d motor driver chip. when i want to brake my car, i make the two Enable pins LOW and the four input pins to LOW
Something like,
analogWrite(10,0); // Enable A
analogWrite(11,0); // Enable B
digitalWrite(8,LOW); //IN A1
digitalWrite(9,LOW); //IN A2
digitalWrite(10,LOW); //IN B1
digitalWrite(11,LOW); //IN B2
But the motors seems to skid or slip and goes way forward than the place i expected to brake. Is there any way to apply hard brake or dynamic brake using the l293d chip so that i can make the car brake instantly where i want without any slip or skid?
The laws of physics prevent an instantaneous stop.
If the wheels are sliding, then you have exceeded the coefficient of friction.
Why do you want to stop so fast?
Edit: Maybe more the the point, do you understand why you cannot get an instant stop?
Using the motor driver brake function does not make it stop. It makes it apply physical resistance to the rotation. The motor and wheels will continue to rotate, but will have resistance and this results in slowing down the vehicle. That does not mean stop. It means slow down.
Are the wheels slipping? If so, you are not slowing down as quickly as possible. You might need to PWM the brake so apply less resistance, and prevent the loss of traction. But how much (what duty cycle of PWM) will depend on a lot of things, so there is likely no set amount of exact PWM that can be calculated ahead of time.