Skip to content

Commit

Permalink
modified maximum angle, pid, ff
Browse files Browse the repository at this point in the history
  • Loading branch information
LeanMeanBeanMachine4774 committed Feb 3, 2025
1 parent 1139185 commit ad8accc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/wrist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import time

from magicbot import feedback, tunable
from magicbot import feedback
from rev import (
SparkMax,
SparkMaxConfig,
Expand All @@ -17,12 +17,11 @@
class WristComponent:
ENCODER_ZERO_OFFSET = 4.427696
MAXIMUM_DEPRESSION = math.radians(-113.0)
MAXIMUM_ELEVATION = math.radians(-10.0)
MAXIMUM_ELEVATION = math.radians(0)
NEUTRAL_ANGLE = math.radians(-90.0)

WRIST_MAX_VEL = math.radians(30.0)
WRIST_MAX_ACC = math.radians(15.0)
angle_change_rate_while_zeroing = tunable(math.radians(0.1))
wrist_gear_ratio = 350.628
TOLERANCE = math.radians(3.0)

Expand All @@ -43,9 +42,9 @@ def __init__(self):
TrapezoidProfile.Constraints(self.WRIST_MAX_VEL, self.WRIST_MAX_ACC)
)
# Values need to be modified with new gear ratio
self.pid = PIDController(Kp=7.6813, Ki=0, Kd=69.887)
self.pid = PIDController(Kp=13.387, Ki=0, Kd=0.0078403)

self.wrist_ff = ArmFeedforward(kS=0.42619, kG=0.09, kV=8.42, kA=0.0)
self.wrist_ff = ArmFeedforward(kS=0.42619, kG=0.13, kV=6.83, kA=0.0)

wrist_config.encoder.positionConversionFactor(
math.tau * (1 / self.wrist_gear_ratio)
Expand Down

0 comments on commit ad8accc

Please sign in to comment.