working mini or e46 config file

Discussions on CAN mapping for ECUs, sensors, PDMs, and more.
Post Reply
MrBlahh
Posts: 45
Joined: Tue Sep 27, 2016 11:13 pm

working mini or e46 config file

Post by MrBlahh »

anyone mind sharing a working e46 or mini cooper config file?

I have no idea how to load these can channels in the app I've not really seen a howto document I have mine working except for brake pressure via lua but I would like to add some of the channels to the native mapping.

car is a 2006 R53 mini

brentp
Site Admin
Posts: 5956
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi, So you already have it working correctly via Lua scripting, correct?

We're working on a collection of pre-sets that can be loaded into the app, but in the meantime you'd have to map them individually by interpreting the Lua scripting mapping.

I'll follow up with some examples of existing channels to get you started.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Mustangkev
Posts: 27
Joined: Thu Apr 09, 2015 8:18 pm

Post by Mustangkev »

I made a start on the E46 CAN mapping but it is far from complete/correct.
I have TPS, RPM, Oil, coolant and ambient temperature working as well as the brake switch and fuel level. Steering works for turning left but not turning right. Clutch switch is not working either.
The main area where I am struggling is with the BitOp functions.

Feel free to try this out and may changes if you can. Here is what I have:


***Edited now the full can mapping is below****
Last edited by Mustangkev on Sun Jul 09, 2017 7:54 pm, edited 1 time in total.

Mustangkev
Posts: 27
Joined: Thu Apr 09, 2015 8:18 pm

Post by Mustangkev »

I now have steering and clutch working as well as the cruise control dash light (planning to use to start and stop logging). I've added individual wheel speeds but they don't work correctly yet.

***Edited now the full can mapping is below****
Last edited by Mustangkev on Sun Jul 09, 2017 7:54 pm, edited 1 time in total.

brentp
Site Admin
Posts: 5956
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

That's great, thanks for the update! I see you're using the "Sign-magnitude" mode for steering, glad that's working for you.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

MrBlahh
Posts: 45
Joined: Tue Sep 27, 2016 11:13 pm

Post by MrBlahh »

Mustangkev wrote:as well as the cruise control dash light
you sir are a genius, I'm going to use this to control logging too

have you looked for the IAT data? I'm running a supercharger & meth and it would be nice to know if intake temps spike

I'm going to work on getting your sample setup with my mini next week, autocrosses all weekend

I posted e46 brake pressure in a separate thread, it's not there by default you have to ask for it on the k-line canbus

Mustangkev
Posts: 27
Joined: Thu Apr 09, 2015 8:18 pm

Post by Mustangkev »

I need to update this as I have wheel speeds working now too. I'll try and get this uploaded tomorrow.
My old computer died but I had a script in there for logging with the cruise control button. It's pretty hand for autox as you can start and stop with your hands on the wheel.

Mustangkev
Posts: 27
Joined: Thu Apr 09, 2015 8:18 pm

Post by Mustangkev »

This should be the final iteration. Wheel speeds are now working correctly. Feel free to try this out and let me know if there are any issues.

{
"rcpCfg": {
"analogCfg": {
"0": {
"alpha": 1.0,
"map": {
"raw": [
0.92,
1.4,
1.72,
2.53,
3.41
],
"scal": [
33.0,
13.0,
0.0,
-35.0,
-72.0
]
},
"max": 255,
"min": 0,
"nm": "Height_LF",
"offset": 0.0,
"prec": 0,
"scalMod": 1,
"scaling": 1.0,
"sr": 10,
"ut": "mm"
},
"1": {
"alpha": 1.0,
"map": {
"raw": [
0.39,
0.83,
1.2,
1.8,
2.54
],
"scal": [
35.0,
16.0,
0.0,
-25.0,
-56.0
]
},
"max": 255,
"min": 0,
"nm": "Height_LR",
"offset": 0.0,
"prec": 0,
"scalMod": 0,
"scaling": 1.0,
"sr": 10,
"ut": "mm"
},
"2": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
3.75,
5.0
],
"scal": [
0.0,
1.25,
2.5,
3.75,
5.0
]
},
"max": 5.0,
"min": 0.0,
"nm": "Analog3",
"offset": 0.0,
"prec": 2,
"scalMod": 1,
"scaling": 1.0,
"sr": 0,
"ut": "Volts"
},
"3": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
3.75,
5.0
],
"scal": [
0.0,
1.25,
2.5,
3.75,
5.0
]
},
"max": 5.0,
"min": 0.0,
"nm": "Analog4",
"offset": 0.0,
"prec": 2,
"scalMod": 1,
"scaling": 1.0,
"sr": 0,
"ut": "Volts"
},
"4": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
3.75,
5.0
],
"scal": [
0.0,
1.25,
2.5,
3.75,
5.0
]
},
"max": 5.0,
"min": 0.0,
"nm": "Analog5",
"offset": 0.0,
"prec": 2,
"scalMod": 1,
"scaling": 1.0,
"sr": 0,
"ut": "Volts"
},
"5": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
3.75,
5.0
],
"scal": [
0.0,
1.25,
2.5,
3.75,
5.0
]
},
"max": 5.0,
"min": 0.0,
"nm": "Analog6",
"offset": 0.0,
"prec": 2,
"scalMod": 1,
"scaling": 1.0,
"sr": 0,
"ut": ""
},
"6": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
3.75,
5.0
],
"scal": [
0.0,
1.25,
2.5,
3.75,
5.0
]
},
"max": 5.0,
"min": 0.0,
"nm": "Analog7",
"offset": 0.0,
"prec": 2,
"scalMod": 1,
"scaling": 1.0,
"sr": 0,
"ut": ""
},
"7": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
3.75,
5.0
],
"scal": [
0.0,
1.25,
2.5,
3.75,
5.0
]
},
"max": 20.0,
"min": 0.0,
"nm": "Battery",
"offset": 0.0,
"prec": 2,
"scalMod": 1,
"scaling": 1.0,
"sr": 1,
"ut": "Volts"
}
},
"canCfg": {
"baud": [
500000,
500000
],
"en": 1
},
"canChanCfg": {
"chans": [
{
"add": 0.0,
"bigEndian": false,
"bm": false,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 809,
"idMask": 0,
"len": 1,
"max": 100,
"min": 0,
"mult": 0.39216,
"nm": "TPS",
"offset": 5,
"prec": 0,
"sr": 10,
"type": 0,
"ut": "%"
},
{
"add": -48.0,
"bigEndian": false,
"bm": false,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 809,
"idMask": 0,
"len": 1,
"max": 255,
"min": 0,
"mult": 0.69202,
"nm": "Coolant",
"offset": 1,
"prec": 0,
"sr": 10,
"type": 0,
"ut": "C"
},
{
"add": -48.0,
"bigEndian": false,
"bm": false,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 1349,
"idMask": 0,
"len": 1,
"max": 255,
"min": 0,
"mult": 1.0,
"nm": "OilTemp",
"offset": 4,
"prec": 0,
"sr": 10,
"type": 0,
"ut": "C"
},
{
"add": 0.0,
"bigEndian": false,
"bm": false,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 790,
"idMask": 0,
"len": 2,
"max": 10000.0,
"min": 0.0,
"mult": 0.15625,
"nm": "RPM",
"offset": 2,
"prec": 1,
"sr": 10,
"type": 0,
"ut": ""
},
{
"add": 0.0,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 809,
"idMask": 0,
"len": 1,
"max": 1,
"min": 0,
"mult": 1.0,
"nm": "Clutch",
"offset": 24,
"prec": 0,
"sr": 10,
"type": 0,
"ut": ""
},
{
"add": 0.0,
"bigEndian": false,
"bm": false,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 1557,
"idMask": 0,
"len": 1,
"max": 150,
"min": 0,
"mult": 1.0,
"nm": "AirTemp",
"offset": 3,
"prec": 0,
"sr": 10,
"type": 3,
"ut": "C"
},
{
"add": 0.0,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 1555,
"idMask": 0,
"len": 7,
"max": 100,
"min": 0,
"mult": 1.0,
"nm": "FuelLevel",
"offset": 16,
"prec": 0,
"sr": 10,
"type": 0,
"ut": "Ltrs"
},
{
"add": 0.0,
"bigEndian": false,
"bm": false,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 501,
"idMask": 0,
"len": 2,
"max": 100,
"min": -100,
"mult": 0.045,
"nm": "Steering",
"offset": 0,
"prec": 0,
"sr": 10,
"type": 3,
"ut": "%"
},
{
"add": 0.0,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 809,
"idMask": 0,
"len": 1,
"max": 1,
"min": 0,
"mult": 1.0,
"nm": "Brake",
"offset": 48,
"prec": 0,
"sr": 10,
"type": 0,
"ut": ""
},
{
"add": -0.3,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 496,
"idMask": 0,
"len": 12,
"max": 200.0,
"min": 0.0,
"mult": 0.03884,
"nm": "LFwheel",
"offset": 0,
"prec": 1,
"sr": 10,
"type": 0,
"ut": "MPH"
},
{
"add": -0.3,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 496,
"idMask": 0,
"len": 12,
"max": 200.0,
"min": 0.0,
"mult": 0.03884,
"nm": "RFwheel",
"offset": 16,
"prec": 1,
"sr": 10,
"type": 0,
"ut": "MPH"
},
{
"add": -0.3,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 496,
"idMask": 0,
"len": 12,
"max": 200.0,
"min": 0.0,
"mult": 0.03884,
"nm": "LRwheel",
"offset": 32,
"prec": 1,
"sr": 10,
"type": 0,
"ut": "MPH"
},
{
"add": -0.3,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 496,
"idMask": 0,
"len": 12,
"max": 200.0,
"min": 0.0,
"mult": 0.03886,
"nm": "RRwheel",
"offset": 48,
"prec": 1,
"sr": 10,
"type": 0,
"ut": "MPH"
},
{
"add": 0.0,
"bigEndian": false,
"bm": true,
"bus": 0,
"div": 1.0,
"filtId": 0,
"id": 1349,
"idMask": 0,
"len": 1,
"max": 1,
"min": 0,
"mult": 1.0,
"nm": "Cruise",
"offset": 3,
"prec": 0,
"sr": 10,
"type": 0,
"ut": ""
}
],
"en": 1
},
"capabilities": {
"channels": {
"analog": 8,
"can": 2,
"canChan": 100,
"gpio": 3,
"imu": 7,
"pwm": 4,
"timer": 3
},
"db": {
"script": 16384,
"tracks": 160
},
"flags": [
"activetrack",
"adc",
"bt",
"can",
"cell",
"gpio",
"gps",
"imu",
"lua",
"obd2",
"pwm",
"telemstream",
"timer",
"tracks",
"usb",
"wifi"
],
"sampleRates": {
"gps": 50,
"sensor": 1000
}
},
"connCfg": {
"btCfg": {
"btEn": 0,
"name": "",
"pass": ""
},
"cellCfg": {
"apnHost": "epc.tmobile.com",
"apnPass": "",
"apnUser": "",
"cellEn": 0
},
"telCfg": {
"bgStream": 0,
"deviceId": ""
}
},
"gpioCfg": {
"0": {
"max": 1.0,
"min": 0.0,
"mode": 0,
"nm": "GPIO1",
"prec": 1,
"sr": 0,
"ut": ""
},
"1": {
"max": 1.0,
"min": 0.0,
"mode": 0,
"nm": "GPIO2",
"prec": 1,
"sr": 0,
"ut": ""
},
"2": {
"max": 1.0,
"min": 0.0,
"mode": 0,
"nm": "GPIO3",
"prec": 1,
"sr": 0,
"ut": ""
}
},
"gpsCfg": {
"alt": 1,
"dist": 1,
"dop": 1,
"pos": 1,
"qual": 1,
"sats": 1,
"speed": 1,
"sr": 10
},
"imuCfg": {
"0": {
"alpha": 0.1,
"chan": 1,
"max": 3.0,
"min": -3.0,
"mode": 1,
"nm": "AccelX",
"prec": 2,
"sr": 10,
"ut": "G",
"zeroVal": 0
},
"1": {
"alpha": 0.1,
"chan": 0,
"max": 3.0,
"min": -3.0,
"mode": 1,
"nm": "AccelY",
"prec": 2,
"sr": 10,
"ut": "G",
"zeroVal": 0
},
"2": {
"alpha": 0.1,
"chan": 2,
"max": 3.0,
"min": -3.0,
"mode": 1,
"nm": "AccelZ",
"prec": 2,
"sr": 10,
"ut": "G",
"zeroVal": 0
},
"3": {
"alpha": 0.1,
"chan": 3,
"max": 120.0,
"min": -120.0,
"mode": 1,
"nm": "Yaw",
"prec": 2,
"sr": 10,
"ut": "Deg/Sec",
"zeroVal": 0
},
"4": {
"alpha": 0.1,
"chan": 5,
"max": 120.0,
"min": -120.0,
"mode": 1,
"nm": "Pitch",
"prec": 2,
"sr": 10,
"ut": "Deg/Sec",
"zeroVal": 0
},
"5": {
"alpha": 0.1,
"chan": 4,
"max": 120.0,
"min": -120.0,
"mode": 1,
"nm": "Roll",
"prec": 2,
"sr": 10,
"ut": "Deg/Sec",
"zeroVal": 0
}
},
"lapCfg": {
"currentLap": {
"max": 0,
"min": 0,
"nm": "CurrentLap",
"prec": 0,
"sr": 10,
"ut": ""
},
"elapsedTime": {
"max": 0,
"min": 0,
"nm": "ElapsedTime",
"prec": 4,
"sr": 0,
"ut": "Min"
},
"lapCount": {
"max": 0,
"min": 0,
"nm": "LapCount",
"prec": 0,
"sr": 10,
"ut": ""
},
"lapTime": {
"max": 0,
"min": 0,
"nm": "LapTime",
"prec": 4,
"sr": 10,
"ut": "Min"
},
"predTime": {
"max": 0,
"min": 0,
"nm": "PredTime",
"prec": 4,
"sr": 10,
"ut": "Min"
},
"sector": {
"max": 0,
"min": 0,
"nm": "Sector",
"prec": 0,
"sr": 10,
"ut": ""
},
"sectorTime": {
"max": 0,
"min": 0,
"nm": "SectorTime",
"prec": 4,
"sr": 10,
"ut": "Min"
}
},
"obd2Cfg": {
"en": 0,
"pids": []
},
"pwmCfg": {
"0": {
"logMode": 1,
"max": 100,
"min": 0,
"nm": "PWM1",
"outMode": 1,
"prec": 0,
"sr": 0,
"stDutyCyc": 50,
"stPeriod": 100,
"ut": ""
},
"1": {
"logMode": 1,
"max": 100,
"min": 0,
"nm": "PWM2",
"outMode": 1,
"prec": 0,
"sr": 0,
"stDutyCyc": 50,
"stPeriod": 100,
"ut": ""
},
"2": {
"logMode": 1,
"max": 100,
"min": 0,
"nm": "PWM3",
"outMode": 1,
"prec": 0,
"sr": 0,
"stDutyCyc": 50,
"stPeriod": 100,
"ut": ""
},
"3": {
"logMode": 1,
"max": 100,
"min": 0,
"nm": "PWM4",
"outMode": 1,
"prec": 0,
"sr": 0,
"stDutyCyc": 50,
"stPeriod": 100,
"ut": ""
}
},
"scriptCfg": {
"data": "",
"page": null
},
"timerCfg": {
"0": {
"alpha": 1.0,
"max": 8000,
"min": 0,
"mode": 0,
"nm": "RPM",
"ppr": 1.0,
"prec": 0,
"speed": 1,
"sr": 0,
"st": 0,
"ut": "rpm"
},
"1": {
"alpha": 1.0,
"max": 8000,
"min": 0,
"mode": 0,
"nm": "RPM2",
"ppr": 1.0,
"prec": 0,
"speed": 1,
"sr": 0,
"st": 0,
"ut": "rpm"
},
"2": {
"alpha": 1.0,
"max": 8000,
"min": 0,
"mode": 0,
"nm": "RPM3",
"ppr": 1.0,
"prec": 0,
"speed": 1,
"sr": 0,
"st": 0,
"ut": "rpm"
}
},
"trackCfg": {
"autoDetect": 1,
"rad": 0.0001,
"track": {
"id": 0,
"sec": [
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
]
],
"sf": [
0.0,
0.0
],
"type": 0
}
},
"trackDb": {
"size": 0,
"tracks": []
},
"ver": {
"bugfix": 0,
"fname": "RaceCapture/Pro MK2",
"git_info": "2.11.0",
"major": 2,
"minor": 11,
"name": "RCP_MK2"
},
"wifiCfg": {
"active": true,
"ap": {
"active": true,
"channel": 11,
"encryption": "none",
"password": "",
"ssid": "RaceCapture/Pro MK2 131"
},
"client": {
"active": false,
"password": "",
"ssid": ""
}
}
}
}

MrBlahh
Posts: 45
Joined: Tue Sep 27, 2016 11:13 pm

Post by MrBlahh »

thanks for posting your config, I have almost all of it working, left front wheel gives some bad data though, jumps up to a very high value then to zero repeatedly almost every refresh

nothing on brake pressure either :( I think on the mk60 dcs unit mini uses it does not broadcast pressure but I've read that it will reply with it if polled, no idea how to do that

MrBlahh
Posts: 45
Joined: Tue Sep 27, 2016 11:13 pm

Post by MrBlahh »

Got wheel speed, 0 shows .1 but whatever it's working I was using your first script, thought I had the 2nd.

Only thing I do not have is brake pressure, I can see it in INPA and mini uses the mk60 module like the e46 but the coding might be different

I've read US mk60's do not broadcast pressure, but I did find the below info, most of which I do not understand. I'm pretty sure the k-bus is not the same network as the twisted pair 500kb canbus I'm tapping into right now. I hooked up inpa and watched the brake pressure but I was not able to get it to work on the racecapture/canbus side. I need to finish my arduino canbus sniffer


The 1F8 seems to be present on those with Hill Desent Control and 4wd. The receiver of 1F8 is the EGS. The format of the brake pressure in byte 2 is: Value=1*(HEX) [bar], range 0-254 [bar]. The brake pressure is also present on the K-Bus by requesting function call 22 01 F5, 21 06 or 21 02 to the mk60. Haven't had time to investigate which one of them it is, but they are the telegrams INPA sends to the mk60 when the screen showing the brake pressure is active.

and this..

The brake line pressures is present on the K-Bus by requesting the function call 21 06, and the brake line pressure offsets in 21 02. The formats are:


Status sensors (21 06):
Positive pressure:
B8 29 F1 02 21 06 45
B8 F1 29 0F 61 06 00 00 C3 DC 14 8F 14 A4 00 00 00 00 11 06

BrakeLinePressureFront = hex2dec('148F')/100 = 52.63 [bar]
BrakeLinePressureRear = hex2dec('14A4')/100 = 52.84 [bar]


BrakeLinePressureFront = hex2dec('1D31')/100 = 74.73 [bar]
BrakeLinePressureRear = hex2dec('1D1C')/100 = 74.52 [bar]

Neg. pressure by twos complement:
B8 29 F1 02 21 06 45
B8 F1 29 0F 61 06 00 00 C3 DC F7ED F783 00 00 00 00 11 06

BrakeLinePressureFront = (hex2dec('F7ED')-65536)/100 = -20.67 [bar]
BrakeLinePressureRear = (hex2dec('F783')-65536)/100 = -21.73 [bar]
BrakeLinePressureFront = (hex2dec('FFA5')-65536)/100 = -0.91 [bar]


Status sensor offset (21 02):
B8 29 F1 02 21 02 41
B8 F1 29 0C 61 02 FA89 FF18 1E81 FE5D 0000 A7

B8 F1 29 0C 61 02 xxxx yyyy 1E81 FE5D 0000 A7
xxxx = hex value in telegram of Offset Front
yyyy = hex value in telegram of Offset Rear
BrakeLinePressureFrontOffset = 0.000625*x + 2.3315e-15
BrakeLinePressureRearOffset = 0.000625*y + 2.3315e-15
where x is twos complement of xxxx (or yyyy) if neg value in xxxx (or yyyy) (msb set), otherwise pos value of xxxx (or yyyy).
Example: 0xFA89 => neg value since msb=1. Twos complement of 0xFA89 = -1399 => -0.87438 [bar].

Post Reply