Logging 25 times faster using DMA - >4000 samples per sec

Developer topics relating to software that logs data from ECUs

Moderator: Freon

Logging 25 times faster using DMA - >4000 samples per sec

Postby S54fan » Sat Dec 22, 2007 3:29 am

I have had success in my testing to run DMA datalogging on my Evo IX.

The usual MUT protocol only runs at 150-180 samples per second, and they are of limited resolution because they are only bytes whereas the internal ECU variables are 2 bytes. In a low gear logging many items you can get a fairly rough data collection. At 6000 RPM logging a typical set of items you only get a row of data for 10 engine revolutions. Furthermore, the communications are a little slow for realtime mapping - writing an ignition map to RAM was taking about 6 seconds. I was able to quadruple the speed by changing the comms routines, but it was taxing the CPU when trying to run the engine by going any faster, so DMA was clearly the way forward.

By increasing the baud rate to 62500 and using the SH2 DMA channel number 3 working the serial port 0 I have a vastly quicker datalogging. I will be converting my RAM read/write map routines to DMA to make the transfers within 0.1 seconds.

If Subaru owners (using 32 bit SH705x series MCU) want to implement something similar I could help with the details of the DMA transfer. However, a good bit of the work required is disassembling the serial comms the ECU uses and understanding all the flags it sets etc so that you can take over the serial port for the DMA and then transfer control back gracefully to MUT or SSM. It has taken a lot of disassembly on the Evo to get to this point, and I've been thinking about using DMA for about 8 months now.

How fast can SSM go at present?
S54fan
 
Posts: 233
Joined: Fri Dec 16, 2005 4:39 am

Postby xswrex » Wed Dec 26, 2007 10:23 am

John that is just amazing! I have only tried up to 9600 baud on SSM on the 68HC16 CPU but the "problem" is that the protocol is talking only when the CPU has time for it. I think that Freon has tried 9600 on the SH2
xswrex
 
Posts: 110
Joined: Thu Oct 20, 2005 3:50 am

Re: Logging 25 times faster using DMA - >4000 samples per

Postby ev8siv3 » Wed Dec 26, 2007 10:23 am

S54fan wrote:I have had success in my testing to run DMA datalogging on my Evo IX.

The usual MUT protocol only runs at 150-180 samples per second, and they are of limited resolution because they are only bytes whereas the internal ECU variables are 2 bytes. In a low gear logging many items you can get a fairly rough data collection. At 6000 RPM logging a typical set of items you only get a row of data for 10 engine revolutions. Furthermore, the communications are a little slow for realtime mapping - writing an ignition map to RAM was taking about 6 seconds. I was able to quadruple the speed by changing the comms routines, but it was taxing the CPU when trying to run the engine by going any faster, so DMA was clearly the way forward.

By increasing the baud rate to 62500 and using the SH2 DMA channel number 3 working the serial port 0 I have a vastly quicker datalogging. I will be converting my RAM read/write map routines to DMA to make the transfers within 0.1 seconds.

If Subaru owners (using 32 bit SH705x series MCU) want to implement something similar I could help with the details of the DMA transfer. However, a good bit of the work required is disassembling the serial comms the ECU uses and understanding all the flags it sets etc so that you can take over the serial port for the DMA and then transfer control back gracefully to MUT or SSM. It has taken a lot of disassembly on the Evo to get to this point, and I've been thinking about using DMA for about 8 months now.

How fast can SSM go at present?


SSM runs at 4800 baud.
ev8siv3
 
Posts: 159
Joined: Fri Mar 24, 2006 11:27 am

Postby S54fan » Wed Dec 26, 2007 12:56 pm

How many logged items does it transfer a second at 4800 baud is what I was really asking?
S54fan
 
Posts: 233
Joined: Fri Dec 16, 2005 4:39 am

Postby Freon » Wed Dec 26, 2007 3:03 pm

Depends on how many bytes each sample is. I think most or all standard SSM items are only 1 byte (8bit).

You can get about 10-12 at 180-200ms. It will go down fast if you log custom parameters that are full floating point.

Also, it seems there is an upper limit to sampling speed. Even with just one item on the SH-2 it seems 100ms is about as fast as it goes. Going to two parameters doesn't do much.

It is not very easy to predict the speed. You're going to have to log yourself and find out. This is not difficult, so get to it!
Freon
 
Posts: 700
Joined: Thu Nov 17, 2005 5:50 pm
Location: Indianapolis, IN

Postby C6ect.ect » Wed Dec 26, 2007 6:14 pm

I wonder how well the evo X will respond to logging, perhaps it might have a better ECU and be a nice match to this super code you've been designing :wink:

Thanks for your contributions Mr. B.
C6ect.ect
 
Posts: 113
Joined: Wed Jul 12, 2006 1:48 pm

Postby S54fan » Fri Dec 28, 2007 4:31 am

Thanks Freon, sadly I no longer have my Subaru to be able to play.

Enginuity is down as well, which I used to enjoy reading to see where the Subaru realtime/logging stuff was up to.

My realtime mapping stuff is presently configured to transfer the whole fuel or timing map whenever a change is made. Was the Subaru stuff like this or was it going to poke individual parts of the map at a time as the user edited them? Did anything get going on the Subaru to use the realtime maps that were developed?

Thanks C6, I think Mitsubishi tend to keep the ECUs relatively unchanged, witness basically the same SH2 code in vast parts of the ECU since the Evo7, I believe the 10 has direct injection though which will have dozens of funky fuel maps for the ultra-lean modes and transitions if VAG stuff is anything to go by :(
S54fan
 
Posts: 233
Joined: Fri Dec 16, 2005 4:39 am

Postby Freon » Fri Dec 28, 2007 2:52 pm

There is no available realtime Openecu mapping for Subarus. I don't think there is anything on the near horizon.

I'm not sure if Enguinity forum is coming back or not, but you can use this forum. NASIOC also has a new sub forum in the Tuning forum area.
Freon
 
Posts: 700
Joined: Thu Nov 17, 2005 5:50 pm
Location: Indianapolis, IN

Postby C6ect.ect » Mon Jan 07, 2008 2:14 pm

The X will have DI?!!

Do you really know what this means?

Direct injection turbo cars can easily produce 500-600 HP just by Ethanol as fuel and boost.

All one needs to do is retard injection until after intake valve is closed to increase the adiabatic constant volume process.

The evo10 will be the future of easy HP
Attachments
LFEE%202006-01%20RP.pdf
(260.88 KiB) Downloaded 784 times
C6ect.ect
 
Posts: 113
Joined: Wed Jul 12, 2006 1:48 pm

Postby S54fan » Mon Jan 07, 2008 2:27 pm

I hear you, but I wonder if you are more excited than me by one piece of the jigsaw, namely the largely theoretical gains from DI... on full power mixtures they still run rich, they still knock, they are still limited by airflow, stock and tuned 1.8T vs 2.0T FSI isn't a wildly difference experience at all for example.

I'm familiar with DI as my other car is a Golf GTI 2.0T FSI, and I've gone into a lot of the docs re the Motronic, the ECU is simply a nightmare with all the different injection modes. As things stand I'd still take a 1.8T to do a modification project, although my feeling on these VWs is they are nice commuters/cars for the wife, not tuner cars of the ilk of the Evo/Subaru (unless they make a blown 3.2 quattro at sensible weight).

Availability of upgrade injectors will be a PITA, as will an unknown strength new engine and gearbox, as well as 4G63 parts that don't fit. CR will be higher too IIRC. It is still only 2.0 and the X is 10% heavier. I'd take a lighter Subaru over it if they sorted the EJ257 chocolate pistons/liners and had twin scroll (all reasons I didn't get another).

Power will still be limited by turbo size, I see DI as mainly a PITA to modify with potentially a gain in power, that up to now is more than offset by a larger gain in complexity of hardware and electronics.

People already run 600 BHP on 4G63 in the UK on pump fuel (GT35R, build engines). Most choose not to because of the cost of it all. I don't think the X will accelerate as well as the IX for a given spend at any level.
S54fan
 
Posts: 233
Joined: Fri Dec 16, 2005 4:39 am

Postby C6ect.ect » Mon Jan 07, 2008 3:10 pm

I do see your point, but maybe 5 years down the road though. The X also has an emissions system that constitutes half of the engine - it's there for good and will have to be incorperated with all tuning.

Did you read the MIT abstract attached? They were able to boost the 2 liter to 4.2 BAR by direct injection ethanol once intake valves are closed
C6ect.ect
 
Posts: 113
Joined: Wed Jul 12, 2006 1:48 pm

Postby S54fan » Mon Jan 07, 2008 3:25 pm

Yes just finished reading it. Does sound interesting. I think the 4.2 bar was absolute pressure not relative though? Still impressive - like the top end of what people do with race fuel on the 4G63, and the tolerance of compression and ignition timing is good.

I wondered if we could modify these DI injections that have limited DI capacity and no good injector upgrade options by using the DI with ethanol, and adding port injection for gasoline? Thing is the high economy stratified combustion mode (with combustion in a pocket above a relief in the piston crown) for the majority of use at cruise might be best done with cheaper gasoline which has a higher calorific value per unit price?
S54fan
 
Posts: 233
Joined: Fri Dec 16, 2005 4:39 am

Postby C6ect.ect » Thu Jan 10, 2008 2:29 pm

The X appears to have ended up with direct port injection instead, according to SCC.
C6ect.ect
 
Posts: 113
Joined: Wed Jul 12, 2006 1:48 pm

Postby Evo4Mad » Fri Jan 11, 2008 2:30 pm

what is DMA logging? is that just a different way of sending data out the serialport of the microcontroller? i.e via means of interrupts? what ROM ID #s do you have it working on?
Evo4Mad
 
Posts: 332
Joined: Mon Jun 13, 2005 11:58 pm
Location: New Zealand

Postby S54fan » Fri Jan 11, 2008 3:50 pm

Hi Hamish,

There is more info on the thread on evolutionm.net but the SH7055 hardware manual reveals the way the DMA works on the chip. In essence it can transfer logging data in blocks at high speed to the serial port by stealing bus cycles so that the ECU can continue its normal processing unaffected. Two interrupts with a handful of instructions are used when the transfer terminates to return control seamlessly to MUT logging.

Each transfer is initiated at present by sending MUT request E5. Rather than a single byte reply, the PC logger receives a 64 byte reply, but it could be any length we like, direct or indirect from anywhere in the ECU's 32 bit address space. I could also make it repeat the dump a programmable number of times in response to a single request ID. It is fairly easy to modify an existing logger to process DMA, I have an example app I'm happy to share and assist with helping it go into Evoscan if that is what you want. This work is converging with the realtime mapping stuff, for which I've done a lot of work on the PC side.

I have it working on 88570008 JDM IX GSR, but it is able to be transferred to all the other Evo 7-9 once I have it finalised. Presently I'm trying to get the ECU to accept blocks of data from the PC, but haven't got it working yet. That isn't needed for logging, just to make realtime map writes to the ECU virtually instant rather than taking up to several seconds.

Cheers,

John
S54fan
 
Posts: 233
Joined: Fri Dec 16, 2005 4:39 am

Next

Return to Data Logging Software

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

cron