Latest Code Updates

A forum for discussing applications and implementations of the MegaShift transmission controller code for the GPIO from B&G. This can control up to 8-speeds and 6 shift solenoids (plus a 16x9 table for controlling a PWM line pressure valve). It has manual and fully automatic modes (16x9 load x speed table), with under and over rev-limit protection, and full data logging of all inputs and outputs (among many other abilities). A TransStim to test your completed board is also available.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

The latest MShift beta code is here:

http://www.msgpio.com/manuals/mshift/V5code.html

On our bench this code fixes a number of problems with the ADC w/ microTCU, as well as fixing some general VSS (with rearranged interrupts) and lever error issues (just plain debugging). While the 5.0xx code has the 'old' serial format (but the COMMS_382X is just a #define away).

This code also:
- changes the minimum TCC speed to 30kph/20mph from 50kph/30mph
- implements 'follow mode'. for gear lever shifting. This is active in auto mode. It lets a user specify a gear lever position, and any time the gear lever is in that position or lower, the target gear will be the gear lever position. For example, if you had a 4-speed transmission, and set the "Burnout Mode Highest Gear" to 3 (under Shift Factors), then the trans if the lever was in 4th (aka. Drive/OD/etc.) the trans would act as an normal automatic, and use gear 1st through 4th. If the lever was in 3rd the target gear would always be 3rd (rev limiting, hysteresis, etc., still applies). And the target gear would always be 2nd if the lever was in 2nd, etc. So it would be automatic in 4th, and essentially manual (based on the lever position) if the lever was in any lower position.
- While this code has the shift function for NAG transmissions, it does not have some of the other required functions to operate these transmissions (but we are working on this!).
- implements a 'Load Smoothing when Braking' parameter. In previous codes, changes in load while braking were ignored. This was perfect for road racing, but less desirable in street applications. The latest code has this parameter to allow a percentage of the change in load to be applied to the short-term average load, so that the target gear will respond quicker under braking. The default has been set at 20% (meaning the braking load responds 1/5 as quickly as when the brakes are not applied).
- the default load gauge is now the short-term load average, which is the value actually used in looking up target gears in the shift table.
- the output channel size was increased from 80 bytes to 96 bytes to allow more information to be datalogged (and create room for future use).

We haven't updated the support doc (http://www.msgpio.com/manuals/mshift/V5tune.html) yet, but we hope to do that soon.

We have nearly identical 6.092 code ready to go with the new serial CRC32 envelope format for use with B&G 3.830+ code (and likely some extra code that uses the new serial format). However we need to do more testing with this new format.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

5.093 beta code has been released here:

http://www.msgpio.com/manuals/mshift/V5code.html

This code:

1. Fixes an INI error that affected the IAC adjustments sent over the CANbus to the engine controller (thanks to gui67!),

2. Fixes an issue in determining the shift lever position on microTCUs.

3. Implements decel mode. This is designed to prevent immediate downshifts when you have accelerated up to a speed just beyond an upshift threshold, then let off the throttle and want to coast (such as in a drag race). It also should prevent many unintended downshifts due to VSS signal drop-outs.

The decel mode settings are under 'General Settings -> Throttle and Load Factors'.

For the decel mode to be triggered:
- the speed must be decreasing (sampled every 1/10th of a second), and
- there is a user TPS threshold setting which the current TPS value must be below (default is 12%).

When the decel mode is active (there is a new indicator in TS) the short-term load (used in the shift table lookup) will be restrained to be less than or equal to the user setting (Max. sLoad in Decel Mode; default is 60 kPa or 60% TPS, depending on what the user has chosen for load). As a result, a lower row of the table can be forced when decelerating.

Downshifts based on the table target gear (from the new lower row) are prevented until decel mode is cancelled or expires (or the rpm drops below the minimum), but upshifts from the shift table are allowed. The decel mode will last as long as the speed continues to decrease OR until the 'downshift delay' period expires (the default is 2.5 seconds, this is user-settable).

Downshifts will still occur if the engine rpm falls below the minimum set in the RPM checking menu (if and only if rpm checking is enabled): http://www.msgpio.com/manuals/mshift/V5tune.html#gr

There are more details here: http://www.msgpio.com/manuals/mshift/V5tune.html#gh

This seems to work on my bench. It's just a first cut, though, and likely needs some work.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

The latest 5.096 beta code/INI has been posted here:

http://www.msgpio.com/manuals/mshift/V5code.html

This code:
  1. Has the first incarnation of Tach-based shifting. When "Tach + Load Shifting" is enabled (under 'General Setting -> Shift Factors -> Auto Shift Mode') the VSS based shift table(s) are no longer used. Instead, there are a series of 'per gear' upshift and downshift engne RPM tables (with 8 elements each by load) under 'Tach + Load Shifts' on the main menu. These tables set the RPM to shift at for each gear (based on the current short-term load average).
    1. Some care must be taken to ensure that an upshift from a gear (say 2nd) will not be followed by an immediate downshift in the target gear (3rd). This will happen if the ratio of the gear ratios (3rd/2nd or 1.000/1.630 = 0.613 for a 4L60e) multiplied by the current rpm in 2nd is lower than the downshift rpm for the target gear. I have code in place (but commented out) to check for this possibility, but I have left it out for now in case it causes more confusion than it solves (by not shifting when the user expects it to). If the shifts start oscillating, that likely means that this situation has been encountered, and the upshift rpm must be raised, the next higher gear's downshift rpm must be lowered, or both. And a similar situation applies for downshifts followed by upshifts.
    2. There are separate load bins for upshifting versus downshifting.
    3. Decel mode has no effect when Tach-based shifting is selected.
    4. The VSS is still used for the line pressure table. If you wanted to eliminate the VSS altogether, you could use the line pressure output as 'Spare Port 0'. Then you can set the 16x9 spare port 0 PWM table up as a gear vs. load (or rpm, etc.) PWM table. There is more information on using the spare ports here: http://www.msgpio.com/manuals/mshift/spareport.html.
    I have done some testing of the Tach-based shifts on my bench, where the Tach-based shifting appears to work as designed. But it is difficult to exactly simulate the RPM change of a shift on my bench, so of course it needs some exposure to the real world before it is ready for prime-time. Use this mode only with extreme caution, conservative RPM values, and slow speeds.

    There is more information on the new Tach-based shift mode here: http://www.msgpio.com/manuals/mshift/V5tune.html#r
  2. Calculates and logs the instantaneous gear ratio (labeled "iRat" in datalogs).
  3. Estimates and reports the current gear from the instantaneous ratio - in preparation for implementing NAG mode. This is "eGear" in the datalogs.
  4. Adds a intermediate gear ratio for FWD transmissions or quick change rear ends (ex. Halibrand). See: viewtopic.php?f=4&t=921&p=4994#p4979 Thanks Addicted!
  5. Adds a provision for VSS placement on wheel rather than output shaft. See: viewtopic.php?f=4&t=921&start=40#p4969 Thanks Addicted!
  6. Fixes the scaling on shift completion delay table (it was 10x too short). See: viewtopic.php?f=4&t=933&start=10#p4986 Thanks thatswagenwagen!
  7. A NEW_VSS interrupt routine that uses both edges of VSS signal to help eliminate spikes. The trigger edge is still the only edge used for VSS period measurements, but if an opposite edge occurs too soon after any particular edge, both are discarded.
  8. VSS_per (32 bits) in the [OutputChannels] for direct ic1 input period measurement. It was previously estimated using the speed, number of VSS teeth, tire size, and final drive ratio within TS on the PC.
  9. The default VSS mask now set to 80% (was 0% which disables the masking). This improves speedo stability with low voltage VR signal on my bench. However, this does freeze the speedo if signals that are not smoothly varying are used (such as turning the VSS signal generator on and off at varying non-zero frequencies), in which case the value should be set to 0. In the real world, VSS signals are smoothly varying, of course (unless they have dropouts, which are not smooth, but which we want to ignore anyhow).
  10. fixes the 2-pt calculations for the line pressure sensor input. See: viewtopic.php?f=4&t=936 Thanks mcneil!
  11. fixes the PC table lookup to use LOAD rather than LOAD_short. See: viewtopic.php?f=4&t=933&start=10#p4952 Thanks thatswagenwagen!
By the way, with a recent update to TS, I am getting "Page 0" burn errors every time flash is burned. There doesn't seem to be any actual issue with burning, though. I do have to click "OK" every time to dismiss the warning dialog, however. I am looking into this.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

The latest 5.097 beta code is here: http://www.msgpio.com/manuals/mshift/V5code.html

This codes adds transmission types under "Hardware -> Transmission Type". This lets the users specify a transmission type so that all the known constants for that trans will be used (and the corresponding menu elements will be 'greyed out'). Users can revert back to 'Set All Parameters' to expose all the setting for editing at any time, of course (existing parameter values will be retained until they are edited).

The idea has been to make set up simpler, but still allow full control over all aspects of the parameters when required (for advanced users or re-purposing circuits when others have been damaged).

The current choices are:
  • Set All Parameters <--- This was the 'old' default behavior
  • NAG mode <--- not functional at present - DO NOT USE
  • General Motors 4L60e
  • General Motors 4L80e
For example, selecting 'General Motors 4L60e' will set the gear ratios (2.290,3.060,1.63,1.000,0.700), input patterns (swA, swB, swC) and output patterns (SolA, SolB, & 32sol), number of VSS teeth (40), and I will add anything else to later releases (the VSS location, for example). The 4L80e is similar (the gear ratios and output patterns have differences, of course) but also sets the number of ISS teeth (31). There is no practical limit to which parameters could be set using the transmission type setting, but we have to be aware that there may be transmissions families out there that don't all share the same internal gear ratios, for example.

The NAG mode is not currently functional, but we are getting closer. Selecting NAG mode under transmission type will give strange behavior, so only do this on a bench, not in a vehicle.

Note that TS may generate a warning when the transmission type is changed because the contents of RAM won't necessarily agree with the local current tune for the affected variables. Once you choose to keep the values on the controller by saving the controller settings as your current tune once or twice this warning should go away.

Finally, note that the settings are only accurate if the controller is wired exactly according to the instructions.

I will add as many transmissions for which we can find adequate documentation (to write a build manual), as long as someone has a working vehicle they are willing to test with.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

Updated 5.098 beta code is here: http://www.msgpio.com/manuals/mshift/V5code.html

This code adds an option to ignore the lever inputs under 'Shift Input Patterns -> Lever and Shift Buttons Configuration -> Use lever input'. If you choose the option to 'Assume Always in Drive', the lever position will always be reported as the highest forward gear (i.e. "Drive").

The default is 'Use lever inputs' which was the behavior in all previous codes.

This may be useful for users whose trans have the PNR gears selection controlled entirely mechanically by the shift lever (i.e. a physical link from the shifter) and whose solenoid pattern is the same in PNR as it is in first gear. Many transmissions fulfill these requirements (mostly due to the need to have limp-home capabilities in the event of a total electronic failure).

When these conditions are met (as they are for the 4L60e, for example) the lever inputs don't even have to be hooked up. The controller will assume the trans is in Drive at all times, and shift according to the table or the manual shift buttons when the lever actually is in Drive. So you still have full automatic and manual (w/ shift buttons) control in the forward gears, as before.

However, if the lever is actually in one of the PNR positions, then the controller will still assume it is in Drive, but the mechanical selection of the PNR gears will put the trans in the selected gear (P, N, or R). The solenoids will be selected from the current gear, but since PNR are likely to be engaged only at slowish speeds, this likely means the solenoids will be in the 1st gear state, which is the correct solenoid state for the 4L60e in P, N, or R.

Selecting this option to 'assume always in drive' means the user no-longer has the option to set specific line pressure control PWM% for Park/Neutral and Reverse (because the controller no longer knows when you are in any of these gears). The line pressure will be set from the line pressure PWM table (or spare port 3 PWM parameters/table, if the PC output is optionally configured as a spare port)

Having this option, plus the ability to shift entirely be rpm and load (Tach based shifting, see the Dec.12, 2014 post above) could prove useful to those hat have issues on either of these fronts (VSS and lever input are the most frequent sources of trouble users encounter with MShift). These also potentially make bare-bones setups with MShift very simple.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

Updated 4.146/5.099 codes/INIs are here:

4.146 release code: http://www.msgpio.com/manuals/mshift/V41code.html

5.099 beta code: http://www.msgpio.com/manuals/mshift/V5code.html

Both of these codes add a speedo adjustment factor (it is a multiplier) when grabbing the VSS from the engine controller over the CANbus. This was required to match up MS3 VSS units (meters/second) with MShift (MPH) where the value would be set to 2.237 (i.e. multiply the MS3 value by 2.237 to get MPH). The value can be set anywhere in the range from 0.000 to 20.000 in 0.001 increments. This factor might also need to be used where the MPH has a different 'granularity' in other codes (in MShift it is x10, but potentially might be x1 or x100 in other codes) Thanks to Dave B. for the suggestion!

Both codes also have fixed speedo correction so that smoothing occurs after the adjustment of the raw speedo value. Applying the correction after the smoothing could result in erratic speedo behavior (especially with larger corrections).

The 4.146 INI has fixes for the MAP/TPS shift and PC menu/units table display. Thanks again to Dave B. for spotting the problem and testing solutions!

In addition to the speedo adjustment factor and the fix for the the speedo correction, the 5.099 beta code:
  1. makes all CANbus memory locations (offsets) user-settable for both outpc and outmsg. This allows users to match MShift to other outpc/outmsg memory layouts. The offset values can be from 0 to 1023 for outpc, and 0 to 255 for outmsg. These offset can be set under 'Tools ->CANbus Offsets OUTPC/OUTMSG '. Note that the VSS outpc offset has been moved to this menu from the CANbus set-up menu.
  2. allows the user to set a speedo offset in outmsg, so that speedo can now be grabbed when using "Get only required vars" for the "CANbus message format" parameter, IF the outmsg structure is set up appropriately on the engine controller.
  3. increases the CANbus VSS offset maximum value for outpc in INI from 255 to 1023. This was required for MS3 where the speedo offset is apparently 332 (with an outpc size of 340 at last count). Thanks to Dave B. for the suggestion!
Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

The 5.099 code posted above has format errors with respect to the CAN offsets for thing like the speed, load, etc.. The 5.099d code and matching INI posted here fix this:

http://www.msgpio.com/manuals/mshift/V5code.html

This code also has a new setting to choose the algorithm for the VSS interrupt on the VSS Setup menu. The choices are:
  • "Use old VSS ISR" which is the algorithm used in all code up to 5.096, or
  • "Use new beta VSS ISR" which has been in place for the last few codes.
The new algorithm is more sophisticated, but less developed. While the new code works well on the bench, users are reporting some issues in field testing. So we have made it an option while we develop this section of the code. The default is to use the old code.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

The latest MShift release code, version 5.100, is available here:

http://www.msgpio.com/manuals/mshift/V5code.html

Compared to the previous 4.146 release code, the major additions/changes to the new 5.100 release code include:
  1. Has a much improved, and more robust interrupt structure. This means 5.100 can handle most VSS overhead and comms traffic more efficiently and more accurately.
  2. Adds Output9 on the dedicated pressure control (PC) output (also can be used as spare port 3)
  3. Does away with the discrete load types (MAP xor TPS) and instead has a calculation with user input that determines how much of each is used. User can choose 100% MAP (and no TPS), 0% MAP (and 100% TPS) or any point in between. The default is 25% MAP and 75% adjusted TPS. See: http://www.msgpio.com/manuals/mshift/V5tune.html#gh
  4. Does away with the use of load for shift hysteresis (it was too variable, and often changed as a result of a shift) so instead the speed hysteresis now is paired with time based hysteresis instead. See: http://www.msgpio.com/manuals/mshift/V5tune.html#gs Many thanks to Addicted for spotting issues, suggestions, and testing solutions.
  5. Implements decel mode, preventing the trans from downshifting under deceleration. See: http://www.msgpio.com/manuals/mshift/V5tune.html#gh
  6. Adjustments to the short-term load average have been made user options under accel, decel, and braking. See: http://www.msgpio.com/manuals/mshift/V5tune.html#gh Many thanks to Addicted for spotting issues, suggestions, and testing solutions.
  7. TCC can be forced to always engage in highest gear. See: http://www.msgpio.com/manuals/mshift/V5tune.html#nt Many thanks to Addicted for spotting issues, suggestions, and testing solutions.
  8. "Follow mode" has been introduced to force the trans to be in the same gear as the shift lever position (up to a user specified maximum gear). See: http://www.msgpio.com/manuals/mshift/V5tune.html#gs Many thanks to Shaodome for spotting issues, suggestions, and testing solutions.
  9. Accounts for the vehicle speed sensor being located on the trans. output shaft or wheel (and allows for an intermediate gear between the output shaft and the final drive ratio, esp. for FWD transmissions). See: http://www.msgpio.com/manuals/mshift/V5tune.html#gv Many thanks to Addicted for spotting issues, suggestions, and testing solutions.
  10. Makes the shift completion time a function of load in a 8 element table (instead of a single value in 4.146). See: http://www.msgpio.com/manuals/mshift/V5tune.html#tc
  11. Implements spare port 3 on the speedo output, and uses a 16x9 PWM table (can also be used as Output 9 or a dedicated line pressure control output)
  12. Makes all CANbus variable offsets user settable (for both OUTPC and OUTMSG). See: http://www.msgpio.com/manuals/mshift/V5tune.html#oa
  13. OUTPC (aka. {OutputChanels} in the INI file) has expanded from 72 bytes to 96 bytes for more complete reporting. Datalogged variables have expanded to be even more comprehensive and descriptive.
  14. Has the first iteration of RPM based shifting. See: http://www.msgpio.com/manuals/mshift/V5tune.html#l
  15. Has a number of fixes for things like PC output control not working properly and a table switching input bug.
Most of these changes and additions have been discussed in recent threads (posted before April 13, 2015). For example, see:
- Trigger hysteresis using avload instead of load?
- What is the shftBut field in datalogs?
Many of the new features (and some not mentioned here) are described in earlier posts in this Latest Code Updates thread as well.

This 5.100 code uses the 'old' serial comms code (as used in 2.920 engine controller code) but other changes to the interrupt structure have made the existing code more efficient. New code (likely 6.100) with the new serial 'CRC envelope' code will be released as a beta code soon, and that code should be fully compatible with engine codes using the new serial comms (such as 3.8xx).

Many thanks to everyone who reported issues, made suggestions for new features and functions, and tested solutions and additions!

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

5.101 code has been released here:

http://www.msgpio.com/manuals/mshift/V5code.html

This 5.101 code has a fix to the line pressure options during a shift when spare port 3 is used in PWM mode. There is more on this here:

viewtopic.php?f=4&t=983&start=10#p5319 (thanks to Addicted!)

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

5.102 code has been released here:

http://www.msgpio.com/manuals/mshift/V5code.html

This 5.102 code has a fix to target gear lookup while hysteresis is in effect. There is more information on this here:

viewtopic.php?f=4&t=1012 (Thanks to BuickV6 for spotting the problem and testing the solution!)

The INI is also fixed up so that the "turboBaud" error no longer occurs n CANbus pass-through configurations.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Locked