diff --git a/components/bms_boss/include/CANIO_componentSpecific.h b/components/bms_boss/include/CANIO_componentSpecific.h index 9127b4ca..7e9dc4e4 100644 --- a/components/bms_boss/include/CANIO_componentSpecific.h +++ b/components/bms_boss/include/CANIO_componentSpecific.h @@ -59,5 +59,7 @@ CAN_prechargeContactorState_E CANIO_tx_getContactorState(void); #define set_elconMaxChargeCurrent(m,b,n,s) set(m,b,n,s, BMS.pack_charge_limit) #define set_elconControlByte(m,b,n,s) set(m,b,n,s, CANIO_tx_getElconControlByte()) #define transmit_BMSB_elconChargeCommand (SYS_SFT_checkElconChargerTimeout() == false) - -#include "TemporaryStubbing.h" +#define transmit_BMSB_currentLimit (SYS_SFT_checkMCTimeout() == false) +#define set_maxCharge(m,b,n,s) set(m,b,n,s, BMS.pack_charge_limit); +#define set_maxDischarge(m,b,n,s) set(m,b,n,s, BMS.pack_discharge_limit); +#include "TemporaryStubbing.h" \ No newline at end of file diff --git a/network/NetworkGen/NetworkGen.py b/network/NetworkGen/NetworkGen.py index 9d67262f..5c7f47c8 100644 --- a/network/NetworkGen/NetworkGen.py +++ b/network/NetworkGen/NetworkGen.py @@ -42,6 +42,7 @@ "description": str, "onBuses": Or(str, list[str]), Optional("duplicateNode"): int, + Optional("baseId"): int, }) SIGNAL_SCHEMA = Schema({ @@ -58,6 +59,7 @@ Optional("description"): str, Optional("cycleTimeMs"): int, Optional("id"): int, + Optional("idOffset"): int, Optional("lengthBytes"): int, Optional("sourceBuses"): Or(str, list[str]), Optional("signals"): dict, @@ -357,30 +359,25 @@ def process_node(node: CanNode): MESSAGE_SCHEMA.validate(definition) if "lengthBytes" in definition and (definition["lengthBytes"] < 1 or definition["lengthBytes"] > 8): raise Exception("Message length must be greater than 0 and less than or equal to 8") - if "id" not in definition: - raise Exception("Message must have a specified 'id'") + if "id" not in definition and "idOffset" not in definition: + raise Exception("Message must have a specified 'id' or 'idOffset'") + elif "id" in definition and "idOffset" in definition: + raise Exception("Message cannot have an 'id' and 'idOffset' at the same time") except Exception as e: print(f"CAN message definition for '{name}' in node '{node.name}' is invalid.") print(f"Message Schema Error: {e}") error = True continue - definition["id"] = definition["id"] + node.offset; - if "sourceBuses" in definition: - ls = [] - if type(definition["sourceBuses"]) is str: - ls.append(definition["sourceBuses"]) - else: - ls = definition["sourceBuses"] - for bus in ls: - if bus not in can_bus_defs: - print(f"Message '{msg_name}' has an undefined bus '{bus}'.") - ERROR = True - break - if bus not in node.on_buses: - print(f"Message '{msg_name}' is on bus '{bus}' but node '{node.name}' is not on that bus.") - ERROR = True - break + if "idOffset" in definition: + if node.baseId is None: + print(f"Message '{name}' has a 'idOffset' specified and {node.name} does not have a 'baseId' specified") + ERROR = True + break + else: + definition["id"] = definition["idOffset"] + node.baseId + node.offset + else: + definition["id"] = definition["id"] + node.offset for existing_node in can_nodes: for msg in can_nodes[existing_node].messages: diff --git a/network/NetworkGen/classes/Can.py b/network/NetworkGen/classes/Can.py index fd81d666..5463325c 100644 --- a/network/NetworkGen/classes/Can.py +++ b/network/NetworkGen/classes/Can.py @@ -430,7 +430,6 @@ def validate_msg(self): signal.start_bit + signal.native_representation.bit_width ) except Exception as e: - breakpoint() raise Exception(e) # validate validationRoles of signals @@ -507,7 +506,7 @@ def __init__(self, name, node_def): self.duplicateNode = True self.alias = self.name + str(self.offset) self.total_duplicates = get_if_exists(node_def, "duplicateNode", int, 1) - + self.baseId = get_if_exists(node_def, "baseId", int, None) self.def_files = node_def["def_files"] self.description: str = get_if_exists(node_def, "description", str, "") self.messages: Dict[str, CanMessage] = {} diff --git a/network/NetworkGen/classes/Types.py b/network/NetworkGen/classes/Types.py index dcd9e093..315b416e 100644 --- a/network/NetworkGen/classes/Types.py +++ b/network/NetworkGen/classes/Types.py @@ -92,6 +92,11 @@ class Units(Enum): amps = "A" rpm = "RPM" pct = "%" + Nm = "Nm" + deg = "deg" + Hz = "Hz" + Wb = "Wb" + class ValidationRole(Enum): diff --git a/network/definition/data/components/bmsb/bmsb-message.yaml b/network/definition/data/components/bmsb/bmsb-message.yaml index e00d37cc..6b269176 100644 --- a/network/definition/data/components/bmsb/bmsb-message.yaml +++ b/network/definition/data/components/bmsb/bmsb-message.yaml @@ -56,3 +56,12 @@ messages: elconMaxChargeVoltage: elconMaxChargeCurrent: elconControlByte: + + currentLimit: + description: BMS Torque limit + id: 0x202 + cycleTimeMs: 100 + sourceBuses: veh + signals: + maxDischarge: + maxCharge: \ No newline at end of file diff --git a/network/definition/data/components/bmsb/bmsb-signals.yaml b/network/definition/data/components/bmsb/bmsb-signals.yaml index 5ccdbe9d..05f76de9 100644 --- a/network/definition/data/components/bmsb/bmsb-signals.yaml +++ b/network/definition/data/components/bmsb/bmsb-signals.yaml @@ -131,3 +131,29 @@ signals: min: 0 max: 25 continuous: true + + maxDischarge: + unit: 'A' + description: BMS Limit Discharge Current + nativeRepresentation: + endianness: little + bitWidth: 16 + resolution: 0.1 + range: + min: 0 + max: 1000 + signedness: unsigned + continuous: true + + maxCharge: + unit: 'A' + description: BMS Limit Charge Current + nativeRepresentation: + endianness: little + bitWidth: 16 + resolution: 0.1 + range: + min: 0 + max: 75 + signedness: unsigned + continuous: true \ No newline at end of file diff --git a/network/definition/data/components/pm100dx/pm100dx-message.yaml b/network/definition/data/components/pm100dx/pm100dx-message.yaml index 4b17bbf2..b6292029 100644 --- a/network/definition/data/components/pm100dx/pm100dx-message.yaml +++ b/network/definition/data/components/pm100dx/pm100dx-message.yaml @@ -1,9 +1,253 @@ messages: + + temps1: + cycleTimeMs: 100 + description: PM100DXR Temperatures 1 + idOffset: 0xA0 + lengthBytes: 8 + signals: + tempModuleA: + tempModuleB: + tempModuleC: + tempGateDriver: + + temps2: + cycleTimeMs: 100 + description: PM100DXR Temperatures 2 + idOffset: 0xA1 + lengthBytes: 8 + signals: + controlBoardTemp: + rtdTemp1: + rtdTemp2: + rtdTemp3: + + temps3AndTorqueShudder: + cycleTimeMs: 100 + description: PM100DXR Temperatures 3 & Torque Shudder + idOffset: 0xA2 + lengthBytes: 8 + signals: + rtdTemp4: + rtdTemp5: + motorTemp: + torqueShudder: + + analogInputVoltages: + cycleTimeMs: 10 + description: PM100DXR Analog Input Voltages + idOffset: 0xA3 + lengthBytes: 8 + signals: + analogInputVoltage1: + analogInputVoltage2: + analogInputVoltage3: + analogInputVoltage4: + startBit: 32 + analogInputVoltage5: + analogInputVoltage6: + + digitalInputStatus: + cycleTimeMs: 10 + description: PM100DXR Digital Input Status + idOffset: 0xA4 + lengthBytes: 8 + signals: + forwardSwitchStatus: + reverseSwitchStatus: + brakeSwitchStatus: + regenDisableSwitchStatus: + ignitionSwitchStatus: + startSwitchStatus: + valetModeStatus: + digitalInput8Status: + + motorPositionInfo: + cycleTimeMs: 10 + description: PM100DXR Motor Position Information + idOffset: 0xA5 + lengthBytes: 8 + signals: + electricalMotorAngle: + motorSpeed: + electricalOutputFreq: + deltaResolverFiltered: + + currentInfo: + cycleTimeMs: 10 + description: PM100DXR Current Info + idOffset: 0xA6 + lengthBytes: 8 + signals: + currentPhaseA: + currentPhaseB: + currentPhaseC: + dcBusCurrent: + + voltageInfo: + cycleTimeMs: 10 + description: PM100DXR Voltage Info + idOffset: 0xA7 + lengthBytes: 8 + signals: + dcBusVoltage: + outputVoltage: + voltageVAB: + voltageVBC: + + fluxInfo: + cycleTimeMs: 10 + description: PM100DXR Flux Info + idOffset: 0xA8 + lengthBytes: 8 + signals: + fluxCommand: + fluxFeedback: + idFeedback: + iqFeedback: + + internalVoltages: + cycleTimeMs: 100 + description: PM100DXR Internal Voltages + idOffset: 0xA9 + lengthBytes: 8 + signals: + refVoltage1.5V: + refVoltage2.5V: + refVoltage5V: + systemVoltage12V: + + internalStates: + cycleTimeMs: 10 + description: PM100DXR Internal States + idOffset: 0xAA + lengthBytes: 8 + signals: + vsmState: + pwmFrequency: + inverterState: + relayStatus1: + inverterRunMode: + selfSensingAssistEnable: + inverterActiveDischargeState: + inverterCommandMode: + rollingCounter: + inverterEnableState: + burstModelMode: + startModeActive: + inverterEnableLockout: + directionCommand: + bmsActive: + bmsLimitingTorque: + limitMaxSpeed: + limitHotSpot: + lowSpeedLimiting: + coolantTemperatureLimiting: + limitStallBurstModel: + + faultCodes: + cycleTimeMs: 10 + description: PM100DXR POST & Run Fault Codes + idOffset: 0xAB + lengthBytes: 8 + signals: + postHWGateFault: + postHWOverCurrentFault: + postAcceleratorShorted: + postAcceleratorOpen: + postCurrentSensorLo: + postCurrentSensorHi: + postModuleTempLo: + postModuleTempHi: + postControlPCBTempLo: + postControlPCBTempHi: + postGateDrivePCBTempLo: + postGateDrivePCBTempHi: + post5vSenseVoltageLo: + post5vSenseVoltageHi: + post12vSenseVoltageLo: + post12vSenseVoltageHi: + post2.5vSenseVoltageLo: + post2.5vSenseVoltageHi: + post1.5vSenseVoltageLo: + post1.5vSenseVoltageHi: + postDCBusVoltageHi: + postDCBusVoltageLo: + postPreChargeTimeOut: + postPreChargeVoltageFailure: + postEepromChecksumInvalid: + postEepromDataOutOfRange: + postEepromUpdateRequired: + postHWDCBusOverVoltageDuringInit: + postBrakeShorted: + startBit: 30 + postBrakeOpen: + runMotorOverSpeedFault: + runOverCurrentFault: + runOverVoltageFault: + runInverterOverTempFault: + runAcceleratorInputShortedFault: + runAcceleratorInputOpenFault: + runDirectionCommandFault: + runInverterResponseTimeOutFault: + runHWGateFault: + runHWOverCurrentFault: + runUnderVoltageFault: + runCanCommandMessageLostFault: + runMotorOverTempFault: + runBrakeInputShortedFault: + startBit: 48 + runBrakeInputOpenFault: + runModuleAOverTempFault: + runModuleBOverTempFault: + runModuleCOverTempFault: + runPcbOverTempFault: + runGateDriveBoard1OverTempFault: + runGateDriveBoard2OverTempFault: + runGateDriveBoard3OverTempFault: + runCurrentSensorFault: + runHwDCBusOverVoltageFault: + startBit: 59 + runResolverNotConnected: + startBit: 62 + + torqueAndTimerInfo: + cycleTimeMs: 10 + description: Torque and Timer Info + idOffset: 0xAC + lengthBytes: 8 + signals: + commandedTorque: + feedbackTorque: + powerOnTimer: + + modulationIndexAndFluxWeakeningOutputInfo: + cycleTimeMs: 10 + description: Modulation Index and Flux Weakening Output Info + idOffset: 0xAD + lengthBytes: 8 + signals: + modulationIndex: + fluxWeakeningOutput: + idCommand: + iqCommand: + + criticalData: + cycleTimeMs: 3 description: PM100DXR Critical Data + idOffset: 0xB0 + lengthBytes: 8 + signals: + torqueCommand: + torqueFeedback: + motorSpeed: + tractiveSystemVoltage: #DC bus voltage + + torqueCapability: cycleTimeMs: 10 - id: 0x11 + description: Motor Controller Torque Capability + idOffset: 0xB1 lengthBytes: 8 signals: - tractiveSystemVoltage: - startBit: 48 + torqueCapability: \ No newline at end of file diff --git a/network/definition/data/components/pm100dx/pm100dx-rx.yaml b/network/definition/data/components/pm100dx/pm100dx-rx.yaml index 5c496e08..e5bf1706 100644 --- a/network/definition/data/components/pm100dx/pm100dx-rx.yaml +++ b/network/definition/data/components/pm100dx/pm100dx-rx.yaml @@ -1,2 +1,3 @@ messages: + BMSB_currentLimit: signals: diff --git a/network/definition/data/components/pm100dx/pm100dx-signals.yaml b/network/definition/data/components/pm100dx/pm100dx-signals.yaml index 6cc92200..f9e5e106 100644 --- a/network/definition/data/components/pm100dx/pm100dx-signals.yaml +++ b/network/definition/data/components/pm100dx/pm100dx-signals.yaml @@ -1,11 +1,1018 @@ signals: + + tempModuleA: + description: Module A Temperature + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + tempModuleB: + description: Module B Temperature + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + tempModuleC: + description: Module C Temperature + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + tempGateDriver: + description: Gate Driver Board Temperature + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + controlBoardTemp: + description: Temperature of Control Board + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + rtdTemp1: + description: Temperature from RTD Input 1 + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + rtdTemp2: + description: Temperature from RTD Input 2 + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + rtdTemp3: + description: Temperature from RTD Input 3 + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + rtdTemp4: + description: Temperature from RTD Input 4 + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + rtdTemp5: + description: Temperature from RTD Input 5 + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + motorTemp: + description: Motor Temperature + unit: degC + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + torqueShudder: + description: Torque Shudder Compensation + unit: Nm + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + analogInputVoltage1: + description: Voltage on Analog Input Voltage 1 + unit: V + nativeRepresentation: + bitWidth: 10 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + analogInputVoltage2: + description: Voltage on Analog Input Voltage 2 + unit: V + nativeRepresentation: + bitWidth: 10 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + + analogInputVoltage3: + description: Voltage on Analog Input Voltage 3 + unit: V + nativeRepresentation: + bitWidth: 10 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + + analogInputVoltage4: + description: Voltage on Analog Input Voltage 4 + unit: V + nativeRepresentation: + bitWidth: 10 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + analogInputVoltage5: + description: Voltage on Analog Input Voltage 5 + unit: V + nativeRepresentation: + bitWidth: 10 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + analogInputVoltage6: + description: Voltage on Analog Input Voltage 6 + unit: V + nativeRepresentation: + bitWidth: 10 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + forwardSwitchStatus: + description: Forward Switch Status + discreteValues: inputStatus + + reverseSwitchStatus: + description: Reverse Switch Status + discreteValues: inputStatus + + brakeSwitchStatus: + description: Brake Switch Status + discreteValues: inputStatus + + regenDisableSwitchStatus: + description: Regen Disable Switch Status + discreteValues: inputStatus + + ignitionSwitchStatus: + description: Ignition Switch Status + discreteValues: inputStatus + + startSwitchStatus: + description: Start Switch Status + discreteValues: inputStatus + + valetModeStatus: + description: Valet Mode Status + discreteValues: inputStatus + + digitalInput8Status: + description: Digital Input 8 Status + discreteValues: inputStatus + + electricalMotorAngle: + description: Electrical Motor Angle + unit: deg + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: 0.0 + max: 359.9 + endianness: big + signedness: signed + continuous: true + + motorSpeed: + description: Motor Speed + unit: RPM + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -32768 + max: 32767 + endianness: big + signedness: signed + continuous: true + + electricalOutputFreq: + description: Electrical Output Frequency + unit: Hz + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + deltaResolverFiltered: + description: Delta Resolver Filtered + unit: deg + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: 0 + max: 359.9 + endianness: big + signedness: signed + continuous: true + + currentPhaseA: + description: Measured Current of Phase A + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + currentPhaseB: + description: Measured Current of Phase B + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + currentPhaseC: + description: Measured Current of Phase C + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + + dcBusCurrent: + description: Calculated DC Bus Current + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + dcBusVoltage: + description: Measured DC Bus Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + outputVoltage: + description: Calculated Output Voltage (Peak-Neutral) + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + voltageVAB: + description: Phase A - Phase B Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + voltageVBC: + description: Phase B - Phase C Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + fluxCommand: + description: Commanded Flux + unit: Wb + nativeRepresentation: + bitWidth: 16 + resolution: 0.001 + range: + min: -32.768 + max: 32.767 + endianness: big + signedness: signed + continuous: true + + fluxFeedback: + description: Estimated Flux + unit: Wb + nativeRepresentation: + bitWidth: 16 + resolution: 0.001 + range: + min: -32.768 + max: 32.767 + endianness: big + signedness: signed + continuous: true + + + idFeedback: + description: D-Axis Current Feedback + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + iqFeedback: + description: Q-Axis Current Feedback + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + refVoltage1.5V: + description: 1.5V Reference Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + refVoltage2.5V: + description: 2.5V Reference Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + refVoltage5V: + description: 5V Reference Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + systemVoltage12V: + description: 12V Reference Voltage + unit: V + nativeRepresentation: + bitWidth: 16 + resolution: 0.01 + range: + min: -327.68 + max: 327.67 + endianness: big + signedness: signed + continuous: true + + vsmState: + description: VSM State + unit: "" + discreteValues: vsmState + + pwmFrequency: + description: PWM Frequency (=0 for PMxxx) + unit: Hz + nativeRepresentation: + bitWidth: 16 + resolution: 1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + inverterState: + description: Inverter State + unit: "" + discreteValues: inverterState + + relayStatus1: + description: Relay 1 Status + discreteValues: activeStatus + + inverterRunMode: + description: Inverter Run Mode + discreteValues: outputState + + selfSensingAssistEnable: + description: Self-Sensing Assist Enable + discreteValues: outputState + + inverterActiveDischargeState: + description: Inverter Active Discharge State + unit: "" + discreteValues: inverterActiveDischargeState + + inverterCommandMode: + description: Inverter Command Mode + discreteValues: outputState + + rollingCounter: + description: Only For Gen 5 + unit: "" + nativeRepresentation: + bitWidth: 8 + resolution: 1 + range: + min: 0 + max: 15 + endianness: big + signedness: unsigned + continuous: true + + + inverterEnableState: + description: Inverter Enable State + discreteValues: outputState + + burstModelMode: + description: Only for Gen 5 + discreteValues: outputState + + startModeActive: + description: Start Mode Active + discreteValues: outputState + + inverterEnableLockout: + description: Inverter Enable Lockout + discreteValues: outputState + + directionCommand: + description: Inverter Direction Command + discreteValues: directionCommand + + bmsActive: + description: BMS Active + discreteValues: bmsActive + + bmsLimitingTorque: + description: BMS Limiting Torque + discreteValues: isLimited + + limitMaxSpeed: + description: Only for Gen 5 + discreteValues: isLimited + + limitHotSpot: + description: Only for Gen 5 + discreteValues: isLimited + + lowSpeedLimiting: + description: Only for Gen 5 + discreteValues: isLimited + + coolantTemperatureLimiting: + description: Only for Gen 5 + discreteValues: isLimited + + limitStallBurstModel: + description: Only for Gen 5 + discreteValues: isLimited + + + #POST Fault Lo + postHWGateFault: + description: POST HW Gate Fault + discreteValues: faultStatus + + postHWOverCurrentFault: + description: POST HW Overcurrent Fault + discreteValues: faultStatus + + postAcceleratorShorted: + description: POST HW Accelerator Shorted Fault + discreteValues: faultStatus + + postAcceleratorOpen: + description: POST HW Accelerator Open Fault + discreteValues: faultStatus + + postCurrentSensorLo: + description: POST Current Sensor Low Fault + discreteValues: faultStatus + + postCurrentSensorHi: + description: POST Current Sensor High Fault + discreteValues: faultStatus + + postModuleTempLo: + description: POST Module Temp Low Fault + discreteValues: faultStatus + + postModuleTempHi: + description: POST Module Temp High Fault + discreteValues: faultStatus + + postControlPCBTempLo: + description: POST Control PCB Temp Low Fault + discreteValues: faultStatus + + postControlPCBTempHi: + description: POST Control PCB Temp High Fault + discreteValues: faultStatus + + postGateDrivePCBTempLo: + description: POST Gate Drive PCB Temp Low Fault + discreteValues: faultStatus + + postGateDrivePCBTempHi: + description: POST Gate Drive PCB Temp High Fault + discreteValues: faultStatus + + post5vSenseVoltageLo: + description: POST 5V Sense Voltage Low Fault + discreteValues: faultStatus + + post5vSenseVoltageHi: + description: POST 5V Sense Voltage High Fault + discreteValues: faultStatus + + post12vSenseVoltageLo: + description: POST 12V Sense Voltage Low Fault + discreteValues: faultStatus + + post12vSenseVoltageHi: + description: POST 12V Sense Voltage High Fault + discreteValues: faultStatus + + #POST Fault Hi + post2.5vSenseVoltageLo: + description: POST 2.5V Sense Voltage Low Fault + discreteValues: faultStatus + + post2.5vSenseVoltageHi: + description: POST 2.5V Sense Voltage High Fault + discreteValues: faultStatus + + post1.5vSenseVoltageLo: + description: POST 1.5V Sense Voltage Low Fault + discreteValues: faultStatus + + post1.5vSenseVoltageHi: + description: POST 1.5V Sense Voltage High Fault + discreteValues: faultStatus + + postDCBusVoltageHi: + description: POST DC Bus Votlage High Fault + discreteValues: faultStatus + + postDCBusVoltageLo: + description: POST DC Bus Voltage Low Fault + discreteValues: faultStatus + + postPreChargeTimeOut: + description: POST Precharge Timeout Fault + discreteValues: faultStatus + + postPreChargeVoltageFailure: + description: POST Precharge Voltage Failure Fault + discreteValues: faultStatus + + postEepromChecksumInvalid: + description: POST EEPROM Checksum Invalid Fault + discreteValues: faultStatus + + postEepromDataOutOfRange: + description: POST EEPROM Data Out of Range Fault + discreteValues: faultStatus + + postEepromUpdateRequired: + description: POST EEPROM Update Required Fault + discreteValues: faultStatus + + postHWDCBusOverVoltageDuringInit: + description: POST HW DC Bus Over Voltage During Init Fault + discreteValues: faultStatus + + postBrakeShorted: + description: POST Brake Shorted Fault + discreteValues: faultStatus + + postBrakeOpen: + description: POST Brake Open Fault + discreteValues: faultStatus + + runMotorOverSpeedFault: + description: RUN Motor Over Speed Fault + discreteValues: faultStatus + + runOverCurrentFault: + description: RUN Over Current Fault + discreteValues: faultStatus + + runOverVoltageFault: + description: RUN Over Voltage Fault + discreteValues: faultStatus + + runInverterOverTempFault: + description: RUN Inverter Over Temperature Fault + discreteValues: faultStatus + + runAcceleratorInputShortedFault: + description: RUN Accelerator Input Shorted Fault + discreteValues: faultStatus + + runAcceleratorInputOpenFault: + description: RUN Accelerator Input Open Fault + discreteValues: faultStatus + + runDirectionCommandFault: + description: RUN Direction Command Fault + discreteValues: faultStatus + + runInverterResponseTimeOutFault: + description: RUN Inverter Response Timeout Fault + discreteValues: faultStatus + + runHWGateFault: + description: RUN HW Gate Fault + discreteValues: faultStatus + + runHWOverCurrentFault: + description: RUN HW Over Current Fault + discreteValues: faultStatus + + runUnderVoltageFault: + description: RUN Under Voltage Fault + discreteValues: faultStatus + + runCanCommandMessageLostFault: + description: RUN CAN Command Message Lost Fault + discreteValues: faultStatus + + runMotorOverTempFault: + description: RUN Motor Over Temp Fault + discreteValues: faultStatus + + runBrakeInputShortedFault: + description: RUN Brake Input Shorted Fault + discreteValues: faultStatus + + runBrakeInputOpenFault: + description: RUN Brake Input Open Fault + discreteValues: faultStatus + + runModuleAOverTempFault: + description: RUN Module A Over Temp Fault + discreteValues: faultStatus + + runModuleBOverTempFault: + description: RUN Module B Over Temp Fault + discreteValues: faultStatus + + runModuleCOverTempFault: + description: RUN Module C Over Temp Fault + discreteValues: faultStatus + + runPcbOverTempFault: + description: RUN PCB Over Temp Fault + discreteValues: faultStatus + + runGateDriveBoard1OverTempFault: + description: RUN Gate Drive Board 1 Over Temp Fault + discreteValues: faultStatus + + runGateDriveBoard2OverTempFault: + description: RUN Gate Drive Board 2 Over Temp Fault + discreteValues: faultStatus + + runGateDriveBoard3OverTempFault: + description: RUN Gate Drive Board 3 Over Temp Fault + discreteValues: faultStatus + + runCurrentSensorFault: + description: RUN Current Sensor Fault + discreteValues: faultStatus + + runHwDCBusOverVoltageFault: + description: RUN HW DC Bus Over Voltage Fault + discreteValues: faultStatus + + runResolverNotConnected: + description: RUN Resolver Not Connected Fault + discreteValues: faultStatus + + commandedTorque: + description: Commanded Torque + unit: Nm + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + feedbackTorque: + description: Torque Feedback + unit: Nm + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + powerOnTimer: + description: Power On Timer + unit: "s" + nativeRepresentation: + bitWidth: 32 + resolution: 3000 + range: + min: 0 + max: 4294967295 + endianness: big + signedness: unsigned + continuous: true + + + modulationIndex: + description: Modulation Index + unit: "" + nativeRepresentation: + bitWidth: 16 + resolution: 0.01 + range: + min: 0 + max: 65535 + endianness: big + signedness: signed + continuous: true + + + fluxWeakeningOutput: + description: Flux Weakening Output + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + idCommand: + description: Commanded D-Axis Current + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + iqCommand: + description: Commanded Q-Axis Current + unit: A + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + torqueCommand: + unit: Nm + description: Commanded Torque + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + torqueFeedback: + unit: Nm + description: Estimated Motor Torque + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + motorSpeed: + unit: RPM + description: Measured Motor Speed + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -32768 + max: 32767 + endianness: big + signedness: signed + continuous: true + tractiveSystemVoltage: - unit: 'V' + unit: V description: Motor Controller DC Bus Voltage nativeRepresentation: bitWidth: 16 resolution: 0.1 range: - min: 0 - max: 450 + min: -3276.8 + max: 3276.7 + endianness: big + signedness: signed + continuous: true + + torqueCapability: + unit: Nm + description: Inverter Available Torque + nativeRepresentation: + bitWidth: 16 + resolution: 0.1 + range: + min: -32768 + max: 32767 + endianness: big + signedness: signed continuous: true diff --git a/network/definition/data/components/pm100dx/pm100dx.yaml b/network/definition/data/components/pm100dx/pm100dx.yaml index 2b7a7a14..751efb09 100644 --- a/network/definition/data/components/pm100dx/pm100dx.yaml +++ b/network/definition/data/components/pm100dx/pm100dx.yaml @@ -1,3 +1,4 @@ description: "Cascadia Motion PM100DX/DXR Motor Controller" onBuses: - "veh" +baseId: 0x01 diff --git a/network/definition/discrete_values.yaml b/network/definition/discrete_values.yaml index c003b827..23ed641e 100644 --- a/network/definition/discrete_values.yaml +++ b/network/definition/discrete_values.yaml @@ -6,6 +6,10 @@ switchStatus: "OFF": 0 "ON": 1 +inputStatus: + "FALSE": 0 + "TRUE": 1 + flag: "CLEARED": 0 "SET": 1 @@ -16,3 +20,73 @@ prechargeContactorState: "CONTACTORS_PRECHARGE_CLOSED": 2 "CONTACTORS_PRECHARGE_HVP_CLOSED": 3 "CONTACTORS_HVP_CLOSED": 4 + +vsmState: + "VSM_START": 0 + "PRECHARGE_INIT": 1 + "PRECHARGE_ACTIVE": 2 + "PRECHARGE_COMPLETE": 3 + "VSM_WAIT": 4 + "VSM_READY": 5 + "MOTOR_RUNNING": 6 + "BLINK_FAULT": 7 + "SHUTDOWN_IN_PROCESS": 14 + "RECYCLE_POWER_STATE": 15 + +inverterState: + "POWER_ON": 0 + "STOP": 1 + "OPEN_LOOP": 2 + "CLOSED_LOOP": 3 + "WAIT": 4 + "IDLE_RUN": 8 + "IDLE_STOP": 9 + +activeStatus: + "ACTIVE": 1 + "INACTIVE": 0 + +inverterRunMode: + "TORQUE_MODE": 0 + "SPEED_MODE": 1 + +enableState: + "DISABLED": 0 + "ENABLED": 1 + +inverterActiveDischargeState: + "DISCHARGE_DISABLED": 0 + "DISCHARGE_ENABLED_WAITING": 1 + "SPEED_CHECK": 2 + "DISCHARGE_OCCURRING": 3 + "DISCHARGE_COMPLETED": 4 + +inverterCommandMode: + "CAN_MODE": 0 + "VSM_MODE": 1 + +burstModelMode: + "STALL": 0 + "HIGH_SPEED": 1 + +inverterLockoutState: + "CAN_BE_ENABLED": 0 + "CANNOT_BE_ENABLED": 1 + +# 0= Reverse if inverter enabled & 0= stopped if inverter disabled. +# I'm not sure how to implement that condition in yaml +directionCommand: + "FORWARD": 1 + "REVERSE": 0 + +bmsActive: + "BMS_NOT_RECEIVED": 0 + "BMS_RECEIVED": 1 + +isLimited: + "NOT_LIMITED": 0 + "LIMITED": 1 + +faultStatus: + "OK": 0 + "FAULT": 1 \ No newline at end of file