Telemetry from Simhub idea - Traction loss, Wheel Lock and ABS
Opened this issue · 5 comments
I'm planning on making an active brake pedal and using Simhub to export the telemetry to the brake pedal to add effects. This is what I have come up with so far:
Set Simhub bass shakers to output telemetry:
-
For Wheel lock, use Wheel lock option, change to mono and tick 'Use lock only' Tick 'Export output value as a property' and use WheelLock as the property name. Set volume slider to zero (if also using bass shakers - you can add the same effect again with a different setup for the bass transducers)
-
For Wheel slip, use Wheel Slip option, change to mono, Tick 'Trigger when brake pedal reaches %' (To stop it triggering during wheel spin when not braking), Tick 'Export output value as a property' and use WheelSlip as the property name. Set volume slider to zero.
-
Alter the SHCustomProtocol.h file with my sketch for the brake pedal. (Not written this yet).
-
Flash the arduino using Simhub.
-
In Simhub, click on the Arduino menu and select the 'Multiple Arduinos' option.
-
Click on the down arrow next to the newly detected arduino and enter this for the Custom Protocol Message:
if([DataCorePlugin.GameRunning]=0,'', 'WL' + format([ShakeITBSV3Plugin.Export.WheelLock.All],'000') + 'WS' + format([ShakeITBSV3Plugin.Export.WheelSlip.All],'000') +'ABS'+ format([DataCorePlugin.GameData.NewData.ABSActive],'0'))
This should then send over serial the telemetry in this format:
WL000WS000ABS0
Where braking lock up and traction loss under braking are measured up to 100 after WL and WS and ABS active or not is 1 or zero.
Simhub allows some customisation of when he effects are triggered and by how much by modifying the response curve in the Shakeit Bass Shakers section.
My plan is to use this information in the arduino sketch to create a fine vibration for wheel slip, a stronger vibration for wheel lock up and a larger pulse effect for ABS.
@GWiz-GitHub Good idea, but why setup a bass shaker if Simhub can output custom serial data itself:
https://github.com/SHWotever/SimHub/wiki/Custom-serial-devices#configuration
I thought about writing a custom Simhub plugin for the DIY active pedal, e.g. to customize the pedal curve, effects, etc., but could not find much helpful information on how to start with that task.
@ChrGri I initially has a setup working to an extent without using the shaker plugin, but there are a few reasons why I decided to use off the shaker plugin instead.
Several games don't output Wheel Slip data directly and so you need to compare the vehicle speed to tyre speed, taking into consideration the tyre diameter of the vehicle. There is a custom plugin that does exactly this, but I found it simpler to piggy back off the Shaker module which does these calculations already (The motors plugin would work just as well).
The shaker and motors plugins have some useful features build in such as only triggering when the pedal is depressed by a certain amount and easy adjustment of the output curve. By using the existing plugin, it allows cross compatibility when swapping games without having to worry about how a specific game outputs it's telemetry (Not all the games send the data in the same format). A custom Simhub plugin would be nice, you could take parts of the exiting plugins but add options for the pedal curve etc as you have mentioned. I haven't worked out how to do that yet either.
I don't know if this is helping, but I found this plugin for calculating the wheel slip
https://github.com/blekenbleu/CalcLngWheelSlip
@Ibakha Yes, that's the plugin that I used previously, but I found the bass shaker export to be easier to set up and more configurable.
An initial implementation of ABS effect and a SimHub plugin to control the pedals have been added to my fork. Tested it in iRacing, where it was working beautiful.