Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

problems programming AP Pitch

Featured Replies

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

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?

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

  • Author

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.