Sign in to follow this  
Guest

DigiTrak Autopilot

Recommended Posts

How that most of my EIS gauge is complete I am turning to modelling the DigiTrak autopilot. This is going to be a really nice addition to an ultralight or homebuilt.I have most of the AP done (it's a very simple single axis system, but very elegant and precise).The main problem I am having is with the AP master switch. I am not sure it is possible to do what I want. The AP has only three buttons, left, right and on/off.First, I tried having it come on in HDG HOLD mode when the AP master switch was clicked (both on at the same time). I used the XML for the Baron as an example, which sets AP mode at the same time as the master switch is turned on.

<Click Kind="LeftSingle">(>K:AP_MASTER) (>K:AP_PANEL_VS_HOLD)</Click>

I tried duplicating this for heading hold.

<Click Kind="LeftSingle">(>K:AP_MASTER) (>K:AP_PANEL_HEADING_HOLD)</Click>

works somewhat. It seems logical, but it turns the AP on, but does not turn it off. The AP starts out OFF, then I click it and comes on and HDG HOLD is on, but I cannot turn HDG HOLD off or the AP master switch off either.Pressing Z turns the AP off and appears to reset the HDG HOLD.For some reason this works, at least the master sw.

<Click Kind="LeftSingle" Event="AP_MASTER">(>K:AP_PANEL_HEADING_HOLD)</Click>

But when I fly, it does not seem to turn the HDG on.Okay, the above works for master sw.This works for HDG but not master sw.

	  <Click Kind="LeftSingle" Event="AP_PANEL_HEADING_HOLD">(>K:AP_MASTER)</Click>

I can never turn it off.At this point I gave up.What I did to solve this was split the AP master switch in halves, one for AP master and the right for HDG Hold.

<Area Left="64" Width="64" Top="150" Height="24">	  <Help ID="HELPID_GAUGE_AUTOPILOT_MASTER"/>	  <Tooltip ID="TOOLTIPTEXT_AUTOPILOT_MASTER"/>	  <Cursor Type="Hand"/>	  <Click Kind="LeftSingle" Event="AP_MASTER"/>	  </Area><Area Left="94" Width="64" Top="150" Height="24">	  <Help ID="HELPID_GAUGE_AUTOPILOT_MASTER"/>	  <Tooltip ID="TOOLTIPTEXT_AUTOPILOT_HEADING_HOLD"/>	  <Cursor Type="Hand"/>	  <Click Kind="LeftSingle" Event="AP_PANEL_HEADING_HOLD"/>	  </Area>

Okay, this works.However, reading the DigiTrak manual, I realized that I need to simulate some of its modal behavior. When it is powered up but not yet engaged it says OFF on the LED display. I need to display OFF until the master switch (???) is clicked _again_ after turning it on. I'd appreciate any suggestions on how to do this!Also, the AP heading mode is engaged by clicking the on/off button again after the OFF mode is displayed. Can this be done?Another item. When first powered up it goes through a calibration period displaying "---" or similar. Can this be modeled?I may have to just add another button or keep the split function of the on/off button, or perhaps make a remote window. I think it is intended that you press the yoke AP button to change modes in real life.Steve

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Wowsa!!! This is alot !! I try to help in sections here...(* Panel power off/on initialization *)(* G:Var1 = Master Sw. push button state *)(* G:Var2 = Initial power up initialization *)(* G:Var3 = Actual AP power state *)(* Set all values to OFF if no power is available *)(A:Circuit general panel on, bool) 0 == if{ 0 (>G:Var1) + 0 (>G:Var2) + 0 (>G:Var3) }(* Start power up timer if AP power initialization is off and there is panel power - 10 second initialization*)(A:Circuit general panel on, bool) 1 == (G:Var2) 0 == & if{ (P:Absolute time, minutes) 0.166 + (>G:Var2) }(* Compare timer start time to actual time to apply a "power available" state to AP *)(P:Absolute time, minutes) (G:Var2) > if{ 1 (>G:Var3) } (* Show the power up initialization on display *)(G:Var1) 0 == (G:Var3) 0 == (G:Var2) 0 > & & (* Show the OFF state on display if initalized *)(G:Var1) 0 == (G:Var3) 1 == & (* Show the ON state on display if AP power is initialized and power is on *)(G:Var1) 1 == (G:Var3) 1 == & (* Turn ON AP master and HDG HLD if pushbutton is pushed on *)(G:Var1) 1 == if{ (>K:AP_HDG_HOLD_ON) + (>K:AUTOPILOT_ON) }(* Turn OFF AP master and HDG HLD if pushbutton is pushed off *)(G:Var1) 0 == if{ (>K:AP_HDG_HOLD_OFF) + (>K:AUTOPILOT_OFF) }(* NOTE THE ABOVE 2 LINES WILL OVERRIDE ANY KEYBOARD ENTRY SO IF AP IS ON SO IS HDG HLD and Vice Versa *)(* The click is only available once AP is initialized *)(G:Var3) 1 == if{ (G:Var1) 1 == if{ 0 (>G:Var1) } els{ 1 (>G:Var1) } } If you need a button on the yoke as well as on the AP itself, replace all G:Var1s with an L: type variable.Hope this helps.. Or gives you ideas... It has not been tested.. Note, the way it looks here on the forum is different since HTML has processed it. On paper the " < " would be " & l t ; " , the " > " would be " & g t ; " and the " & " would be " & a m p ; ". All without the quotes and remove spaces between characters.Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Thanks Roman. The code worked. It took me about four hours of hair pulling to get it the way I wanted.It appears MS has left some confusion over this quasi data-quasi programming language they have created. I could not tell whether it is procedural (like Javascript) or non-procedural (like CSS). It appears the order of elements matters and comes into play more so when dealing with timers. I had to add a second power reset element after the timer to get it to shut off with the battery switch.And I had a time figuring out where and how to add the avionics master switch into the code so it would turn off with that.All while keeping the power on initialization behavoir.But your code mostly worked out of the box!Now, I have run into another problem. The AP needs to acquire the current aircraft heading when the master switch is clicked (and goes into HDG HOLD mode from OFF) and set the autopilot heading lock to this direction. But I cannot see how to do this because the value comes from the HSI heading bug, but of course, I do not have an HSI on the panel. The DigiTrak does not require one AFAIK because it has an internal GPS/magnetometer to get heading info from.Right now it always starts at heading 000 and pulls the ac there when you click no matter what heading.But it's coming along!Steve

Share this post


Link to post
Share on other sites

>But I cannot >see how to do this because the value comes from the HSI >heading bug, but of course, I do not have an HSI on the >panel. The DigiTrak does not require one AFAIK because it >has an internal GPS/magnetometer to get heading info from. Steve, I believe that you'll find that parameter is available for you to read whether you have an HSI installed or not. Of course, I may be all wet here also! :)

Share this post


Link to post
Share on other sites

Steve, Glad it worked somewhat for you :-)This should help in the heading dept. once the button is clicked on.(* The click is only available once AP is initialized *)(G:Var3) 1 == if{ (G:Var1) 1 == if{ 0 (>G:Var1) } els{ 1 (>G:Var1) + (A:Plane heading degrees true, degrees) (>K:HEADING BUG SET) } } Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

BTW you will have trouble testing an autopilot on an a/c that you have specified NO DIRECTIONAL GYRO for! The a/p needs this to exist to get direction information. Otherwise the a/c spins around in a circle!aircraft.cfg

[direction_indicators]//1 Type: 0=None, 1=Vacuum Gyro, 2=Electric Gyro, 3=Electro-Mag Slaved Compass, 4=Slaved to another//2 Indicator number of slaving indicator if Type=4// MUST have DG.direction_indicator.0=1,0

Of course the DigiTrak IRL has it's own gyro and magnetometor besides the GPS slave. Doesn't need no stinkin' DG.Ahhh, I will try that code Roman. I kept looking at HEADING_BUG_SET, but could only imagine it worked with the mouse once you had clicked on a numeric display.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