Max Square Wave Latency

From DIY contraptions to sophisticated FreeEMS-specific designs! Plus general hardware development!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Max Square Wave Latency

Post by Fred »

I just checked the entire code base over looking for issue 499 only to find that the max9924 circuit on my PumaS1 introduces a constant 0.11ms of delay into the input, and thus the output, if you sample the input before the MAX chips...

I'm wondering if this is normal or if there is a problem with the Puma and if there is any way to reduce it to near zero. If not we'll have to add a hardware latency setting into the code soon. I was planning to eventually anyway, but I don't like the idea of needing that much of one by default.

I guess we'd really need three:
  • Input latency
  • Injector output latency
  • Ignition output latency
All should be margin-of-error small, but right now the first one is fairly big for me.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
DeuceEFI
LQFP144 - On Top Of The Game
Posts: 578
Joined: Thu Feb 25, 2010 3:57 am
Location: Gosport, IN USA
Contact:

Re: Max Square Wave Latency

Post by DeuceEFI »

Here are the results of my testing with the 1nF capacitor between the input resistors and without the capacitor.
Attachments
MAX9926_Latency_Without_1nF_Capacitor.logicdata.zip
WITHOUT the 1nF capacitor between the input resistors.
(1.52 KiB) Downloaded 789 times
MAX9926_Latency_With_1nF_Capacitor.logicdata.zip
With the 1nF capacitor between the input resistors.
(1.46 KiB) Downloaded 785 times
TonyS
LQFP112 - Up with the play
Posts: 192
Joined: Mon Jun 21, 2010 4:18 pm

Re: Max Square Wave Latency

Post by TonyS »

Hey Andy (or Fred),

Fred stated in his software diary thread that issue 499 is now fixed.
Do the files you attached (which I don't know how to read) show that the delay was caused by the value of cap? Thanks, Huff
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Max Square Wave Latency

Post by Fred »

It seems to have an effect. I wonder if using a stiffer input resistor would be wise too. maybe 1k + no cap. Hard to say. This testing is far from complete.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
MotoFab
1N4001 - Signed up
Posts: 307
Joined: Thu May 29, 2008 1:23 am
Location: Long Beach CA

Re: Max Square Wave Latency

Post by MotoFab »

Last night I chatted with DeuceEFI about this issue. On the Max9926 part, the 1nF cap across the inputs pins can be removed. The 9926 will operate just fine.

The other possibility is to feed the Hall Effect signal into the negative input pins (IN1- and IN2-), and let IN1+ and IN2+ float. Also no capacitor. In this configuration the output signal is inverted.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Max Square Wave Latency

Post by Fred »

MotoFab wrote:Last night I chatted with DeuceEFI about this issue. On the Max9926 part, the 1nF cap across the inputs pins can be removed. The 9926 will operate just fine.
Actually, this is not true. Andy showed a reduction to around 40% latency over the stock configuration which is still WAY too much.
The other possibility is to feed the Hall Effect signal into the negative input pins (IN1- and IN2-), and let IN1+ and IN2+ float. Also no capacitor. In this configuration the output signal is inverted.
This seems entirely pointless, and would render the output signal incompatible.

What may work is holding the negative line at 2.5V, though.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
TonyS
LQFP112 - Up with the play
Posts: 192
Joined: Mon Jun 21, 2010 4:18 pm

Re: Max Square Wave Latency

Post by TonyS »

Hi Fred,
Can you detail your experimental setup a bit?

I am curious as to the details in determining how the 110us delay measurement was derived.
Does the Fredstim generate two, out of phase bi-polar signals with the 0V point being the time reference for your measurement?

Maybe you could also use the "Hall" configuration (0 - 5V square wave on + input and floating - input) to confirm latency.

Thanks,
Huff
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Max Square Wave Latency

Post by Fred »

Huff, the fredstim is a straight 0-5V "hall" signal, and at the time, I had a floating -ve lead and the cap installed. Andy tried without the cap and halved my latency. I came across it while testing firmware and thought i had a code/math issue. I checked and double checked every single line of code before clicking, realising, and checking the hw. I've not done any experiments or checks, however I may do some "any day now" as I have the required equipment to do that.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Max Square Wave Latency

Post by Fred »

Bump :-)
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Dan
LQFP144 - On Top Of The Game
Posts: 1204
Joined: Tue Mar 02, 2010 2:33 pm
Location: Australia

Re: Max Square Wave Latency

Post by Dan »

Bump! :-)

Can I do anything to help here?
Post Reply