Jump to content
Sign in to follow this  
taguilo

RUDDER_SET questions:How to control

Recommended Posts

Guest Skymed

I want to control the tail rotor of a helicopter using the RUDDER_SET function.This works OK: (A:RUDDER POSITION,percent) 163.84 /-/ * (>K:RUDDER_SET) However, I want to be able to influence the position of the rudder(tail rotor) based on external variables such as throtttle position, so replaced it with the following: (A:general eng propeller lever position:2,percent) 50 > if{ (A:general eng propeller lever position:2,percent) 5 / (>L:addrudder,enum) } (A:RUDDER POSITION,percent) (L:addrudder,enum) - 163.84 /-/ * (>K:RUDDER_SET) But this seems to start an incremental counter that, as soon as the (A:general eng propeller lever position:2,percent) 50 > is true, forces the rudder to -100% instead of adjusting it the way I wanted.Any hints??Steve

Share this post


Link to post
Share on other sites

Hi Steve,Gave it just a glance, but it seems you will always get this result, because each new rudder position you are commanding by code is affected by the LVar.Maybe this works: (L:RuddPos,percent) (A:RUDDER POSITION,percent) !=(L:addrudder, enum) (L:AddruddControl, enum) != ||if{ (A:RUDDER POSITION,percent) (L:addrudder,enum) - 163.84 /-/ * s0 (>K:RUDDER_SET) l0 (>L:RuddPos,percent) (L:addrudder,enum) (>L:AddruddControl, enum)}Besides, don't you need to reset the LVar anytime (A:general eng propeller lever position:2,percent) is lower than 50? Also noticed the LAddrudder var is always positive; seems it should be signed like (A:RUDDER POSITION,percent) ? (Maybe the tail-"rudder"-needs to turn to one side only?) Hope this helpsTom

Share this post


Link to post
Share on other sites
Guest Skymed

Tomyes, after I posted I realised that what I had was, in effect, a counter !!What i want to do is basically emulate increased torque from the main rotors when throttle is increased, and decrease torque when throttle is decreased. This will then make the chopper want to turn more in one direction than another. I will try the code you posted and see if I can make heads or tails of it :-))Steve

Share this post


Link to post
Share on other sites

Steve,This is a corrected version of my first approach:if{ (A:RUDDER POSITION,percent) (L:addrudder,enum) - s0 (percent *GOES HERE*) 163.84 /-/ * (>K:RUDDER_SET) l0 (>L:RuddPos,percent) (* or maybe l0 /-/ (>L:RuddPos,percent) *)(L:addrudder,enum) (>L:AddruddControl, enum)}TomPS: I prefer to use the same units in AVar to LVar assings, in this case would be (L:Addrudder, percent) and (L:(AddRuddControl,percent)

Share this post


Link to post
Share on other sites
Guest Skymed

TomI must be as dumb as a sack of hammers, because it seems to be doing the same thing.counting down to - 100 percent.here is what I have: (A:general eng propeller lever position:2,percent) 50 > if{ (A:general eng propeller lever position:2,percent) 5 / (>L:addrudder,percent) } els{ 0 (>L:addrudder,percent) } (L:RuddPos,percent) (A:RUDDER POSITION,percent) != (L:addrudder,percent) (L:AddruddControl,percent) != || if{ (A:RUDDER POSITION,percent) (L:addrudder,percent) - s0 163.84 /-/ * (>K:RUDDER_SET) l0 (>L:RuddPos,percent) (L:addrudder,percent) (>L:AddruddControl,percent) }Steve

Share this post


Link to post
Share on other sites

Steve,Did a short test at home, and found this seems to work:To capture the LVar change: (L:addrudder,percent) (L:AddruddControl,percent) != if{ (A:RUDDER POSITION,percent) (L:Addrudder,percent) (L:AddruddControl,percent) - - 163.84 /-/ * (>K:RUDDER_SET) (L:addrudder,percent) (>L:AddruddControl,percent) }To capture the Rudder Event change(s):(A:RUDDER POSITION,percent) (L:Addrudder,percent) (L:AddruddControl,percent) - - 163.84 /-/ * (>K:RUDDER_SET) You may want to capture RUDDER_RIGHT; RUDDER_LEFT, etc as well.I guess you'll need to do some cosmetics on the code to make it work as expected. This is a start point only :-)Tom

Share this post


Link to post
Share on other sites
Guest Skymed

TomThanks a million..will get to work on it right away and let you know how I make out.Steve

Share this post


Link to post
Share on other sites
Guest Skymed

Tom So far so good......... (L:addrudder,percent) (L:AddruddControl,percent) != if{ (A:RUDDER POSITION,percent) (L:Addrudder,percent) (L:AddruddControl,percent) - - 163.84 /-/ * (>K:RUDDER_SET) (L:addrudder,percent) (>L:AddruddControl,percent) } (A:RUDDER POSITION,percent) (L:Addrudder,percent) (L:AddruddControl,percent) - - 163.84 /-/ * (>K:RUDDER_SET) It works as advertised except for an interesting conundrum. It adds and subtracts the (L:Addrudder,percent) variable smoothly, but does not maintain the offset at the rudder. I can jiggle the pedals and recenter the rudder even with a 50% value maintained in the (L:Addrudder,percent) var.I am trying to set an "offset" in the rudder that is maintained. In other words ( and I hope I can explain this), I want to make the rudder offset X % to the left/right, requiring X % of opposite pedal to counteract that ( based on the variable input from(L:Addrudder,percent))so in effect the pedals will be be also offset the amount in (L:Addrudder,percent) to keep the nose straight. the coding does this perfectly until I move the pedals at which time I can recenter them and the rudder yet still have an offset of x in the (L:Addrudder,percent)....if that makes ANY sense at all !!!Any thoughts?Steve

Share this post


Link to post
Share on other sites

Steve,Just a little bug in the AXIS_RUDDER_SET event...Make it: (A:RUDDER POSITION,percent) (L:Addrudder,percent) - 163.84 /-/ * (>K:RUDDER_SET) Now, if you watch the rudder (tail?) in spot view, it shows a bit "noisy". This is an undesired visual effect you have to deal with when coding events control. However, I just tried it in my 757 and worked like you described, ie I needed to apply variable right rudder as power (used instead of collective) increases beyond 50%.Tom

Share this post


Link to post
Share on other sites
Guest Skymed

TomWorks brilliantly !!Thanks a million.Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...