All pages
Powered by GitBook
1 of 1

Loading...

Velocity Control Mode

Velocity Control uses the PID controller to run the motor at a set speed in RPM (or configured conversion factor units).

It is called in the same way as Position Control:

API Docs:

API Reference:

Want to control the acceleration of your velocity controller? See MAXMotion Velocity Control for an improved version of Velocity Control with more features and control.

Velocity Control mode will turn your motor continuously. Be sure your mechanism does not have any hard limits for rotation.

Velocity Loop constants are often of a very low magnitude, so if your mechanism isn't behaving as expected, try decreasing your gains.

setSetpoint
SetSetpoint
m_controller.setSetpoint(setPoint, ControlType.kVelocity);
using namespace rev::spark;

m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kVelocity);