Skip to content

Commit db43414

Browse files
authored
Merge pull request #303 from thedropbears/retune_arm
update wrist pid
2 parents 214ac1e + f18cbc1 commit db43414

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/wrist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class WristComponent:
2727
12.0 / 20.0
2828
) * 350.628 # not remeasured and just adjusted by the change in gear reduction
2929
TOLERANCE = math.radians(3.0)
30-
VEL_TOLERANCE = 0.05
30+
VEL_TOLERANCE = math.radians(6.0)
3131

3232
def __init__(self, mech_root: wpilib.MechanismRoot2d):
3333
self.wrist_ligament = mech_root.appendLigament(
@@ -49,8 +49,8 @@ def __init__(self, mech_root: wpilib.MechanismRoot2d):
4949
self.wrist_profile = TrapezoidProfile(
5050
TrapezoidProfile.Constraints(self.WRIST_MAX_VEL, self.WRIST_MAX_ACC)
5151
)
52-
# theoretical max pos 0.01 max velocity 0.1
53-
self.pid = PIDController(Kp=37.129, Ki=0, Kd=0.091477)
52+
# theoretical max pos 0.01 max velocity 0.05
53+
self.pid = PIDController(Kp=19.508, Ki=0, Kd=0.048599)
5454

5555
# https://www.reca.lc/arm?armMass=%7B%22s%22%3A8%2C%22u%22%3A%22kg%22%7D&comLength=%7B%22s%22%3A0.15%2C%22u%22%3A%22m%22%7D&currentLimit=%7B%22s%22%3A40%2C%22u%22%3A%22A%22%7D&efficiency=90&endAngle=%7B%22s%22%3A-10%2C%22u%22%3A%22deg%22%7D&iterationLimit=10000&motor=%7B%22quantity%22%3A1%2C%22name%22%3A%22NEO%22%7D&ratio=%7B%22magnitude%22%3A432%2C%22ratioType%22%3A%22Reduction%22%7D&startAngle=%7B%22s%22%3A-110%2C%22u%22%3A%22deg%22%7D
5656
self.wrist_ff = ArmFeedforward(kS=0.42619, kG=0.45, kV=4.10, kA=0.01)

0 commit comments

Comments
 (0)