-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Currently in Closed Loop Control the motor configuration sets PID values for both position and velocity as follows:
/*
* Configure the closed loop controller. We want to make sure we set the
* feedback sensor as the primary encoder.
*/
motorConfig.closedLoop
.feedbackSensor(FeedbackSensor.kPrimaryEncoder)
// Set PID values for position control. We don't need to pass a closed loop
// slot, as it will default to slot 0.
.p(0.1)
.i(0)
.d(0)
.outputRange(-1, 1)
// Set PID values for velocity control in slot 1
.p(0.0001, ClosedLoopSlot.kSlot1)
.i(0, ClosedLoopSlot.kSlot1)
.d(0, ClosedLoopSlot.kSlot1)
.velocityFF(1.0 / 5767, ClosedLoopSlot.kSlot1)
.outputRange(-1, 1, ClosedLoopSlot.kSlot1);It seems that slot 0 is intended only for position control and slot 1 only for velocity control. This could cause confusion for users who might think both slots can be used interchangeably for different control modes.
The same code snippet is also shown in the official documentation: REV Robotics Closed Loop Control Getting Started
.
Metadata
Metadata
Assignees
Labels
No labels