Arduino go kart EMS
Re: Arduino go kart EMS
Thanks Fred. I appreciate your thoughts greatly.
I'll post again in a little while once things really begin to take shape.
I'll post again in a little while once things really begin to take shape.
Re: Arduino go kart EMS
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!
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!
-
- LQFP112 - Up with the play
- Posts: 119
- Joined: Sat Apr 24, 2010 1:42 am
- Location: New Zealand
Re: Arduino go kart EMS
Code: Select all
float q = ((float)(Y - yMaxValue)) / (float)(yMinValue - yMaxValue);
Re: Arduino go kart EMS
Cheers, all fixed up now (Including removal of all the floats).johntramp wrote:Take care you don't divide by zero.Code: Select all
float q = ((float)(Y - yMaxValue)) / (float)(yMinValue - yMaxValue);
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
Re: Arduino go kart EMS
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
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!
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!
Re: Arduino go kart EMS
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
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
Re: Arduino go kart EMS
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.
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!
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!
Re: Arduino go kart EMS
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?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
.
Re: Arduino go kart EMS
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!
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!
Re: Arduino go kart EMS
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:
To cut down on math, when walking down the array from higher to lower bin values, just do 'half' of the test.
Does that make sense?
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]) )
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])