MegaTune is tuning software for MegaSquirt V1.01 and V2.2 hardware. It supports V1.0, V2.0, V2.98x and V3.0 embedded software from Bowling and Grippo, and V1.0x Dual Table embedded software from Eric Fahlgren and Guy Hill. Any problem reports, comments or suggestions should be directed to Eric Fahlgren , not to Bruce or Al, since this was my doing and is not necessarily condoned by them. Installation ------------ Unzip in a directory of your choice. You can optionally put the configuration files (all the .inc, .cfg and .ini files) in a directory named mtCfg, which if it exists, will be the preferred source and destination for storing these files. If you have a turbo MAP sensor (MPX4250), copy the files from the Turbo subdirectory into the installation directory. If you have a NA MAP sensor (MPX4115), then copy the files from the NA subdirectory there. Use Vi, notepad or your favorite editor to modify the megatune.ini file and set the gauge and bar limits to those appropriate for your application. Make sure to set the MAP gauge to 100 for normally aspirated applications and up to 255 for boosted ones. You can modify the temperature units setting to display all temperatures in either Fahrenheit or Celsius. You will probably want to set the tachometers so that the redline matches your engine. The communications settings dialog allows you to set the timer interval. The megatune.cfg file is generated and written automatically whenever you change settings, so there is no need to edit it manually any more. V 2.16 - 13 AUG 2003 ============================================ ================================================================= This version has been tested with Mike Robert's MegaSquirt Logfile Visual Viewer (MSLVV) version 2.16 (Mike has changed his versioning scheme to jive with MT so as to make it easier to know what works where). See the files section of the MegaSquirt yahoo group for the release code. Bug Fixes --------- Add Ben Stembridge's fix for the blurry gauges. Fix rounding of TPS percentages in VE table and elsewhere. Fix bug in Require Fuel calculator where nCylinders is garbage. Lance Gardiner uncovered a bug in the Enrichments dialog that mangled the O2 sensor settings. If you started MT and displayed the Enrichments screen before connecting to the MS, then the O2 sensor type (and Alpha-N) settings would be mangled. All fixed now. Enhancements ------------ Two major enhancements appear in this release. First, I merged in Steve Herz and Marc Piccioni's Warmup Wizard from their MegaTuneCS variant, try it, you'll like it. Find it under Runtime -> Warmup Wizard; hit F1 for context sensitive help. Second, there is now a user-defined dialog box that appears in the Settings menu. This is a very crude mechanism that allows you to edit data anywhere in flashed ram by customizing the contents of the megatune.ini file. See that file and read the help (hit F1 while displaying the dialog) for full details. (Thanks to MiseryQ and Mike Soultanian for their testing of this feature.) IMPORTANT NOTE FOR USER-DEFINED DIALOG USERS! --------------------------------------------- The standard code's V command only sends back 125 bytes, so MegaTune will never show those last three values properly unless you change the SCI routines. Dave Jeal wanted to see all 128, so he changed this part of the embedded code: MODE_V: clr txcnt lda #$03 sta txmode lda #$7E <==== MAKE THIS #$81 I then made MT handle this as a general case (a couple releases back). I suggest you make this change in your code, or you'll only ever see garbage coming back into the user-defined dialog fields for your extended variables. (Sending the values to MS works fine, only fetching them fails.) A host of minor enhancements were included. The serial data rate is now configurable via the communications settings dialog, with allowed speeds of 9600 (default), 19,200 and 38,400 BPS. UNLESS YOU HAVE MODIFIED YOUR EMBEDDED CODE TO TAKE ADVANTAGE OF THIS, DO NOT DO NOT DO NOT CHANGE IT FROM 9600! Mike Robert has tested this out in his code and it seems to work for him, so if you need faster comm for higher resolution datalogs or whatever, seek him out. Did I say DO NOT CHANGE FROM 9600 without knowing what you are doing? MT now allows gauge/meter values to be reversed, so as to accomodate WB O2 interfaces that have rich at low voltage and lean at high. See megatune.ini for details. The temperature scale setting in megatune.ini was previously case sensitive, only upper case values were valid. MT now ignores case for these values so 'C' is the same as 'c'. I added Per Andersen's colored indicators to the runtime dialog's status bar. Mike Robert requested that the "full" data log get five new columns to the far right. These contain the two duty cycle values, corresponding to PW1 and PW2, and the three raw data values stored in the "blanks spots" of the runtime variables, so if you are experimenting with the embedded code and want to data log some values, just write them into those last locations and they will be logged. Mike's Log View version 1.4 and later supports display of these values. Eric Aston's suggestion regarding locating the tuning spot and cursor has been implemented in 3D tuning. You now have optional vertical and horizontal indicator lines for the two objects as they move about the grid. Several gauges now show telltale values, that is, the highest reading of the gauge leaves a ghost image at that position. This is behavior is currently hard coded, so you cannot modify which gauges have telltales, or turn them off altogether, but I'll probably put this in the megatune.ini file sometime. Gauge behavior has changed a bit. The old "redline LED" is gone, replaced by a change in the background color for the whole gauge. I never did like those little LEDs, as they were hard to see; the new background color change is very obvious. The colors used for warning and danger are accessible in the megatune.ini file as follows: backgroundColor = 202, 202, 202 ; Normal. bgWarningColor = 255, 255, 190 ; Warning (light yellow). bgDangerColor = 255, 160, 160 ; Danger (light red). The limits for each gauge are set using a new form of the gauge limit entries in megatune.ini. The old form (which still works just fine) had three values: gauge = lower, upper, redline and the new form has six: gauge = lower, upper, low-danger, low-warning, high-warning, high-danger When the gauge's displayed value is below low-danger or above high-danger, then the background color is set to the bgDangerColor; likewise when the needle value is outside the low-warning and high-warning limits (but still inside the danger limits), the background color is set to the warning color. The old style is interpreted as meaning "no warning limits, no lower danger, upper danger = redline." V 2.15 - 31 MAR 2003 ============================================ ================================================================= New command in Tuning suggested by Mike Lough, the "GO TO" mode command. Type G to toggle it on or off. When in "GO TO" mode, the cursor chases the tuning spot. Some might find this annoying, but give it a try, you might like it. Look in the megatune.ini, there is a new section GaugeColors, which allows you to set every color used by the analog meters and LED bars. I don't suggest you change them, but if you cannot read the gauges because colors dither or go to some wacky value due to a small color map, you'll need to tweak them here. NOTE: You need not add this block of values to old megatune.ini files, as the default values are the same as they've always been. Likewise, down in the Tuning section of the .ini file are five new color values for the tuning windows. You can set all of the colors for the cursor, spot, grid and so on. A final value, gridOrient, allows you to set the space-based 123 euler angles for orienting the 3D grid in its perspective view (use the N and M keys to find something you like, then copy the numbers from the status window into your .ini file). Acceleration enrichment has two cold adjustments: the original additive adjustment (Cold Accel Enrichment) and a new for embedded code V2.0 code multiplier (Cold Accel Mult). Access it on the enrichments dialog. V 2.14 - 26 JAN 2003 ============================================ ================================================================= Added raw datalog, all values are stored without transformation. Notice that the sensor values are all in raw ADC counts, so you'll have to pump most numbers through the appropriate transfer function to make sense of them. Dual table stuff: VE and PW are now page specific on the runtime dialog. Pop it up and type alt-1 and alt-2 to see it work. The VE grid is now displayed as a 3D surface plot in the Tuning dialog. You can toggle between the surfact plot and the flat view by pressing the 'Z' key repeatedly. Note that the flat view has been flipped such that low MAP values are at the bottom. The navigation keys have been reversed to work more intuitively with the flipped view, up raises MAP, down lowers it (left still lowers RPM and right raises it). As a nice side effect, the reworked plotting code eliminates the phantom dot and cursor that arose occasionally with the previous implementation. Prof. Matthias Lindner pointed out a bunch of bugs with the gauge and LED bar settings, MAT on front page had its lower bound set to the MAP gauge's lower bound, the LED bars didn't pay very much attention to the minimum value at all... This is all fixed now. Matthias also suggested the color of the messages on the tuning screen key into the cursor and the spot, so now they do. The cursor is red and so is the text which reports its position; likewise for the spot and its new text values. Someone tried to set deceleration enrichment above 100% and found that MT limited this to the range 1-100%. I've changed the range to 0-200%, which should satisfy anyone. V 2.13 - 09 NOV 2002 ============================================ ================================================================= Default gauge on tuning screen is now EGO correction, since this is the most used number (by me, at least) while tuning. Command line read of .msq files, just double click on one then set the application to be MegaTune.exe. Alt-V for VE table. When a VEX or msq file is read, you are asked if you want to download it to the MegaSquirt and burn the contents to FLASH RAM. There are two datalog formats now, the "classic" format to accomodate MST3k, and a full log with real time, and VE with pulse width for both injector drivers. A new entry in the megatune.ini file allows you to set the default controller code version for off-line editing. Previously, MT assumed 1.0 unless it was connected to a running MS, so you could not modify any of the v2 or dual table options. The new default is v2, set it to 0.1 for dual table code. V 2.12 - 10 SEP 2002 ============================================ ================================================================= VEX Import had a bug which transposed the table values on input, all fixed now and ready to rock with MST3k. VE Table scaling can be accomplished by either clicking the button on VE Table dialog or using the VE Scale command from the Tools menu. Enter a pair of actual ReqFuel values and the table is scaled correctly, or just make up a couple of numbers that scale it as you like. V 2.11 - 04 SEP 2002 ============================================ ================================================================= Alpha N bug fix: MS uses raw ADC values internally, but MT uses percentage values through out. MT was not consistent, and sent percentages to MS occasionally, screwing things up greatly. Should be all fixed now. Likewise, duty cycle had some problems that lingered, but should be better now when more than one squirt per cycle is used. Go to the tuning screen and look at the bottom of the screen. There are now three sets of gauges available for display in the lower right of the gauge panel: enrichments, pulse width for bank one, or pulse width for bank two. MT now has better support for different MAT and CT sensors. Previous versions used the table in thermfactor.inc to convert the raw ADC counts to temperature for display on the real time display screen. If you used thermistors with the same curves for both, then things worked fine, but if you used, say, a GM MAT sensor and a Bosch CTS, then your MAT values were probably displayed way off (this in no way affected operation inside MS, as it doesn't ever use actual MAT, just the density factor from airdenfactor.inc). You can now create a file named matfactor.inc and put it in the same directory with thermfactor.inc and have different thermistors with correctly displayed temperatures. You can use gentherm2 v 2.3 to generate a matfactor.inc directly, or if you have a correct thermfactor.inc, just rename it matfactor.inc and put it in the proper directory. New key mappings Alt-C gone, replaced with Alt-S Ctrl-S saves F in tuning screen "finds" the intersection nearest the spot. EGO LEDs on front page and tuning screen. Driven from the settings in the megatune.ini file, where there is better documentation. V 2.10 - 03 AUG 2002 ============================================ ================================================================= Lots of new stuff in 2.10, here's the list. Installation ------------ Installation has changed, the mtCfg directory is the preferred location for all the .inc, .ini and .cfg files. The old location (where megatune.exe resides) will still work, but if you create the mtCfg directory you can keep your installation cleaner. Bug Fix ------- All previous versions with meters on the front page have consumed system resources without releasing them. This would ultimately cause the machine to either lock up or crash. All fixed in 2.10, thanks to Guy Hill for pointing this out to me. Dual Table Mode Support ----------------------- Speaking of Guy, this version supports dual table mode, which is available in his highly modified controller code. Dual table mode controls the two injector drivers on MS completely independent of one another. This allows you to use one driver for fuel injectors, and the other, say, for water injection (or anything else you can dream up). When you are using dual table mode, you change the "page" that you are working on by either clicking the spin control on the front page or by typing alt-1 and alt-2. The page upon which you are working is not obvious (I'm working on this), so pay attention to that little box on the bottom of the front page. Table Editor/Memory Viewer -------------------------- The new table editor (on the Tools menu) allows you to edit the raw memory inside your controller. Make sure you know what you are doing before you change anything here. Those of you hacking the assembler code will find this invaluable, because you can get to every byte accessible to MT, including those unused bytes at the end of the controller RAM. The memory viewer is a read-only version of the table editor. It allows you to view any memory location in the controller, but is only available with Guy's dual table code. If you turn on realtime updating, and set the base address to $0100, you can watch the stack grow and shrink at the top end of the page. Communications Logging ---------------------- The communications menu shows a new communcation logging facility. This dumps out all data communicated with MegaSquirt into a text file named comm.log in the MT working directory. This file shows all data as hex bytes, except for the command character sent from MT to MS, which is shown in ASCII. Hot Keys -------- There are finally hot keys for navigating the commonly used dialogs and functions. Note that these are global hot keys, so when you invoke one it doesn't matter what is going on, that hot key jumps into action (so, if you are in the middle of the tuning screen and need to change enrichments, type Alt-E and change them, without leaving the tuning screen). The keys are as follows: Alt-1 - switch to page one in dual page mode. Alt-2 - switch to page two in dual page mode. Alt-C - pop up the constants dialog. Alt-E - pop up the enrichment dialog. One peculiarity of this is that the Close button on all the dialogs can no longer be invoked by Alt-C, since this now pops up the constants dialog. VE Table Exchange ----------------- Darren Clark has come up with a standard called VEX for exchanging VE information between various programs and has implemented it as the file format for his MSTweak3000 (aka MST3K). I've added a like import and export facility in MT (and published the C++ objects as utlities), see VEX import and VEX export under the File menu. Go to the yahoo site and search for VEX and EVEME, then look in the files section for some other goodies. Dump ---- The dump command has been moved from the File menu to Tools. Throttle Factor Table --------------------- A generator for throttlefactor.inc can be found under the Tools menu. Either type in the raw ADC counts corresponding to closed and full open throttle, or sit in the car, and use the "get" buttons while holding the pedal in the proper position. It couldn't be easier, could it? This is a .inc file, so adheres to the rules for other .inc file with respect to location (read the first entry for this release). V 2.00 - 16 JUN 2002 ============================================ ================================================================= Enrichment window now 640x480 compatible. Controller resets are reported with a Bing! and setting the connected status bar entry to "RESET n" where n is the number of resets detected since startup. Barometric correction can now be disabled (v 2.0 controller code only). The toggle is on the constants page. V 2.00beta - 07 JUN 2002 ============================================ ================================================================= Second beta fixes V2 detection, reduces biggest windows to 640x480. The two major inputs are displayed in the first two gauges on the front panel. RPM is always displayed, and either MAP (in the case of speed-density) or throttle position (in the case of alpha-N) is next. Updating of gauge values is much improved, and the type of gauge should always reflect the metering algorithm. The TPS values have all been changed to Throttle %, and the runtime value is translated with a TPS->TP transfer function now. This function is defined in an include file with the same form as a the other .inc files, and is read from throttlefactor.inc. If this file is not found, the map from ADC counts of 0-255 are mapped to 0-255 percent throttle values. (Guy Hill's alpha-N version of the controller code utilizes this file, allowing you to work in engineering units rather than voltages or raw ADC counts.) The non-sticking O2 switching voltage is fixed. V 1.61 - 14 MAY 2002 ============================================ ================================================================= All constants are fully initialized, so you get a reasonable starting point without downloading from the controller. There are now two algorithms for injection control: the original speed density (MAP-based load) and a new alpha-N (TPS-based) system. Alpha-N is only implemented in the v.2.0 and later controller codes, and the setting will have no effect in versions older than that. The version 2.0 code also allows setting of EGO sensor parameters, namely EGO type (traditional 0-1v narrow band or wide band). Once you've specified the sensor type, you should also set the switch point for the sensor (0.5 v for nB and 2.5 for DIY-WB; other WB sensors may have different switch points). The datalog has moved from the tuning screen and is now under the file menu! Once enabled, datalogging occurs as long as MT is displaying the top window, the runtime window or the tuning window. The comm port initialization bug is fixed. V 1.60 - 13 MAY 2002 ============================================ ================================================================= Wacky new front page. Dump command added to File menu. It writes out the contents of constants array and VE table into the file MegaTune.dmp in the directory in which MT is run. Bug fix for constants page which zeroed out all the values on the left side of the dialog box. Comm verification added. V 1.52 - 01 MAY 2002 ============================================ ================================================================= Made comm handling a lot more robust and added "connected" status to both runtime and tuning dialogs. Still not perfect but much better. Fixed bug on enrichment dialog where illegal value in 160 degree warmup enrichment bin would lock MT into a loop. Added duty cycle to runtime output. V 1.51 - 22 APR 2002 ============================================ ================================================================= MSCOMM is now obsolete! This version uses the Win95 serial port calls, so it appears to be completely robust with respect to data communications. I've been running the timer interval at 50 ms, on a 233 mHz PII laptop with Win98, and have seen zero errors in many tens of minutes of datalogging. If you do see errors report them to me (efahl@adams.com) immediately! Comm settings are auto saved, so when you change comm ports, that port value is written to the megatune.cfg (which is also no longer needed at startup, it defaults to com1 and 200 ms timer interval). Two new fields have been added to the Enrichments. Both fields are only active for version 2.0 and later of the MS controller code, so if you want to take advantage of them, you will need to update your MS. The new Priming Pulse field allows you to specify the duration of a priming pulse applied when MS is powered up. The EGO Active Above RPM field allows you to set the RPM below which closed loop operation is disabled. See the help for the enrichment dialog for more. Database files now store parameters from ReqFuel calculator, notably engine displacement, injector flow and AFR. This allows you to see where that funny number came from. V 1.50 - 13 APR 2002 ============================================ ================================================================= This is the first release of the modified B&G code. Help is implemented across all dialogs, just hit F1 wherever you want help. At startup all of configuration tables are read from the startup directory, so you need to select the right versions of kpafactor.inc and barofactor.inc installed (see Installation, above). All commands have keyboard mappings, there is no need to ever use the mouse. Either type the underlined letter on the button, or "alt-letter" and the button will be pressed just like all other MFC-based applications. Settings file save and load are added, the default directory is the startup directory. Files contain version info, allowing future versions to do conversion. Required fuel calculator now allows metric or English units. Bar charting on run time screen, units added. VE Tuning key mappings include arrows for moving cursor and shift-up/down to scale VE. Bar between gauges and tuning map shows magnitude of VE. VE Tuning screen scales properly with large fonts. "Esc" exits anything now. Two screens require confirmation before editing: the VE Tuning and the top-level MegaTune dialog. When bouncing down the road, hitting "Esc" twice will return you to either of these two screens.