Position and Velocity Closed Loop Control

Hey, I’m working with the new sparks max and I want to know the difference between a position closed loop control and a velocity closed control loop.

Thanks.

Position closed loop reduces the difference between a measured position and a desired position of the mechanism.

Velocity closed loop reduces the difference between a measured velocity and a desired velocity of the mechanism.

They’re the same thing, just operating on a different order.

So if I want a chassis to run strate i use the velocity one.

If you use a velocity PID based on gyro rate, if you get bumped off course the PID will make sure angular velocity returns to 0, but won’t correct for what you knocked off by. If you use PID based on gyro angle, it will get back to the angle you were driving before being knocked off.

I want to use PID on the chassis so the two sides of the chassis are sync to the same velocity so i go straight when both sides at full power.

One thing to keep in mind is that without some sort of integrator or positional feedback coupled with velocity control, if you hit a disturbance, the robot won’t ever “catch up” to where you intend it to be.

There are three ways I have seen it done which I describe below (not to say there aren’t others). Note the difference between trajectory and path—trajectory is time parameterized, a path is not.

  1. A trajectory is pre-calculated (either deployed to the robot in a file or computed prior to the motion). Throughout the motion, position setpoints from the trajectory are sent from the RIO to the speed controller, which operates in position closed loop mode.
  2. A trajectory is again pre-calculated. Throughout the motion, there is a feedback mechanism running on the RIO which compares desired position along the trajectory to actual position. A corresponding velocity setpoint is then computed and sent from the RIO to the speed controller, which operates in velocity closed loop mode.
  3. There is some sort of real-time path following algorithm running on the RIO that looks at positional deviation from a desired path. An example of this would be the adaptive pure pursuit algorithm. A corresponding velocity setpoint is then computed and sent from the RIO to the speed controller, which operates in velocity closed loop mode.

I would recommend checking out 254’s motion planning presentation from 2015 champs if you haven’t already: https://docs.google.com/presentation/d/1xjtQ5m3Ay4AYxS_SfloF2n_vWZnCU25aXZuu9A59xPY/view