viper4gh / SimHub-Plugin-CalcLngWheelSlip

Plugin for SimHub. It calculates longitudinal wheel slip by the relationship between Tyre RPS and Car Speed and provides the result as new properties.
32 stars 8 forks source link

Using Slip Values for shakers or rumble motors #8

Closed duarte11vieira closed 1 year ago

duarte11vieira commented 1 year ago

Hi first of all thanks for your work, is there any way I can use the properties generated by your plugin to drive a rumble motor?

I allready tried to assign to each wheel signal, the correct property generated by the plugin, but nothing happens.

Could this be a scale issue? Or there are other things I need to be aware.

Thanks in adavance.

viper4gh commented 1 year ago

I don't use it, but should work in general. I think I tested it in the past with my brake pedal rumble motor. And if I use a replay SimHub shows a signal with these properties.

2023-09-29_12-03-21__SimHub - Automobilista 2 - Game connected

2023-09-29_12-07-40__SimHub - Automobilista 2 - Game disconnected

For every wheel I used the NCalc Formula (FL, FR, RL, RR):

if([ViperDataPlugin.CalcLngWheelSlip.Computed.LngWheelSlip_FL]>0,[ViperDataPlugin.CalcLngWheelSlip.Computed.LngWheelSlip_FL]*100, 0)

Because the values of my properties are between -1.0 and +1.0, positive values = locking, negative values = spinning. For brake rumble you need the positive values only, what is the first check in the Formula. And then you have to multiply the value by 100, because you need it in percent, which means between 0 and 100.

duarte11vieira commented 1 year ago

Thanks for your answer with such detail, so I am looking in to the negative values (slip effect for acelerator).

I dont know If simhub will handle negative values, but probably is just need to convert it in to a positive value. Something like:

if([ViperDataPlugin.CalcLngWheelSlip.Computed.LngWheelSlip_FL]<0,[ViperDataPlugin.CalcLngWheelSlip.Computed.LngWheelSlip_FL]*-100, 0)

Will try this formula latter.

viper4gh commented 1 year ago

This is exactly how it should work ;-)

duarte11vieira commented 1 year ago

Hey man, worked like a charm! Thanks for your contribution :)

viper4gh commented 1 year ago

Issue solved