Bringing TBI and Multi Port Fuel Injection to a New Level.     EFI Conversions and Tuning! Seattle to Portland! E-mail Tuning Consultant!
Page 64 of 70 FirstFirst ... 14545960616263646566676869 ... LastLast
Results 946 to 960 of 1049

Thread: new $EE tuning thing!

  1. #946
    Fuel Injected! steveo's Avatar
    Join Date
    Aug 2013
    Posts
    2,437
    Quote Originally Posted by kur4o View Post
    My ultimate goal is to make an idle cylinder fuel correction patch. What I am missing is the control interface at the mode4 control window.
    If you can help with the interface it will be done really fast, since I have some ideas how to do it.
    what do you want the interface to look like? a toggle checkbox to turn it on, and maybe a field for each cylinder with a +/- button?

    tell me what bytes you want it to modify and i'll try to make it happen

  2. #947
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    byte 2 bit 7 will "set" TRIM correction.
    byte 9 will be selected cylinder for correction. It will be the same format as cylinder drop stream. 000-111 or 0 to 7
    byte 11 bit 6 will be global enable or it will switch from ram to bin table.
    UPDATE
    byte 8 will be new cylinder TRIM value in absolute format $80=0 correction
    idle rpm , linepress and egr correction should be greyed out.

    They might get some correction but the format will be the same.
    Here is how it should work to get some idea.
    On eside cylinder idle correction table will be copied to ram. The global enable will switch between ram and bin table.

    When you press set button you will enable correction to ram table. Than you need to press the cylinder number which will be corrected. it will be one cylinder at a time correction

    It will be great if each cylinder number button has separate display window which will be populated on start up from the table in bin. Than you make correction from two +- buttons, from that value. Since the value will be stored to ram it must be remembered in eehack when you switch from cylinder to cylinder correction.

    So it should look like 1 set button, 1 global enable button, 8 cylinder number select buttons, 8 display windows or 1 big display window, 2 +- buttons.
    The display can have raw hex values or steps. 1 step will be $01 in hex correction.Converted to decimal will take too much space.

    I played with the source code and managed to clone cylinder drop interface but is far from ready. I will try to give you some visual perspective so you don`t make any guess work.

    What will be nice addition is two buttons MAF and SD. Arbitary selection which one will be grey, based on maf/sd settings in bin.
    Attached Images Attached Images
    Last edited by kur4o; 01-29-2018 at 02:58 PM. Reason: add screanshot

  3. #948
    Fuel Injected! steveo's Avatar
    Join Date
    Aug 2013
    Posts
    2,437
    i can do that no problem, just have to find a few free minutes to do it. of course, i haven't looked at eehack's code in so long, I forget how most of it works.. but we'll manage. i will send you the areas of the source code that i've modified.

  4. #949
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    Great,
    I am looking forward for it. Patch is done. It just needs some testing.

    I was playing with the interface too, but still learning the hard way.

  5. #950
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    Here is my development so far. You can get it as starting point for the much needed refinements.
    Mode 4 commands work as expected, but the sliderbar doesn`t remember settings and don`t update to current cylinder setting.
    It also needs to be some idiot proof. When first a cylinder is pressed you get a value of 00 for correction, untill the slider is moved

    Second display bar with bin settings will be nice too.

    Source code attached.
    Attached Files Attached Files

  6. #951

  7. #952
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    We can do all, but one at a time. It works just like cylinder drop control. byte_9 on mode4 control string defines cylinder number: binary 000-111, hex 0-7, or 1-8 cylinder number.

    You can set the trims first at a ram table and than switch from ram table to bin table with the global enable switch at byte 12 bit 6.
    You can also modify the ram table when the global enable switch is on, but it will be one cylinder at time also. Switching byte_9 from 000-111 will change the cylinder number that`s controlled.

    It will be great if eehack can remember the last settings for each cylinder so you don`t have to adjust every time you switch the cylinder, since the slider remains in the last set position.

  8. #953
    Fuel Injected! steveo's Avatar
    Join Date
    Aug 2013
    Posts
    2,437
    Quote Originally Posted by kur4o View Post
    It will be great if eehack can remember the last settings for each cylinder so you don`t have to adjust every time you switch the cylinder, since the slider remains in the last set position.
    that's easily done! just need to make an array like this somewhere in the class defintion to store the values (in controller.h):

    Code:
    char cyl_trim_recall[8]; // char is 8 bit, array index starts from zero
    then you have to set them to zero when the class loads, otherwise they could contain random values. in the controller::controller function (which initializes the mode4 controller) you need to zero all of them (or whatever else)

    Code:
    for(int x=0;x<8;x++) cyl_trim_recall[x] = 0;
    then make a function or whatever:

    Code:
    void switch_trim_cyl(int old_id, int new_id) {
      // array is 0-7 cyl id is 1-8
      cyl_trim_recall[old_id - 1] = ui->trim_slider->value;
      ui->trim_slider->setValue(cyl_trim_recall[new_id - 1])
    }

  9. #954
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    It does look too advanced for my current skills, but I will give it a try.

    Will it be easy to display the bin trim table at another display and load these values for initial cylinders` slider values instead of zeroing them at initialization.

  10. #955

  11. #956
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    Mode 2 dump will be perfect, unless the engine is running. I noticed eside doesn`t like aldl interrupts when engine is on.
    In that case a copy of the current cyl trim table to some free space on tside will do the trick.

    I test the patch and it writes the ram table just fine. The only untested part is the switching between ram and bin table on eside, but that is really simple so now I need to test it on a running engine.

    I have been struggling to make a mode 3 dump of random byte and make it display on the controller window. The request is made(I checked aldl comms) and the display part is good. The problem is I always get zero at the display. So the linkage between the two is broke. Do you have some hints what I am doing wrong.

  12. #957
    Fuel Injected! steveo's Avatar
    Join Date
    Aug 2013
    Posts
    2,437
    QT has text displays like QLabel, QLineEdit, etc and numerical displays like QSpinBox.

    I assume you're using a text based display, lets say QPlainTextEdit (QLabel is better but I didnt know that when writing EEHack... EEHack was my first real QT program!)

    m3_get(x,y) should get you an integer, so

    Code:
    int x = m3_get(0x01,0x02);
    ...gets you a 16 bit integer as x.

    you need to convert that integer to a string to display. so...

    Code:
    QString s = QString::number(x);
    gets you a string representation, base 10, of your integer, as s.

    or if you want hex display base 16:

    Code:
    QString s = QString::number(x,16)
    then you go ahead and display that:

    Code:
    ui->your_text_thing->setPlainText(s);
    you can wrap it up into an ugly one liner if you want:

    Code:
    ui->your_display->setPlainText(QString::number(m3_get(0x01,0x02),16));
    or better yet, make a function:

    Code:
    void controller::your_function_name(byte a, byte b) {
      int x = m3_get(a,b);
      ui->your_display->setPlainText(QString::number(x,16));
    }
    then just call it when you need it:

    Code:
    your_function_name(0x05,0x08);

  13. #958
    Fuel Injected! steveo's Avatar
    Join Date
    Aug 2013
    Posts
    2,437
    one thing worth mentioning if you're using QT Creator, just put the cursor over something and press F1 and it'll give you help. for example if you have a QString object of any kind, click it then press F1 and it'll give you the manual for it. that's basically how I learned to use qt well enough to get EEHack working. QT has a function for almost everything you'd ever want to do.

    a lot of EEHack's code is a bad example to follow

  14. #959
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    456
    When I put this code in datastream.cpp
    Code:
     
        int cyltrim1_byte = m3_get(0x26,0xE5,0xE4);
        if (cyltrim1_byte != -9999) {
            log->info.trim1_bin.set(cyltrim1_byte);
    
        }else {
            log->info.trim1_bin.set(cyltrim1_byte);
    
        }
    and this in datalog_window.cpp
    Code:
       ui->cyltrims_display->setText(QString::number((qint8)log->info.trim1_bin.get(),10));

    It works and the display is updated.

    But if I move the ui->code to controller.cpp, it doesn`t want to update any value. Stays at zero.
    When I put the m3_get command in controller.cpp either I got errors or it doesn`t do anything.
    So definitely I am missing some linkage between the two functions.

  15. #960
    Fuel Injected! steveo's Avatar
    Join Date
    Aug 2013
    Posts
    2,437
    ahh i see what you're going for. the info header isn't a bad way to do it, but make sure it isn't trying to get data before any exists. the datastream and everything it does works in another thread so it can get a bit odd as far as serializing events goes

    log->is_data() should return true if there is log data, meaning that info data should be populated. i'd check for log->is_data() == true

    if control->ecminfo.get() == true that means there is a request to update ecminfo pending, which is a further indication the data may be stale, you can control->ecminfo.request() so the datastream thread refreshes that info..

    there's also a qt signal emitted from the datastream thread called updated_ecm_info() if you wanted to connect it to a slot to display your data. the 'proper event-driven way' to deal with this is create a slot in controller.h and connect it when the controller is initialized in the launcher.. that way it functions like a queued callback when the data gets retrieved. can walk you through that if you want.

Similar Threads

  1. 1badcell and thats not the only thing
    By 1badcell in forum Introductions
    Replies: 2
    Last Post: 12-30-2013, 04:25 PM
  2. Replies: 6
    Last Post: 11-27-2012, 11:03 AM
  3. Replies: 2
    Last Post: 11-07-2012, 07:26 AM
  4. Minor thing.
    By historystamp in forum GearHead EFI Forum Support
    Replies: 7
    Last Post: 01-21-2012, 02:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •