Retard per cylinder: Don't use all sensors[x]

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Retard per cylinder: Don't use all sensors[x]

Post by Reverant »

Retarding per cylinder on knock, and logging the retard amount to sensors[x], uses ALL outpc.sensors[0-15], regardless of the actual cylinder number:

Code: Select all

    if (ram5.knock_conf & KNOCK_CONF_DEBUG) {
        /* for debug */
        for (x = 0; x < 16; x++) {
            outpc.sensors[x] = v2.knk_rtd[x];
        }
    }
Why not change to:

Code: Select all

    if (ram5.knock_conf & KNOCK_CONF_DEBUG) {
        /* for debug */
        for (x = 0; x < ram4.no_cyl; x++) {
            outpc.sensors[x] = v2.knk_rtd[x];
        }
    }
Or even better, log to actual outpc variables once we allow for sizeof(outpc) > 512?

Yes, no, maybe?
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: Retard per cylinder: Don't use all sensors[x]

Post by racingmini_mtl »

If this is really a debug feature (as the code shows), that constraint should not be an issue. If you want it to be a feature used for normal operation then it is a different thing.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: Retard per cylinder: Don't use all sensors[x]

Post by Reverant »

If you use retard per cylinder, you really, REALLY want to be able to see it and log the retard per cylinder. Does anyone really think otherwise?
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: Retard per cylinder: Don't use all sensors[x]

Post by racingmini_mtl »

I agree with you but this is obviously not what is intended by that piece of code because it actually repurposes sensor variables for some debug information. That is not how normal features work so I assume this is due to the current limitations, as you mentioned.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: Retard per cylinder: Don't use all sensors[x]

Post by Reverant »

Still, as the knock code only retards cylinders that are up to ram4.no_cyl, there's no point in recording for cylinders that are never going to be retarded. Just saying.
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: Retard per cylinder: Don't use all sensors[x]

Post by racingmini_mtl »

The problem is that you're looking at it as a normal logging feature which it is not. It's a debug feature. It will overwrite normal outputs which makes it unacceptable as a normal feature regardless of the number of wasted outputs.

It would have to clearly prevent the use of the overwritten outputs (in the ini, presumably) and have information in the tooltips about this to even start to be considered as a normally usable logging feature.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: Retard per cylinder: Don't use all sensors[x]

Post by Reverant »

Time to put the retard per cylinder info in the outpc then.
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
Suprazz
Master MS/Extra'er
Posts: 500
Joined: Mon Jan 22, 2007 7:58 pm
Contact:

Re: Retard per cylinder: Don't use all sensors[x]

Post by Suprazz »

I agree
Best looking and most advanced CAN-bus gauge
Toyota Supra 7MGE, 7M-GTE and 1JZ-GTE Plug and play ECUs: http://www.perfecttuning.net
Serial to Bluetooth or Serial to WiFi
DIYAutotune Canadian, EFI Source and ECUMaster reseller!
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: Retard per cylinder: Don't use all sensors[x]

Post by Reverant »

Bump for this one.

I would like to be able to monitor/log the per-cylinder ignition retard, and yet still use some/all of my Generic sensors.
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Retard per cylinder: Don't use all sensors[x]

Post by vw_chuck »

Yea if you are controlling fuel per cylinder and spark per cylinder you should be able to see what each is doing on a per cylinder basis.
You should also be able to see knock on a per cylinder basis. This is common sense for knock control.
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: Retard per cylinder: Don't use all sensors[x]

Post by Reverant »

Bump.

I understand that re-writing the code to overcome the 512byte outpc limit is a task that will consume a lot of man hours, so as a workaround, PLEASE just use the no_cyl variable instead of 16. That way we can at least log each cylinder without losing all generic sensors, at least until we overcome the outpc limit. It's a 10 second code change. I just don't see why one of the devs can't do it.
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
Post Reply