Jump to content

Hercules engine control

Recommended Posts

SPNU517A.pdf, page 594 notes:


17.3 Angle Functions

Engine management systems require an angle-referenced time base to synchronize signals to the engine toothed wheel. The N2HET has a method to provide such a time base for low-end engine systems. The reference is created by the N2HET using three dedicated instructions with fractional angle steps equal to

/8, /16, /32, /64.


Trying to wrap my head around this.


They say "low-end" systems. What is "low end"? Can I spin my 32 tooth wheel to 11000 RPM and get an accurate 'angle' from this?


This is going to be fun. ;)



*note- thread / topic title changed.

Link to post
Share on other sites
  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Looks like absolutely the right guy ended up with the board.

All I need are 12 more characters and I can install some unknown software package.... 

Thought about it some more: I'm an idiot. And if I had a dollar for each time I've had that epiphany, I'd be a rich idiot. I have two VR sensors around, and a single tooth on the flywheel, so can ge

Posted Images

Anyhow, been thinking about this and using eQEP module [page 432 of the aforementioned PDF] for crankshaft position determination but it needs an 'index' position indication which I can't really get with a 32 tooth wheel on the end of the crankshaft as it's a separate signal, and being stuck in the rear engine case with oil splashing around... and also seems to prefer 90* separation between A and B pickups... I'm at a loss. I can give it 80* between pickups, which might work, but the index is the kicker as I cannot easily modify things for a third single trigger. Further complicating things is the pickups are variable reluctance so I have to condition those, likely MAX9926 will be used.


I can provide a trigger signal from the camshaft position sensor but it is one tooth (hurray!), turns 1/2 crankshaft speed (boo!) and is subject to cam chain slap (hiss!).


I can generate a relatively well 'known' index (chain slap isn't that much actually, maybe 1/4 crankshaft degree and the chain is under tension at the signal point anyhow so no real slap) once every two turns of the crankshaft. If I treat the A & B signals as a 64 signal (tooth) encoder (128 if I catch falling and rising on both), and realize I'd need probably 2-4 full crank rotations to get accurate index, it might work?


All the calculations would need to take into account I'm measuring over two crank rotations instead of one, and might not be a bad thing actually since I'd be detecting engine cycle and crankshaft position instead of simply crankshaft position. I could use that to determine when in the engine cycle is the best time to read sensors and take a little load off the ADC and sample manifold air pressures when needed instead of continuously.


One need is to fire two spark plugs, one time each, every two crankshaft revolutions. So one plug fires (the numbers are conversational, not literal) at 0*, the next fires 440 degrees later (360+80) later, then the first fires 280 degrees (360-80) later. If I treated it like 720* instead of 360* would I be able to be at least as accurate as before?


Considering the 32 tooth 'wheel' with two detectors spinning at 10000 RPM, that's ((32*2)*10000)/60, right? So, 10667 'pulse per second', or nearly 11KHz; capture both rising and falling edges that jumps to 22KHz. Again, considering 32 'teeth', that's angular resolution of 11.25 degrees between rising edges (or falling edges), and sampling both rising and falling, resolution theoretically increases to 5.625 degrees.


Throw N2HET and angle generator in and the more reading and thought necessary of course, it appears that with sufficient 'tooth' resolution and an accurate timer, one could derive a reasonable angle assumption from the period between subsequent 'tooth' events, knowing engine rotational speed.


I wish there were more gearheads around here. ;)

Link to post
Share on other sites

Thought about it some more: I'm an idiot. And if I had a dollar for each time I've had that epiphany, I'd be a rich idiot. :lol:

I have two VR sensors around, and a single tooth on the flywheel, so can get an accurate 'index' for either cylinder on every rotation.

So with one of those VR's and the two around the 32-tooth wheel I can get crank position.

Toss in the cam NE sensor and I can get engine cycle information (i.e. intake, compression, power, exhaust) too, so can schedule sensor readings appropriately.

Link to post
Share on other sites

I have a 91 Toyota Pickup so it has some OBD just not OBD-2 stuff. Only has a funky under-hood connector that one has to fart with in order to get any meaningful info... and watch the 'check engine' light blink out codes. I don't really fancy myself as a gearhead either, though I could tear down the truck to the last bolt and reassemble it given all the proper tools... which I lack most of. I do all of my own vehicle work, excepting anything that needs 'specialty' tools I can't rent.

Link to post
Share on other sites

So I need to fashion up a VR sensor conditioning circuit... thinking I might need a pair of MAX9926. Use one to get the two 'gear' wheel VR signals out for the A & B quadrature decoder, and the other to get the flywheel VR out for the index signal, and the unused channel on the 2nd 9926 can get the cam NE signal out for engine cycle determination. Fortunately, I have 6 of those chips here waiting to be exploited. ;)


So I'll need clean 12v to 5v & 3.3v rails, throttle position, manifold and barometric pressure and temperatures and coolant temperature inputs, and need to have outputs to control the injectors, ignition, fuel pump and ... maybe a couple others yet to be determined.

Link to post
Share on other sites

Intake and coolant temperature sensors are basic 2 wire thermistors and TPS is 3 wire: +5v, tap, GND.
So likely these would only need proper calibration to work at 3v3 instead of 5v.
I'm looking at doing 'coil near plug' using LS2-type ignition coils which require a 5v logic level signal to trigger spark. I.e. how long the logic level signal is held high determines coil dwell. 5ms seems to be what everyone, GM included, defaults to so the logic has to go high 5ms before the crank is in position, then go low to spark.

Injecting fuel is another story as I've yet to settle on fuel injectors so ... here's a blank. ;)


*edit- image of coil wiring removed

Link to post
Share on other sites

Didn't realize earlier MAX9926 (page 14) ...

For quadrature-connected VR sensors, the open-drain output DIRN indicates the rotational direction of inputs IN1 and IN2 based on the output state of COUT1 and COUT2. DIRN goes high when COUT1 is leading COUT2, and low when COUT1 is following COUT2.

Might be handy to know the engine is running backwards? :wacko:

Turbo might not like that. ;)

He he.

Link to post
Share on other sites

@@spirilis - I have a favor to ask: can you confirm somehow that J10, the 30 pin header, pin 29 is 0.425" from J4 pin 1.


I ask because I loosely set a single row, 10 pin male header in J10 / positions 25-6. I then tried to set a female header over J4 and the 10 pin header: the female pulls the far end of the 10 pin loose header up like it's bending it to get the pins in. Visually, it looks to be about the width of a physical pin difference, so instead of having exactly 3 pins between J4 and J10, it's 4.25.


Not sure I'm making sense. :S



Link to post
Share on other sites

Well, I tried to print a copy and lay it over the pins and it looks like my visuals are correct. The pin 29 on J10 does appear to be approximately the width of on pin... literally the width of the metal part of the pin 'farther' than one would expect from 0.10" pin spacing, so instead of the pin being centered 0.400" it appears to be 0.425. Not enough to worry about now, but if it comes time to spin a board, I might have to rent micrometers. :D

Link to post
Share on other sites

So, anyhow, time to plan.


I need to monitor and compensate the following variables:

Coolant temp;

Intake air temp (pre turbo);

Intake air temp (post turbo);

Throttle position;

Ambient air pressure (BARO)

Manifold Air pressure (MAP);

Crankshaft position;

Camshaft position.



I need to control the following:

Ignition timing and 'dwell' duration- I'm using logic level coils (LS2) so need 5v for them;

Injection timing and duration- haven't settled on injectors so I'll assume the worst, as in wait for it;

. fuel pump relay;

. power to fuel injectors (switched 12v);

. maybe coolant fan on/off @ temp;


I'm willing to listen to thoughts about RTOS and such.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...