Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
SparkFlexConfig config = new SparkFlexConfig()
.closedLoop.pid(0.01, 0, 0.001);
spark.configure(config, ResetMode.kNoResetSafeParameters, PersistMode.kNoPersistParameters);SparkClosedLoopController closedLoopController = spark.getClosedLoopController();
closedLoopController.setSetpoint(10, ControlType.kVelocity); // 10 RPMm_controller.setSetpoint(setPoint, ControlType.kCurrent);using namespace rev::spark;
m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kCurrent);

m_controller.setSetpoint(setPoint, ControlType.using namespace rev::spark;
// Set the setpoint of the PID controller in raw position mode
m_controller.setSetpoint(setPoint, ControlType.kPosition);// Set the setpoint of the PID controller in raw position mode
m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kPosition);SparkFlexConfig config = new SparkFlexConfig();
// Set PID gains
config.closedLoop
.p(kP)
.i(kI)
.d(kD)
.outputRange(kMinOutput, kMaxOutput);using namespace rev::spark;
SparkFlexConfig config;
// Set PID gains
config.closedLoop
.P(kP)
.I(kI)
.D(kD)
.OutputRange(kMinOutput, kMaxOutput);SparkFlexConfig config = new SparkFlexConfig();
// Set PID gains
config.closedLoop.feedForward
.kS(s)
.kV(v)
.kA(a)
.kG(g) // kG is a linear gravity feedforward, for an elevator
.kCos(g) // kCos is a cosine gravity feedforward, for an arm
.kCosRatio(cosRatio); // kCosRatio relates the encoder position to absolute positionusing namespace rev::spark;
SparkFlexConfig config;
// Set PID gains
config.closedLoop.feedForward
.kS(s)
.kV(v)
.kA(a)
.kG(g) // kG is a linear gravity feedforward, for an elevator
.kCos(g) // kCos is a cosine gravity feedforward, for an arm
.kCosRatio(cosRatio); // kCosRatio relates the encoder position to absolute positionSparkMaxConfig config = new SparkMaxConfig();
// Set MAXMotion parameters
config.closedloop.maxMotion
.cruiseVelocity(cruiseVel)
.maxAcceleration(maxAccel)
.allowedProfileError(allowedErr);using namespace rev::spark;
SparkMaxConfig config;
// Set MAXMotion parameters
config.closedloop.maxMotion
.CruiseVelocity(cruiseVel)
.MaxAcceleration(maxAccel)
.AllowedProfileError(allowedErr);SparkFlexConfig config = new SparkFlexConfig();
config.closedLoop
// Set PID gains for position control in slot 0.
// We don't have to pass a slot number since the default is slot 0.
.p(kP)
.i(kI)
.d(kD)
.outputRange(kMinOutput, kMaxOutput)
// Set PID gains for velocity control in slot 1
.p(kP1, ClosedLoopSlot.kSlot1)
.i(kI1, ClosedLoopSlot.kSlot1)
.p(kD1, ClosedLoopSlot.kSlot1);using namespace rev::spark;
SparkFlexConfig config;
config.closedLoop
// Set PID gains for position control in slot 0.
// We don't have to pass a slot number since the default is slot 0.
.P(kP)
.I(kI)
.D(kD)
.OutputRange(kMinOutput, kMaxOutput)
// Set PID gains for velocity control in slot 1
.P(kP1, ClosedLoopSlot::kSlot1)
.I(kI1, ClosedLoopSlot::kSlot1)
.D(kD1, ClosedLoopSlot::kSlot1);// Use the PID gains in slot 0 for position control
m_controller.setSetpoint(setPoint, ControlType.kPosition, ClosedLoopSlot.kSlot0);
// Use the PID gains in slot 1 for velocity control
m_controller.setSetpoint(setPoint, ControlType.kVelocity, ClosedLoopSlot.kSlot1);using namespace rev::spark;
// Use the PID gains in slot 0 for position control
m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kPosition, ClosedLoopSlot::kSlot0);
// Use the PID gains in slot 1 for velocity control
m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kVelocity, ClosedLoopSlot::kSlot1);m_controller.setSetpoint(setPoint, ControlType.kPosition);using namespace rev::spark;
m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kPosition);

m_controller.setSetpoint(setPoint, SparkBase.ControlType.kMAXMotionPositionControl);using namespace rev::spark;
m_controller.SetSetpoint(setPoint, SparkBase::ControlType::kMAXMotionPositionControl);
SparkFlexConfig config = new SparkFlexConfig();
// Set PID gains
config
.closedLoop
.pid(0, 0, 0) // slot 0
.pid(0, 0, 0, ClosedLoopSlot.kSlot1) // slot 1
.feedForward
.kS(s) // slot 0 by default
.kV(v, ClosedLoopSlot.kSlot0) // slot 0 explicitly
.kA(a)
.kG(g) // Only use one of kG and kCos
.kCos(g)
.kCosRatio(cosRatio)
.sva(s, v, a, ClosedLoopSlot.kSlot1); // slot 1using namespace rev::spark;
SparkFlexConfig config;
// Set PID gains
config
.closedLoop
.pid(0, 0, 0) // slot 0
.pid(0, 0, 0, ClosedLoopSlot::kSlot1) // slot 1
.feedForward
.kS(s) // slot 0 by default
.kV(v, ClosedLoopSlot::kSlot0) // slot 0 explicitly
.kA(a)
.kG(g) // Only use one of kG and kCos
.kCos(g)
.kCosRatio(cosRatio)
.sva(s, v, a, ClosedLoopSlot::kSlot1); // slot 1// Set the setpoint of the controller in raw position mode, with a feedforward
m_controller.setSetpoint(
setPoint,
ControlType.kPosition,
0, // setpoint position
arbFeedForward
);using namespace rev::spark;
// Set the setpoint of the controller in raw position mode, with a feedforward
m_controller.SetSetpoint(
setPoint,
SparkBase::ControlType::kPosition,
0, // setpoint position
feedForward
);