Arduino go kart EMS

Free Open Source Firmware project discussion forum. Post your Free Open Source firmware projects here!
noisymime
DIP8 - Involved
Posts: 29
Joined: Wed Feb 06, 2013 4:12 am

Re: Arduino go kart EMS

Post by noisymime »

Thanks Fred. I appreciate your thoughts greatly.

I'll post again in a little while once things really begin to take shape.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Arduino go kart EMS

Post by Fred »

You're welcome :-)
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!
johntramp
LQFP112 - Up with the play
Posts: 119
Joined: Sat Apr 24, 2010 1:42 am
Location: New Zealand

Re: Arduino go kart EMS

Post by johntramp »

Code: Select all

 float q = ((float)(Y - yMaxValue)) / (float)(yMinValue - yMaxValue);
Take care you don't divide by zero.
noisymime
DIP8 - Involved
Posts: 29
Joined: Wed Feb 06, 2013 4:12 am

Re: Arduino go kart EMS

Post by noisymime »

johntramp wrote:

Code: Select all

 float q = ((float)(Y - yMaxValue)) / (float)(yMinValue - yMaxValue);
Take care you don't divide by zero.
Cheers, all fixed up now (Including removal of all the floats).

A quick question around wheel decoding / speed calcs... For the missing wheel, I'm just testing for a gap time of >1.5x the last gap time to determine a missing tooth. I'm also calculating RPM based on the time between the last 2 teeth (Obviously taking a missing tooth into account).

Are these sane approaches? I'm particularly worried about determining RPM from just the last 2 teeth, should I be averaging out over, say, the last 4 or anything?

Really appreciate any help. Thanks
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Arduino go kart EMS

Post by Fred »

You will get a lot of RPM noise that way. What you want to do, and me too, as I have RPM noise right now, is choose cylinder count / 2 points (for a 4 stroke) and use those. For a 2 stroke single cyl, just do RPM once per revolution. Clearly at lower revs this'll be very wrong, though. During cranking you may want to just use all teeth as you are, then switch once running, or some other scheme. I'm planning to make mine configurable to some extent. This is one reason why I said single cylinder is HARD... think about RPM variation during a cycle, it's bad enough on a real engine, on a single cylinder it's wild.

http://www.facebook.com/photo.php?fbid= ... =3&theater

For gap testing, you'll want to be more fussy than that. But not as fussy as I was/am. My implementation is too slow. What I plan to do is be fancy only while syncing, and then check tolerance vs expected there after. Read this: viewtopic.php?f=56&t=1340
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!
noisymime
DIP8 - Involved
Posts: 29
Joined: Wed Feb 06, 2013 4:12 am

Re: Arduino go kart EMS

Post by noisymime »

Huge thanks Fred, you're a tremendous help!

I'm still just bench testing with a stim at the moment as the engine is a few weeks from ready, but I'm nearly at a point in the code where all the basic requirements are covered. That's not to say they're any good, or even that they'll work at all, but they're there :)
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Arduino go kart EMS

Post by Fred »

What sort of stim? JimStim default does not provide a realistic reverse polarity signal for missing tooth. FredStim does, though, but that's more expensive and more likely to start a FreeEMS addiction :-)

And, you're welcome, of course! :-)

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!
noisymime
DIP8 - Involved
Posts: 29
Joined: Wed Feb 06, 2013 4:12 am

Re: Arduino go kart EMS

Post by noisymime »

Fred wrote:What sort of stim? JimStim default does not provide a realistic reverse polarity signal for missing tooth. FredStim does, though, but that's more expensive and more likely to start a FreeEMS addiction :-)
.
Yeah just a JimStim I had from a prior MS project (Sorry, hadn't even heard of FreeEMS at that time!). Is the missing reverse polarity a problem if I'm only planning on using a hall gear tooth sensor?
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Arduino go kart EMS

Post by Fred »

No, that's VR specific.
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: Arduino go kart EMS

Post by MotoFab »

Hey there Noisy, sounds like a fun project you're working on. I think you can get there with an Arduino. It's certainly a great learning process. Having to work within possible hardware constraints often produces creative solutions. And that process stays with you for life.

Anyway, I have a couple of suggestions for what they're worth. Sorry in advance if the code isn't correct.

Do a range check before walking through the table.
If false, then there would be some error condition to deal with.
Something like this maybe:

Code: Select all

// Range check for lower that the highest bin, and higher than the lowest bin.
//Or break it up into 2 tests to determine which end of the scale is out of range.
if ( (Y <= fromTable.axisY[y]) && (Y >= fromTable.axisY[y-7]) )
To cut down on math, when walking down the array from higher to lower bin values, just do 'half' of the test.

Code: Select all

//Instead of:
if ( (X <= fromTable.axisX[x]) && (X >= fromTable.axisX[x-1]) )

//Only do half of the test, the other half is redundant.
//Only check to see if the compared value is higher than the value in the next lower bin.
//Something like this:
if (Y >= fromTable.axisY[y-1])
Does that make sense?

Post Reply