Why when I motion chain my turns in LemLib it overshoots no matter how i tune PID

chassis.turnToHeading(90, 1000, {.maxSpeed = 50, .minSpeed=50, .earlyExitRange=1});
when I use this or any other line of code that includes a turn and a motion chain it will make my turn way overshoot. I can’t fix it with tuning and I don’t know why it does this.

Hi,

This is because you are setting a minSpeed, the idea behind min speed is that the robot doesnt stop between motions, hence the chaining. By setting a minSpeed but not having a second motion the robot turns to the desired heading, caping its minimum speed at your desired speed, then when it exits it coasts, giving you that overshoot.

Hope that helps,

Andrew
2131H Programming Dep.

Ps. I suggest asking questions on the lemlib discord, they generally are quicker to respond.

2 Likes