Jump to content
Sign in to follow this  
Demious

problems programming AP Pitch

Recommended Posts

I'm having some problem programming the Autopilot Pitch to the pitch trim on my Saitek Multi Panel.

 

This is what I've done:

In SPAD, I opened the setup page of the Multi Panel and on the Trim tab, I set both directions to an FSUIPC virtual button. Both with unused virtual joystick and virtual button numbers, of course.

Then I logged the AP Pitch in the virtual cockpit, which showed the AP_PITCH_REF_INC_UP/DN.

I send the virtual button from SPAD to FSUIPC by clicking Send-button-to-flight-sim button and programmed the respective AP_PITCH_REF_INC commands to the buttons send from SPAD.

When I check the log as I now move the trim on the Saitek panel, I get multiple lines of the correct command, both up and down, so that seems to work fine. However, the virtual AP trim wheel doesn't move at all.

 

What am I doing wrong here?


Cheers!

Maarten Franken

Share this post


Link to post
Share on other sites

Sounds like the same problem that you fixed with the gauge script I provided in
http://forum.avsim.net/topic/435041-problem-programming-fuel-selectors-to-hardware-controller/#entry2929574

The current code that handles the mouse wheel looks like this:

1 (>K:AP_PITCH_REF_INC_DN) (L:KNOB_AUTOPILOTO_VS,number) ++  90 min (>L:KNOB_AUTOPILOTO_VS,number) }
1 (>K:AP_PITCH_REF_INC_UP) (L:KNOB_AUTOPILOTO_VS,number) -- -90 max (>L:KNOB_AUTOPILOTO_VS,number) }

So (>L:KNOB_AUTOPILOTO_VS,number) is the local gauge variable that needs updating when the AP pitch gets changed.

The corresponding aircraft variable might be AUTOPILOT PITCH HOLD REF (in radians), so here is some untested code, that you can insert in your existing gauge script:

(A:AUTOPILOT PITCH HOLD REF,radians) rddg 90 min -90 max (>L:KNOB_AUTOPILOTO_VS,number)

Maybe it needs 90 + or 90 - after the rddg if the range is wrong. As I wrote: untested.

 

Question to more experienced Gauge programmers: rddg converts radians to degrees, but can I directly request degrees, too?

Share this post


Link to post
Share on other sites

The PITCH_REF command is for the FSX autopilot, the KNOB_AUTOPILOTO is for the animation

of the pitch wheel.

 

I control the AP from a remote mouse wheel clickspot on the panel, and issue two PITCH_REF

commands for each click to get the desired response.  I have not tried to animate the pitch wheel,

but the code referenced above should do the trick.

<Mouse>
      <Cursor Type="Hand"/>
      <Click Kind="WheelUp + WheelDown" >

      (M:Event) 'WheelUp' scmp 0 == if{ 
         (A:Autopilot Master,bool) if{
         (A:AUTOPILOT ALTITUDE LOCK,bool)  if{
         (A:Autopilot Nav1 Lock,bool) (>L:NAV337,bool)
         (A:Autopilot Heading Lock,bool) (>L:HDG337,bool)
         (>K:AP_ATT_HOLD_ON)  
         (L:NAV337,bool) 0 != if{ 0 (>K:AP_NAV1_HOLD_ON) }
         (L:HDG337,bool) 0 != if{ 0 (>K:AP_HDG_HOLD_ON) } }
         (>K:AP_PITCH_REF_INC_DN)
         (>K:AP_PITCH_REF_INC_DN) } } 

      (M:Event) 'WheelDown' scmp 0 == if{
         (A:Autopilot Master,bool) if{
         (A:AUTOPILOT ALTITUDE LOCK,bool)  if{
         (A:Autopilot Nav1 Lock,bool) (>L:NAV337,bool)
         (A:Autopilot Heading Lock,bool) (>L:HDG337,bool)
         (>K:AP_ATT_HOLD_ON)  
         (L:NAV337,bool) 0 != if{ 0 (>K:AP_NAV1_HOLD_ON) }
         (L:HDG337,bool) 0 != if{ 0 (>K:AP_HDG_HOLD_ON) } }
         (>K:AP_PITCH_REF_INC_UP) 
         (>K:AP_PITCH_REF_INC_UP) } }

      </Click>
</Mouse>


Bert

Share this post


Link to post
Share on other sites

I'll have a look at it. Thanks, Bert! :D


Oh, Thomas, I completely overlooked you. Thanks to you to, of course :D


Cheers!

Maarten Franken

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...