New to Embedded Programming - Curious About EMS Software Architecture
Posted: Tue Jan 11, 2022 1:54 am
Hey guys! Gonna dive right into it - sorry for the essay I'm about to write, and apologies if I have questions that are "googleable" or considered common knowledge. I'm still pretty new to embedded programming but I'm doing a huge amount of reading in my spare time! Hopefully this is an appropriate spot to post this.
About Me/Background
For context, I'm a software developer (mostly C# and .net) and I want to write my own EMS for an NA 1985 Mazda rx7. I'm quite familiar with this car and have rebuilt most of its systems a couple times. I'm also interested in adding hybrid elements to the car, like a motor-generator to gather energy from exhaust gases and/or a motor-generator to power the car in parallel with the rotary engine (if you're familiar with current F1 cars - mgu-h and mgu-k).
I've been researching engine management software architecture for the last few months, but am finding that most software is proprietary. I did buy a bunch of great technical papers from the SAE site, and I've been looking at the ms3-source git repo - and now I've stumbled on this forum! I'm hoping I can keep learning and get to a point where I can give back.
Initial goals:
- runs the stock NA 13b rotary engine (how hard can it be?)
- can enable logging to view sensor data in the cloud (this part is a bit easier for me - I made a prototype app that can display data in real time)
- being a dev by trade, I hate spaghetti and want to make the ems as reusable and abstracted as possible
Future goals/nice-to-haves:
- basic functions programmable (engine timing, air-fuel ratio maps)
- hybrid functionality
- support for a turbocharger, because I may want one in the not-so-distant future
Questions
- Do we just rely on the crankshaft positioning sensor to properly time the spark/fuel injection, or is a timer used?
- Are interrupts used to control the coils/injectors/rest of the car, or are there multiple threads (or modules) that each monitor/control a part of the car?
- Are there standardized control algorithms for the software to use, or is that something that each EMS developer would have had to discover for themselves (for example when calculating engine load)?
Thanks if you made it this far - I'm still so unclear on a lot of these concepts that I'm not really sure how to turn them into questions! I guess my main uncertainty is how the software is laid out (simple, right?) so I'm hoping that it'll make more sense as I look at the source code.
- Roland
About Me/Background
For context, I'm a software developer (mostly C# and .net) and I want to write my own EMS for an NA 1985 Mazda rx7. I'm quite familiar with this car and have rebuilt most of its systems a couple times. I'm also interested in adding hybrid elements to the car, like a motor-generator to gather energy from exhaust gases and/or a motor-generator to power the car in parallel with the rotary engine (if you're familiar with current F1 cars - mgu-h and mgu-k).
I've been researching engine management software architecture for the last few months, but am finding that most software is proprietary. I did buy a bunch of great technical papers from the SAE site, and I've been looking at the ms3-source git repo - and now I've stumbled on this forum! I'm hoping I can keep learning and get to a point where I can give back.
Initial goals:
- runs the stock NA 13b rotary engine (how hard can it be?)
- can enable logging to view sensor data in the cloud (this part is a bit easier for me - I made a prototype app that can display data in real time)
- being a dev by trade, I hate spaghetti and want to make the ems as reusable and abstracted as possible
Future goals/nice-to-haves:
- basic functions programmable (engine timing, air-fuel ratio maps)
- hybrid functionality
- support for a turbocharger, because I may want one in the not-so-distant future
Questions
- Do we just rely on the crankshaft positioning sensor to properly time the spark/fuel injection, or is a timer used?
- Are interrupts used to control the coils/injectors/rest of the car, or are there multiple threads (or modules) that each monitor/control a part of the car?
- Are there standardized control algorithms for the software to use, or is that something that each EMS developer would have had to discover for themselves (for example when calculating engine load)?
Thanks if you made it this far - I'm still so unclear on a lot of these concepts that I'm not really sure how to turn them into questions! I guess my main uncertainty is how the software is laid out (simple, right?) so I'm hoping that it'll make more sense as I look at the source code.
- Roland