GoFlight programming and the Bendix/King KAP 140

Locked
User avatar
robains
Posts: 69
Joined: Fri Nov 28, 2014 3:38 pm
GoFlight programming and the Bendix/King KAP 140

Post by robains » Wed May 30, 2018 10:29 pm

I've been trying to program my GoFlight MPCPro using GoFlight Interface Tool (GIT) and I've had partial success with the exception of the HDG and NAV operation.

I see the KAP140_ Lvars and the "regular" events that get triggered when pushing the HDG or NAV button, but when I emulate those Lvars and events using GIT I get nothing ... ROL will change "HDG" in the display but the aircraft will not respond to the set heading (HEADING_BUG_SET value from AUTOPILOT_HEADING_LOCK_DIR).

Is there any that just NOT exposed that is needed to make this work? I don't mind if there is hidden logic, as I'll stop trying to make it work if that's the case. I can sorta make it work but I have to set NAV ARM and then going in/out of HDR/ROL works, but I shouldn't really need to set NAV Arm?

I was able to get AP On/Off, BARO (that was a little tricky as I need to get current Alt and then round up to nearest 100ft), ARM, Alt/VS, Alt Selection (100/1000 inc), but HDG and NAV are proving problematic.

So any Lvars/Event usage and/or logic implementation hints would be most grateful.

On a side note I'm using the F1 750/650 also but not sure if that is relevant. I've also got EVERY other button/knob mapped and working with GoFlight modules including WX and even "options" (like pitot cover, chocks, pilot, etc.) and even included mapping of the correct sound event and add sound events where none were before.

Cheers, Rob.

Taguilo
Posts: 658
Joined: Sun May 11, 2014 11:49 am
Re: GoFlight programming and the Bendix/King KAP 140

Post by Taguilo » Thu May 31, 2018 1:13 pm

Hi,

Just use the "LUA" LVars programmed for that, described in the manual. There's no other way appart from typical FS autopilot events.

However, in case of heading bug or OBS needles, DO NOT use _SET events in your module. Replacce that for typical INC DEC commands which are naturally linked to knob's rotation. It's me who is using _SET to mask the other events, and it's going to conflict if you also program the same events in your module.

Tomas

User avatar
robains
Posts: 69
Joined: Fri Nov 28, 2014 3:38 pm
Re: GoFlight programming and the Bendix/King KAP 140

Post by robains » Thu May 31, 2018 3:44 pm

Thanks Tomas,

Was hoping to avoid Lua, but will try it out.

Cheers, Rob.

EDIT: I didn't realize Steve's GIT now has Lua "built-in" so no need for FSUIPC ... in that case, I'll get Lua'ing.

User avatar
robains
Posts: 69
Joined: Fri Nov 28, 2014 3:38 pm
Re: GoFlight programming and the Bendix/King KAP 140

Post by robains » Fri Jun 01, 2018 4:59 pm

Hi Tomas,

Quick update: I was able to get HDG and NAV working as expected but I did NOT need to use LUA scripts. In fact, I don't really understand why Milviz provided all these Lvars?

KAP140_LuaALT_KeyDown
KAP140_LuaALT_KeyUp
KAP140_LuaAPM_KeyDown
KAP140_LuaAPM_KeyUp
KAP140_LuaAPR_KeyDown
KAP140_LuaAPR_KeyUp
KAP140_LuaARM_KeyDown
KAP140_LuaARM_KeyUp
KAP140_LuaBARO_KeyUp
KAP140_LuaBARO_KeyDown
KAP140_LuaDEC100_KeyDown
KAP140_LuaDEC100_KeyUp
KAP140_LuaDEC1000_KeyDown
KAP140_LuaDEC1000_KeyUp
KAP140_LuaDOWN_KeyDown
KAP140_LuaDOWN_KeyUp
KAP140_LuaHDG_KeyDown
KAP140_LuaHDG_KeyUp
KAP140_LuaINC100_KeyDown
KAP140_LuaINC100_KeyUp
KAP140_LuaINC1000_KeyDown
KAP140_LuaINC1000_KeyUp
KAP140_LuaNAV_KeyDown
KAP140_LuaNAV_KeyUp
KAP140_LuaREV_KeyDown
KAP140_LuaREV_KeyUp
KAP140_LuaUP_KeyDown
KAP140_LuaUP_KeyUp

In GIT detective, I see the *KeyDown does get set but *KeyUp is never set? Anyway using a combination of these Lvars for HDG:
KAP140_RollHdgRol
KAP140_RollMode
KAP140_LuaHDG_KeyDown

Along with two triggered events is now working as expected for me without having to write LUA scripts. Nothing against LUA scripts as they are very powerful, but just not needed in this case.

Cheers, Rob.

Taguilo
Posts: 658
Joined: Sun May 11, 2014 11:49 am
Re: GoFlight programming and the Bendix/King KAP 140

Post by Taguilo » Fri Jun 01, 2018 5:47 pm

Hi Rob,

Those "LUA" Lvars are useful for people that want to program LUA scripts with an interface like FSUIPC.
That's the principal reason I provided them. But they don't necessary need to be used solely in Lua.
Actually I use them to send AP command to AP server gauge from the AP 2D popup.

_KeyDown sends a command meaning a keypress down.
_KeyUp sends a Keypress release

Most of them only need a Keydown, so KeyUp is discarded, but there are a bunch that need a button to be held down, and in those cases KeyUp is detected and processed. Anyway, KeyUp might be necessary for Lua scripts to detect when the event must conclude.

Regards,
Tomas

User avatar
robains
Posts: 69
Joined: Fri Nov 28, 2014 3:38 pm
Re: GoFlight programming and the Bendix/King KAP 140

Post by robains » Fri Jun 01, 2018 6:05 pm

Hi Tomas,

Thanks for the response, understand now ... provides a reference for FSUIPC to work it ... fortunately GIT doesn't require any of the facilities of FSUIPC.

Cheers, Rob.


Locked

Return to “310 Redux Support Forum”