My project's - need help choosing parts.

Hi there!

I'm new to this forum, my first post, English is not my native language and so on.. so please bear with me..

To begin with, I'm roughly 50 years old and guess I have almost a unrealistic expectations to this thing you call Arduino.. microcomputer and it's possibility's. Long time since I had make up my mind to enter this holy world of gale, programming microcomputer.

It's not as I don't have a programmers experience. I began 1980 in assembly (16kb Tandy Radio shack computer with Z80 1.77mhz processor, 8bit simple assembly language connected with tape recording and b/w tv travel monitor) but 5 years later start to program in Pascal for Dos, resident programs among them etc. and today my main language is Delphi. I reckon I could say I would be what is referred as, as extremely advanced programmer. Have build over 100 applications of all sorts but recently some challenging one as fully grown up payroll system, account system, sales- customer- supply- stock- system (all systems integrated), custom system, strategy game, etc.. etc..

But enough of introduction. Next two three years I'm going to do lot's of stuff regarding two stroke engine as a pet project's on my old snowmobile which I don't feel like suspend. To begin with the suspension system integrated with controller and air- shocks. Most likely I will also do injection system and perhaps turbocharge system if everything goes well.

My programmers experience have tough me one thing above other and that is planing and knowledge. To know in details what one is going into.. way ahead.

Even though I'm not going into any project this winter I have been drawing rough diagrams of all kinds of problems and hopefully, solutions. As for now one problem I think I will stumble on is a "sensor lagging", specially in injections system, even also on turbo- and ignition systems.

The speed is enormous, 8.500 rpms or 140 round per second and in every cycle and in it's 360° space of piston travel, lot's of stuff is going on, stuff which demands extreme precision and no what so ever tolerance for lagging of any kind.

Arduino and it's power will be my first thing to consider or judge whether or not I'm on right track.

I will use this thread in the future so I doesn't has to introduce me and this project all over again. Hope that is not against any rules here.

Thanks ahead and I will be in touch.

The speed is enormous, 8.500 rpms or 140 round per second and in every cycle and in it's 360° space of piston travel, lot's of stuff is going on, stuff which demands extreme precision and no what so ever tolerance for lagging of any kind.

Arduino and it's power will be my first thing to consider or judge whether or not I'm on right track.

Read this:

Long story short - by the time the engine's crankshaft rotates 140 times in a second, the Arduino (well, the ATMega328 microcontroller) will have already churned through many, many thousands of lines worth of C code.

Provided you don't do anything crazy like use blocking code, you shouldn't have any problem using an Arduino to control/monitor/etc an engine running flat out.

Thanks crOsh

I did read this and I feel more confident that Arduino will supply a lot more than I will need for most of my projects in the future.

But…

When I was talking about power and lagging I was not solely referring to the 16mhz microcomputer. Uuuhh… sensors, multitasking/threads, multiple events triggering, etc. was also on my mind.

I’m kind of shooting in the dark here… but let’s take one example from my future projects to explain some of my thoughts so far, further.

The injection system for three cylinder two stroke engine.

Two stroke machine fires in every cycle so at 8.500rpm (that is roughly the max rpm I will be running this motor even though this kind of motor is runned at 9.500rpm in some modified version’s) so at 8.500rpm or 140 cycles pr. seconds every cycle will last roughly 7ms.

In that time frame I have to do couple of things.

Let’s try to wrap this up roughly.

  1. read and calculate rpm,
  2. read fuel ratio from O2 wideband controller
  3. read exhausts heat
  4. read throttle position
  5. read and perhaps control pressure from fuel pump
  6. read throttle position
  7. read fuel pressure
  8. calculate fuel map from at least three dimension array (some factors as : rpm, throttle pos, tempurature, air pressure are at my mind)

Then I have to fire three injection’s where each of one will be using at least 2ms of time to spray, adding up to 6ms total for three in every cycle… then if using delay (not doable) I have only 1ms to read and calculate every single thing there is for this job… eehh… as I said, not possible.

Ok. Perhaps I would try to brake the firing part of injectors to some kind of multiprocessing in the loop and build my own kind of multitasking kernel for some kind of “distribution of cpu-power” or even try to trigger microseconds timer interrupt’s for on and off triggering each injector, but even so and even for overwhelming believe on my own programming skills, I somehow fear ahead the complexity and even more, the demand of accuracy, strengtheners and purity of such a code alone, even not consider the environment I’m in of electricity and sensors each of it own, demanding time for proper functioning.

One other way to simple this project would be to brake it a part’s and add other (smaller) micro processors for this task, that is, processor for each cylinder. So one processor take care of solely one job, that is, to fire one injector. Then I only have to trigger each processor with hardware interrupt (imagine that would be very simple) with information such as duration. Some rules for communications and data transfer would be necessary between master processor and slaves, but as for now and from my point of view, not undo able or so complicated task or… but perhaps I’m wrong?

Yes, I suppose it depends on what you want to do. The Mega Squirt uses the 68HC908 or MC9S12C64. Much more capable than the Atmega chips available in the Arduino platform I'd say.

See if the Due will be enough power for you?

garrinn:
Let’s try to wrap this up roughly.

  1. read and calculate rpm,
  2. read fuel ratio from O2 wideband controller
  3. read exhausts heat
  4. read throttle position
  5. read and perhaps control pressure from fuel pump
  6. read throttle position
  7. read fuel pressure
  8. calculate fuel map from at least three dimension array (some factors as : rpm, throttle pos, tempurature, air pressure are at my mind)

Full disclosure, this is my own project, but you might want to checkout http://speeduino.com

It’ll do all of the above except for fuel pressure and exhaust heat, though neither would be that difficult to add.