Jump to content

Poor Man's Force Feedback for DCS (Lua based)


Recommended Posts

As currently we have no force feedback widely available to use and I was playing with possibilities of Lua scripting in-game, I did some tests.

 

Lua export function can send up to 100 messages per second, which means information is sent out every 10ms.

 

Export can contain multiple interesting metrics, such as:

 

So I was thinking - calculating those metrics to apply forces on the stick are way, way easier than working on obscure, troll-patented FF implementations. The code is easy to understand and calculate in whatever programming language you want.

 

Of course well-done, playable FF would still be a long way, but I guess even basic shakes while gear is down, player is taking off/landing or experiences great g-forces would still be great addition for immersion.

 

What do you think?

Link to comment
Share on other sites

How about using a raspberry pi! It supports lua 5.1, C++ and Python.

Can communicate with the pc via VNC, wireless or bluetooth.

Can also output to control relays, actuators, and sensors.

And it does not add any overhead to the pc os.

 

 

 

First thought, when you open the canopy, the command, sent to the pi, would turn on a fan!

Instant wind in the face!

Or landing gear down, or afterburner, send command to subwoofer!

 

 

 

I have successfully connected my pi to my pc, and can control the pi from the pc. All through my home network.

Step one, done!

 

 

 

Just a thought.

"Yeah, and though I work in the valley of Death, I will fear no Evil. For where there is one, there is always three. I preparest my aircraft to receive the Iron that will be delivered in the presence of my enemies. Thy ALCM and JDAM they comfort me. Power was given unto the aircrew to make peace upon the world by way of the sword. And when the call went out, Behold the "Sword of Stealth". And his name was Death. And Hell followed him. For the day of wrath has come and no mercy shall be given."

Link to comment
Share on other sites

Hi

The Raspi has a build in USB hub so it cannot become a Slave Device.

But you can use it as it is (a full working Computer) and connect it to your Gaming PC over Network.

MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

OK, then it seems like all calculations should be made on computer as background app, and force feedback signals sent straight to joystick (ex. Arduino which already has working HID joystick library) with DC motors

Link to comment
Share on other sites

Hi

I don't think that you can send this information to a HID.

But I am not sure. I know that PID-HID devices have a very strict Protocol how to send and receive

Why do you want to use a HID?

Wouldn’t it be easier to use an Arduino Serial protocol?

MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

Hi

Interesting idea.

Can you give some details on how you implement these two functions?

I know how to setup an HID Device or Multi HID's on one pro Micro. But I never tried two different Functions on one Device. Sounds very interesting.

as for my take on such a problem (besides the open source FFB ) would be to send Axis/Button Data to the Lua and use this way to input "Joystick" functions into DCS.

MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

No, the Arduino Joystick will work like normal one, no Lua.

 

Lua would be used only for exporting telemetrics to background app, which would translate it for Arduino (not sure how yet) to move motors.

 

EDIT: Actually, I did some reading on Arduino. Looks like implementing USB HID both way would be difficult or even impossible. That way one could use two Arduinos, as they are pretty cheap - one for Joystick, second for Forcefeedback only, communicating as serial port via USB


Edited by Avat
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...