Archive

Phoenix 6 Migration

Pheonix 5 APi is officially deprecated

Phoenix 6 PID reference in converting PID gains: https://pro.docs.ctr-electronics.com/en/latest/docs/api-reference/device-specific/talonfx/basic-pid-control.html

Everything is now in rotations/sec therefore we can remove the conversion to encoder tics per 100 ms

Cancoder offsets Debugging

Possible Causes:

Getting encoder offsets

(this should be its own wiki page once we get it solidified with good screen shots)

Requirements

Steps

Intake Logic

image.png

We need to ensure the direction of the motor is correct before we go.

Take a look at runPivot() within Intake() which uses the limit switches to protect the mechanism

State Machine

Review state machines with this video: https://www.youtube.com/watch?v=-Yicg2TTMPs&ab_channel=MATLAB

We have a state machine for our pivot. Check out the states defined in intake

Then look how the states are defined within periodic()

You will now need to implement the command PivotRetract by changing the state of the pivot;

Intake command

there are a few additional commands that need to be implements for our intake command to function

Take a look at the TODO and implement those commands.

LoggedTunableNumbers

test you work if it performs correctly change your hardcoded numbers into LoggedTunableNumbers so we can easily change the following