Skip to content

Conversation

mvl-boston
Copy link
Contributor

@mvl-boston mvl-boston commented Sep 10, 2025

Honda Nidecs benefit from pitch compensation for gas and brake. Have been testing this for a month on an openpilot fork.

Adding this change in a similar manner as the Bosch change in earlier versions of #2488

Todo:

mvl-boston and others added 30 commits July 14, 2025 20:27
@github-actions github-actions bot added car related to opendbc/car/ honda labels Sep 10, 2025
@mvl-boston
Copy link
Contributor Author

Putting this on hold as test route is not obviously better. Need to move from speed control to gas pedal control to make impact more visible, staying as draft until a PR for pedal control is working.

@sshane
Copy link
Contributor

sshane commented Sep 27, 2025

I had tried to add pitch compensation to Toyota when trying to understand and undo the internal PCM compensations it does to our acceleration request, but was never able to get it working reliably in all scenarios.

Highpassing (~derivative) the pitch, and then allowing the integral controller to wind up after pitch changes worked much more reliably and more responsively. It removed any steady state error if the pitch estimation was wrong, or if the factor to go from pitch -> accel (gas/brake in your case) is totally unknown.

Unclear if it would benefit you here, but you can copy what I did for Toyota and report back:

high_pass_pitch = self.pitch.x - self.pitch_slow.x
pitch_compensation = float(np.clip(math.sin(high_pass_pitch) * ACCELERATION_DUE_TO_GRAVITY,
-MAX_PITCH_COMPENSATION, MAX_PITCH_COMPENSATION))
pcm_accel_cmd += pitch_compensation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/ honda

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants