Autopilot pitch mode attitude hold setting

I am having trouble with setting the AP to pitch hold and or attitude hold.
They don’t seem to take. My default pitch mode is zero, none. If I set the
default pitch mode to 1 = pitch the AP will turn on and the pitch hold mode
will be set. I don’t want this, I want to turn the AP on and set the pitch
hold via a second dedicated button. Any help in other settings I should be
aware of would be helpful. The pitch hold ref setting seems to be a crazy
number 9999999, I can’t set that either.

Which avionics system are you using in this case, and what events are you
sending to engage the pitch mode?

This might not solve your issue but also set these to 1 since you plan to us
no default. use_no_default_bank =1 use_no_default_pitch =1 Since you already
have default_bank_mode =0 this is correct. When you turn on the master
autopilot you will have no pitch hold of any type. So now you can use events
or settable Avars to enable pitch modes.

My own AP from the KAP140. Setting the AP ON will automatically set the Pitch
Mode to ON if I have default pitch mode to 1 in the system.cfg, Setting the
default pitch mode to 0 (none) does not allow me to set the pitch mode to on.
So I believe there is a design issue here. I can turn on the ALT mode and the
Pitch mode Turns off, then I can turn the ALT mode off and now the pitch mode
stays off. I can then turn the pitch mode ON and it works. However I can not
just turn the Pitch mode off, I have to always Turn ALT on THen turn ALT off.
In fact just use the KAP140.xml and the AP on - make an AP switch turn it on -
use simvar watcher and see the pitch mode get set to 1. So what am I missing?
what setting to get the pitch mode to stay off when I turn on the AP edit:
using K:AP_PITCH_LEVELER_OFF and K:AP_PITCH_LEVELER_ON

I have default_pitch_mode=1 default_bank_mode=1 and use_no_default_bank=0
use_no_default_pitch=0 bank mode does what I expect, however pitch does not. I
would assume they work the same way.

changing to use_no_default_pitch =1 did not fix my issue.

Is this being used in conjunction with the sim G1000 NXi or the GNS430W/530W?
They have drop-in override autopilots and so I need to verify what code I
should be looking at (those or the sim).

See if there is a conflict by having simvars open with all autopilot
variables. I have a saved profile then watch to solve any issues. See if you
have a conflict with pitch hold and vertical hold. Look for the value shorty
flickering or swapping. Or just both zero.

So no definitive answer to my issue? Bumping this with more questions. What is
Attitude HOLD (yes Attitude not Altitude) compared to Pitch HOLD. When I read
about Attitude hold this was designed in world war II for aircraft to hold two
or three axis. roll,pitch (and yaw) with one command. Is this the case for the
event AP_ATT_HOLD ? Why can I not turn off Pitch Mode, when pitch mode will
turn off If I turn on Altitude mode (yes Altitude)? What is the requirement to
get the Pitch mode to not come on whenthe AP is turned on and the
default_pitch_mode=1 (setting to zero seems not to be an option ). I seem to
be able to turn AP_BANK_HOLD_OFF and AP_BANK_HOLD_ON for Bank , why not Pitch?

Hello @DA40CGDFQ I ran some tests using the C172
Classic with its KAP140 and was able to enable/disable the attitude and pitch
hold modes independently. I had to first comment out the GNS430/530 as they
are intercepting the key events but as far as I understand, you do not have
any JS code that could interfere? If you can provide me with a package and
repro steps, I can trace what’s happening in your case. Regards, Sylvain

Yes I do have js code. This AP is the Kap140, with mods. There are 4 switches.
Roll, heading, altitude, pitch. The AP turns on with the roll switch, the
pitch mode turns on at the same time. Default pitch mode = 1, if I set to 0
none, the the pitch mode does not turn on, however I can’t turn the pitch mode
on after that. I will make a project for you.

Just to be sure How do you turn on/off pitch mode using js

      1. case "MYAP_Push_PCH":
  2.   if (SimVar.GetSimVarValue("AUTOPILOT MASTER", "Bool"))
  3.     if (SimVar.GetSimVarValue("AUTOPILOT PITCH HOLD", "Boolean")) {
  4.       SimVar.SetSimVarValue("K:AP_PITCH_LEVELER", "number", 0);
  5.     }
  6.     else {
  7.       SimVar.SetSimVarValue("K:AP_PITCH_LEVELER", "number", 1);
  8.     }
  9.   }
  10. break;

I have also tried

      1. case "MYAP_Push_PCH":
  2.   if (SimVar.GetSimVarValue("AUTOPILOT MASTER", "Bool"))
  3.     if (SimVar.GetSimVarValue("AUTOPILOT PITCH HOLD", "Boolean")) {
  4.       SimVar.SetSimVarValue("K:AP_PITCH_LEVELER_OFF", "number", 0);
  5.     }
  6.     else {
  7.       SimVar.SetSimVarValue("K:AP_PITCH_LEVELER_ON", "number", 0);
  8.     }
  9.   }
  10. break;

I also commented out the 530 I have, but still not able to turn pitch mode
on/off

Ok taking more to @mattnischan at WT and people
there, the key is to use K:AP_ATT_HOLD_ON and OFF with the
default_pitch_mode=0 I believe this is working now. close this issue. edit:
Interesting that ATT turn on off the pitch mode.

Ok taking more to WT and people there,

the key is to use K:AP_ATT_HOLD_ON and OFF with the default_pitch_mode=0 I
believe this is working now. close this issue.

edit: Interesting that ATT turn on off the pitch mode

Hello @DA40CGDFQ I used both AP_ATT_HOLD and
AP_PITCH_LEVELER events, sent from a SimConnect application and it worked as
expected. AP_ATT_HOLD event will toggle both pith hold and wing level modes If
pitch hold mode is already active, the AP_ATT_HOLD event will first disable it
so that all modes are off and sending AP_ATT_HOLD a second time will be needed
to switch it on. Regards, Sylvain

I cannot get AP_PITCH_LEVELER to work in js, I have a 530 in the aircraft
also. I have posted to WT discord. See my code post above. Very simple.