Tell me "Read the FAQ, N00b" - Compiling MS code?
What do I need to do to get up and running for compiling and uploading my own (or other people's) code to the MS?
I have both Ubuntu and Vista, and a laptop with something terrible like win95 on it. I'm not sure when I'll have to start compiling, and when I'll just be uploading code/tables other people wrote, but since I'm going to start soldering soon, I might as well spend the next day or two (putting off doing laundry by) setting up my computer so I don't have to do it later. Thanks! -Abe. |
[secretly watching this thread]
|
No compiling. Download the 1st file for all the software necessary http://www.msextra.com/manuals/MS_Ex...nual_Index.htm. IIRC it includes easytherm, but not 100% sure on that. There are also links further down for support tuning software like Megalogviewer/vexme. Don't know about ubuntu compatibility with linux, but it does work with vista. I'm assuming that you will be running the MS extra for fuel and spark like everyone else here who runs MS-I.
As for other people's maps. Everyone's MS has an *.msq file in it that is what people share, but it is for all settings so I wouldn't just load someone else's map into your car before making sure that things like inverted spark/overboost protection/etc... are the same as yours. You can always use a program like vexme to export/import just the spark/fuel maps. When reading the manuals, it's easy to get overwhelmed as things sound much more complex than they really are, but once you get your car running, megatune/megalogviewer/VEanalyzer make much more sense and is pretty intuitive. I remember feeling kind of over my head while reading the manual, and when using the software live, it made MUCH more sense. |
Originally Posted by brgracer
(Post 184081)
No compiling. Download the 1st file for all the software necessary http://www.msextra.com/manuals/MS_Ex...nual_Index.htm. IIRC it includes easytherm, but not 100% sure on that. There are also links further down for support tuning software like Megalogviewer/vexme. Don't know about ubuntu compatibility with linux, but it does work with vista. I'm assuming that you will be running the MS extra for fuel and spark like everyone else here who runs MS-I.
As for other people's maps. Everyone's MS has an *.msq file in it that is what people share, but it is for all settings so I wouldn't just load someone else's map into your car before making sure that things like inverted spark/overboost protection/etc... are the same as yours. You can always use a program like vexme to export/import just the spark/fuel maps. When reading the manuals, it's easy to get overwhelmed as things sound much more complex than they really are, but once you get your car running, megatune/megalogviewer/VEanalyzer make much more sense and is pretty intuitive. I remember feeling kind of over my head while reading the manual, and when using the software live, it made MUCH more sense. he wants to de-compile edit and then re-compile the firmware for his MS ;) |
Originally Posted by richyvrlimited
(Post 184114)
Uhh dude, Abe is a bit more advanced than needing to know where to D/Load MegaTune from ;)
he wants to de-compile edit and then re-compile the firmware for his MS ;) |
This work for you?
http://www.bgsoflex.com/megasquirtembdown.html |
Abe, just curious what changes/improvements you wish to make? Or is this a "for the fun of it" type project for you?
|
Here's a link to the latest beta d/l.
http://www.msextra.com/ms2extra/file...ta20071122.zip Here's a link to the thread about the latest beta: http://www.msextra.com/viewtopic.php?t=26715 If I remember right, everything is hard pathed to C:/msii, so create the directory then expand the zip there. Look for the file "make.bat" and run it. I'm pretty sure you also need to install Cygwin (free) but that takes a long time to d/l so try make.bat w/o first. Once you do a build, you'll create a .s13 file (maybe .s19, god my memory sucks). Copy that file up one directory level and run the download batch file w/ MS connected to d/l. The batch files gives you step by step instructions. It's straight forward. Be sure your coils are not connected or you will fry them. Even after you flash, the default spark setting hold the coils hot so don't connect the them until you set the ignition settings to Miata specific values. You might want to verify w/ a multimeter or o-scope to be sure. |
Ha, thanks for the vote of confidence, guys. I'm just not afraid, I wouldn't say I'm 'advanced'. Trying to be a little intelligent here and not reinventing any wheels, I really want to get up and running ASAP, reusing what's available in the community so I know I'm not doing anything dumb.
THEN yes, there's a lot I want to do. With/Like Arga, I want to run the OEM '99 sensors. An external box for voltage regulation seems easy enough, but I might want to write my own cruise control routine (easy enough I think if I put real cut out switches on things). I have three main goals: 1) A car with knock sensing, definable fuel & spark tables, maybe EBC. You know, an actual computer controlled turbo car that will do what I need it to stay together without running only 7 psi. 2) To help develop a 99+ "pnp" MS solution so people don't have to buy CAS sensors or give up features their car had stock just to get a real ECU in the car 3) To dink around with things like configurable water injection, wheel sensor or accelerometer based traction control, making my turn signals flash in new and exciting ways. Just anything a "computer in a car" could do, just one that has access to esoteric engine condition information. So yeah. Pointing me to "MS101 for dummies" is excellent, I don't want to learn the hard way! But I'm also sure I'm going to look at something interesting before too long, certainly apprenticing under Arga with the starting/idling on an NB miata is something I want to do ASAP. |
Thanks! That's exactly what I'm looking for. I'll probably want to steal your maps, too, although yours probably don't go too far into the 100-200 kpa range. :-)
Originally Posted by arga
(Post 184152)
Be sure your coils are not connected or you will fry them. Even after you flash, the default spark setting hold the coils hot so don't connect the them until you set the ignition settings to Miata specific values. You might want to verify w/ a multimeter or o-scope to be sure.
Sounds like windows is the development environment of choice then? |
Originally Posted by cjernigan
(Post 184136)
This work for you?
http://www.bgsoflex.com/megasquirtembdown.html |
Originally Posted by AbeFM
(Post 184158)
3) To dink around with things like configurable water injection, wheel sensor or accelerometer based traction control, making my turn signals flash in new and exciting ways. Just anything a "computer in a car" could do, just one that has access to esoteric engine condition information.
There was also going to be an expansion board for general purpose I/O. That might be a better solution. Not sure where that is, though. |
that REALLY interests me. A long time ago it sounded like it was right around the corner. I'll tell you, I see more value in that than in the sequencer board. If you give up on backwards compatibility (something I feel is a big mistake in most development projects, start fresh if there's something to be gained!!), you could use the GPIO board to take over duties the MS is now doing, and then free up those channels for running 4 dedicated fuel injector lines from the CPU. That's enough for a sequential 4 or a banked 8. It kinda isn't ideal for V-6's but I mean, give up your 3 LEDs and one spare output and bingo! You've got 4 injectors.
You know, or not. Anyway, GPIO board is what really turns me on about all this - I want more ins and outs, ideally some analog. |
http://www.jbperf.com/p&h_board/
heh - interesting. I gotta find out about the MS1x and the MS2x code, everything I see says the extra code is only for the MS1 but I know that's not right, maybe it's just the manuals? Anyway, hmmm, 4 independant injector channels. It's enough to make a guy want to keep his staged injection. :-P I can't be the first person to see this, can I? <edit> Ok ok, I found it. Lots of MS-II stuff. Sounds like there's a lot missing, and a lot there. At least it's a bit easier to read now that there's a reason. :-) Arga, got a link to that code again, I can't find it - the two versions of your ignition code for the OEM sensors. |
MSII owners already have 0.001ms injector resolution and thus no need for an "HR" code variant, thus they will not lose their on-board PWM capability. So that board is basically a standalone PWM injector driver. It takes a standard injector input and produces an output of equal duration but consisting of a brief peak period followed by a PWM current limited period. You could use it with any ECU, not just megasquirt. It's based on this IC from National: http://www.national.com/mpf/LM/LM1949.html |
My take was that maybe you could run 4 channels by using the two outputs per channel of the MS-II and setting them to run 4 channels seperately, letting the driver board run the show.
What has me more concerned is the lack of EGT handling by the MS2-x |
Originally Posted by AbeFM
(Post 184504)
My take was that maybe you could run 4 channels by using the two outputs per channel of the MS-II and setting them to run 4 channels seperately, letting the driver board run the show.
What has me more concerned is the lack of EGT handling by the MS2-x The trouble with EGT is it's affected by a couple of other things like ignition timing and where you stick the probe. Using it for closed loop fuel correction's not going to be a good idea. It probably wouldn't be too hard to hack the code to log a single EGT channel, however. |
Originally Posted by Matt Cramer
(Post 184550)
There's talk of the MS2/Extra V3.0 code being able to run four outputs using the peak & hold boards like what you describe.
Peak-and-hold isn't really something you should need to do in software.
Originally Posted by Matt Cramer
(Post 184550)
The trouble with EGT is it's affected by a couple of other things like ignition timing and where you stick the probe. Using it for closed loop fuel correction's not going to be a good idea. It probably wouldn't be too hard to hack the code to log a single EGT channel, however.
|
Originally Posted by AbeFM
(Post 184573)
Oh yeah - and it's not the fastest sensor in the world, tenths of a second aren't great. I have seen people monitor each cyl separately, though, which I think is not only trick but also great if you have individual fuel trims.
|
Originally Posted by AbeFM
(Post 184504)
My take was that maybe you could run 4 channels by using the two outputs per channel of the MS-II and setting them to run 4 channels seperately, letting the driver board run the show.
It's four completely separate driver channels. Output INJ1 is driven by U1, which is triggered by input 1. Output INJ2 is driven by U2, triggered by input 2, and etc... There is no switching logic at all, this board is just a simple input follower. A thought however- I don't know what the cam sensor on an NB outputs. If you guys get one pulse per cam revolution (indicating #1 TDC only) instead of two pulses per cam revolution like us NA'ers, then it would be trivial to build a circuit to steer the pulses from the MS to the correct pair of injector drivers, based on the CAS indication. BTW- what EGT sensor are you guys using? Mine is slower than hell, no possible way it could be used for fuel tuning- if I floor it on the highway, it takes a couple of seconds to see the change in EGT. |
I don't understand the reluctance to add an NA CAS to the NB. Seems to me to be a simple, effective, and proven solution, without real downside. Only negative I can think of is the cost of the part, which is negligible if purchased used.
|
Adding a CAS to an NB isn't that bad, it is a working solution. It would be nice to be able to make a full on PNP solution for the NB though. If something could be built and contained within the MS case that would be awesome.
|
I understand that from a PNP level, but someone who assembles their own ecu and flashes it with their own code ain't exactly a PNP customer.
|
I'm not talking about adding an NA CAS to an NB, I'm talking about using the one that's already there. In the '00 anyway (the latest year for which I have a diagram) you guys have a factory camshaft sensor, separate from the crank sensor, feeding position 2H on the ECU via a GY/L wire. From the diagram on page B-1b of the FSM, it appears to be near the front of the engine on the cold side.
If this sensor produces a single pulse per cam rev (one pulse for every two crank revs) then it could be used to drive a simple gating circuit that would steer the EM's injector pulses to two separate injector banks. (thinks about this for a minute...) No, actually there's a problem with this idea- you couldn't go above 50% duty cycle on the injectors at any time. Bad idea. |
http://forum.miata.net/vb/attachment...chmentid=54465http://forum.miata.net/vb/attachment...chmentid=54466
I know what you're talking about Joe. Top right is the 2002 cam signal. The others are from an NA. Here's a thread that was started concerning this. http://forum.miata.net/vb/showthread.php?t=259190 Reverant is currently building a custom circuit for it, not sure what it entails. |
Ok, the top picture looks like an NA CAS to me. Upper trace is CMP, lower trace is CKP.
The bottom picture is an NB, I assume? I can't quite figure that one out. I thought that the NB crank wheel had four teeth on it, evenly spaced. Neither of the two traces seems to indicate that. Could you translate that picture for me? Which trace is which, and what's up with the double-single-double-single upper trace? |
Originally Posted by Joe Perez
(Post 184879)
Nay. Look at the schematic here: http://www.jbperf.com/p&h_board/P&H_board_schem.jpg
It's four completely separate driver channels. Output INJ1 is driven by U1, which is triggered by input 1. Output INJ2 is driven by U2, triggered by input 2, and etc... There is no switching logic at all, this board is just a simple input follower.
Originally Posted by Joe Perez
(Post 184879)
A thought however- I don't know what the cam sensor on an NB outputs. If you guys get one pulse per cam revolution (indicating #1 TDC only) instead of two pulses per cam revolution like us NA'ers, then it would be trivial to build a circuit to steer the pulses from the MS to the correct pair of injector drivers, based on the CAS indication.
Originally Posted by Joe Perez
(Post 184879)
BTW- what EGT sensor are you guys using? Mine is slower than hell, no possible way it could be used for fuel tuning- if I floor it on the highway, it takes a couple of seconds to see the change in EGT.
http://www.teamrip.com/accessories.html And they claim 0.180 seconds/100* f. Not quick, not slow. I keep getting tempted to try to mount a BARE sensor in there, but I'm sure it would only last like a day.
Originally Posted by Ben
(Post 184881)
I don't understand the reluctance to add an NA CAS to the NB. Seems to me to be a simple, effective, and proven solution, without real downside. Only negative I can think of is the cost of the part, which is negligible if purchased used.
And adding anything to the back of the motor could only make getting the coil packs on and off even harder. :-) Oh, and the weight. :-P But mostly, I just want to do it. It seems clean and trick. I really want to run a 32-1 toothed wheel or something, actually. Seems like you could tell more about the motor that way. |
Originally Posted by Ben
(Post 184881)
I don't understand the reluctance to add an NA CAS to the NB. Seems to me to be a simple, effective, and proven solution, without real downside. Only negative I can think of is the cost of the part, which is negligible if purchased used.
Hypothetically if the MS could utilise the NB hardware I'd have moved over to it by now for that very reason. Not because my car runs poorly, etc. just because if something is more accurate it'll improve the driveability/smoothness of the car (even if it's only 1% it's worth it to me) I just wish I was clever enough to be able to beta-test the NB code for the MSII :( as it is I'm going to move over to the MSII chip and then port over to the NB hardware once someone else far cleverer than me has done the legwork :( |
Originally Posted by richyvrlimited
(Post 184986)
I just wish I was clever enough to be able to beta-test the NB code for the MSII :( as it is I'm going to move over to the MSII chip and then port over to the NB hardware once someone else far cleverer than me has done the legwork :(
|
Originally Posted by AbeFM
(Post 184982)
I was saying if the MS has basically 4 channels, two for gating and two for PWM, you should be able to use those four channels all for gating
Well codemonkey, looks like you've got some hacking to do. :D It's got a single pulse on one side, and a double pulse on the other. I beleive it's the turning off of the first pulse each time that corresponds to TDC for cyl 1/4. You know, you could in theory extract a single "true #1 TDC" out of that by using a two bit counter which is reset by CKP. IOW- once two CMP pulses are received, generate a surrogate CMP pulse. But reset the counter on each CKP pulse. So only the double-pulse would be able to generate an output pulse. You'd just have to offset it somewhat as we'd be looking at the rising edge of the second pulse vs. the falling edge of the first. There are also four blips on the crank, TDC/BCD, but then the other pulses (apparently!) aren't evenly spaced something about 170*/30* or something strange. The sum total of my knowledge about the NB crank wheel comes from a single picture posted on FM's site about their adjustable crank wheel. And now that I look at it, you're right- those teeth aren't evenly spaced. (Why did I think they were?) http://flyinmiata.com/Store/images/07-91000.jpg And if I can develop a PnP solution then everyone benefits. The sensors are already there. |
I still can barely believe they aren't evenly spaced, but they aren't.
Ok, what's cmk and cpk and kfc and all that? Makes me hungry, the acronyms I know now what they are. Really, just get the computer to read them (similar set up on DSM's) and run with it, no reason to build circuits, is there? |
first part of this thread discusses it:
http://www.msextra.com/viewtopic.php?t=24249 one cam pulse, 4 crank pulses, 2 cam pulses, 4 crank pulses. 8 crank pulses in a 720 degree crank cycle. (360 cam cycle) Crank pulses 2, 4, 6, and 8 occur 10 degrees BTDC and work nicely as tach pulses. |
Originally Posted by AbeFM
(Post 185117)
Ok, what's cmk and cpk and kfc and all that? Makes me hungry, the acronyms I know now what they are.
CMP = Cam Pulse. One per crank rev- a long one and a short one. (I haven't scoped 'em out yet to tell which is which.) CKP = Crank pulse. Two per crank rev, evenly spaced at 0° and 180°, all of equal length. KFC = Kentucky Fried Chicken. A lump of steroid-enhanced poultry, deep fried under pressure and seasoned with a blend of 11 herbs and spices. |
Originally Posted by AbeFM
(Post 185117)
I still can barely believe they aren't evenly spaced, but they aren't.
Ok, what's cmk and cpk and kfc and all that? Makes me hungry, the acronyms I know now what they are. Really, just get the computer to read them (similar set up on DSM's) and run with it, no reason to build circuits, is there? http://www.msextra.com/ms2extra/MS2-Extra_Miata.htm |
I've been starting to, and thanks for the pointers.
I'm hoping the jimstim (maybe in 4G63 mode?) will do a good job emulating my stock sensors. If that's working, I figure everything else should just work out, excepting that I'll be struggling for idle with my silly huge injectors. |
Originally Posted by Matt Cramer
(Post 185252)
You might want to take a look at what the MS2/Extra crew has been up to, although it's a work in progress and the sensor pictures are not completely accurate.
http://www.msextra.com/ms2extra/MS2-Extra_Miata.htm |
It did look way complicated. Yours works, though, right? I wonder if it could be leading to your missing pulses?
How many "chugs" does it take to start? -Abe. |
Originally Posted by AbeFM
(Post 185389)
, excepting that I'll be struggling for idle with my silly huge injectors.
|
Official code docs: http://www.megamanual.com/ms2/code.htm
|
Originally Posted by richyvrlimited
(Post 185649)
how big? I'm on 600cc's and can Idle fine (after a bit of work ;))
Originally Posted by JustinHoMi
(Post 185699)
Official code docs: http://www.megamanual.com/ms2/code.htm
|
You still coming up to my place for beer and soldering tomorrow, or are you past that point already?
|
I was thinking I was past it, but then I got a lunch date in Escondido. I figure if I'm all the way up there, I might as well drop by. :-)
Currently I've got the CPU installed and up and talking, I was able to flash beta 11-22 code onto it, and now I have to read the stuff Arga sent me to make sure I have the right stuff installed, figure out what a msq file is, what to do with it, etc. I also have to build the outputs and some of the inputs, and then make up a harness. So, yeah, lots to do. A weekend's worth, if I didn't have other stuff to do. Maybe I'll give away my link piggy as a white elephant gift at this xmass party sunday. :-P |
Ok everyone, here's my issues with the build:
First: Use the pul up resistors on the JimStim or your tac won't work. Though I wonder how well this will work if the sensor doesn't put out much current.... Actual issue: Does anyone know how to program the jimstim, or make it put out a 99+ miata-like pulse train? Also, my O2 reading is weird. There's a few spots on the pot where it works, and everywhere else I get weird, jumpy, sticky values in the MegaTune program. The voltage goes up NICE and linearly with pot travel. I checked the signal, at the connector, the board, and even at the CPU pin (scarey on 0.5mm pitch parts without real tools)..... Any idea why this is so BAD? |
Abe- I totally forgot about this the other night when you were over at my place, but have you done a scope capture of the actual cam and crank sensors?
Reason I ask is that I know it'd be nice for you to have a good simulated output for bench testing, and I have two ideas there. One, we could simply ask Jim what it would take to add a new wheel output to the simulator. Like an idiot, I forgot to write down the p/n of the CPU last night so I could check to see if it's re-programmable, but it's worth an ask. Two, if that's a no-go, I could build you a dedicated NB wheel simulator using a parallax microcontroller I've got lying around. But again, I'd need a detailed scope trace for that. (your car doesn't have variable cam timing, right?) |
I am pretty sure the sim is programmable, cause he tells you where to buy a USB cable for reprogramming it (though why there's some doubt that I could hack the end off a cable and attach it to the board is beyond me)...
Yeah - I wanted to get traces but never got to it. I'm sure I could get some from online... I'd be interested to see what your current meter thinks of it. Otherwise, yeah - I suppose someone could dig up a logic analyzer, but I think I already have a NB simulator in my garage, under my hood. I can just crank the motor and see if it gives me RPM as a start. |
I'm still a bit confused by that whole USB-serial thing. He mentions that it can be done, but gives no specs whatsoever on the software involved. I emailed him to get an inside opinion.
BTW- I don't think it's necessary to use the fancy current probe to measure your sensors. When I do mine, I typically just disconnect the plug and slip a piece of that 30ga wire I gave you into the female portion of the connector, then plug it back in and connect to it with a standard probe. This way I can measure 4 signals at once, to get relative timings. The only place I've used the current probe so far was for measuring the coil primaries, to get a close look at the current profile. I wanted to reality-check the dwell times that everyone has been using, and they do indeed check out. edit: BTW, I checked out the datasheet on the "special cable" and it's nothing more than a USB to RS232 converter, which presents itself to Windows as a virtual COM port. So you could probably just use straight RS232 and not bother with the expensive cable. |
Oh, I don't think I need to measure current, but I am currious - if folks are having issues reading the signal, I'd like to know what it is the ECU sees.
Guess it's time to dig into the wiring diagrams, I want to figure out what I need to take from the OEM ECU, and what I have to leave there. Ideally, the OEM only gets five or six wires to it, just enough for the AC, Alt, cruise control.... -Abe. |
DOH!
I forgot you were doing a piggyback! That means that the cam and crank sensors are still going to be attached to your stock ECU, meaning that you don't need the pullups on the MS. You could just wire the two signals directly to the base of the two transistors you threw in on the proto area and call it a day. |
I'm *starting* with a piggyback, and planning on extracting the OEM ecu as fast as possible. So unless the sensor can't sink the current from two pullups, I'm not worried.
Anyway, right now, there's no way the stock ECU can run my tripple sized injectors, so those lines are coming off. That leaves the ignition, which won't pull any timing so I can try to get the fuel for idle and off idle mapped, but after that, the MS will run spark too... Then I think the cam/cas/etc can all get cut off the OEM ECU Related: Does anyone have the little 3rd '99 connector for the OEM ecu? I bought two of everything from online components, but that connector I only put in one. The part is literally 80 cents, but shipping is like $10. Sigh. |
All times are GMT -4. The time now is 04:44 AM. |
© 2024 MH Sub I, LLC dba Internet Brands