Vibrate the brake pedal when wheel's blocking

Here you can show and share your design ideas and ask questions about them

Re: Vibrate the brake pedal when wheel's blocking

Postby RacingMat » Wed 3. Jul 2013, 21:26

It's working fine for him !

You're totally right yokoyoko :D
:idea: we have to compare mean circumferential speed's wheels and car's speed

PS1 : the formulas he's using, confuse me as well at the moment ! more to see on his blog's page. But we can manage to find our own ;)
PS2 : i'll kindly ask Sirnoname
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
X-Sim Stage 2 edition
 
Posts: 454
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 124 times

Re: Vibrate the brake pedal when wheel's blocking

Postby yokoyoko » Wed 3. Jul 2013, 21:40

Sometimes it helps to read the given sources :roll: :lol:
Is there somebody out there who understands this or can translate it to a none coding guy? ;)

for( long i = 0; i < 4; ++i ) // Check all wheels for lock up
{
const TelemWheel &wheel = info.mWheel;
if(3.0*abs(wheel.mRotation)/metersPerSec<=.5) // if wheel is rotating slower than 50% vehicle spd { // speed@hub = dist/time = dist/angle * angle/time = 1.9m/2*pi * .mRotation = 3 * .mRotation
++sumLocked; // count how many wheels are locked
}
} // End rotation check


if (info.mUnfilteredBrake >= 0.1 && metersPerSec >= 1.0) // Are we moving AND braking?
{
if(sumLocked >= 1) // If we are moving AND braking AND have lockup in at least n wheels then...
{ SetDigital(6); // Send digital feedback (turn on digital output 6 - vibration)
SetAnalog(2,0); } // Send analog feeback (set analog channel 2 to zero - LED brightness)
else SetAnalog(2, min(abs((long) info.mWheel[3].mRotation*1.5),255)); // otherwise analog 2 represents brake disc rotation speed as the brightness of an LED on the board
}
else // If not braking OR moving
{
ClearDigital(6); // If we aren't braking OR we aren't moving then there should be no FFB
SetAnalog(2,0);
}



[i]speed@hub = dist/time = dist/angle * angle/time = 1.9m/2*pi * .mRotation = 3 * .mRotation

--> ok, the speed@hub is in [m/s]
--> this is the same like: dist/angle * angle/time
= (1,9m/2)*pi * .mRotation = 2,985 * .mRotation (I first read--> 1,9m/(2*pi) BUT this would be 6 ^^)
--->3 * .mRotation

Question:
Should 1,9m be the tire circumference? And if so - why should it be the same for all cars? A 225/45R17 tire has 192cm f.e.
?

Why can't it just be "if the car is moving BUT the speed@hub=0 --> vibrate the pedal" (wheels are locked) :lol:
Sorry be I don't get Richards code at the moment... Mat can you explain it further?
User avatar
yokoyoko
 
Posts: 392
Images: 28
Joined: Tue 7. Aug 2012, 03:16
Location: Germany / Bad Eilsen
Has thanked: 33 times
Been thanked: 12 times

Re: Vibrate the brake pedal when wheel's blocking

Postby yokoyoko » Wed 3. Jul 2013, 21:52

I think we have to look to get the circumferential speed ... if this value is smaller than the vehicles speed = the wheels are blocking.???


Perhaps what I wrote in the prev. post is wrong! I now think it is depending on wheelspin/slippage and static frition too. I will have to read how a control device of an anti-locking brake system on a "real" car is working ... :oops:

Edit: can't we use fanatecs code ^^
User avatar
yokoyoko
 
Posts: 392
Images: 28
Joined: Tue 7. Aug 2012, 03:16
Location: Germany / Bad Eilsen
Has thanked: 33 times
Been thanked: 12 times

Re: Vibrate the brake pedal when wheel's blocking

Postby RacingMat » Thu 4. Jul 2013, 11:52

I went into the code of internal plug in of rFactor (guided by magicfr69) to look for a slip ratio :

TelemWheel
.mRotation; (float) // radians/sec
.mGripFract; (float) // an approximation of what fraction of the contact patch is sliding

so I can check the slip ratio of each wheel = mWheel[1].mGripFract

good news yokoyoko : it seems that finally we won't need to mimic the true ABS calculation : comparing 'estimated car speed' and 'wheel speed' as we have the final result : for example, if mGripFract > 80% then the wheel is blocked and is sliping :)

no ?
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
X-Sim Stage 2 edition
 
Posts: 454
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 124 times

Re: Vibrate the brake pedal when wheel's blocking

Postby RacingMat » Thu 4. Jul 2013, 15:08

"grip fract" seems to be the right variable in rFactor : it used for another purpose here (force feedback steering) but the meaning is the same !

Code: Select all
FFB steer front grip fract="0.00000" // Range 0.0 to 1.0 (previous hardcoded value was 0.0), additional effect of front grip loss on steering force


If "1" the steering force level will drop a lot when the front wheels lose grip. For example when you lock up under braking the steering goes very light suddenly.
by Pandamasque http://isiforums.net/f/showthread.php/181-FFB-Parameter-FFB-steer-front-grip-fract?p=1794&viewfull=1#post1794
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
X-Sim Stage 2 edition
 
Posts: 454
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 124 times

Re: Vibrate the brake pedal when wheel's blocking

Postby yokoyoko » Thu 4. Jul 2013, 23:38

it seems that finally we won't need to mimic the true ABS calculation : comparing 'estimated car speed' and 'wheel speed' as we have the final result : for example, if mGripFract > 80% then the wheel is blocked and is sliping


That sounds interesting. Good research Mat!
About the % of slipping I am not sure at the moment. 100% and the wheels are totaly locked but the cornering forces decrease really strong at about 30% ...perhaps the suggested 80% are already to high. I think several values are worth to test them.

User avatar
yokoyoko
 
Posts: 392
Images: 28
Joined: Tue 7. Aug 2012, 03:16
Location: Germany / Bad Eilsen
Has thanked: 33 times
Been thanked: 12 times

Re: Vibrate the brake pedal when wheel's blocking

Postby RacingMat » Fri 5. Jul 2013, 10:19

+1 your graph is worthy ! thanks

I've tried to plug my MOMO logitech wheel AND my wingman FFB Joystick in rFactor ... it behaves weird : is it possible to do this ?

because an interesting point is that when I brake with the joystick : it vibrates !!!
(not when grip is lost ... but it's a beginning) :P

if it's not possible to plug wheel and joystick simultaneously, i've read that sofwares can remap and mix several USB device into a unique virtual device... but it's more complicated
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
X-Sim Stage 2 edition
 
Posts: 454
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 124 times

Re: Vibrate the brake pedal when wheel's blocking

Postby yokoyoko » Fri 5. Jul 2013, 16:42

if it's not possible to plug wheel and joystick simultaneously, i've read that sofwares can remap and mix several USB device into a unique virtual device


Hi Mat, mon ami :D

x-sim³ has this feature. you can use several input devices. Wheel + joystick should be no problem. You will have to set this up in the extractor. Perhaps sirnoname could join this thread? Because I have to admit I can't explain the "how to" without the software (I have no acess to my sim at the moment)

SOrry for not really helping you at this point. General I think your plan (especially with the added code for rfactor) is a really cool feature.
User avatar
yokoyoko
 
Posts: 392
Images: 28
Joined: Tue 7. Aug 2012, 03:16
Location: Germany / Bad Eilsen
Has thanked: 33 times
Been thanked: 12 times

Re: Vibrate the brake pedal when wheel's blocking

Postby RacingMat » Mon 15. Jul 2013, 22:23

Okay !
some news now, I've been busy the last week at programming !

1- trying the python's way of Joao http://b.joaoubaldo.com/my-projects/rfactor2python/
but I gave up because it complicates too much the workflow : rFactor / plugin Python / Python file / Arduino

2- so I went the ISI C++ "internal plugin" way : programming a plugin to send infos via USB to arduino

I managed to light a led on the Arduino depending on telemetry data from "my" plugin :-)

the calculation is still a pending question : gripFract, rotationWheel ? the results are different ! i'll need further tests (and finishing debugging the plugin) ;-)
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
X-Sim Stage 2 edition
 
Posts: 454
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 124 times

Re: Vibrate the brake pedal when wheel's blocking

Postby RacingMat » Fri 2. Aug 2013, 15:22

Some news : it works on my desktop dev computer with leds :-)
but now I have to test if it works on my game computer !...

I would be able to vibrate the brake pedal when blocking the wheels
and one more thing : bonus gift -> vibrate the gas pedal when skiding (too much acceleration)

Next step, finding 2 small DC motors for vibration and receiving a cheap driver board for Arduino http://dx.com/p/l9110-dual-channel-h-bridge-motor-driver-module-for-arduino-black-157149 4€50
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
X-Sim Stage 2 edition
 
Posts: 454
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 124 times

PreviousNext

Return to Motion simulator designs

Who is online

Users browsing this forum: No registered users and 2 guests