PDA

View Full Version : Dyno software integration



samgm2
August 26th, 2011, 12:15 AM
I am writing control software for a dyno that we have just installed. The problem is that most dynos are really just designed to do wide open throttle tuning and frankly pathetic software and electronics support.

I have written software to control the dyno using a Labjack U6 PRO DAQ. This amazing unit is both low cost and very robust.

Now I could produce an analog representation of torque from the dyno load cell that would feed into one of the A/D channels of the EFILive V2 scanner, but then I would have to export the runs for later processing. Ideally however, the processing could be performed live if I was able to access the current injector duty cycle being scanned by the V2 and feed THAT into MY program for real-time calculation.

What I am after is the derivation of a spark table based on an efficiency calculation.

I would like to be able to access an efilive DLL that I can query for the "current fuel injector" duty cycle and RPM if possible (spark would be varied to find the efficiency maxima). Even better would be a dll function that can advance or retard timing through an efilive DLL for completely automated spark table derivation.

I would be surprised if such a dll didn't already exist (as part of the internals of the scanner software). Is there anyway that a few of the functions within the DLL could be made available? It would make dyno tuning far more robust and frankly produce near perfect tuning results. Spark tuning is far too much of a guessing game. This would eliminate that (as long as a dyno with the proper hardware signals is available).

Does such a dll already exist? Is it already available or can it be made to be.
Thanks,

I am hoping that a ".NET" accessible dll is available.

Sam

joecar
August 26th, 2011, 03:15 AM
...

Now I could produce an analog representation of torque from the dyno load cell that would feed into one of the A/D channels of the EFILive V2 scanner, but then I would have to export the runs for later processing. Ideally however, the processing could be performed live if I was able to access the current injector duty cycle being scanned by the V2 and feed THAT into MY program for real-time calculation.

What I am after is the derivation of a spark table based on an efficiency calculation.

I would like to be able to access an efilive DLL that I can query for the "current fuel injector" duty cycle and RPM if possible (spark would be varied to find the efficiency maxima). Even better would be a dll function that can advance or retard timing through an efilive DLL for completely automated spark table derivation.

...I'm interested in how you use injector duty cycle and spark advance in your calculation, and how this effects the tuning process.

There already are some dyno integration pids available in the software.

GMPX
August 26th, 2011, 09:07 AM
Same, there is a pdf in the EFILive V8 Docs folder called "EFILive Flashscan Serial Protocol", this can be used to share Scantool data with the Dyno. There is a number of dyno companies who have implemented this.

minytrker
August 26th, 2011, 11:51 AM
Same, there is a pdf in the EFILive V8 Docs folder called "EFILive Flashscan Serial Protocol", this can be used to share Scantool data with the Dyno. There is a number of dyno companies who have implemented this.

is dynojet supported?

samgm2
August 26th, 2011, 12:50 PM
This is certainly a step in the right direction and I will go ahead and implement an interface to the dyno software, but the frame rate is very low with rs-232 and it requires an rs-232 interface. More and more RS-232 ports are getting harder and harder to come by on a laptop. Yes, there are USB to rs-232 adapters out there, but my success with them is very low, especially under Windows 7.

Is there a reason that a limited subset of access to USB data stream can't be provided? Yes, I can interface to the RS-232 data stream but it's long term utility is highly uncertain. At 10 packets per second, the data rate is pretty bad. Any chance that at the very least a baud rate higher than 57K baud can be selected and a packet rate faster than 10 per second forced if the number of pids is low?

Sam


Same, there is a pdf in the EFILive V8 Docs folder called "EFILive Flashscan Serial Protocol", this can be used to share Scantool data with the Dyno. There is a number of dyno companies who have implemented this.

samgm2
August 26th, 2011, 01:29 PM
This interface doesn't depend on the dyno used. It only requires polling the RS-232 port on the scan tool to access the data. You can send a "D" frame to get a list of the current PIDs being scanned.

If you are able to write software to control your dyno then you can also write software to get the data from the scan tool directly. My only problem is the data rate from the RS-232 (which is very low at 10 packets per second) and the fact that it is RS-232 at all.

Ideally, the interface would be through a dll that is privy to the usb data stream (which is several orders of magnitude faster). A limited interface through that dll would make the system far more robust and responsive (not to mention easier than dealing with a serial bus). My suspicion is that a DLL already exists. I imagine that many of us would want access to the data so that we can write our own custom applications (particularly for more sophisticated tuning techniques).

In the mean time, I will go ahead and scan the serial stream. It is certainly better than nothing. It would be nice to be able to program the desired PIDs directly over the serial port.

Paul if you are reading this, a way of changing timing on the fly would be EXTREMELY handy and efficient for tuning on a dyno. Maybe we can call it a "T" frame... :-)

Sam


is dynojet supported?

samgm2
August 26th, 2011, 01:37 PM
Power produced per fuel used will vary based on spark timing. Optimal spark occurs when power produced is maximized as spark timing is varied.

Sam

Blacky
August 26th, 2011, 05:52 PM
Paul if you are reading this, a way of changing timing on the fly would be EXTREMELY handy and efficient for tuning on a dyno. Maybe we can call it a "T" frame... :-)Sam

Bidirectional controls (such as changing timing and fueling) are planned for the RS232 link.
Regards
Paul

Blacky
August 26th, 2011, 06:05 PM
This is certainly a step in the right direction and I will go ahead and implement an interface to the dyno software, but the frame rate is very low with rs-232 and it requires an rs-232 interface. More and more RS-232 ports are getting harder and harder to come by on a laptop. Yes, there are USB to rs-232 adapters out there, but my success with them is very low, especially under Windows 7.

Is there a reason that a limited subset of access to USB data stream can't be provided? Yes, I can interface to the RS-232 data stream but it's long term utility is highly uncertain. At 10 packets per second, the data rate is pretty bad. Any chance that at the very least a baud rate higher than 57K baud can be selected and a packet rate faster than 10 per second forced if the number of pids is low?

Sam

FlashScan's RS232 interface is designed for use with:

dedicated Dyno Control computers (usually desktop based PCs with real UART ports)
wide band controllers
other embedded systems

Most of those devices that are intended for use with the RS232 data stream only have RS232 available, they do not have access to USB.

We may support a high speed CAN based PID interface in future.

If your programming skills extend to handling memory mapped files and semaphores, you could hook directly into EFILive's Scan/Tune interface. Then you can grab the PID data directly from the Scan Tool's memory image as often as you like.
Let me know if you're interested in implementing something like that and I'll send you the specifications.

Just for your info, here's the shared memory layout (Delphi code) for getting PID data from the Scan Tool


PARM_LEN = 32;
UNITS_LEN = 32;
MAX_SHMEM_FRAMES = 100; // Maximum number of frames in shared memory

TShmemParm = record
Name: array[0..PARM_LEN-1] of char;
value: double;
units: array[0..UNITS_LEN-1] of char;
end;
TShmemFrame = record
pidCount: integer;
age: integer;
notes: Cardinal;
parm: array[0..MAX_PIDS-1] of TShmemParm;
end;
TShmemArray = record
vinScan: array[0..17] of char;
vinDirty: boolean;
pidListDirty: boolean;
cnxTune: boolean;
cnxScan: boolean;
newData: boolean;
newRealtime: boolean;
dirty: boolean;
firstFrame: integer;
frameCount: integer;
frame: array[0..MAX_SHMEM_FRAMES-1] of TShmemFrame;
end;


If in the Scan Tool, you're scanning real-time data then only frame[0] contains valid data and frameCount will be 1.
If you're viewing previously recorded data, then frames[0..99] contain the first 100 frames of selected data and frameCount will be the MIN(100,number of frames selected by user).

Note:
Cardinal is a 'C' unsigned long
boolean is a 'C' unsigned char
integer is a 'C' int
double is a 'C' double
char is a 'C' char
record is a 'C' struct
array[0..x-1] is a 'C' array[x]

Regards
Paul

samgm2
August 27th, 2011, 01:27 AM
Perfect! I would very much appreciate this. I have extensive programming experience.

Thanks,

Sam


FlashScan's RS232 interface is designed for use with:

dedicated Dyno Control computers (usually desktop based PCs with real UART ports)
wide band controllers
other embedded systems

Most of those devices that are intended for use with the RS232 data stream only have RS232 available, they do not have access to USB.

We may support a high speed CAN based PID interface in future.

If your programming skills extend to handling memory mapped files and semaphores, you could hook directly into EFILive's Scan/Tune interface. Then you can grab the PID data directly from the Scan Tool's memory image as often as you like.
Let me know if you're interested in implementing something like that and I'll send you the specifications.

Just for your info, here's the shared memory layout (Delphi code) for getting PID data from the Scan Tool


PARM_LEN = 32;
UNITS_LEN = 32;
MAX_SHMEM_FRAMES = 100; // Maximum number of frames in shared memory

TShmemParm = record
Name: array[0..PARM_LEN-1] of char;
value: double;
units: array[0..UNITS_LEN-1] of char;
end;
TShmemFrame = record
pidCount: integer;
age: integer;
notes: Cardinal;
parm: array[0..MAX_PIDS-1] of TShmemParm;
end;
TShmemArray = record
vinScan: array[0..17] of char;
vinDirty: boolean;
pidListDirty: boolean;
cnxTune: boolean;
cnxScan: boolean;
newData: boolean;
newRealtime: boolean;
dirty: boolean;
firstFrame: integer;
frameCount: integer;
frame: array[0..MAX_SHMEM_FRAMES-1] of TShmemFrame;
end;


If in the Scan Tool, you're scanning real-time data then only frame[0] contains valid data and frameCount will be 1.
If you're viewing previously recorded data, then frames[0..99] contain the first 100 frames of selected data and frameCount will be the MIN(100,number of frames selected by user).

Note:
Cardinal is a 'C' unsigned long
boolean is a 'C' unsigned char
integer is a 'C' int
double is a 'C' double
char is a 'C' char
record is a 'C' struct
array[0..x-1] is a 'C' array[x]

Regards
Paul

Blacky
August 27th, 2011, 08:04 AM
shared memory name:

SHM_NAME = 'EFILiveScanTool';

Declare handles:

fdmem: THandle; // in 'C' declare as "THandle fdmem;"
shmem: ^TShmemArray; // in 'C' declare as "TShemArray *shmem;"

Attach to EFILive's shared memory segment:

fdmem := CreateFileMapping($FFFFFFFF,nil,PAGE_READONLY,0,si zeof(TShmemArray),SHM_NAME);
if ( fdmem<>0 ) then
shmem := MapViewOfFile(fdmem,FILE_MAP_READ,0,0,0);
else
shmem := nil;

Detach from EFILive's shared memory segment:

if ( shmem<>nil ) then
UnmapViewOfFile(shmem);
if ( fdmem<>0 ) then
CloseHandle(fdmem);

Access EFILive's shared memory segment:

pidName: string;
pidValue: double;

if ( Assigned(shmem) and shmem.newData and (shmem.frameCount>0) ) then
begin
for pid:=0 to shmem.frame[0].PidCount-1 do
begin
pidName := shmem.frame[0].parm[pid].Name;
pidValue := shmem.frame[0].parm[pid].value;
// Do something with the pid name and value here...
end;
end;


Note: When the Tune Tool is running it reads the PID data from the shared memory segment, then sets newData to false.
So if the Tune Tool is running you should not rely on the newData flag to determine if new data has been stored in the shared memory segment.

Regards
Paul

samgm2
September 3rd, 2011, 04:34 AM
Is timing advance available any other way? Does the current scanner software support live timing changes for a particular cell or as an offset to the timing tables? What about throttle position? I am sure that for new computers, this must be available as well (drive by wire).

I've come quite a ways with setting up something similar to the efilive MAP tables (for efficiency) but with access to the dyno control hardware. It would make tuning a snap if I could change timing on the fly. I could automate the entire tuning process. I am thinking of even driving throttle.

Sam

Blacky
September 3rd, 2011, 09:52 AM
Yes you can make live timing changes using the F12 tab page.
However, you can't automate that from an external app.
Automating it is something we are looking at implementing in the design of the V8 scan tool software.

Regards
Paul

Blacky
September 3rd, 2011, 09:53 AM
If you're tuning LS1 controllers have you considered a RoadRunner PCM?
That allows you to make changes to any table directly, in real time, while the engine is running, even under full load.

Regard
Paul

samgm2
September 3rd, 2011, 12:05 PM
Paul, I'm not interested in LS1 controllers. They are too old. I'm only interested in current technology and in alternative fuels. All of the tuning that I am doing is on Ethanol, Methanol, E-85 and in the very near future variations of Butanol (which is currently generating a lot of interest in the scientific community because it has nearly the same energy content as gasoline. My feeling about Butanol is that it is too costly to produce and has gelling and crystallization problems. That said, I've seen some very promising techniques for producing it (probably for its value for blending and as an octane enhancement agent). One of the Chemists that I used to work with developed a process that produced it at moderately low temperatures from methanol and ethanol (which was of great interest to US Midwestern farmers - because cars would not longer need to be flex fuel to run it).

The flame-front of alcohols combustion is significantly different from gasoline and requires a dramatically different spark table shape. I am simply trying to write software that will quickly find the best spark table for all the fuels and for combining those tables for flex-fuel operation. In this case an alcohol optimized engine would operate as a flex fuel vehicle by allowing the driver to put in Methanol, or Ethanol, or E-85 or Butanol, etc.

Sam


If you're tuning LS1 controllers have you considered a RoadRunner PCM?
That allows you to make changes to any table directly, in real time, while the engine is running, even under full load.

Regard
Paul

GMPX
September 3rd, 2011, 12:55 PM
Paul, I'm not interested in LS1 controllers. They are too old.
Paul mentioned the LS1 because that is the only PCM that can have real-time tuning in the after market, the new stuff cannot (unless you are GM I suppose).

samgm2
September 3rd, 2011, 01:38 PM
So how is dynamic spark done? Is this available for say the E-37 and E-38 computer or is it only for the old LS1 stuff? Is there an OBDII command to change timing and assuming there is, why (could it perhaps be for a traction control system that would order the PCM to retard timing to cut power)? Or is this something that you guys do some other way?

Sam


Paul mentioned the LS1 because that is the only PCM that can have real-time tuning in the after market, the new stuff cannot (unless you are GM I suppose).

GMPX
September 3rd, 2011, 09:51 PM
On the new ECM's the timing controls are very limited via the OBD-II port, it's restricted to subtracting timing only (an ECM constraint).