Phil's missing teeth decoder dev thread

Official FreeEMS vanilla firmware development, the heart and soul of the system!
User avatar
jbelanger
LQFP144 - On Top Of The Game
Posts: 387
Joined: Sat Feb 23, 2008 8:58 pm
Contact:

Re: Phil's missing teeth decoder dev thread

Post by jbelanger »

Actually, if you only look at the rising edges the signal is fine. It's only if you're looking at the falling edge that you have what would looks like 2 bigger gaps. The LPT sym signal is exactly the same as the one from the megamanual.

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

Re: Phil's missing teeth decoder dev thread

Post by Fred »

Good point Jean, looking at the code the else block has lots in it. It should have precisely nothing.

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!
johnsop1
DIP8 - Involved
Posts: 26
Joined: Tue Jan 13, 2009 1:56 am

Re: Phil's missing teeth decoder dev thread

Post by johnsop1 »

I guess it all depends on how the hardware signal detector works. If it only detects the rising edge and then returns low a fixed time after, you will get an output that will match the jimstim. If the detector goes high on the rising edge and then goes low on the falling edge you will get something like my LPT sym. The rising and falling edge detector gives more information and should decode better. Any Idea the type of detector we will be using? I can write code for ether.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Phil's missing teeth decoder dev thread

Post by Fred »

Because you only sense the zero crossing, only one edge of any signal is in an accurate position angle wise. Thus you should only run important code on the leading edge (transition from 0 to 1). The other code will get a generic function to filter noise at some point but for now the trailing edge should just turn off the LED output again. I could configure the timer to only generate an interrupt on those edges, but the other edges will still be useful for simple things, but definitely not for timing or sync purposes.

Cheers,

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!
johnsop1
DIP8 - Involved
Posts: 26
Joined: Tue Jan 13, 2009 1:56 am

Re: Phil's missing teeth decoder dev thread

Post by johnsop1 »

Because you only sense the zero crossing
Careful there Fred. I think you mean "Because you only sense the rising edge zero crossing". There is a also a falling edge zero crossing. Some detectors can detect both.

Sorry to be so picky. I am an old hardware guy and these details are important.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Phil's missing teeth decoder dev thread

Post by Fred »

johnsop1 wrote:
Because you only sense the zero crossing
Careful there Fred. I think you mean "Because you only sense the rising edge zero crossing". There is a also a falling edge zero crossing. Some detectors can detect both.
Well, you are right, I was vague. What I should have said was "Because you only sense the falling edge and output an accurate rising edge to trigger from" etc. The thing is, a fixed tooth spacing will give you a nice set of edges, but if you look at a single tooth's pattern it rises slowly from zero not crossing it going more positive, then falls through zero rapidly at an exact place (the tooth centre) and then rises slowly back to zero again, also not crossing it. You can say that there is another crossing in there (because by definition there must be), but the location of it is not deterministic. I hope that made a little more sense than before :-)
Sorry to be so picky. I am an old hardware guy and these details are important.
I like picky :-) There is a distinct lack of picky/honest on another forum I know of due to censorship. You'll never offend me by correcting me when I'm wrong :-) I like it, everyone learns from good arguments/discussions.

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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Phil's missing teeth decoder dev thread

Post by Fred »

OK, I finally have my JimStim under control, so feel free to throw s19's at me any time.

If the stuff is really experimental and you don't want it to ever show up in the history then you can work on a temporary branch and discard it at the end if it sucks. Or if it rocks you can just merge it back into your master and push. :-)

git branch <name>

gets you an identical copy of the current commited HEAD

then you can work on it however you want by

git checkout <name>

commit commit commit

and if you like some of it, but not some others you can use git cherry pick to pull various bits out

there are even interactive modes to make sure you get the lines you want and not the ones you don't.

Sorry for being evangelist like :-)

Back to the code 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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Phil's missing teeth decoder dev thread

Post by Fred »

Ok Fred,

Here is an S19 that I hope will sync on a 36-1 jimstim.

Phil
Push that code up! :-) It syncs up pretty quickly. Rapidly varying RPM makes it drop out briefly but it comes back in quickly at any RPM. The JimStim varying RPM is pretty nasty though because it varies in steps which is worst case for a decoder. I'd say it's a success. And now I wanna see the code! :-)

I've been working on a formatter for eclipse. I'm getting closer with it... but a bit still to do. I'll let you know when I commit it to the docs directory. Mean time you can pull my changes whenever you like. I'll let you know if there are any that are relevant to you.

I guess the garbage collection means you are on Debian or Ubuntu. Did you mention that earlier? I'm not sure. Good OS's though! I prefer deb but I'm fussy as hell.

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!
johnsop1
DIP8 - Involved
Posts: 26
Joined: Tue Jan 13, 2009 1:56 am

Re: Phil's missing teeth decoder dev thread

Post by johnsop1 »

It's pushed.

Now to grab your new stuff and figure out some this spark and squirt stuff.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Phil's missing teeth decoder dev thread

Post by Fred »

Pulled merged and pushed.

We should agree on a merge strategy. IE, there is no point in you merging my stuff with yours and me merging your stuff with mine. Either I should merge your stuff in and you should take it back again or vice versa. Obviously if you've been working on it since I merged yours into mine it is valid to remerge, but otherwise it seems like doing the work twice, once each. Perhaps the best approach would be to pull my stuff to a separate branch, see if you need/want any of it (mostly you won't care) and then ignore it. Then before each push you do a pull, merge and then push. If I keep my public up to date the chances are I can just pull and merge yours with a fast forward (no commit required). Anyway, enough musing on that...

Nearly 2am here, so it's off to sleep for me :-)

Thanks!

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!
Post Reply