Switching Between Closed Loop and Open Loop

We didn’t take advantage of any closed loop functions on the Talon SRX or SparkMax last year. Our team is anticipating using either Motion Magic or REV Smart Motion (depends on when our Falcons arrive) during an autonomous period this year.

My question is after enabling closed loop functionality for a drivetrain in autonomous, do you need to disable this feature in teleop? I’m seeing the command SetControlMode for the Talons, which I imagine is what I would need, but I can’t seem to locate a similar command in the SparkMax API.

edit: We use C++

From the phrasing of your question, it sounds like you do not intend to use closed-loop in teleop. If this is what you want to do, note that setReference() allows you to change the control mode.

You are correct, no intention of closed loop on drivetrain in teleop (unless game dictates something else).

SetReference is the solution (just confused me, as this seemed like a command only for PID controllers)

In the CTRE library, there’s the set method so you don’t actually have to use SetControlMode.

CPP set method

Java set method

In the CTRE library, the set method takes a ControlMode which you can change between things such as PercentOutput, Position, Velocity, etc.

I find this intuitive because whenever you send a control command to the motor, you have to explicitly specify how you want that to be controlled.

Anyway, just thought I’d add this just in case someone found this thread looking for stuff about Talons or Victors (and now Falcons).

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.