Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix TSS2 creep with higher stopping target #2508

Closed
wants to merge 1 commit into from

Conversation

pd0wm
Copy link
Contributor

@pd0wm pd0wm commented Nov 9, 2020

If these tuning values fix the TSS2 creep, and still provide smooth stopping I can put them in carParams so they can be tuned on a vehicle by vehicle basis.

Original discussion: #1270

I think we need to increase start/stopping speed as well to maintain the same resume speed from a stop. If these values work we also need to make sure we only change them for the vehicles that need it and keep other cars the same.

@pd0wm pd0wm changed the title harcoded hack to increase stopping target Try to fix TSS2 creep with higher stopping target Nov 9, 2020
@zorrobyte
Copy link
Contributor

zorrobyte commented Nov 9, 2020

I would argue that, off the cuff, these values differ per vehicle; especially between hybrid/non-hybrid braking systems.
It's been a long time since I've touched the state machine but if I remember correctly it could use a rewrite/refactor (such as releasing brakes 100% when creeping, then entering in the stopping condition again will ALWAYS jerk in current implementation in stop and go traffic, etc).

You want to modulate the brake pedal and allow the car to creep forward under own power without completely releasing the brake pedal, something that is impossible with current state machine. Maybe interp to lead distance would be the best way to handle this. (hint: expand the LongCtrlState.stopping function)

@briskspirit
Copy link
Contributor

This workaround won't help imho as I tested it.
In my opinion problem is that vEgo gets negative so "system"(longcontrol.py?) releases brakes and applies them again when vEgo = 0. Sorry if I am wrong, just trying to fix the same issue with my Corolla and started from longitudinal tuning, then found that MIN_CAN_SPEED is wrong for TSS2 Corolla (should be .375) and was checking this graph after each tune:

Capture

@pd0wm
Copy link
Contributor Author

pd0wm commented Dec 3, 2020

I don't think it has to do with the speed going negative.

What's interesting though is that the system briefly goes into CRUISE_STATE 11 when the wheel speeds hit zero. This in turn causes ACCEL_NET to jump up. Seems like they have some internal processing of our accel command, and going into certain states makes the actual braking lower than we command.

2020-12-03-152747_671x1140_scrot

@briskspirit
Copy link
Contributor

briskspirit commented Dec 3, 2020

Stopping brake rate 0.1:
f66032c2b5aa18ac 2020-12-03--16-55-23 340sec
f66032c2b5aa18ac_2020-12-03--16-55-23_340sec_STOPPING_BRAKE_RATE01

Stopping brake rate 0.2(on old long tune):
f66032c2b5aa18ac 2020-11-21--13-02-06 507sec
f66032c2b5aa18ac_2020-11-21--13-02-06_507sec_STOPPING_BRAKE_RATE02_oldtune

Stopping brake rate 0.4(no more creep but very harsh stop):
f66032c2b5aa18ac 2020-12-03--17-31-01 182sec
f66032c2b5aa18ac_2020-12-03--17-31-01_182sec_STOPPING_BRAKE_RATE04

@briskspirit
Copy link
Contributor

briskspirit commented Dec 4, 2020

Tried stopping brake rate 0.3 - feels good, will post graphs later
@pd0wm maybe we need to parametrize this value to interface too?

@pd0wm
Copy link
Contributor Author

pd0wm commented Dec 4, 2020

Did you also increase the stopping target? If changing the value is a good fix for this problem we should indeed parameterize it.

@briskspirit
Copy link
Contributor

No, I change parameters one by one, so stopping target is the same. Will check graphs in the evening and parametrize it.

@briskspirit
Copy link
Contributor

briskspirit commented Dec 5, 2020

Confirm that stopping brake rate 0.3 solves(or hides) the problem.
f66032c2b5aa18ac 2020-12-04--17-55-48 2293sec
@pd0wm what you say? If you agree I will parametrize this const and add to every TSS2 car as 0.3 + to defaults as 0.2

f66032c2b5aa18ac_2020-12-04--17-55-48_2293sec_STOPPING_BRAKE_RATE03_

@briskspirit
Copy link
Contributor

Ok, so I figured out the fix, will PR today.
f66032c2b5aa18ac 2020-12-05--14-33-16_549sec
STOPPING_BRAKE_RATE = 0.1 ! So now it stops fine and smooth.

f66032c2b5aa18ac_2020-12-05--14-33-16_549sec_STOPPING_BRAKE_RATE01

@pd0wm pd0wm closed this Dec 11, 2020
@pd0wm pd0wm deleted the fix-tss2-creep branch December 11, 2020 13:59
@pd0wm pd0wm added bugfix car vehicle-specific and removed car bug fix labels Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix car vehicle-specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants