Hi everybody I need help with a small problem, i am using baby orangutan b328, sensors 8QTRC, and two motor 10:1;
i am programing in Arduino IDE with the library of QTR and OrangutanMotors
void loop()
{
///////////
unsigned int sensors[6];
///////////
int position= qtr.readLine(sensors);
//////////
int error = position - 2500;
///////////
int motorSpeed = KP * error + KD * (error - lastError);
///////////
lastError = error;
////
int M1=80;
int M2=80;
///////////
int m1Speed = M1 + motorSpeed;
int m2Speed = M2 - motorSpeed;
///////////
if (m1Speed <0)
m1Speed = 0;
if (m2Speed <0)
m2Speed = 0 ;
/////////
//////////
motors.setSpeeds(m1Speed, -m2Speed);
I need help, how make that my follower aplicate brakes in the curves, my follower is ok when follows straight line but when is a curve, it is unstable.