Skip to content

Export shunt/HV monitor telemetry on CAN (0x602–0x605) and implement encoding#84

Open
Modellfan wants to merge 1 commit intomasterfrom
codex/implement-telemetry-for-shunt-and-hvmonitor
Open

Export shunt/HV monitor telemetry on CAN (0x602–0x605) and implement encoding#84
Modellfan wants to merge 1 commit intomasterfrom
codex/implement-telemetry-for-shunt-and-hvmonitor

Conversation

@Modellfan
Copy link
Copy Markdown
Owner

Motivation

  • Provide CAN telemetry for the shunt and HV monitor that mirrors existing serial values and matches the contactor telemetry style (fixed CAN IDs, raw payload bytes, no CRC/counter).
  • Close the visibility gap for shunt/HV monitor runtime parameters by publishing scaled/offset uint16 values and meta/DTC fields on CAN.

Description

  • Add new CAN message IDs BMS_MSG_SHUNT_HV_META (0x602), BMS_MSG_SHUNT_HV_I_CURRENT_COUNTERS (0x603), BMS_MSG_SHUNT_HV_DI_TEMP_POWER (0x604), and BMS_MSG_SHUNT_HV_U12_U3 (0x605) in settings.h.
  • Implement send_shunt_hv_monitor_telemetry_messages() in src/bms/battery_manager.cpp and call it from Monitor100Ms(), producing the four telemetry frames with proper byte-level packing and scaling.
  • Add helper encoding utilities encodeUnsigned(), encodeSignedOffset(), and writeUint16ToCanBytes() for consistent scale/offset encoding and saturation to 0..65535 in battery_manager.cpp.
  • Include bms/hv_monitor.h and expose the new sender function prototype in battery_manager.h.
  • Update documentation files documentation/CAN_Message_Packing.md and documentation/Shunt_HV_Monitor_Telemetry.md with the exact byte layouts and a note that CAN IDs 0x6020x605 now publish shunt/HV monitor telemetry.

Testing

  • No automated tests were added or run for this change.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant