Arduino as ECU?
Disclaimer: I know next to nothing about this stuff.
Anyone ever think about using an Arduino as an ECU? http://arduino.cc/en/Main/ArduinoBoardMega The Mega is coincidental, has nothing to do with megasquirt ( i think ). Some potential benefits to using this as a platform to build onto:
Now feel free to tell me why this won't work :) |
probably not enough program memory. also the 8bit mcu is less powerful than a ms2. Now if you start talking about like a avr32 then you are talking. Have fun writing it from scratch though.
|
Parallax propeller could probably get the job done. Nifty little microcontroller. However, once you take the price and the amount of work into account, MS looks pretty awesome :)
|
|
Originally Posted by Jeff_Ciesielski
(Post 617414)
Parallax propeller could probably get the job done. Nifty little microcontroller.
Originally Posted by neogenesis2004
(Post 617410)
probably not enough program memory.
I'm sure the Arduino is plenty powerful, I just can't personally imagine wanting to spend the time it would take, when the MS2/3 codebase is already so well developed. Just wish they'd fucking let us see the fucking schematics for the fucking MS3 and the fucking MS3X that they've been keeping so fucking secretive on fear that some fucker will clone the fucking thing, with no regard for all the fucking people out there who don't give a fuck about copycats and just want to be able to properly optimize their fucking I/O circuits. Fuckers... |
I saw the title of this thread and said aloud "Holy shit"
I wouldnt want to program that shit |
Not with an Arduino, but the "megasquirt project" started out as a more open-source code on a simple microcontroller.
PS- I love Arduinos |
Originally Posted by Joe Perez
(Post 617443)
I'm sure the Arduino is plenty powerful, I just can't personally imagine wanting to spend the time it would take, when the MS2/3 codebase is already so well developed. Just wish they'd fucking let us see the fucking schematics for the fucking MS3 and the fucking MS3X that they've been keeping so fucking secretive on fear that some fucker will clone the fucking thing, with no regard for all the fucking people out there who don't give a fuck about copycats and just want to be able to properly optimize their fucking I/O circuits.
Fuckers... |
The difference between the arduino and the 68HC908 is that the Arduino language is a varient of c, while the 68HC908 used assembly language. It would take a whole lot more memory, flash, cpu cycles to accomplish the same thing on an Arduino.
Of course the MS-II was written in c, and has a similar amount of ram and a similar cpu. However the MS-II's cpu has twice the flash (64k) as the Arduino (32k). So your code would have to be approx half the length of the MS-II. It would be a little bit worse than that since the Arduino language has so much abstraction going on. Then again... you could use an Arduino Mega, which has 128k of flash. :) The other issue you might have with the Arduino is timing. I'm not sure that the Arduino's timing is fine grained and accurate enough, and I'm not sure that the Analog inputs are fast enough (with the abstraction). Even the MS-II had to use assembly language for reading the analog inputs. You could use straight c or assembly language on the arduino... but then it wouldn't really be an arduino. |
That said... I do have an Arduino in the proto area of my megasquirt =)
|
The arduino "language" is just c++ functions that have been premade to help nubs. You can still code in its simple compiler using c++ only, giving you a finer control. The compiler still converts it to assembly so both still get their bits set from assembly inthe end.
Additionally, the arduino just uses a Atmel AVR chip while the MS chip is a freescale chip. Both have C++ compilers available, and both can also be coded solely in assembly. Both are VERY similar chips, main difference actually being 8bit on the AVR and I believe the MS2 is 16bit. The MS3 is 32bit so the comparable Atmel chip would be from the AVR32 family. A large reason AVR chips are so massively used is because a great open source GCC compiler exists for it and it also has a tremendous forum support. Freescale and other chips often require more expensive toolchains in order to fully utilize high level languages like C++. |
I know a guy working on a FOSS ECU for the duinos. If I can get hold of him again, I can try to put you in touch, if you're any good as a dev.
MS3 - it's worse than you think. There is self destruct code built into the thing such that if you do certain things that might be indicative of trying to clone it, it deletes everything and bricks it, yay. LOL @ neo's comment "Fuck the fucking fuckers!!!" Re propeller chips, there is a guy obsessed with them on diyefi.org/forum with a thread and project using 2 chips to produce an EMS. Finally, FreeEMS isn't dead despite the total lack of updates to the website and any information on what has been happening. Here is an out of date thread on it : https://www.miataturbo.net/megasquirt-18/diyefi-org-freeems-future-true-diy-engine-management-19077/ I got a car running and m2cupcar tuned it (fuel only) by feel, picking up midrange and 5mph top speed on the flat. I did that 8 or 9 months ago in the US of A. First run and drives were in Florida at the end of a 13500 mile road trip that started in California with AbeFM :-) I guess I started and ended the trip with miata guys! In any case, I've been doing some closed source EMS work for a guy from the US who flew me in to do it, and then into China for a month each. There is a video of that here : http://www.youtube.com/watch?v=QvJgyuzoako Lots of good things are coming from us soon (where soon is a relative term). Fred. |
Hippy fred with long hair is lulz.
|
Originally Posted by rb26dett
(Post 617862)
I know a guy working on a FOSS ECU for the duinos. If I can get hold of him again, I can try to put you in touch, if you're any good as a dev.
MS3 - it's worse than you think. There is self destruct code built into the thing such that if you do certain things that might be indicative of trying to clone it, it deletes everything and bricks it, yay. LOL @ neo's comment "Fuck the fucking fuckers!!!" Re propeller chips, there is a guy obsessed with them on diyefi.org/forum with a thread and project using 2 chips to produce an EMS. Finally, FreeEMS isn't dead despite the total lack of updates to the website and any information on what has been happening. Here is an out of date thread on it : https://www.miataturbo.net/showthread.php?t=19077 I got a car running and m2cupcar tuned it (fuel only) by feel, picking up midrange and 5mph top speed on the flat. I did that 8 or 9 months ago in the US of A. First run and drives were in Florida at the end of a 13500 mile road trip that started in California with AbeFM :-) I guess I started and ended the trip with miata guys! In any case, I've been doing some closed source EMS work for a guy from the US who flew me in to do it, and then into China for a month each. There is a video of that here : http://www.youtube.com/watch?v=QvJgyuzoako Lots of good things are coming from us soon (where soon is a relative term). Fred. I read your thread about the free ems, seems interesting. I have no relevant abilities myself (my experience is with php, perl .NET and a little Java, no nuts and bolts programming really), but i figured the arduino could be a good base to work off of (especially the 'mega') due to the large number of inputs, wide availability, low cost, and support base. -Tomaj |
Oh, it's definitely a GREAT base to get into embedded programming. Once you get it down you can move into AVR programming in general and use the regular GCC AVR compiler with something like Programmer's Notepad (my personal fav). The compiler has all the MCU bits built in, so when you look at the datasheet and you see say a timer called TIM1 or something, you can directly set those bits, clear them, or use them in a function.
Once you can code for the AVR in straight C++ you can translate that into programming for basically any MCU. |
Originally Posted by ctxspy
(Post 617403)
Disclaimer: I know next to nothing about this stuff.
Anyone ever think about using an Arduino as an ECU? http://arduino.cc/en/Main/ArduinoBoardMega The Mega is coincidental, has nothing to do with megasquirt ( i think ). Some potential benefits to using this as a platform to build onto:
Now feel free to tell me why this won't work :) Hi there, I'm currently working on using a Arduino - "Duemilanove" as a custom ECU. let me know if you want to share ideas! Software is my area, so the hardware side is quite a learning curve! |
I have an AEM ECU running in "parallel mode". My NB factory ECU is doing idle, emissions, etc. I recently installed a 12 tooth Trackspeed trigger wheel for better ignition accuracy.
I have a Dueminalove for generating an NB crank signal, and the AFM signal it expects. I agree with what neogen and Joe wrote above.... If you want to dabble in what it takes to write ECU code, go browse diyefi.com. |
Arduino ECU hardware shield prototypes
I have had an "very alpha" Arduino Mega ECU shield designed and have two prototypes. I started to test basic functionality of sensors, VR decoding etc, but I haven't progressed very far from that due to work getting in the way. I will post all the Eagle files and pics of prototype h/w to start discussion if anyone wants me to.
|
I have been reading ECU theory and the software seems pretty straightforward. My hope would be to make a direct drop in replacement for the existing ECU for my '91 Miata.
The AVR328 is a lot more powerful and has a lot more memory than the existing 6800 based ECU. The AVR is a very strong math performer and also includes a hardware multiplier so with it we can be less reliant upon precomputed tables (which the existing unit uses almost exclusively). I decided to use the Arduino "Duemilanove", as it offers 6 Analogue inputs and 14 Digital I/O (6 of which have been set up for PWM), this seems to be enough to monitor and control the Miata engine. It also has a built in USB transceiver, which allows for simple debuging and also direct control of the board while in use via any laptop with a terminal (I use a custom AT command set to control the board). My first port of call, is to use the Arduino as a data capture device, as I need to know what the existing ECU is seeing from the Engine, and consequently what signals it sends back and when. Has anyone already tried this? I can't seem to find any Miata ECU data captures. Also, looking at the engine diagram, it looks like my version of the ECU doesn't control the ignition timing (the ignitors seem to handle that themselves), is that right? Many thanks for your help! |
You need to think about IO and accuracy of IO. IE, you need to think about timers, in particular, hardware timers! Without massive CPU speed, these are critical in getting accurate RPM/Position inputs and accurate ignition angle outputs and fuel pulsewidths. Without those things, you may as well have MegaSquirt 1 :-p
|
All times are GMT -4. The time now is 06:17 AM. |
© 2024 MH Sub I, LLC dba Internet Brands