SimHub ShakeIt speed shift effect experiments

blekenbleu

SimHub+Arduino hacker
Premium
SimHub provides a default Gear shift effect,
but one arguably would prefer an effect which varies with smoothness of shifts.
After some floundering, shift roughness may best correlates with abrupt changes in speed or acceleration.
Of course, acceleration is literally changes in speed; changes in acceleration are called jerk.
Rough shift experiments were first discussed here:

Rough shift effect​


I apologize for the delay in providing this, and it turns out that
changes in car speed are more indicative of clumsy shifts.
Here is a working formula:
JavaScript:
var s = $prop('SpeedKmh');
var g = $prop('Gear');
const tc = 3;  // IIR smoothing factor
const noise = 0.01 // non-linear filter threshold

// initialize IIR filter history
if(null==root["lows"]) {
   root["lows"] = s;
   root["og"] = g;
}

// IIR low-pass filter
var lows = root["lows"];        // lowpass IIR output
var ds = s - lows;
if (g == root["og"])
  ds = 0;                // only interested in speed changes during shifts
root["og"] = g;
lows += (s - lows) / tc;    // low-pass filtered speed
root["lows"] = lows;
return 10 * Math.abs(ds);

The upper graph plots gear changes, and the lower graph is shift abruptness from the above JavaScript:
View attachment 502287
.. but rather than more clutter in @RCHeliguy's thread,
further content will continue here.
Attached is a profile with experimental effects.
As usual, it wants .txt removed from its name
and copying into SimHub's profile directory, which is usually Documents\SimHub.

Here is an alternative IMO worth considering.
 

Attachments

  • SpeedShiftsGrp.siprofile.txt
    15.6 KB · Views: 194
Last edited:
correlates with abrupt changes in speed or acceleration
Exactly how it correlates, telemetry-wise, is as arguable as how well (tactile perception).
At least for now, the focus will be on telemetry. Following are plots for:
  • gear, then absolute values for gear-change gated
    • surge acceleration
    • high-passed filtered changes in speed
    • high-passed filtered changes in surge acceleration
shifts.gif

Front right and Rear left should arguably be more similar,
since high-pass filtered speed changes is nominally equivalent to surge acceleration.
Shift smoothness was not noted while recording,
which of these best correlates is unknown; live testing is wanted.
Since high-pass filtered changes in acceleration is nominally equivalent to jerk
and that term is often associated with rough shifts, Rear right seems promising..
 
Last edited:
Upvote 0
In addition to gear changes, we also want samples during clutch releases.
As a reminder, to derive acceleration from speed samples, one typically
subtracts the previous speed value from the current value,
then optionally low-pass filters those differences,
instead of subtracting low-pass filtered previous samples from current samples.
However, rough shifts interest is more for sudden changes than long-term accuracy.
Minimizing errors between methods involves tedious juggling of gains and filtering factors.
Here are two plots evaluating methods, gated neither by gear changes nor clutch releases:
  • Front left is SpeedKmh
  • Front right is AccelerationSurge
  • Rear left is current speed minus low-pass filtered previous speeds
  • Rear right is current acceleration minus low-pass filtered previous accelerations
plot1.gif

The second plot is when braking with front tire lockup, a limit condition:
plot2.gif

The low pass time constant determined to roughly minimize
differences between Front right and Rear left was then also applied to Rear right.
 
Last edited:
Upvote 0
What I noticed from testing the effect is that the impulses don't last long enough to generate a strong feeling from the shakers even though it looks correct in the live effect preview. I tried it independently on pucks, bst1, bst2 and bk advance. With the volume all the way up, gamma of 2, input gain of 200, and everything else muted, I could only feel about half of the shifts. I noticed the same thing when I used input gain to get more info out of the road vibration effect, some impulses were too short for my shakers to reproduce unless there were several of them close together.

I haven't seen any option for custom effects to control the duration, but the gear shift effect has a pulse duration setting. Maybe gear shift can be used as an input and your effect can control its response.

I really like the idea of a having a more dynamic and physics-based shift response. I turned the default effect off because it has a consistent and one-note feel to it. Right now I use wheel slip to give me a shift-like feel based on traction loss.
This was a good observation and great suggestion
(I have not yet resumed sim racing since hurting my back)
A solution is to export GEAR SHIFT effect as property gearchanges,
then gate speed change telemetry by that property, e.g.
JavaScript:
var s = $prop('SpeedKmh');
const tc = 3;  // IIR smoothing factor

// initialize IIR filter history
if(null==root["lows"])
   root["lows"] = s;

// IIR low-pass filter
var lows = root["lows"];      // lowpass IIR output
s -= lows;           // current speed - low-passed = high-passed
lows += s / tc;    // low-pass filtered speed
root["lows"] = lows;
if (0 == $prop('ShakeITBSV3Plugin.Export.gearchanges.All'))
    return 0;
return 10 * Math.abs(s);
 
Last edited:
Upvote 0
Thanks to @sierses, for recordings from more games,
allowing evaluation of effect portability among Assetto Corsa, ACC, Autombolista,
AMS2, iRacing, Project Cars 2, RRRE and RFactor 2.
Incorporating his suggestion to export a property from SimHub's GEAR SHIFT effect
for its Pulse duration control,
an experimental Speed Shift profile is now attached to the first entry in this thread.
The profile has a group of three effects:
  • GEAR SHIFT to export gearchanges property
  • CUSTOM gear change diagnostics
  • CUSTOM Tactile outputs, based on shift's smoothness of speed changes
    • while nominally Corners, these should be mixed to a single tactile channel
    • No attempt was made to optimize actual tactile effects
The gear change diagnostics CUSTOM EFFECT is simply to visualize some processed telemetry
from which gear change telemetry is being sampled for tactile effects:
diagnostics.gif

Front left is high-pass-filtered speed changes,
Front right is Clutch telemetry, if ever non-zero,
else gearchanges property from GEAR SHIFT.
Rear left is rescaled SpeedKmh property;
Rear right is rescale absolute values of AccelerationSurge property.

Below are processed telemetry signals sampled by gearchanges or Clutch releases:
sampled.gif

Front left is high-pass-filtered speed changes sampled only by gearchanges.
Rear left is the same, except also sampled for Clutch releases, as are the remaining pair:
Front right is AccelerationSurge;
Rear right is high-pass-filtered AccelerationSurge (AKA jerk).
 
Last edited:
Upvote 0
  • Deleted member 1449502

Dude this is awesome!! so much better than the standard layered gear shift effect we've been using. Since transitioning to AC from ACC I haven't been able to get the gear effect to work well, it's been super inconsistent and frustrating going back and forth. This is right on the money! I cloned the effect 4 times and ran them at:

[Rear Left] - 54hz - TST (Clutch release) TST rear and at pedals
[Front Left] - 36hz - MID BASS (High-pass filtered speed change)Shaker mid back
[Front Right] - 24hz - LOW BASS (Acceleration Surge) Shaker at pedals
[Rear Right] - 12hz - LOW BASS (Acceleration Surge/Jerk) Shaker at rear of rig
 

Attachments

  • GEAR SHIFT EFFECT.siprofile.txt
    35.4 KB · Views: 179
Upvote 0
  • Deleted member 1449502

What do you think of the routing config?
I've been tinkering with the layers and balance and I think I have it dialed. I'll have a sit on it tonight and post it tomorrow. Interested to hear what you think
 
Last edited by a moderator:
Upvote 0
This is right on the money
I love it when plans come together.

What do you think
I use only small exciters and focus on actionable feedback (driving aids)
rather than immersion. It is not that I perceive no value in immersion,
but I personally find e.g. road texture and engine tactile effects
distracting and not conducive to driving well.

My shifter is on a cantilever;
that is where I would attach a gear shift effect exciter.
I already have harness tensioning for deceleration,
which feeds back some consequences of rough shifts,
and am currently working on pneumatic acceleration feedback.

I have a longer-term plan to create a SimHub MIDI plugin
to pass low frequency MIDI volume commands
to an Equalizer APO VST plugin. This will enable exciters,
which tend to be efficient with light structures
when excited in the 50-100Hz octave,
to be modulated at much low frequencies,
effectively preempting need for large (and more expensive)
shakers and amplifiers. This will also allow SimHub to
simultaneously and independently alter strength and frequency of tactile effects.
 
Last edited:
Upvote 0
Another SimHub CUSTOM speed shift effect:
Run once javascript:
JavaScript:
root["low"] = 0;
var shift;
const tc = 3;  // high-pass filter time constant

Javascript:
JavaScript:
shift = 3000 * $prop('SpeedMph') / (1 + $prop('Rpms'));
shift -= root["low"];
root["low"] += shift / tc;
return 10 * Math.abs(shift);
speed_rpm.png
 
Last edited:
Upvote 0
Back
Top