Skip to content

Commit

Permalink
use closed loop sign for feedforward ks
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienMorey committed Mar 10, 2024
1 parent 362c9cb commit 5ca12d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from phoenix6.hardware import TalonFX, CANcoder
from phoenix6.controls import VoltageOut, VelocityVoltage, PositionDutyCycle
from phoenix6.signals import InvertedValue, NeutralModeValue
from phoenix6.signals import InvertedValue, NeutralModeValue, StaticFeedforwardSignValue
from phoenix6.configs import (
ClosedLoopGeneralConfigs,
MotorOutputConfigs,
Expand Down Expand Up @@ -93,7 +93,14 @@ def __init__(

# configuration for motor pid
steer_pid = (
Slot0Configs().with_k_p(3).with_k_i(0).with_k_d(0.1).with_k_s(0.16784)
Slot0Configs()
.with_k_p(3)
.with_k_i(0)
.with_k_d(0.1)
.with_k_s(0.16784)
.with_static_feedforward_sign(
StaticFeedforwardSignValue.USE_CLOSED_LOOP_SIGN
)
)
steer_closed_loop_config = ClosedLoopGeneralConfigs()
steer_closed_loop_config.continuous_wrap = True
Expand Down

0 comments on commit 5ca12d5

Please sign in to comment.