Skip to content

Commit

Permalink
try something like this
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jan 23, 2025
1 parent 7ceed32 commit 9072e44
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@


def get_long_tune(CP, params):
kiBP = [0.]
kiBP = [0., 5.]
if CP.carFingerprint in TSS2_CAR:
kiV = [0.25]
kiV = [0.5, 0.25]

else:
kiBP = [0., 5., 35.]
Expand Down Expand Up @@ -218,7 +218,9 @@ def update(self, CC, CS, now_nanos):
prev_aego = self.aego.x
self.aego.update(a_ego_blended)
j_ego = (self.aego.x - prev_aego) / (DT_CTRL * 3)
a_ego_future = a_ego_blended + j_ego * 0.5

future_t = float(np.interp(CS.out.vEgo, [0., 5.], [0.25, 0.5]))
a_ego_future = a_ego_blended + j_ego * future_t

if actuators.longControlState == LongCtrlState.pid:
# constantly slowly unwind integral to recover from large temporary errors
Expand Down

4 comments on commit 9072e44

@ntegan1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

0000017c--125ee11c6f

tried this yesterday wondering if it would help my (seemingly ki-caused) oscillations.
ki of 1.
seems i need a ki of closer to 0.5 in the 15mph -> 40mph range to reduce oscillation but maybe need higher ki for good
(tssp corolla, sdsu, no pedal)

@ntegan1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

looks like more of an overshoot of aego relative to actuators output accel with aego moving average (40 window) filter removed

@ntegan1
Copy link

@ntegan1 ntegan1 commented on 9072e44 Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0000017b--c427ab2a53

I was impressed with the braking at a stop light here

not sure if this branch has an affect on feedforward, but looks like aego may have followed output accel with smaller delay than usual?

Image

Image

might try 0.5 instead of 1. for my tssp ki

@ntegan1
Copy link

@ntegan1 ntegan1 commented on 9072e44 Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0000017d--58125023d

nice smooth stop with ki = 0.5

406555750-6abd6002-8f57-485b-b4b7-1081311f917c.mp4
2025-01-24.14-13-19.mp4

pretty good ramp up from 20mph to 37mph and slowdown ~ 50 seconds into the 01:23 minute video

can see a bit of oscillation on the straightaways but with ki at 0.5, not too bad to where the oscillation is visible in vEgo

Please sign in to comment.