Author Topic: Anti-Stick Stirring Code  (Read 302 times)

funked

  • Guest
Anti-Stick Stirring Code
« on: October 28, 1999, 05:51:00 PM »
I don't know what you guys have implemented in the latest version because I am hors de combat for a few weeks.

But here's the way to do it IMHO.

Limit the power of the pilot's arms and feet.  I know you limit the force.  What you need to limit (in addition to the force) is the force times speed of movement.  This is the real limit that a pilot encounters.

So if the joystick movements call for a  (force * speed of movement) that is greater than the power limit for that direction (lateral or longitudinal or rudder), then the control surface only moves as far as a real pilot could move it in a given amount of time.

Here's an algorithm (forgive the syntax) to compute the current simulated stick position based on the last stick position value and the pilot's commanded stick position.

"i" is the time counter.

"dt" is the time step size.

"command" is the player's joystick position, ranges from -1 to 1.

"position" is the simulated stick position at time i*dt, in inches, and it ranges from -position_limit to +position_limit.

"deltastick" is the commanded change in stick position.

"force(position)" is the stick force in lbs, a function of position, trim, airspeed, etc.  Force and position always have the same sign I think.

"position_limit" is aircraft stick deflection limit as determined by your existing force limiter code, in inches.

"direction" is the sign of deltastick.

"power" is the power required to do the commanded stick movement.

"powerlim" is the max power the pilot can exert.


deltastick = (command * position_limit - position[i-1])

IF deltastick = 0
THEN
  position=position[i-1]
ELSE
  direction = abs(deltastick)/deltastick
  IF (command*position_limit/position[i-1]) < 0
  THEN
    position=0
  ELSE
    power = deltastick * force(command*position_limit) / dt
    IF power > powerlim
    THEN
      position = position[i-1] + deltastick*powerlim/power    
    ELSE
      newposition = command*position_limit
    END IF
  END IF
END IF

In English:

First we check to see if the pilot is commanding a change.  If not we don't move the control surface.

If he is commanding a change then we see if he is calling for a change in the sign of the stick position.  If this is true we let him go to zero.  We'll deal with any movement past zero in the next time step.

Otherwise, we check to see if his desired stick movement will require more power than is available.  If he's calling for too much power, we let him move the at rate allowed by his max available power.  If he's not using too much power, we let him move the stick where he wants.  

Note that we conservatively compute power at the commanded position.  Because force and position have the same sign, the power limit is only invoked when the stick is being moved away from center.  So the commanded position in this case will always be further from center and have a larger force than the current position.

Super-condensed version:  
The pilot gets instant simulated stick movement unless he crosses the origin or tries to make a move that requires more power than a human can exert.  If he crosses the origin he gets a negligible one-timestep delay before moving the simulated stick any further.  If his movement does not require to much power, then we let him move the simulated stick as limited by the inertia and friction of the joystick on his desk.


Where do you get power values?  Find a human factors study by NACA or NACA or USAF.  Or you can go to the gym and use barbells to measure how fast you can move your forearm laterally and longitudinally with a given force on it.  You can do the same thing on a leg press machine to estimate the speed of rudder movements at a given force.  Take the force (lb) times speed (in/s) and you've got power limits for your anti-stick stir code.


Note:  I'm assuming you guys can compute the instantaneous forces on the control surface, and use the gear ratios (inches of stick motion for degrees of control surface motion) to find the stick forces for a given control surface force.  Likewise you can convert control surface deflection limits into stick deflection limits.

[This message has been edited by funked (edited 10-28-1999).]

funked

  • Guest
Anti-Stick Stirring Code
« Reply #1 on: November 04, 1999, 09:12:00 AM »
punt

Werewolf

  • Guest
Anti-Stick Stirring Code
« Reply #2 on: November 04, 1999, 09:27:00 AM »
Hm, sounds interesting, but it is relative to many variables I think (altitude, speed...) and we all will be the  pilots with the same abilities. And the question is if it won't delay input on weaker CPUs.

Maybe we should testify our fitness and get our own profile   (at last all those PC-Pilots go out to gymn and work on their profile)

Werewo

Werewolf

  • Guest
Anti-Stick Stirring Code
« Reply #3 on: November 04, 1999, 09:27:00 AM »
Hm, sounds interesting, but it is relative to many variables I think (altitude, speed...) and we all will be the  pilots with the same abilities. And the question is if it won't delay input on weaker CPUs.

Maybe we should testify our fitness and get our own profile   (at last all those PC-Pilots go out to gymn and work on their profile)

Werewo

Werewolf

  • Guest
Anti-Stick Stirring Code
« Reply #4 on: November 04, 1999, 09:27:00 AM »
Hm, sounds interesting, but it is relative to many variables I think (altitude, speed...) and we all will be the  pilots with the same abilities. And the question is if it won't delay input on weaker CPUs.

Maybe we should testify our fitness and get our own profile   (at last all those PC-Pilots go out to gymn and work on their profile)

Werewo

Werewolf

  • Guest
Anti-Stick Stirring Code
« Reply #5 on: November 05, 1999, 12:01:00 PM »
Very strabge I have hit post reply only once  

funked

  • Guest
Anti-Stick Stirring Code
« Reply #6 on: November 08, 1999, 10:12:00 AM »
Heheheh Werewolf shall include a weakness factor for US pilots suffering from English food?  

Werewolf

  • Guest
Anti-Stick Stirring Code
« Reply #7 on: November 08, 1999, 10:19:00 AM »
  and how about a bonus for german pilots for using Pervitin

Werewo