Skip to content

Commit

Permalink
Bms yaml and more (#131)
Browse files Browse the repository at this point in the history
* Update bms.yaml

* add quotes

* make speed signed

* fixup mpu voltage sense

* fix charger
  • Loading branch information
jr1221 committed Jun 10, 2024
1 parent 75d62f9 commit fee72b6
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 67 deletions.
167 changes: 105 additions & 62 deletions cangen/can-messages/bms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,68 +134,6 @@ msgs:
- !CANPoint
size: 16
format: "divide10000"

- !CANMsg
id: "0x87"
desc: "Cell Voltage"
fields:
- !NetField
name: "BMS/PerCell/CellVoltage"
unit: ""
topic_append: true
points:
- !CANPoint
size: 8
- !CANPoint
size: 16
- !NetField
name: "BMS/PerCell/InstantVoltage"
unit: ""
points:
- !CANPoint
size: 16
- !NetField
name: "BMS/PerCell/InternalResistance"
unit: ""
points:
- !CANPoint
size: 16
# - !NetField
# name: "BMS/PerCell/Shunted"
# unit: ""
# points:
# - !CANPoint
# size: 8
# - !NetField
# name: "BMS/PerCell/OpenVoltage"
# unit: ""
# points:
# - !CANPoint
# size: 8

- !CANMsg
id: "0x86"
desc: "Current Limits"
fields:
- !NetField
name: "BMS/Pack/DCL"
unit: ""
points:
- !CANPoint
size: 16
- !NetField
name: "BMS/Pack/CCL"
unit: ""
points:
- !CANPoint
size: 16
- !NetField
name: "BMS/Pack/Current"
unit: ""
points:
- !CANPoint
size: 16
signed: true

- !CANMsg
id: "0x84"
Expand Down Expand Up @@ -276,6 +214,111 @@ msgs:
- !CANPoint
size: 8
signed: true
- !NetField
name: "BMS/Segment_Temp/5"
unit: "C"
points:
- !CANPoint
size: 8
signed: true
- !NetField
name: "BMS/Segment_Temp/6"
unit: "C"
points:
- !CANPoint
size: 8
signed: true

- !CANMsg
id: "0x86"
desc: "Current Limits"
fields:
- !NetField
name: "BMS/Pack/DCL"
unit: ""
points:
- !CANPoint
size: 16
- !NetField
name: "BMS/Pack/CCL"
unit: ""
points:
- !CANPoint
size: 16
- !NetField
name: "BMS/Pack/Current"
unit: ""
points:
- !CANPoint
size: 16
signed: true

- !CANMsg
id: "0x87"
desc: "Cell Voltage"
fields:
- !NetField
name: "BMS/PerCell/CellVoltage"
unit: ""
topic_append: true
points:
- !CANPoint
size: 8
- !CANPoint
size: 16
- !NetField
name: "BMS/PerCell/InstantVoltage"
unit: ""
points:
- !CANPoint
size: 16
- !NetField
name: "BMS/PerCell/InternalResistance"
unit: ""
points:
- !CANPoint
size: 16

- !CANMsg
id: "0x88"
desc: "BMS Voltage Noise"
fields:
- !NetField
name: "BMS/NoiseVoltage/1"
unit: "%"
points:
- !CANPoint
size: 8
- !NetField
name: "BMS/NoiseVoltage/2"
unit: "%"
points:
- !CANPoint
size: 8
- !NetField
name: "BMS/NoiseVoltage/3"
unit: "%"
points:
- !CANPoint
size: 8
- !NetField
name: "BMS/NoiseVoltage/4"
unit: "%"
points:
- !CANPoint
size: 8
- !NetField
name: "BMS/NoiseVoltage/5"
unit: "%"
points:
- !CANPoint
size: 8
- !NetField
name: "BMS/NoiseVoltage/6"
unit: "%"
points:
- !CANPoint
size: 8

# debugging only - use messages as needed, be sure to fill rest with FFs and only send from one place in code
- !CANMsg
Expand Down
10 changes: 6 additions & 4 deletions cangen/can-messages/charger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,33 @@ msgs:
signed: true
format: "divide10"
- !NetField
name: "Charger/Box/F_HardwareFailure"
name: "Charger/Box/F_CommTimeout"
unit: "bool"
points:
- !CANPoint
size: 1
- !NetField
name: "Charger/Box/F_OverTemp"
name: "Charger/Box/F_WrongBatConnection"
unit: "bool"
points:
- !CANPoint
size: 1

- !NetField
name: "Charger/Box/F_VoltageWrong"
unit: "bool"
points:
- !CANPoint
size: 1

- !NetField
name: "Charger/Box/F_WrongBatConnection"
name: "Charger/Box/F_OverTemp"
unit: "bool"
points:
- !CANPoint
size: 1
- !NetField
name: "Charger/Box/F_CommTimeout"
name: "Charger/Box/F_HardwareFailure"
unit: "bool"
points:
- !CANPoint
Expand Down
4 changes: 3 additions & 1 deletion cangen/can-messages/mpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ msgs:
points:
- !CANPoint
size: 8
signed: true
- !NetField
name: "MPU/State/TSMS"
unit: ""
Expand Down Expand Up @@ -72,8 +73,9 @@ msgs:
unit: "V"
points:
- !CANPoint
endianness: "little"
size: 32
endianness: "little"
format: "divide10000"

- !CANMsg
id: "0x504"
Expand Down

0 comments on commit fee72b6

Please sign in to comment.