How Hysteresis Works

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.
Post Reply
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Hysteresis example

Post by Bernard Fife »

gurov,

The hysteresis is +/- mph, so if you have it set to 10, it is +10 or -10.

For the shift table, look at the default:
gearTable.JPG
In this case, at 100 kPa, the 1-2 shift will be at 60 mph. That's because the first cell in the 100 kPa row that has a 2 in it is in the 60 mph column.

The 2-1 downshift will also be at 59.9, because the speed value is below 60, so the next lower bin is used (the 40 mph column) and this has a 1 in it for the gear.

This is neglecting the hysteresis, which can screw up the shift relative to the table if hysteresis is large, so I recommend you keep it small - 2 to 3 mph. This will be easier once I have the smoothing sorted, hopefully.

In the default table (@ 100 kPa) the 2-3 shift will be at 100 mph, and the 3-4 shift will be at 140 mph.

At 45 kPa, the shifts in the default table are:
1-2: 26 mph
2-3: 48 mph
3-4: 70 mph

If you accelerated up to 65 mph @100kPa, then let off the throttle so the speed remained the same, you would initially be in 2nd gear, but shift to 3rd once the averaged load dropped to 75 kPa, and then shift to 4th once it got to 35 kPa. Jumping on the throttle again would cause downshifts to 2nd (@100kPa, of course).

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
gurov
Posts: 164
Joined: Mon Jun 01, 2009 1:01 pm

How Hysteresis Works

Post by gurov »

good, this works well.

i did have one instance of trans upshifting but instantly downshifting again, my hysteresis is set to 10 mph and 0 kpa.

also, when i put the trans into drive from neutral, from a standstill, sometimes the gear is set to 5, and i can hear it thunk down through the gears as it downshifts to 1st. at this point, there is no speed signal present.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife »

gurov,

I will have a look. At very least, the code ought to set the target gear to 1 whenever the trans is in neutral. Look for new code in a day or two.

The upshift might have been caused by the 0 kPa hysteresis. If you set that even to 5 kPa it should help.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
gurov
Posts: 164
Joined: Mon Jun 01, 2009 1:01 pm

Re: Latest Code Updates

Post by gurov »

Lance wrote:gurov,

I will have a look. At very least, the code ought to set the target gear to 1 whenever the trans is in neutral. Look for new code in a day or two.

The upshift might have been caused by the 0 kPa hysteresis. If you set that even to 5 kPa it should help.

Lance.
wait, i want to DISABLE load changes allowing shifts for now. i want the KPA to be able to go from 18 to 150 and not shift. is this possible ?
gurov
Posts: 164
Joined: Mon Jun 01, 2009 1:01 pm

Re: Latest Code Updates

Post by gurov »

gurov wrote:
Lance wrote:gurov,

I will have a look. At very least, the code ought to set the target gear to 1 whenever the trans is in neutral. Look for new code in a day or two.

The upshift might have been caused by the 0 kPa hysteresis. If you set that even to 5 kPa it should help.

Lance.
wait, i want to DISABLE load changes allowing shifts for now. i want the KPA to be able to go from 18 to 150 and not shift. is this possible ?

also, my gear target columns are straight for now. i.e. speed range can only have one gear. so it would not have been shifting due to that anyway, this was like RIGHT on the edge of the speed-based shift, but i thought hysteresis would take care of this.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

How Hysteresis Works

Post by Bernard Fife »

gurov,

The hysteresis conditions are OR'd, not AND'd. So if either condition is met, a shift is allowed.

With the kPa hysteresis at 0, this is what happens: either the speed has to change by your 10 mph setting, OR the kPa has to change by 0 (your setting) before a shift is allowed. That is, it doesn't have to change at all.

Since EITHER the speed or the load hysteresis sufficient to allow a shift, you essentially have no hysteresis if you set the kPa to 0. So a fluctuating speed signal (because of noise) can cause a shift, because the 0 setting on the load has essentially disabled the hysteresis.

If I understand correctly, you want a higher kPa hysteresis, this will make the speed hysteresis the 'effective' condition. However, you don't want to set the kPa hysteresis too high once you start tuning the shift table, otherwise it will prevent shifts due to load changes at the same speed (like in the default table example above).

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
gurov
Posts: 164
Joined: Mon Jun 01, 2009 1:01 pm

Re: How Hysteresis Works

Post by gurov »

Lance wrote:gurov,

The hysteresis conditions are OR'd, not AND'd. So if either condition is met, a shift is allowed.

With the kPa hysteresis at 0, this is what happens: either the speed has to change by your 10 mph setting, OR the kPa has to change by 0 (your setting) before a shift is allowed. That is, it doesn't have to change at all.

Since EITHER the speed or the load hysteresis sufficient to allow a shift, you essentially have no hysteresis if you set the kPa to 0. So a fluctuating speed signal (because of noise) can cause a shift, because the 0 setting on the load has essentially disabled the hysteresis.

If I understand correctly, you want a higher kPa hysteresis, this will make the speed hysteresis the 'effective' condition. However, you don't want to set the kPa hysteresis too high once you start tuning the shift table, otherwise it will prevent shifts due to load changes at the same speed (like in the default table example above).

Lance.
correct, i want speed to dictate the upshift/downshift for now, my issues is that if i have 3 gears in the same speed column, chances are it will hunt because of changing load, whereas the thing to do would be to stay in lower gear and let the turbo take care of the acceleration. 25.5 kpa change is nothing, as i've said before, it's very easy to make this engine go from 18 kpa to over 100.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: How Hysteresis Works

Post by Bernard Fife »

gurov,

However, 25.5 is a LOT more than 0.

I will change the kPa hysteresis factor to be 0 kPa to 255 kPa for the next code release. Then you can set it as high as you prefer.

The hysteresis isn't designed to take the fluctuations out of the load signal though, that's the job of the LOAD Smoothing Factor. So the higher the load averaging factor (it can go up to 4000), the lower the hysteresis can be for a given level of fluctuation in the MAP signal.

The gears should be set by the table as much as possible. So if you don't want the trans to shift based on load, use the vertical columns with all the same value like you have. Or just put in one shift - so 2nd gear above 100 and and 3rd below for example, then you will only shift when you hit boost.

I still don't advise setting the kPa hysteresis very high, as this will only work if you have a 'vertical' table like your (which defeats the purpose of load based shifting). I know you realize this, but I mention it in case someone else reads this and thinks it applies to them (or to the default setting).

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
gurov
Posts: 164
Joined: Mon Jun 01, 2009 1:01 pm

Re: How Hysteresis Works

Post by gurov »

I've switched to tps as load, will see how that feels. one thing I noticed right away, grabbing tps as load over can will go to 65k in megashift if in ms3 tps value reads slightly below 0, this would probably play tricks on hysteresis. and wot threshhold etc.

calibrating tps slightly under min value in ts fixed this, but if there are any mechanical warmup controls on the plate like my sentra, this could be problematic. the throttle closes as the tb warms up via a thermostat.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: How Hysteresis Works

Post by Bernard Fife »

gurov,

It looks like that's because MS-II uses a signed int for the TPS, but I have LOAD as an unsigned int in the MShift code. When MS-II goes negative, MShift roll-overs and you get huge values. I will change it for the next code version (coming soon).

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