The online racing simulator
[RELEASED] Cruise control hack
(25 posts, started )
[RELEASED] Cruise control hack
I've been aching to give this a go for quite some time and today was the day The video below show a cruise control mod that works with any analog controller. The actual speed control algorithm is rather dumb and it the speed is oscillating quite a bit in powerful cars, especially in uphill sections. However, getting it right shouldn't be a problem once I get my hands on some info about PID controllers (by any chance, anyone of you guys wouldn't know about anything, would you? ).

Before someone asks, no, I'm not releasing it - at least not now. If I ever manage to get the throttle position maths right, I'll talk to the mods here to make sure there's no way somebody could use this to cheat. If all goes well, I'll make a public release eventually.

VIDEOS REMOVED, see the post #6
Wouldn't have had you as a cruiser there MadCatX However, nice work, and interesting to see you running Arch(?) I guess you're intercepting the throttle axis information and modifying what LFS sees and using InSim to monitor? I'm afraid I'm not up on PIDs
I've never ever been a cruiser, but the idea of a cruise control mod came up on the forums way too often for me not to try to make one. I'm indeed running Arch (nice job spotting the "A"). Using virtualized Windows as a development system is a bit of a pain in the ass, but I still consider it a better solution than dualbooting. I've got too accustomed to KDE4 desktop goodies that I can't really work effectively in Windows anymore. (plus there's no better LaTeX editor than Kile)

I intercept DirectInput calls using a proxy DLL and I run a "helper" InSim/OutGauge app which talks to the DLL through a shared memory. Wiki pointed me to a good looking article explaining the basic PID magic, I'll definitely share at least the throttle controller logic if I get it working reasonably enough.
#4 - Jakg
Great, although the article was somewhat too extensive for a quick reading, it contained some most valuable info, thanks a lot. BTW, this sort of PID controllers for dummies is a good reading too if you're looking for an example of practical implementation.

Anyway, I got the basic PID implementation working and it performs very well - it quite successfully attempted to hold the speed even when I slid the FZ5 into the grass. Once I fine-tune all the gain values, I'll post another vid if you guys are interested.

When I get all the compatibility and cheating issues sorted out, I'll post the mod itself.
OK, enough coding for today, time for a GN drink and bed...
Isnt there a guy on youtube who posted about something similar,
I wouldn't know, but since it's not all that hard to figure out, I guess it's quite possible...
This thing's been working pretty much like I expected so I finally decided to make a public release so that you guys could have some fun with it too. However, please bear in mind that this is still more or less a techdemo app so it is not ultra convenient to use and there might be some compatibility issues (it is not compatible with any other mods using proxy dinput8.dll for instance). Because of the same reason it is unlikely I'll provide any updates or bugfixes for the mod.

It works only with analog controllers, keyboards or mouses are not supported. Be sure you read the README before you use it. Have fun!
Attached files
crsctrl.zip - 1.6 MB - 575 views
just wanted to mess with this. but when i connect insim nothing comes up.

it say insim connected.

than nothing else, what am i doing wrong?
Did you read the README and set everything up properly? You should get control buttons once you leave the menu...
I have got the buttons ingame. But nothing happens when i press them.

Im using a g25. Ive set the axis to s0 is that wrong?
Quote from MadCatX :Did you read the README and set everything up properly? You should get control buttons once you leave the menu...

now i have same problem has him ^
Quote from doc_90 :I have got the buttons ingame. But nothing happens when i press them.

Im using a g25. Ive set the axis to s0 is that wrong?

If you can control the throttle even when the cruise is on, then you have a wrong throttle axis set in the config. If you can't even turn the cruise on, you're not driving in practice mode - the README mentions this BTW (cheating protection) - or you're driving slower than 3 m/s.
nope, i going at 60 like in video in practice and still buttons not work.

i read the read me more than 10times and i did it correctly
Define don't work. If you're not trying to use the cruise while in race or qualification, if should work.
Same for me. It connects, setted axis... but buttons in LFS dont work
Quote from MadCatX :Define don't work. If you're not trying to use the cruise while in race or qualification, if should work.

well,

in config i setted axis to S0.

inverted - 0
seperate - 1

lfs, outgauge port is 3000

i run programe, connect lfs with insim 29999 and it say connected and shows the cruise buttons but when you click them nothing happens.
The config doesn't have any effect on how the buttons work. If "nothing happens" means that the cruise doesn't turn on even for a little while, you have to make sure you set the number of race laps to "practice".
Quote from MadCatX :The config doesn't have any effect on how the buttons work. If "nothing happens" means that the cruise doesn't turn on even for a little while, you have to make sure you set the number of race laps to "practice".

yes it practice

it say on button. "cruise off"

so reach 60 and press set and nothing happens. pressing the others has same effect.
The only way I was able to reproduce this behaviour to misconfigure OutGauge, are you certain you have it set like this?

OutGauge Mode 1
OutGauge Delay 5
OutGauge IP 127.0.0.1
OutGauge Port 30000
OutGauge ID 0

The Mode, IP and Port lines are crucial here. Another possibility would be a pretty obscure bug in my InSim "library"...
OutGauge Mode 1
OutGauge Delay 5

--------------

you didnt mention atall this part in readme

ok buttons work but it wont hold the speed. :/
Quote from Franky.S :OutGauge Mode 1
OutGauge Delay 5

--------------

you didnt mention atall this part in readme

I kind of expected everybody to know this already

Quote :
ok buttons work but it wont hold the speed. :/

If you can still control the throttle when the cruise is on, you have to point the mod to the correct axis. If you cannot control the throttle, you might have to fiddle with SEPARATE or INVERTED values.
For me, it works in singleplayer, but not multiplayer, is it singleplayer only at the moment?.
It works only in practice mode, no matter whether it's in single or multiplayer.

[RELEASED] Cruise control hack
(25 posts, started )
FGED GREDG RDFGDR GSFDG