Skip to content

MG5 Brake Pedal #13

Closed
sunrisesteel wants to merge 0 commit intolukasloetkolben:mgfrom
sunrisesteel:mg
Closed

MG5 Brake Pedal #13
sunrisesteel wants to merge 0 commit intolukasloetkolben:mgfrom
sunrisesteel:mg

Conversation

@sunrisesteel
Copy link
Copy Markdown

@sunrisesteel sunrisesteel commented Jun 30, 2025

Following up on my previous to you I think the brake pedal from the driver is at EHBS_HSC2_FrP00, BrkPdlAppdHSC2 and not at GW_HSC2_HCU_FrP00, EPTBrkPdlDscrtInptStsHSC2, that includes ACC/Radar braking (albeit delayed i think), but not KERS braking I don't think.

I thought it would be helpful to update it and push it to you to save the trouble - including the dbc extras and the carstate.py - but I also wasnt sure if to do this to your opendbc repo? or this one ? or well anywhere - so ive done it here for now, but can do it somewhere else, just ask.

Further reading leads me to believe I also need to update the safety to use 0x1b6 not 0xaf I assume, but it is 1:20am and i've not go to it yet.

From mg.h

    // Brake pressed
    if (addr == 0xaf) {
      brake_pressed = GET_BIT(to_push, 31U);

Pictures of analysis below from our chat / my messages earlier.

image
Above red is driver brake, green is acc requesting acceleration/deceleration, yellow is EPTBrkPdlDscrtInptStsHSC2,.

You can see in the first section, only ACC requests brake, minimal pedal force kPa (purple), but doesnt trigger EPTBrkPdlDscrtInptStsHSC2, the second section you can see similar and a long delay between the kPa starting & EPTBrkPdlDscrtInptStsHSC2 kicking true, and finally at the end you can see a manual brake press, aligned with the brake kPa, followed later by the EPTBrkPdlDscrtInptStsHSC2 a bit delayed. I am fairly sure given I saw up to 2.4ish seconds between the brake force applying and the EPTBrkPdlDscrtInptStsHSC2 msg its not suitable to know the brake pedal is pressed by the driver when compared to ACC request acceleration or WhlBrkPrs

image
image
Some other reference images of similar above - interesting points are as cruise is reduced, torque of acc goes negative and to zero before and then triggers the acc accel requests - suspect this is the KERS doing its thing before it decides "I am not reducing fast enough, I better brake".

@sunrisesteel sunrisesteel changed the title MG Brake Pedal MG5 Brake Pedal Jun 30, 2025
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant