Quote:
Originally Posted by Tom Bottiglieri
The wheel controller which followed the trajectory basically looked like this (one running for each wheel, using the given wheel's path data:
Code:
double update() {
Segment step = follower.getNextSegment();
double motor = 0;
motor = (step.vel * K_vel) + (step.acc * K_acc) + (step.jerk * K_jerk);
motor += ((step.pos - getWheelPos()) * K_p);
return motor;
}
|
Very cool! Your last second change in the Einstein finals was exciting to watch, and the controlled s-curve was very impressive.
What I can gather from this code is that the motor speed for each side is first calculated with a feedforward term from the velocity, acceleration, and jerk, and then additionally a proportional feedback term is added using feedback from the actual encoder position. Is this correct?
If I'm reading it correctly, is there a reason why the feedforward velocity (the velocity, acceleration, and jerk sum) is calculated on the robot using the curve values rather than calculated beforehand and output as motor velocity values?