View Single Post
Old 10-28-2023, 06:02 AM   #196 (permalink)
t vago
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 830
Thanked 708 Times in 456 Posts


Got the fuel injector simulator to spit out an approximation of a frequency modulated peak and hold signal, as can be seen below. The yellow waveform is the base fuel injector signal that MPGuino initially generates as a reference, and the blue waveform is the peak/hold output. However, the hold portion appears to be itself delayed, very likely due to MPGuino capturing these pulses itself.



See, the fuel injector and VSS simulators both generate signals that are supposed to be reasonable approximations of what MPGuino would actually see from a running, moving vehicle. As soon as MPGuino switches the edge of a given simulator waveform signal, it will actually handle that signal change via the interrupts that it would normally use. This is very useful for refining and troubleshooting the signal capture interrupt code. However, it can also introduce delays, especially on lower-level interrupts. The VSS and fuel injection signal capture interrupts are two of the highest priority interrupts within MPGuino - they will always have higher priority over any other interrupts being used. The simulators use the timer1 overflow interrupt, which is also use for LCD delay generation, and of course they have a lower priority on the interrupt hierarchy. So, when the timer1-based simulator generates the waveform, the higher priority interrupt will immediately take over once the timer1 overflow interrupt code ends.

And this is likely why the hold portion of the simulated peak/hold fuel injector signal is missing a few spikes.

On the plus side, my MPGuino code could already somewhat handle frequency modulated peak/hold signals. The code can correctly read the number of fuel injector pulses and can therefore calculate engine speed. However, it currently cannot accurately measure the length of the peak/hold signal... That will be the next trick I teach it.
Attached Thumbnails
Click image for larger version

Name:	TBIInjector.gif
Views:	124
Size:	55.7 KB
ID:	34275   Click image for larger version

Name:	Screenshot 2023-10-28 104620.jpg
Views:	133
Size:	72.8 KB
ID:	34276  
  Reply With Quote