Skip to content

Commit

Permalink
Squashed 'opendbc/' changes from 2ae0327e..d217f701
Browse files Browse the repository at this point in the history
d217f701 Initial version of actuator dbc. Scalings represent my system gear ratios. See derivation in signal decriptions.
59a48a6f Endianness consistency.
ca74555 Counters are not cheksums. Checksums and counters revised. SteeringWheelAngle_DSC name reverted!
82da8d23 Tentatively added MDM status signal
87556a8 Added DSC statuses
4f810c29 Added torque factors
5272f021 Added few target nodes
7726134a Added messages from other BMW models
62d72c41 Added sender nodes and improved message names
e9113e6d Added traction control off button message
925aa0b1 Speed message cleanup
d15eaccd More precise steering factor
cdcca447 Another acceleration and gyro
3ee916a7 Added accelerators and checksum signals in Speed message
dd6829bd Added Ignition ON, modified steering ratio factor
33495aa6 Update README.md
0bf00e48 correction
904c0115 Added BMW CANbus overview.
47b386c4 OpenDBC updates
b83847eb Added some counter signals
c46ce064 Updated ShiftLeverPosition to bit-wise for readability. Added enumeration.
7f4515e2 Added PRND states. Confirmed with https://bmw.spoolstreet.com/threads/gs7-program-code-disassembly-project.6045/post-94403
dac7982f Added GearSelector postion signals inspired by https://www.spoolstreet.com/threads/gs7-program-code-disassembly-project.6045/post-93145
019e5fb3 OpenDBC updates
5b051948 Merge branch 'master' of https://github.com/dzid26/opendbc-BMW-E8x-E9x
e8a293fc Added ignition terminal states
1959ac7a Merge remote-tracking branch 'remotes/comma/master'
f308ca62 Subaru: added counter and checksum to brake msg
35233ad4 Added dynamic cruise control torque request signal
d1f76d60 Add Motor_20 CRC support (commaai#229)
6252718a Add STEER_ANGLE to all STEER_TORUQE_SENSOR messages (commaai#228)
c0b42612 Revert "add angle field in torque sensor message to all cars (commaai#227)"
bd82848c add angle field in torque sensor message to all cars (commaai#227)
56f0259d Lexus CTH fix: brake pressed is on bit 5 like corolla and rav4
9b6ca31b fix: Replicate changes done on _honda_2017.dbc (commaai#225)
1bd26d0a Added messages. Cleaned up endianness (commaai#226)
44b9e74f Revert "Toyota: add checksum to BRAKE_MODULE (commaai#224)"
8b18c92e Toyota: add checksum to BRAKE_MODULE (commaai#224)
2bab4d6d Add Honda-Bosch lane line detection signals. (commaai#223)
cbe4528b Added engine torque
7fe0df53 Added lateral and longitudal accelerometers and battery voltage
a1aa3b78 Cleanup of Nissan DBC (commaai#218)
c1f76482 reverting changes to Chrysler: speed message seems different from car to car
2de8e9e8 Chrysler: Speed msg is 5 bytes
f4ac315e Chrysler: add counter to 514
d23d0b80 Merge remote-tracking branch 'remotes/comma/master'
0fb62cf8 Toyota Blind Spot Monitor (TSS2-only?) (commaai#219)
a3ba5d0 Added blinkers
748e94e9 wiper button
ec3f4a39 Removed openSteering messages. Added gear enums and cruise +5/-5 Renames...
555d99a1 Improved OpenActuator packing
b0412d4e Added (invented) OpenPilot request message
abc339dd Added kph factor to WheelSpeeds from DSC
2a385a49 Added motor controller CAN message
12e4a137 message size
c53c4221 OpenDBC updates
5cc88e9a OpenDBC updates
c358ed3f Added units; fixed steering speed signal in 0xc4
91fdf6da OpenDBC updates
b9ba537e OpenDBC updates
4009e81e another wheel position - active all the time
85d2fc72 OpenDBC updates
d9870aa6 Added unknown messages
71af0e4d Added F-CAN missing signals - unknown
5d7b1ee0 unit
db436dd Speed scaling
e7bc05fc OpenDBC updates
a11eff80 Corrected cruise control pedal pressed vs driver pedal pressed
db531561 OpenDBC updates
6c442ac7 OpenDBC updates
58e577ca Delete BMW E-series CAN dev.dbc
86d5f8e6 OpenDBC updates
9f582ac8 Merge branch 'master' of https://github.com/dzid26/opendbc-BMW-E8x-E9x
4903aa5e OpenDBC updates
0d03e177 OpenDBC updates
ebc3047f OpenDBC updates
c5927819 OpenDBC updates
6fb2ce67 OpenDBC updates
94ef8924 OpenDBC updates
8649b0e3  size set to 7
c80c750f Merge branch 'master' of https://github.com/dzid26/opendbc-BMW-E8x-E9x
8add7117 acc pedal
dfeb7a3e Steering Wheel angle and wheels speed
5e619d76 BMW dbc copied from OpenDBC repository https://github.com/dzid26/opendbc-BMW-E8x-E9x/
5fe0915d Steering wheel sensor DSC
0c944a8e OpenDBC updates
0deef5ce OpenDBC updates
fa64ef48 OpenDBC updates
ee6523fe Other can messages
88156113 Removed spaces
783586d2 Added can messages from SZL
98b7cace Dynamic cruise control vehicle option has different can messages
13ff1a1a Cruise control
731d1978 Updated pedal statuses
9afe6b0f Corrected to throttle
90801021 Added some cruise statuses
52154764 cruise speed scaling
44dc4833 cruiseControlStatus
9a59d3e5 Added bunch of unknown messages
a88851e3 Cruise counters set to Big endian
2c0e0a24 Rename BMW E-series K+CAN.dbc to BMW E-series CAN.dbc
d53a55a1 SteeringButtons
91d4a861 Fixed many DBC syntax issues
6a147162 Removed module names due to bug/conflict?
7eb3daf7 Fixed names.
5660526f Fixes after cabana broke it
7e70bcae brake depress flag
88647719 Update BMW E-series K+CAN.dbc
fc62bb41 Delete BMW E-series K+CAN
f231bede Cruise control commands
e3cd3441 Added brake pedal pressed
39359a4d OpenDBC updates
129384ca Rename BMW E-series to BMW E-series K+CAN
ec83a615 Update BMW E-series
dee5aa61 Initial test commit

git-subtree-dir: opendbc
git-subtree-split: d217f701793db79a1574fd5829f91d648c3b7af6
  • Loading branch information
dzid26 committed Feb 22, 2022
1 parent ab3557e commit 3d18c31
Show file tree
Hide file tree
Showing 46 changed files with 1,809 additions and 95 deletions.
91 changes: 91 additions & 0 deletions OpenActuator.dbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
VERSION ""


NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_

BS_:

BU_: Actuator Driver


BO_ 250 ControlCmd1: 7 Driver
SG_ CRC8_CMD1 : 0|8@1+ (1,0) [0|255] "" Actuator
SG_ Counter_CMD1 : 12|4@1+ (1,0) [0|15] "" Actuator
SG_ MotorId_CMD1 : 8|2@1+ (1,0) [0|3] "" Actuator
SG_ ControlMode : 10|2@1+ (1,0) [0|3] "" Actuator
SG_ PositionChange : 16|16@1- (0.0125558,0) [-360|360] "deg" Actuator
SG_ TorqueFeedforward : 32|11@1- (0.0102667,0) [-10|10] "N*m" Actuator
SG_ TorqueCloseloopMax : 43|10@1+ (0.0102667,0) [0|10] "N*m" Actuator

BO_ 252 LimitsCmd2: 6 Driver
SG_ CRC8_CMD2 : 0|8@1+ (1,0) [0|255] "" Actuator
SG_ Counter_CMD2 : 12|4@1+ (1,0) [0|15] "" Actuator
SG_ VelocityLimit : 16|16@1+ (1,0) [0|0] "" Actuator
SG_ AccelLimit : 32|16@1+ (1,0) [0|0] "" Actuator

BO_ 251 ControlStatus1: 8 Actuator
SG_ CRC8_STAT1 : 0|8@1+ (1,0) [0|255] "" Driver
SG_ Counter_STAT1 : 12|4@1+ (1,0) [0|15] "" Driver
SG_ TorqueActual : 32|11@1- (0.0102667,0) [-8|8] "N*m" Driver
SG_ TorqueCloseLoopActual : 43|11@1- (0.0102667,0) [0|8] "N*m" Driver
SG_ SpeedActual : 56|8@1- (0.0357143,0) [-4.5|4.5] "rev/s" Driver
SG_ PositionError : 16|16@1- (0.0125558,0) [-360|360] "" Driver

BO_ 253 SystemStatus2: 8 Actuator
SG_ CRC8_STAT2 : 0|8@1+ (1,0) [0|255] "" Driver
SG_ Counter_STAT2 : 12|4@1+ (1,0) [0|15] "" Driver
SG_ ChipTemp : 16|8@1+ (1,-60) [-60|195] "C" Driver
SG_ PositionRaw : 24|32@1- (1,0) [0|0] "" Driver



CM_ SG_ 250 PositionChange "Relative position degrees at steering wheel to raw motor angle units x 64.
Motor 360deg = 65536 units, so:
Factor = 64_mutiplier *360deg/65536 / FinalGearRatio / GearboxRatio";
CM_ SG_ 250 TorqueFeedforward "Feedforward torque at steering wheel to motor raw current mA x 8.
Factor formula:
8_const * 1A/1000mA * MotorRatedTorque / MotorRatedCurrent * GearboxRatio * FinalGearRatio";
CM_ SG_ 250 TorqueCloseloopMax "Closeloop torque limit at steering wheel to motor raw current mA x 32.
If internally close loop is in the same direction as feedforward, closelooop is simply limited by the value.
If internally close loop is in opposite direction to feedforward, then close loop limit is set to |feedforwad| so that closeloop has always power to cancel the feedfrward to avoid uncontrolled rotation away from target position.

Factor formula:
32_const * 1A/1000mA * MotorRatedTorque / MotorRatedCurrent * GearboxRatio * FinalGearRatio";
CM_ SG_ 251 SpeedActual "Filered speed in revolutions per seconds

factor = 1[rev/s]/ FinalGearRatio / GearboxRatio";
CM_ SG_ 251 PositionError "Position error (desired - actual) in degrees at steering wheel from raw motor angle units x 64.
Motor 360deg = 65536 units, so:
Factor = 64_mutiplier *360deg/65536 / FinalGearRatio / GearboxRatio";
BA_DEF_ "BusType" STRING ;
BA_DEF_DEF_ "BusType" "CAN";
VAL_ 250 ControlMode 0 "Off" 1 "ControlEnable" 4 "Assist" ;

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
BMW network overview:
=====
BMW fork for of opendbc mainly created for openpilot development (so things like steering angle, speed, buttons were of a biggest intrest).
BMW E-series have 4 CAN busses:

**D-CAN** - [500kbps] - diagnostic CAN - this is in OBD2 port and can be used with "K+DCAN cable" for flashing etc

**F-CAN** - [500kbps] - chasis CAN - things like SZL and DSC connected here - messages from steering and traction control (accelerometers, gyros, steering angle, etc)
**PT-CAN** - [500kbps] - powertrain CAN - engine and transmission, etc. Some of messages from F-CAN are copied here by JBBF gateway

**K-CAN** - [100kbps] - body CAN - so things like climate, radio, door status, buttons - Some messages are copied from PT-CAN and F-CAN here too.

Several message-IDs are repeated between buses by the gateway. Note, this DBC doesn't specify which bus contain which message. This could be added perhaps to message description.


There is many points where K-CAN can be accessed in BMW. PT-CAN and K-CAN can be found in the corner of driver footwell. F-CAN can be found under doorstep trim. D-CAN on pin 6,14 of OBD2 port.



opendbc
======

Expand Down
Loading

0 comments on commit 3d18c31

Please sign in to comment.