Custom Effect Respo...
 
Notifications
Clear all

Custom Effect Response Curve - Ramp then Pulse?

10 Posts
2 Users
0 Reactions
2,213 Views
(@exigeous)
Trusted Member
Joined: 3 years ago
Posts: 35
Topic starter  

I've added a Arduino with a vibration motor to my brake pedal - I'd like to build a response curve that would start at 80% brake pressure at 50% strenght then ramp to 100% strength to 95% pressure - then from 95% to 100% pulse the motor to let me know I'm in the "red" zone. I have the curve set but don't see any way to add the pulse when getting to 95-100%

Given how extensive the options are I'm sorta guessing there is a way to do this, am I missing anything?

Thanks!


   
Quote
(@romainrob)
Honorable Member
Joined: 5 years ago
Posts: 530
 

Hi,
This could be done with 2 effects.
Limiting the first effect to the 50-95% brake pressure range.
And having a dedicated pulse  effect if brake > 95, using the blink function

blink(blinkername, blinkdelay, currentstatus)

It would something like that:
blink('BrakePulse', 200, [Brake] > 95)


   
ReplyQuote
(@exigeous)
Trusted Member
Joined: 3 years ago
Posts: 35
Topic starter  
Posted by: @romainrob

Hi,
This could be done with 2 effects.
Limiting the first effect to the 50-95% brake pressure range.
And having a dedicated pulse  effect if brake > 95, using the blink function

blink(blinkername, blinkdelay, currentstatus)

It would something like that:
blink('BrakePulse', 200, [Brake] > 95)

Ah, awesome - I guess I was assuming you could only create a single custom effect, of course you could do more. Thanks for the suggestion, gonna set this up now. So glad I built this as it's already been extremely helpful, was cheap and so easy to build.

Thank so much for the input,

~Ross


   
ReplyQuote
(@exigeous)
Trusted Member
Joined: 3 years ago
Posts: 35
Topic starter  

@romainrob Well that didn't do it - no matter what I put in the function it never activates unless I just put [brake] - even putting something simple like [brake] > 25 never activates as shown in the live effects display.

So while I have the second custom effect created I can't get it to pulse or even activate, other than based on the threshold/settings for the response filter. I feel like the blink function might not work in this way but as I can't really find any documentation on it I'm at a bit of a loss.

Any other ideas? Thanks again for your help!

~Ross


   
ReplyQuote
(@romainrob)
Honorable Member
Joined: 5 years ago
Posts: 530
 

@exigeous I forgot, you need a formula returning a result between 0 and 100. My bad.
Try:
blink('BrakePulse', 200, [Brake] > 95) ? 100 : 0

And play with the 200ms value to adjust the pulse rate


   
ReplyQuote
(@exigeous)
Trusted Member
Joined: 3 years ago
Posts: 35
Topic starter  
Posted by: @romainrob

@exigeous I forgot, you need a formula returning a result between 0 and 100. My bad.
Try:
blink('BrakePulse', 200, [Brake] > 95) ? 100 : 0

And play with the 200ms value to adjust the pulse rate

Well that's not got it either - when I look in the "Raw result" field while editing the formula it bounces between 0 and 100 over and over. Then when in game (or replaying data, wow that feature is awesome) it never activates - my main brake detection does and is vibrating the pedal so I know that's working.

I assume the formula is: If over 95 then return 100, if not then return 0 - correct? Just posted in the Discord as well to see if anyone over there knows, again really appreciate your time and help.

~Ross


   
ReplyQuote
(@romainrob)
Honorable Member
Joined: 5 years ago
Posts: 530
 

The formula is if brake > 95, blink between 0 and 100 every 200ms
I tried it on my weak pedals motors.
It's hard to tune with the inertia, and already pulsating nature of the motors..
I felt ok...ish around 80ms.
I tested with a low threshold of 25 to make it obvious. So:

blink('BrakePulse', 80, [Brake] > 25) ? 100 : 0

Make sure the effect is mapped to a motors.
And double check the output isn't disabled for telemetry replays in the advanced output settings.


   
ReplyQuote
(@exigeous)
Trusted Member
Joined: 3 years ago
Posts: 35
Topic starter  
Posted by: @romainrob

The formula is if brake > 95, blink between 0 and 100 every 200ms
I tried it on my weak pedals motors.
It's hard to tune with the inertia, and already pulsating nature of the motors..
I felt ok...ish around 80ms.
I tested with a low threshold of 25 to make it obvious. So:

blink('BrakePulse', 80, [Brake] > 25) ? 100 : 0

Make sure the effect is mapped to a motors.
And double check the output isn't disabled for telemetry replays in the advanced output settings.

You are a ROCK STAR - I don't understand why this didn't work before, I copy/pasted your code exactly and nothing. It isn't/wasn't the motor assignment as if I just put [brake] it would rumble but now it's working perfectly!

So from 70-95% I get a progressively stronger rumble then at 95% it starts to pulse. The only thing I don't have perfect is when the first one ramps to 95% it would stop so only the pulse is happening, I played around with the code but couldn't work that out so I just turned that effect down a bit and the pulsing one at 100% so while it's doing both technically the pulse is so much louder than I can feel the difference in my foot.

The only odd thing is in some cars the brakes lock up WAY before these, hell the Aston DBR9 in iRacing tends to lock the brakes at around 50% pressure, so I'll either create separate custom effects for different cars or just edit them per car. I do wish there was a way to rename "Custom Effect" as I have 2 now and can't see any way to rename them.

Again thanks so very much!


   
ReplyQuote
(@romainrob)
Honorable Member
Joined: 5 years ago
Posts: 530
 

@exigeous Haha!
I'm afraid results will indeed vary on a per car basis.
You can make the 1st effect stop at 95% brake with this formula:

[Brake] <= 95 ? progress(70, 95, [Brake], 100) : 0

Or even merge both in a single formula:

[Brake] <=95 ?
progress(70, 95, [Brake], 100) :
(blink('BrakePulse', 200, 1) ? 100 : 0)

But it's probably best to be able to tune them separately


   
ReplyQuote
(@exigeous)
Trusted Member
Joined: 3 years ago
Posts: 35
Topic starter  

@romainrob Once again you rock!


   
ReplyQuote
Share: