Open didrif14 opened 6 years ago
Resolved. Turns out there is an error in the doleftPID() function.
input = p->Encoder - p->PrevEnc;
Perror =p->TargetTicksPerFrame + input;`
Should be:
input = p->Encoder - p->PrevEnc;
Perror =p->TargetTicksPerFrame - input;`
We are trying to use your modifications for our differential drive robot. The left encoder is giving us negative values, however when we modify the encoder_driver.ino with "0-left_enc_pos;" the left motor recieves 255 PWM singnal.
It fixes the encoder values, but it affects somthing else. Same thing happens if we change the encoder wires.
Do you have any tips on how to fix this issue?