添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I'm trying to get the forces on the control surfaces (on hinges to be specific), so I can reflect it on the force feedback joystick. I tried several dataref, couldn't really find the one I'm looking for.

Using datarefs in sim/flightmodel/parts/, I can get the XYZ forces on the wing elements with the control surfaces and by comparing it to the wing element which doesn't have the control surface, I can guess the XYZ force caused by the control surface. But this is not really the force on the hinges.

Is there any other way to get what I want?

I'm pretty sure you won't find this data in a dataref as the sim is unaware of these forces.

A google search for keywords like: hinge moments torque, control surface, aerodynamic, etc. might produce some helpful papers.

Maybe a rough estimative solution could be to apply the bell shaped drag/aoa curve of a flatplate (replacing AoA with control surface deflection in degrees) along with basic algorithms on air density/airspeed/control surface area. I assume your goal is to get a model for the variation of control forces with different parameters, rather than the actual torques (given no consumer FF joystick could probably match those)?

Edit: you might also want to add parameters like control surface weight and inertia for low speed situations. I always missed how the cessna yoke is pulled in the forward position by gravity when parked and cold and then jerk back by propwash when you start the engine. :)

I'm trying to get the forces on the control surfaces (on hinges to be specific), so I can reflect it on the force feedback joystick. I tried several dataref, couldn't really find the one I'm looking for.

Using datarefs in sim/flightmodel/parts/, I can get the XYZ forces on the wing elements with the control surfaces and by comparing it to the wing element which doesn't have the control surface, I can guess the XYZ force caused by the control surface. But this is not really the force on the hinges.

Is there any other way to get what I want?

Only Austin can answer if this is modelled in the sim.

If it isn't then we can't support it in the SDK.

I will ask him about it.

Thanks for the replies.

Nils, yes my goal is to get the variation in control forces to reflect them on the FF joystick. The only FF plugin available, doesn't really do much once you are in the air.

Sandy, Thanks. Could you please ask Austin and let me know. I was thinking about asking Austin myself, but you are the more appropriate person to do that.

If XP doesn't have any such thing then I'd have to calcualte it as Nils suggested. Problem is I'm new to aerodynamics, well, I'll learn.

Thanks for the replies.

Nils, yes my goal is to get the variation in control forces to reflect them on the FF joystick. The only FF plugin available, doesn't really do much once you are in the air.

Sandy, Thanks. Could you please ask Austin and let me know. I was thinking about asking Austin myself, but you are the more appropriate person to do that.

If XP doesn't have any such thing then I'd have to calcualte it as Nils suggested. Problem is I'm new to aerodynamics, well, I'll learn.

Hi Chris

It is as I suspected, these do not exist.

However I sent your post to Austin an he came back with this.

==================================

CORRECT

THEY ARE NOT SIMULATED

but, really, it would be so easy to come up with decent forces... just use the ratio of dynamic presssure at current speed divided by dynamic pressure at redline speed as the ratio of max stick force, and toss in some sinusoidal oscillations if stalled... the math is so easy (dynamic pressure can simply be the INDICATED airspeed squared, if you don't mind the units (as you dont for a ratio)... EASY!)

austin

After reading Austin reply a few times, it finally makes sense.

That's a pretty easy way to do what I want without reading all those complicated articles about Cm, Cp and AC/MAC.

Is the soruce code for X-Force available? I couldn't find it. Or is source code for any other joystick related plugin is available? Or do I need to start from scratch.

After reading Austin reply a few times, it finally makes sense.

That's a pretty easy way to do what I want without reading all those complicated articles about Cm, Cp and AC/MAC.

Is the soruce code for X-Force available? I couldn't find it. Or is source code for any other joystick related plugin is available? Or do I need to start from scratch.

I doubt if the source will be available.

IMO starting from scratch is always the best way and is more fun.

Since you know a lot more about plugins, Could you check if I'm right.

I'd do the plugin in MSVC,

in XPluginStart, I'd look for FF joystick using DirectX and will acquire it and set the default conditions for sinusoidal x, sinusoidal y and spring effect and keep them disabled.

in FlightLoopCallback, I'd modifiy and enable spring effect with the

force = Max_Spring_Effect_Force_allowed_by_joystick * V^2/Vne^2

If wings are in stall, would enable sinusoidal x

If tail is in stall, would enable sinusoidal y

and in XPluginStop, would just release the directX joystick device.

Sounds right?

Chis:

I've never seen any FF SDK specs so I wonder: Is it possible to create realistic trim effects so that changing trim changes the "spring" center of the stick?

Do you have direct control of the current going to the FF servos or are you merely tampering with pre-defined effects?

Chis:

I've never seen any FF SDK specs so I wonder: Is it possible to create realistic trim effects so that changing trim changes the "spring" center of the stick?

Do you have direct control of the current going to the FF servos or are you merely tampering with pre-defined effects?

Hi Nils

On windows this comes under the Direct Input API which is part of the DirectX SDK.

I have managed to get various parts of DirectX working under our plugin SDK.

Nils, as Sandy mentioned it's part of DirectX, they call it DirectInput. If you are interested download the DirectX SDK and read the documentation about DirectInput.

Yes, you can change the center of spring effect. You specifiy center and max force for spring effect. How the trim changes the center? Sorry I'm newbiew to flying.

No, you don't have direct control over the servos. Infact it's good that you don't have to deal with servo directly, if you do and try to do a spring effect, chances are that you'd overshoot and keep osciallating, unless you are dedicating a realtime process for that.

Limitation are not really because of DirectInput, Most of the FF joysticks have Imersion technology IP and they provide you bunch of ready made effect. You can use any combination of these effects and can also use envelopes (like for sawtooth).

Yes, you can change the center of spring effect. You specifiy center and max force for spring effect. How the trim changes the center? Sorry I'm newbiew to flying.
Ok, cool. Then you can probably achieve a pretty realistic effect by moving the center with the trim datarefs (though you need to overwrite the flight controls and take the trim portion out so that it isn't added twice).

Is the above something you're planning to do?

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.

FFJoystick.zip

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.