Questions about the implementation
Posted: Sat Oct 30, 2021 12:55 am
I've been reading over some of the code and have come up with some questions. Sorry if this is newbie stuff, but here goes:
1. I see some rather complicated logic around MAP averaging. I assume the idea is to smooth out the pulse that happens as the valves open and close. Any reason not to just use a simple RC circuit to low pass at 100Hz, reducing max sample rate from 10kHz to 1kHz-ish? Given most wiring harnesses don't use a shielded or twisted cable for MAP (unlike knock sensors), it seems overkill to sample so high. i.e. is it really necessary to track cylinder to cylinder differences in MAP at 9000RPM, or is having the average for the whole crank rotation sufficient? I could see needing additional filtering at very low RPM though, so perhaps the complexity remains, but at a lower frequency.
2. A lot of tables seem to have hard coded sizes and axis. I assume this is a limitation of TunerStudio? Some aftermarket EMS let you change the axis to be anything you want, which is gives the user a lot of flexibility, esp when the output of one table can used as an input to another table. Is there a goal to move in that direction, or is the idea that if users want to change anything they need to edit the source code? I guess one possibility would be to implement a rudimentary table constructor using the console, and then have that spit out a custom TS ini file.
3. Some tables seemed overprovisioned in accuracy; the ignition table uses a float instead of an int16_t in 0.01 degrees, the VE table is a float instead of 0.01%, etc. Is this easy to change or would it break compatibility with existing tunes (does TunerStudio convert appropriately between configurations?) I did see a pending pull request that addresses some of the load bins, but not the tables themselves.
4. I guess a hardware question - is there a reason the pins are protected with op-amps instead of relying on input impedance (some sort of RC circuit, maybe voltage divider since the MCU is a 3.3V part) and built in pin diodes?
1. I see some rather complicated logic around MAP averaging. I assume the idea is to smooth out the pulse that happens as the valves open and close. Any reason not to just use a simple RC circuit to low pass at 100Hz, reducing max sample rate from 10kHz to 1kHz-ish? Given most wiring harnesses don't use a shielded or twisted cable for MAP (unlike knock sensors), it seems overkill to sample so high. i.e. is it really necessary to track cylinder to cylinder differences in MAP at 9000RPM, or is having the average for the whole crank rotation sufficient? I could see needing additional filtering at very low RPM though, so perhaps the complexity remains, but at a lower frequency.
2. A lot of tables seem to have hard coded sizes and axis. I assume this is a limitation of TunerStudio? Some aftermarket EMS let you change the axis to be anything you want, which is gives the user a lot of flexibility, esp when the output of one table can used as an input to another table. Is there a goal to move in that direction, or is the idea that if users want to change anything they need to edit the source code? I guess one possibility would be to implement a rudimentary table constructor using the console, and then have that spit out a custom TS ini file.
3. Some tables seemed overprovisioned in accuracy; the ignition table uses a float instead of an int16_t in 0.01 degrees, the VE table is a float instead of 0.01%, etc. Is this easy to change or would it break compatibility with existing tunes (does TunerStudio convert appropriately between configurations?) I did see a pending pull request that addresses some of the load bins, but not the tables themselves.
4. I guess a hardware question - is there a reason the pins are protected with op-amps instead of relying on input impedance (some sort of RC circuit, maybe voltage divider since the MCU is a 3.3V part) and built in pin diodes?