Recently I’ve been working on a new drive system that will allow our robot to drive very smooth this year. I learned of trapezoidal profiling and was thinking of integrating that technique into our drive code this year to achieve this. My main goal is to create a class that will take a polar coordinate as a position input and compute the necessary means of getting to that point in a smooth fashion. Could anybody help me in determining how to go about doing this?
PS: if there is a way to implement PID loops into this that would be awesome.
I am using the relative coordinates. What I did was use these equations: magnitude= (rightDistance + leftDistance)/2 and angle = (rightDistance - leftDistance)/wheelContactWidth to derive the left and right wheel distances that the robot needs to travel to get to the proper coordinate and then I just feed those values to two PID controllers (one for each motor). We are using a tank drive system. I know that the Integral controller would work a little, however I think that a trapezoidal profile would work better.