Properly mad stuff Dmitri - well done that man...
Announcement
Collapse
No announcement yet.
Better datalogging using the stock ECU
Collapse
X
-
Paul Nugent
Webmaster http://S2central.net
Administrator http://S2forum.com
1994 S2 Coupe ABY - aka Project Lazarus
2001 A6 allroad 2.5TDi - family tank
2003 S4 Avant 4.2 V8 - daily burble
Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)
There are only 10 kinds of people that understand binary - those that do, and those that don't
-
Originally posted by Nuvo View PostVery impressive, can you tell me what the little black box on top of the ECU is please? I'm guessing it must be the emulator you use for tuning.
Moates Ostrich 2.0
Comment
-
Originally posted by S2central.net View PostProperly mad stuff Dmitri - well done that man...
Comment
-
Originally posted by prj View Post2) The fastest I can read is on average one sample every 210 milliseconds on Group 0. So that's 4.76 samples per second.
A bit faster than VAG-COM. It gave me 4.3-4.4 samples per second.
On group 1+, it is about 228ms, so about 4.39 times per second.
Anyway, looking good5vtq gte
Comment
-
Originally posted by Val View PostIs this with 1 or 3 groups (by 4) logged in the same time?
Anyway, looking good
I re-wrote in assemblly inside the ECU what it shows in group 8, so I can get 12 different values into one group at the same time, instead of just 4.
You need a custom KWP 1281 implementation for that though (which I wrote in windows).
This entire system consists of 2 parts:
1) ECU software
2) Windows computer software
One can not function without the other.
And because the baud rate is so low and due to KWP 1281 limitations, you can't really log more than one group. You'll get an update rate of 1hz, which is useless.
Comment
-
An example with some parameters.
There are more loggable parameters of course, but no point to put them all onto the same picture.
Comment
-
Revisiting this because the KWP1281 protocol has a lot of overhead, is slow, and when logging you don't really need a "TCP" style protocol, more a "UDP" fire and forget style protocol... so all the data integrity and handshaking does not create huge demands.
The problem is that sometimes when mapping / tuning KWP1281 disconnects. Be it VAG-COM itself or my custom logging driver.
There is some noise or error on the K-Line and then connection just drops...
Then it takes ages to re-establish the connection, and obviously your pull is ruined.
So what I did is, I made a virtual switch inside the ECU's software (can be made to a hardware switch), which either lets normal diagnostic routines run, or my special routine.
This special routine, when activated, replaces the entire monstrous ECU diagnostics routine and simply spams the K-Line with data as fast as possible.
I used a simple protocol with two sync bytes, and then data, so the client can sync onto the data stream.
I need to field test this (so far works only on the bench), but I am getting speeds of around 50 samples/second.
This compares very favorably to 4.2-4.5 samples/second I got before on the bench.
Not to mention, that if a byte is dropped or mis-received, just one or two samples will be lost, as the ECU will just keep going and the client will re-sync to the data stream.
Pictures coming soon (tm).
Comment
-
50 samples per second sounds awesome and will make the data much better suited for things like the Virtual Dyno program. I seem to get an average of 3 samples per seond out of the standard Vagcom, and it drops as low as 2 samples per second at high rpm.1995 RS2 on Alcohol (6.8sec 100-200km/h)
1994 80E Avant
1986 2L Golf 2 on Alcohol
Comment
-
Originally posted by EspenW View Post50 samples per second sounds awesome and will make the data much better suited for things like the Virtual Dyno program. I seem to get an average of 3 samples per seond out of the standard Vagcom, and it drops as low as 2 samples per second at high rpm.
If all is successful, I might patch your tune someday.
It is pretty easy to make some activity in VAG-COM kick it into this special mode, but to get it out of there would require restarting the car.
I just change a byte in the binary with my emulator, which toggles between normal diagnostics mode and fast logging mode.
Comment
-
Just had a first look at this topic.
Really like it. Quite impressed again with our Motronic and your skills!www.S2power.com
S2 Coupe - decat - EPS exhaust - RS2 IC - RS2 front - RS2 brakes - RS2 mirrors - Koni shocks - H&R springs - Jehnert doorpanels & Audison Amps - leather & sunroof - VEMS - USA rearlights
Comment
-
Routine that populates the buffer in all of it's glory:
Code:1 $NOMOD51 2 $INCLUDE(80C515.MCU) 3 ; Entry point, 90 85 22 is replaced. 4 MOV DPTR, #08700h 5 CLR A 6 MOVC A, @A+DPTR 7 JZ valuespam 8 ; If the byte is not altered, do normal logic 9 MOV DPTR, #08522h 10 LJMP 555Ah 11 ; If byte is altered spam... 12 valuespam: 13 ; Set up transmit mode to 9 bit UART with 9600 BAUD 14 MOV PCON, #080h 15 MOV SCON, #0E8h 16 MOV P2, #00h 17 18 ; Check if a buffer transmit op is already in progress 19 JNB IEN0.4, fillbuffer 20 ret 21 22 fillbuffer: 23 ; Leave room for length 24 MOV R0, #0AFh 25 ; 1, 1st magic sync byte of 0xFEFD 26 INC R0 27 MOV A, #0FDh 28 MOVX @R0, A 29 ; 2 - RPM, 0x3A 30 INC R0 31 MOV A, 03Ah 32 MOVX @R0, A 33 ; 3 - LOAD, 0x3F 34 INC R0 35 MOV A, 03Fh 36 MOVX @R0, A 37 ; 4 - Voltage, 0x36 38 INC R0 39 MOV A, 036h 40 MOVX @R0, A 41 ; 5 - IAT, 0x37 42 INC R0 43 MOV A, 037h 44 MOVX @R0, A 45 ; 6 - Coolant Temp, 0x38 46 INC R0 47 MOV A, 038h 48 MOVX @R0, A 49 ; 7 - TPS, from ADC 50 INC R0 51 MOV DPTR, #0BE00h 52 LCALL 017CFh 53 MOVX @R0, A 54 ;8 - Timing, from memory 55 INC R0 56 MOV R1, #05Fh 57 MOVX A, @R1 58 MOVX @R0, A 59 ;9,10 - IPW, from memory 60 INC R0 61 MOV A, 05Eh 62 MOVX @R0, A 63 INC R0 64 MOV A, 05Fh 65 MOVX @R0, A 66 ; 11 - Vehicle speed 67 INC R0 68 MOV P2, #01h 69 MOV R1, #070h 70 MOVX A, @R1 71 MOV P2, #00h 72 MOVX @R0, A 73 ; 12 - Maf table number, memory 74 INC R0 75 MOV R1, #0E8h 76 MOV A, @R1 77 MOVX @R0, A 78 ; 13 - Maf table cell, memory 79 INC R0 80 MOV R1, #0EAh 81 MOV A, @R1 82 MOVX @R0, A 83 84 ; Add length 85 MOV A, R0 86 SUBB A, #0AFh 87 MOV R0, #0AFh 88 MOVX @R0, A 89 90 ; Initialize transmission 91 SETB IEN0.4 92 MOV SBUF, #0FEh 93 94 RET 95 END
Last edited by prj; 17 November 2011, 13:05.
Comment
-
Originally posted by prj View PostRoutine that populates the buffer in all of it's glory:
Code:1 $NOMOD51 2 $INCLUDE(80C515.MCU) 3 ; Entry point, 90 85 22 is replaced. 4 MOV DPTR, #08700h 5 CLR A 6 MOVC A, @A+DPTR 7 JZ valuespam 8 ; If the byte is not altered, do normal logic 9 MOV DPTR, #08522h 10 LJMP 555Ah 11 ; If byte is altered spam... 12 valuespam: 13 ; Set up transmit mode to 9 bit UART with 9600 BAUD 14 MOV PCON, #080h 15 MOV SCON, #0E8h 16 MOV P2, #00h 17 18 ; Check if a buffer transmit op is already in progress 19 JNB IEN0.4, fillbuffer 20 ret 21 22 fillbuffer: 23 ; Leave room for length 24 MOV R0, #0AFh 25 ; 1, 1st magic sync byte of 0xFEFD 26 INC R0 27 MOV A, #0FDh 28 MOVX @R0, A 29 ; 2 - RPM, 0x3A 30 INC R0 31 MOV A, 03Ah 32 MOVX @R0, A 33 ; 3 - LOAD, 0x3F 34 INC R0 35 MOV A, 03Fh 36 MOVX @R0, A 37 ; 4 - Voltage, 0x36 38 INC R0 39 MOV A, 036h 40 MOVX @R0, A 41 ; 5 - IAT, 0x37 42 INC R0 43 MOV A, 037h 44 MOVX @R0, A 45 ; 6 - Coolant Temp, 0x38 46 INC R0 47 MOV A, 038h 48 MOVX @R0, A 49 ; 7 - TPS, from ADC 50 INC R0 51 MOV DPTR, #0BE00h 52 LCALL 017CFh 53 MOVX @R0, A 54 ;8 - Timing, from memory 55 INC R0 56 MOV R1, #05Fh 57 MOVX A, @R1 58 MOVX @R0, A 59 ;9,10 - IPW, from memory 60 INC R0 61 MOV A, 05Eh 62 MOVX @R0, A 63 INC R0 64 MOV A, 05Fh 65 MOVX @R0, A 66 ; 11 - Vehicle speed 67 INC R0 68 MOV P2, #01h 69 MOV R1, #070h 70 MOVX A, @R1 71 MOV P2, #00h 72 MOVX @R0, A 73 ; 12 - Maf table number, memory 74 INC R0 75 MOV R1, #0E8h 76 MOV A, @R1 77 MOVХ @R0, A 78 ; 13 - Maf table cell, memory 79 INC R0 80 MOV R1, #0EAh 81 MOV A, @R1 82 MOVХ @R0, A 83 84 ; Add length 85 MOV A, R0 86 SUBB A, #0AFh 87 MOV R0, #0AFh 88 MOVX @R0, A 89 90 ; Initialize transmission 91 SETB IEN0.4 92 MOV SBUF, #0FEh 93 94 RET 95 END
RED Mitsubishi Lancer Evolution VI TME nº 16 of 250
BLACK Mitsubishi Lancer Evolution VI TME nº 189 of 250
LWB Audi Sport Quattro project
Comment
-
Originally posted by Nuvo View PostI can follow most of it, although I'd need to dig out the reference manual for a few processor specifics. I know x86 assembler better.
Processor is a 80C535. Open IDA Pro and get cracking, there is lots to do... hehe.
Comment
Comment