First run with ND on G1x. Looks like Tv goes to 2s and then ISO increases to 1000 (at 186). Than ISO goes to 160. Different as I expected but from motion blur it is better to keep the 2s.
But why ISO goes from 1000 to 160 and not from 800 to 100? Is this the Hysteresis?
You're right, I totally forgot about the hysteresis.
The effect is that the ND is put in when Tv would otherwise be shorter than Tv ND thresh, and after it is in, will only be put out when Tv is longer than Tv ND thresh + hysteresis value (in consistent units, which they aren't in the script UI.)
Since this means the ND should have only been removed when the exposure was below the limit, how did your run use the ND at all? In the calculation, all the exposure change starts on Tv, even if it's outside limits, and the calculation for ISO happens after the ND calculation. So the ND calculation still saw the Tv go longer than the ND limit, and it looks like it did the right thing, although I didn't really design it for this.
To avoid this, you could make ND thresh 1 second, hysteresis 1 stop, and then the ND should be removed at 2 seconds, and only put back in if tv goes shorter than 1 second. I chose 1 stop hysteresis here only because it makes the math simple, other values should be fine.
You might need to make the ND thesh at least slightly less then the tv max.
I set tv_nd_thresh to 2s and tv_max to 2s? Did this make the difference?
I said this because I'm lazy and didn't want to try to figure out which calculations use > or >= etc and how they might interact. In the example above, if you set ND thresh to 0.9 seconds then the ND will come out slightly above the absolute tv limit of 2 seconds (including the 1 stop hysteresis) and there should be no ambiguity. From an exposure point of view, the difference between changing the ND at ~1.9 or 2 sec is insignificant.