Skip to content

Difference between "slotIdx" and "pidIdx" #33

@Wibis428

Description

@Wibis428

There are a handful of functions that require either a "slot index" (slotIdx) or a "pid index" (pidIdx) parameter:

talon.configSelectedFeedbackSensor(FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs);

talon.setSelectedSensorPosition(int sensorPos, int pidIdx, int timeoutMs);

talon.selectProfileSlot(int slotIdx, int pidIdx);

talon.config_kp(int slotIdx, double value, int timeoutMs);

talon.configAllowableClosedLoopError(int slotIdx, int allowableClosedLoopError, int timeoutMs)

From what I've read in the documentation, the talon is capable of storing 4 different "Motor Control Profiles" (pg. 72 of software reference manual). One motor control profile consists of one set of PID loop gains and a few other closed-loop preferences. Am I correct in assuming slotIdx refers to one of these motor control profiles? This makes sense to me, as talon.config_kp() and talon.configAllowableClosedLoopError() would need to know which motor control profile to apply the config to.

As for pidIdx, the only documentation I can find says that pidIdx should be "0 for primary closed loop, 1 for cascaded closed loop". I can't find anywhere where it's specified what this actually means, so I don't understand why talon.configSelectedFeedbackSensor(), talon.setSelectedSensorPosition(), and talon.selectProfileSlot() require this parameter. In every example usage I've seen of functions that require pidIdx, it's always passed in as 0 and never as 1. What's the point of this parameter, and how is it different than slotIdx?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions