Attached is the first beta version for my Forced Feedback Joystick plugin.
Just the executable. I need to do some code cleanup first and then I'd also upload the source code.
Here is what it does,
Probably doesn't do anything for helo (didn't test it).
Reflect the inertia proportional to the acceleration of the stick. (it doesn't take weight into consideration yet).
Reflect the balancing force as,
Force = indicated_airspeed ^ 2/ ((Vno + Vne)/2) ^ 2
If the plane has stall warning, and is in stall, it will remove the balancing force. So only force left would be the inertia. You should be able to feel a sudden removal of spring effect.
On the ground you'd only feel the inertia, on the air as you approch (Vne+Vno)/2, you'd start feeling the balancing force plus inertia.
I haven't implemented trim offsets to change the center point.
This plugin doesn't have any menu yet. So you won't see it in the plugin menu. I will soon add the setup window to allow changes to certain variables via some menu.
If you have both XForce and this plugin installed, you probably would need to disable one. I don't think DirectX would allow one application to have two instances of the same joystick. It probably would just let the first plugin to get the stick and the second one will fail.
Oh and yes, you'd need to have forced feedback joystick to feel the effects.
BTW, is there a way to upload a file here without zipping it up? I tried few extentions and appearently this forum only allows me to upload .txt or .zip files.
Good Stuff Chis
The acquire function would fail if another app has already acquired the device.
I tested your plugin and I noticed the effect when the aicraft stalls.
I dug into my archives and pulled out the FF plugin that I did.
My goodness it was for XP V6 and used DX7.
That was back in September 2003, time travels at a frightnening rate.
Anyway here it is.
http://www.xpluginsdk.org/downloads/ForceFeedbackWin.zip
I have rebuilt if with the DX9 SDK.
I debugged it with your plugin present and it fails on the acquire which is what I would expect.
You can use this to test your plugin when another plugin is trying to use the device.
When you open the widget panel I acquire the device.
When you close the widget panel I release the device.
If you click the first check box it will bring up a file dialog and you can load an effect file.
Then just click on the second check box and it will play that effect back.
The sample effects files are included in the zip.
I'd no idea that you worked on a FF plugin. Is it any close to completion?
I tested yours with mine, Not really sure what's going on. It usually allows mine to get the stick over yours. I might be mistaken, but that's what it felt like. BTW do you make a call to SetCooperativeLevel? If you do, which HWND do you pass. I pass the GetActiveWindow() as HWND, I believe that would associate it with the main xplane window.
I'm experimenting different equations for the balancing force. That's where your Datarefsee has been of great help.
V^2/Vne^2 si not really as realistic as I thought it is. The force on the hinges should also be directly proportional to Cl (which depends on alpha), and on the center of lift on the control surface. I don't really know how to calculate center of lift on the control surface, but I'm trying to incoporate "sim/flightmodel/forces/fnrml_aero" into the equation, which should make it dependent on the Cl and alpha. This way I won't need to look at the stall warning, Since both V and fnrml would drop significantly at stall. It should be more realistic than just disabling the balancing force at stall.
BTW, which joystick you used? I tried mine under old MS sidewinder force and new Saitek EvoX force. I found under Saitek EvoX force, it sometimes starts shaking the stick rapidly, finally debugged it down to some bug in the driver (or the firmware in joystick). If I play more than one effect at a time with significant forces, The firmware doesn't play them right. I think it overshoots and starts shaking rapidly. My same test code and FF plugin works fine under MS sidewinder force feedback.
Hi Chis,
>V^2/Vne^2 si not really as realistic as I thought it is. The force on the hinges should also be directly proportional to Cl (which depends on alpha), and on the center of lift on the control surface.
If that's any help, when hydraulically-powered flight controls were introduced after WW2, it was discovered that there was a requirement for "artificial feel", as it was called at the time, to make up for direct force feedback. From Eric Brown's "Testing for Combat", the F2H for example used a system that required a force proportional to airspeed for elevator deflection.
(Since there are many ways of changing the characteristics of control surfaces, such as aerodynamic balancing, the use of servo tabs of various kinds, the addition of springs and weights in the control linkage etc., there does not seem to be a single way to scale the feedback force correctly for all applications, anyway.)
One thing that crossed my mind that regardless of the availability of a force feedback joystick, it would be interesting for many aircraft to reduce the control effectiveness with increasing airspeed, as it happened for many types in real life for a variety of reasons. Such a limit would probably need to be configurable per axis, but I believe it would really help realism for example with WW2 aircraft types that hardly ever featured powered controls and were often subject to loss of control effectiveness at high speeds.
Maybe that could be something that your plug-in can accomplish as a simple spin-off developement of its original task ;-)
Regards,
Henning (HoHun)
Attached is the source code and the compiled windows plugin for force feedback joystick.
I experimented with a few different equations for the balancing force (spring effect on joystick), Am still not satisfied with any. This compiled version is using the equation as,
Max Spring Force = (V^2 * Lift)/(Vne^2*W)
At stall, both lift and the V drops and you so you'd feel a very slight force. And as you recover from stall, both lift and V goes up, you'd feel that too.
Since my understanding of planes and aerodynamics is very limited, anyone with better understanding who has the capability to compile this plugin, is more than welcome to try other equations and come up with a better way to reflect the forces on the stick.
FFJoystick.zip
One thing that crossed my mind that regardless of the availability of a force feedback joystick, it would be interesting for many aircraft to reduce the control effectiveness with increasing airspeed, as it happened for many types in real life for a variety of reasons. Such a limit would probably need to be configurable per axis, but I believe it would really help realism for example with WW2 aircraft types that hardly ever featured powered controls and were often subject to loss of control effectiveness at high speeds.
Since I'm really a newbie to this, I'm not really sure what you mean by "reduce the control effectiveness with increasing airspeed"? You mean at higher airspeed you'd need to pull the joystick more to achieve the same alpha?
Hi Chis,
>Since I'm really a newbie to this, I'm not really sure what you mean by "reduce the control effectiveness with increasing airspeed"?
I guess "reduce the control throw with increasing airspeed" would have been clearer.
This results in 100% control throw being available up to a limit speed, which then reduces to 50% at twice the limit speed, 25% at four times the limit speed etc.
The limit of course is defined by the force the pilot can exert on the controls.
To portray this limit on a non-force feedback joystick, this would mean that the relation joystick travel to control throw changes above the limit speed. (This would be "force-feedback light", as it means that as the speed increases, the force required for a certain control throw increases, too :-)
This re-scaling of the joystick characteristics might also help force-feedback joysticks, as I don't think you can actually crank up the forces high enough to prevent the pilot from achieving any desired control throw - which is different in real life.
Just my thoughts, I'm not really an expert either!
Regards,
Henning (HoHun)
I'd no idea that you worked on a FF plugin. Is it any close to completion?
I tested yours with mine, Not really sure what's going on. It usually allows mine to get the stick over yours. I might be mistaken, but that's what it felt like. BTW do you make a call to SetCooperativeLevel? If you do, which HWND do you pass. I pass the GetActiveWindow() as HWND, I believe that would associate it with the main xplane window.
I'm experimenting different equations for the balancing force. That's where your Datarefsee has been of great help.
V^2/Vne^2 si not really as realistic as I thought it is. The force on the hinges should also be directly proportional to Cl (which depends on alpha), and on the center of lift on the control surface. I don't really know how to calculate center of lift on the control surface, but I'm trying to incoporate "sim/flightmodel/forces/fnrml_aero" into the equation, which should make it dependent on the Cl and alpha. This way I won't need to look at the stall warning, Since both V and fnrml would drop significantly at stall. It should be more realistic than just disabling the balancing force at stall.
BTW, which joystick you used? I tried mine under old MS sidewinder force and new Saitek EvoX force. I found under Saitek EvoX force, it sometimes starts shaking the stick rapidly, finally debugged it down to some bug in the driver (or the firmware in joystick). If I play more than one effect at a time with significant forces, The firmware doesn't play them right. I think it overshoots and starts shaking rapidly. My same test code and FF plugin works fine under MS sidewinder force feedback.
Hi Chis
It was just a test to see if it would work with our SDK in the early days.
It was basically a modified version of the read effects example that came with the DX SDK.
I never had any intention of taking it any further.
I have an old MS Sidewinder ForceFeeback joystick that I used for testing it.
In that plugin I use GetForegroundWindow().
However it is safer to use the "sim/operation/windows/system_window" dataref which will return the Xplane window handle.