element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Ben Heck Featured Content
  • Challenges & Projects
  • element14 presents
  • element14's The Ben Heck Show
  • Ben Heck Featured Content
  • More
  • Cancel
Ben Heck Featured Content
Forum Engine Management
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Ben Heck Featured Content to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 63 replies
  • Subscribers 46 subscribers
  • Views 4210 views
  • Users 0 members are here
Related

Engine Management

jack.chaney56
jack.chaney56 over 9 years ago

Hi Ben,

I am a programmer with a very small amount of skill with circuits, and am looking to create a platform for an engine management system, using an Arduino Mega 2560. I had done a bit of the coding, when I ran into some timing issues with the built in Arduino manager, so I switched over and started using AVR Studio and a programmer to go directly to the chip itself.  The code looks like it should work ok, but now I need some additional circuits to handle the energy levels of coils and injectors (Something like IGBTs). Sensors are being run through simple dividers (no protection yet), and cam and crank inputs are through a simple comparitor

 

Let me know what you think,

Jack

  • Sign in to reply
  • Cancel

Top Replies

  • jack.chaney56
    jack.chaney56 over 7 years ago +2
    Back again... After a bit of time away seeking enlightenment (and a steady paycheck), I am ready to get back to work on my project. I have continued to play around with the code and a number of components…
  • jack.chaney56
    jack.chaney56 over 7 years ago +2
    I want to start this thing right, so the shopping list for people that want to play along at home: Raspberry Pi - version is not significant if you don't mind a slow response when using Eclipse, but 3B…
  • jack.chaney56
    jack.chaney56 over 7 years ago +2
    Start off with two things. First, I forgot (neglected) to provide instruction on how to get the compiled code onto the Nano. Fault of familiarity; having done the process so many times, I had shifted to…
Parents
  • jack.chaney56
    jack.chaney56 over 7 years ago

    I found out how to attach a zip file... I had to go over to the advanced editor

     

    So here is the zip with the source so far.

    Attachments:
    ECM_E14_20180901.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • fayobambam@gmail.com
    fayobambam@gmail.com over 7 years ago in reply to jack.chaney56

    I don't know if it has been said but there is an open source project called speeduino. Its been running engines for a while now, actually my daily runs on it. It started on the ATMEGA 2560 but its been ported to the teensy 3.6? ARM32. You could use the well developed hardware for testing purposes with your code.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • fayobambam@gmail.com
    fayobambam@gmail.com over 7 years ago in reply to jack.chaney56

    I don't know if it has been said but there is an open source project called speeduino. Its been running engines for a while now, actually my daily runs on it. It started on the ATMEGA 2560 but its been ported to the teensy 3.6? ARM32. You could use the well developed hardware for testing purposes with your code.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
  • jack.chaney56
    jack.chaney56 over 7 years ago in reply to fayobambam@gmail.com

    Hi,

    No I had not seen that (yet), if you could post the link here, I can chase things down and see if it will give me some help with the hardware aspects of this project. My source is primarily for 328, but I also have a version that runs on 2560 that uses all shared code with the exception of 4 files.

     

    Thank you for the shout out,

    Jack

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • fayobambam@gmail.com
    fayobambam@gmail.com over 7 years ago in reply to jack.chaney56

    www.speeduino.com that's the homepage. Glad to be of help

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • jack.chaney56
    jack.chaney56 over 7 years ago in reply to fayobambam@gmail.com

    Thanks a lot for the link. I looked over the site and kind of gleaned much of the information. The information provided shows they are using the Arduino interface, which might explain the reason for upgrading to the ARM processor version. The Arduino interface takes time away from the operation. I also see they are working on some CAM and Crank problems that I have already resolved and will present here. The fun thing to see is how they have a developed UI stage for updating calibration information. This is where a one man show, can be a little slow. I know what needs to be done, and I have a mental image of the interface and the code to make it work, but I just haven't done the deep dive into writing the code.

     

    My aim is to use off the shelf open source tools, so everything is repeatable by other members. So, I have started building a simplified UI using GCC and have been flip flopping between GTK+ or QT, but I am leaning to GTK because of some licensing questions I have about QT. We shall see.

     

    Thanks again for the link,

    Jack

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • fayobambam@gmail.com
    fayobambam@gmail.com over 7 years ago in reply to jack.chaney56

    Not a software person myself pretty much at beginner level. The mega is the primary platform for the project and some new additions had to be made to the Arduino software side to speed up things. The injection and ignition channels are limited by the number of timers; (9) I think? The crank and cam triggers are kind of modular ;missing tooth on crank or cam is functioning properly and other patterns have been added. You may get in touch with Josh the developer if you need more info.  A more closer to the hardware approach like yours would probably utilize the available resources more efficiently. When its ready I would love to be a tester

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • jack.chaney56
    jack.chaney56 over 7 years ago in reply to fayobambam@gmail.com

    Hi,

     

    Timers can be a little obscure if you don't work with them all the time. There are actually 6 timers on the 2560 numbered  0 through 5. Timers 0 and 2 are 8 bit timers and have 8 bit compare registers. Timers 1, 3, 4 and 5 are 16 bit timers, and have 16 bit compare registers. 3, 4, and 5 also each have 3 compare registers, so that might be where the idea of 9 timers comes in.

     

    I invite you to read the description of how the source works for my project further down, and I am happy to answer questions about technique.  I think I am up to programming methods for doing formulas that are fast and accurate. I already covered linear and planar interpolation. I also covered use of binary radians to provide simplification of the equations. Stuff coming up is when to perform the calculations, what information is necessary, and how to generalize operations so they can become reused processes.

     

    Look forward to hearing more from you,

    Jack

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube