Jump to content

Generic 3d table for switched output


bradsm87

Recommended Posts

I've been playing around with the Storm sample file and can't seem to find a nice way to set up a 3d table or something else that can let me control an output's on or off state dependent on both load and RPM without at least wasting a GP PWM output that won't be physically used. I need to control Nissan on/off VTC  control and be able to customise the switch points based on both RPM and load. I have attached a screenshot from another ECU's approach to achieving this.

The only way I've found so far seems a bit messy but workable. If I enable a GP PWM output, set up the 3d table with values of 0 for off and 100 for on, not use that physical pin at all, enable another normal GP output, set the condition for that one to be on if the previously set up GP PWM is above 50%, put some other conditions in if needed and use that one as the VTC solenoid output. Is this the way to go or is there a better way?

I know Virtual GP PWM outputs are coming. This will be great because I don't know if I'll have a spare pin to assign a GP PWM to that won't be physically used anyway.

Switched VTC.jpg

Link to comment
Share on other sites

Yeah, I think would be good to have a GP boolean on/off table too.  Its been asked for a few times in the past, specifically for VTC.  I will get it on the wish list to consider.

You can just use a GP PWM but you have to choose your axis breakpoints carefully.  For instance if you want one switch point at 4000RPM, you need a column at 3999 and a column at 4000 to get rid of the interpolation.

Link to comment
Share on other sites

3 minutes ago, bradsm87 said:

Because it will still interpolate between cells and use duty cycles in between

Fair, you could give it very sharp cutoffs by playing with your axes or you could possibly use a math block instead of the gp pwm as it looks like it would be a reasonably simple equation.

Link to comment
Share on other sites

1 hour ago, Adamw said:

Yeah, I think would be good to have a GP boolean on/off table too.  Its been asked for a few times in the past, specifically for VTC.  I will get it on the wish list to consider.

You can just use a GP PWM but you have to choose your axis breakpoints carefully.  For instance if you want one switch point at 4000RPM, you need a column at 3999 and a column at 4000 to get rid of the interpolation.

Yes boolean on/off would be excellent. I've played with 3d tables with RPM axis of 999, 1000, 1999, 2000, 4299 and 4300. I need VTC on at 2000rpm at low load but on at 1000rpm at high load with effectively a straight line in between. I thought this would be really easy to do in a 3d map but it actually seems tricky to do with the playing around I've done.

1 hour ago, Vaughan said:

Fair, you could give it very sharp cutoffs by playing with your axes or you could possibly use a math block instead of the gp pwm as it looks like it would be a reasonably simple equation.

Interesting concept. Yes math block could be a winner to get the different cutoff at varying load. I'll have a play with that option. Thanks.

Link to comment
Share on other sites

OK here is a challenge! I'm not sure that a math block can do this but maybe I just can't get my head around how to do it. Here is an excel formula that does exactly what I need for the lower VTC threshold, that is, 2000rpm up to 40kpa with the RPM threshold gradually decreasing to 1000rpm at 80kpa then staying at 1000rpm at higher than 80kpa. The excel formula works as I would want the math block to work.

VTC lower threshold.jpg

Link to comment
Share on other sites

21 minutes ago, mapper said:

I would try to use an Virtual Aux with on condition

Aux pwm > 50% 

And switch off time of 0.2sec or so

This gives you a boolean including hysteresis. 

I'd still need to enable a GP PWM output which occupies a real output pin to get the PWM value from. I need a GP output to apply the on/off to a real output anyway so what advantage would bringing a Virtual Aux in have?

Link to comment
Share on other sites

58 minutes ago, bradsm87 said:

I'd still need to enable a GP PWM output which occupies a real output pin to get the PWM value from. I need a GP output to apply the on/off to a real output anyway so what advantage would bringing a Virtual Aux in have?

Sorry my fault. You have to do it the other way arround. 

Virtual Aux PWM 

Aux with condition VA PWM > 50%

and turn off delay: 0.2sec

But yes we  have to wait for VA PWM update

Link to comment
Share on other sites

coworker has made the comment that you might be better of switching around math block 1 and 2 there as that would mean the LH End calculation would happen immediately before the lower threshold calulation which uses it instead of using the value from the last round of calculations, I doubt you would be able to see a difference but it would be more technically correct.

Link to comment
Share on other sites

After a bit more playing with this, can I request that you consider implementing a dedicated "cam switch" feature? This could apply to Nissan VTC on SR20s and TB48s as well as Honda VTEC, Toyota VVTL-i etc etc. It would be nice to have setpoint setup with the same (or more) control as the arrangement screenshotted in the first post as well as user definable lockouts (eg. don't engage below X speed, X MAP)?

Link to comment
Share on other sites

8 hours ago, bradsm87 said:

After a bit more playing with this, can I request that you consider implementing a dedicated "cam switch" feature? This could apply to Nissan VTC on SR20s and TB48s as well as Honda VTEC, Toyota VVTL-i etc etc. It would be nice to have setpoint setup with the same (or more) control as the arrangement screenshotted in the first post as well as user definable lockouts (eg. don't engage below X speed, X MAP)?

Our GP Output style of control for the GP PWM functions combined with a non interpolated table with only on/off state would do this.

Weirdly Adam and I were discussing this type of function last week, I added it to our issue tracker probably the same day as your OP.

Link to comment
Share on other sites

14 hours ago, TechDave said:

Our GP Output style of control for the GP PWM functions combined with a non interpolated table with only on/off state would do this.

Weirdly Adam and I were discussing this type of function last week, I added it to our issue tracker probably the same day as your OP.

How would non-interpolated work when you have for example?:

         1000    2000
40        0          1
80        1          1

Would the "cutoff line" follow straight between those diagonal cells? Would 60kpa at 1500rpm be 1 because that's what I would need?

Link to comment
Share on other sites

35 minutes ago, bradsm87 said:

Would the "cutoff line" follow straight between those diagonal cells? Would 60kpa at 1500rpm be 1 because that's what I would need?

Correct, thats how I would expect it to work.  The switch point would be 60kpa and 1500RPM.  59.9kpa and 1499RPM would be off.  60.0Kpa and/or 1500RPM would be on.  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...