From e61e52c79895cc082d8fcac1ee4449a75600e636 Mon Sep 17 00:00:00 2001 From: mSparks43 Date: Tue, 27 Dec 2022 20:56:24 +0100 Subject: [PATCH] independant ECC pids for GE/PW/RR --- 747-400.acf | 86 +++++++++-- README.pdf | Bin 149355 -> 149355 bytes .../init/scripts/B747.42.EEC/B747.42.EEC.lua | 14 +- .../B747.01.xt.manipulators.lua | 5 +- .../scripts/B747.05.xt.simconfig/version.lua | 1 + .../B747.42.xt.EEC/B747.42.xt.EEC.GE.lua | 7 +- .../B747.42.xt.EEC/B747.42.xt.EEC.RR.lua | 2 +- .../scripts/B747.42.xt.EEC/B747.42.xt.EEC.lua | 140 ++++++++++++++---- .../B747.70.xt.autopilot.lua | 8 +- .../B747.70.xt.autopilot.monitor.lua | 8 +- .../B747.70.xt.autopilot.vnavspd.lua | 2 +- 11 files changed, 215 insertions(+), 58 deletions(-) diff --git a/747-400.acf b/747-400.acf index 2acc2c3cd..6a69d6d9d 100644 --- a/747-400.acf +++ b/747-400.acf @@ -120117,9 +120117,9 @@ GROUP Upper EICAS END_GROUP END_GROUP - GROUP EPR Thrust Command + GROUP Thrust Command EPR RR SHOW_LESS 1.000000 sim/cockpit2/annunciators/reverser_deployed - SHOW_EQUAL 0.000000 laminar/B747/engines/thrust_ref + SHOW_EQUAL 2.000000 laminar/B747/engines/type gen_pointer Engine 4 POS 1748.500000 942.000000 IMAGE CRT Displays/EICAS Upper/N1_thrust @@ -120173,6 +120173,62 @@ GROUP Upper EICAS OFFSET 0.000000 END_GROUP + GROUP Thrust Command EPR PW + SHOW_LESS 1.000000 sim/cockpit2/annunciators/reverser_deployed + SHOW_EQUAL 0.000000 laminar/B747/engines/type + gen_pointer Engine 4 + POS 1748.500000 942.000000 + IMAGE CRT Displays/EICAS Upper/N1_thrust + DATAREF laminar/B747/engines/TRA[3] + LIGHT_MODE GLASS_AUTO + LIGHT_RHEOSTAT 10 + BUS_SRC 2 + KEY_FRAME 0.850000 -67.000000 1.000000 + KEY_FRAME 1.750000 67.000000 + IS_DRAGGABLE 0 + IS_VERTICAL 1 + OFFSET 0.000000 + + gen_pointer Engine 3 + POS 1642.500000 942.000000 + IMAGE CRT Displays/EICAS Upper/N1_thrust + DATAREF laminar/B747/engines/TRA[2] + LIGHT_MODE GLASS_AUTO + LIGHT_RHEOSTAT 10 + BUS_SRC 2 + KEY_FRAME 0.850000 -67.000000 1.000000 + KEY_FRAME 1.750000 67.000000 + IS_DRAGGABLE 0 + IS_VERTICAL 1 + OFFSET 0.000000 + + gen_pointer Engine 2 + POS 1536.500000 942.000000 + IMAGE CRT Displays/EICAS Upper/N1_thrust + DATAREF laminar/B747/engines/TRA[1] + LIGHT_MODE GLASS_AUTO + LIGHT_RHEOSTAT 10 + BUS_SRC 2 + KEY_FRAME 0.850000 -67.000000 1.000000 + KEY_FRAME 1.750000 67.000000 + IS_DRAGGABLE 0 + IS_VERTICAL 1 + OFFSET 0.000000 + + gen_pointer Engine 1 + POS 1430.500000 942.000000 + IMAGE CRT Displays/EICAS Upper/N1_thrust + DATAREF laminar/B747/engines/TRA[0] + LIGHT_MODE GLASS_AUTO + LIGHT_RHEOSTAT 10 + BUS_SRC 2 + KEY_FRAME 0.850000 -67.000000 1.000000 + KEY_FRAME 1.750000 67.000000 + IS_DRAGGABLE 0 + IS_VERTICAL 1 + OFFSET 0.000000 + + END_GROUP END_GROUP GROUP N1 GROUP N1 Tape @@ -121308,7 +121364,7 @@ GROUP Upper EICAS LED_ROWS 4 END_GROUP - GROUP N1 Thrust Command G + GROUP Thrust Command N1 GE SHOW_LESS 1.000000 sim/cockpit2/annunciators/reverser_deployed SHOW_EQUAL 1.000000 laminar/B747/engines/type gen_pointer Engine 4 @@ -121319,8 +121375,10 @@ GROUP Upper EICAS LIGHT_MODE GLASS_AUTO LIGHT_RHEOSTAT 10 BUS_SRC 2 - KEY_FRAME 0.850000 -67.000000 1.000000 - KEY_FRAME 1.950000 67.000000 + KEY_FRAME -100.0000 -67.000000 1.000000 + KEY_FRAME 31.0000 -67.000000 1.000000 + KEY_FRAME 116.0000 102.000000 + KEY_FRAME 200.0000 102.000000 IS_DRAGGABLE 0 IS_VERTICAL 1 OFFSET 0.000000 @@ -121333,8 +121391,10 @@ GROUP Upper EICAS LIGHT_MODE GLASS_AUTO LIGHT_RHEOSTAT 10 BUS_SRC 2 - KEY_FRAME 0.850000 -67.000000 1.000000 - KEY_FRAME 1.950000 67.000000 + KEY_FRAME -100.0000 -67.000000 1.000000 + KEY_FRAME 31.0000 -67.000000 1.000000 + KEY_FRAME 116.0000 102.000000 + KEY_FRAME 200.0000 102.000000 IS_DRAGGABLE 0 IS_VERTICAL 1 OFFSET 0.000000 @@ -121347,8 +121407,10 @@ GROUP Upper EICAS LIGHT_MODE GLASS_AUTO LIGHT_RHEOSTAT 10 BUS_SRC 2 - KEY_FRAME 0.850000 -67.000000 1.000000 - KEY_FRAME 1.950000 67.000000 + KEY_FRAME -100.0000 -67.000000 1.000000 + KEY_FRAME 31.0000 -67.000000 1.000000 + KEY_FRAME 116.0000 102.000000 + KEY_FRAME 200.0000 102.000000 IS_DRAGGABLE 0 IS_VERTICAL 1 OFFSET 0.000000 @@ -121361,8 +121423,10 @@ GROUP Upper EICAS LIGHT_MODE GLASS_AUTO LIGHT_RHEOSTAT 10 BUS_SRC 2 - KEY_FRAME 0.850000 -67.000000 1.000000 - KEY_FRAME 1.950000 67.000000 + KEY_FRAME -100.0000 -67.000000 1.000000 + KEY_FRAME 31.0000 -67.000000 1.000000 + KEY_FRAME 116.0000 102.000000 + KEY_FRAME 200.0000 102.000000 IS_DRAGGABLE 0 IS_VERTICAL 1 OFFSET 0.000000 diff --git a/README.pdf b/README.pdf index 7cd471db1ce48af7275caea0dea9486e785b750f..32e45421799a7f9a8ffe1e30352599db9dd054c8 100644 GIT binary patch delta 112 zcmaFe$N9RCv!R7?3)5FiHX{R5Gb4lPzb%<$q3rE)R!lZr&d$beM$WDlhL(=zE~YM) hmgbHIE*1tB1_sWKre+pSrgjQ8gp_Qb>%w%72>|FU9dZBw delta 112 zcmaFe$N9RCv!R7?3)5FiHUnb=Q)A2Nzb%<$q3rE)R!lZr&PJAwP8J5nuCAs|F2+XA h29B%w%72>|p(9nt^* diff --git a/plugins/xtlua/init/scripts/B747.42.EEC/B747.42.EEC.lua b/plugins/xtlua/init/scripts/B747.42.EEC/B747.42.EEC.lua index 95be5ae24..10ae135a0 100644 --- a/plugins/xtlua/init/scripts/B747.42.EEC/B747.42.EEC.lua +++ b/plugins/xtlua/init/scripts/B747.42.EEC/B747.42.EEC.lua @@ -53,7 +53,15 @@ B747DR_throttle_resolver_angle = deferred_dataref("laminar/B747/engines/TRA", " B747DR_log_level = deferred_dataref("laminar/B747/engines/logging", "number") --true / false B747DR_pidthrottleP = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/p", "number") -B747DR_pidthrottleHP = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/highp", "number") -B747DR_pidthrottleLP = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/lowp", "number") +--B747DR_pidthrottleHP = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/highp", "number") +--B747DR_pidthrottleLP = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/lowp", "number") B747DR_pidthrottleI = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/i", "number") -B747DR_pidthrottleD = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/d", "number") \ No newline at end of file +B747DR_pidthrottleD = deferred_dataref("laminar/B747/flt_ctrls/pid/throttle/d", "number") + +B747DR_pideccI = deferred_dataref("laminar/B747/flt_ctrls/pid/ecc/N1/i", "number") +B747DR_pideccD = deferred_dataref("laminar/B747/flt_ctrls/pid/ecc/N1/d", "number") +B747DR_pideccP = deferred_dataref("laminar/B747/flt_ctrls/pid/ecc/N1/p", "number") + +B747DR_pidepr_eccI = deferred_dataref("laminar/B747/flt_ctrls/pid/ecc/epr/i", "number") +B747DR_pidepr_eccD = deferred_dataref("laminar/B747/flt_ctrls/pid/ecc/epr/d", "number") +B747DR_pidepr_eccP = deferred_dataref("laminar/B747/flt_ctrls/pid/ecc/epr/p", "number") diff --git a/plugins/xtlua/scripts/B747.01.xt.manipulators/B747.01.xt.manipulators.lua b/plugins/xtlua/scripts/B747.01.xt.manipulators/B747.01.xt.manipulators.lua index 49ac3ba28..d0b31dbea 100644 --- a/plugins/xtlua/scripts/B747.01.xt.manipulators/B747.01.xt.manipulators.lua +++ b/plugins/xtlua/scripts/B747.01.xt.manipulators/B747.01.xt.manipulators.lua @@ -2309,13 +2309,14 @@ function B747_throttle_animation() B747DR_throttle[i]=B747_interpolate_value(B747DR_throttle[i],0,0,1,1) else B747DR_throttle_reversor[i]=B747_interpolate_value(B747DR_throttle_reversor[i],0,-1,0,1) - if B747DR_ap_FMA_autothrottle_mode==0 or B747DR_ap_FMA_autothrottle_mode==1 then + --[[ if B747DR_ap_FMA_autothrottle_mode==0 or B747DR_ap_FMA_autothrottle_mode==1 then B747DR_throttle[i]=B747_interpolate_value(B747DR_throttle[i],simDR_engn_thro[i],0,1,0.5) --print("manual speed throttle") else --print("auto speed throttle") B747DR_throttle[i]=simDR_engn_thro[i] --B747_interpolate_value(B747DR_throttle[i],simDR_engn_thro[i],0,1,2) - end + end]]-- + B747DR_throttle[i]=simDR_engn_thro[i] end end diff --git a/plugins/xtlua/scripts/B747.05.xt.simconfig/version.lua b/plugins/xtlua/scripts/B747.05.xt.simconfig/version.lua index a0c395e06..b2bea34ec 100644 --- a/plugins/xtlua/scripts/B747.05.xt.simconfig/version.lua +++ b/plugins/xtlua/scripts/B747.05.xt.simconfig/version.lua @@ -149,3 +149,4 @@ fmcVersion="XP1150-2022/12/22 03:27" fmcVersion="XP1150-2022/12/26 19:54" fmcVersion="XP1150-2022/12/27 01:48" fmcVersion="XP1150-2022/12/27 03:05" +fmcVersion="XP1150-2022/12/27 20:56" diff --git a/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.GE.lua b/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.GE.lua index 9a9391baf..356acee34 100644 --- a/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.GE.lua +++ b/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.GE.lua @@ -20,10 +20,11 @@ function throttle_resolver_angle_GE(engine_in) thrust_ratio_factor = B747DR_display_N1_max[engine_in] / 116.0 --117.5 - throttle_angle = (3.022549485226715E-03 + 1.441727698320892E+00 * simDR_throttle_ratio[engine_in] + -9.568752920557220E-01 * simDR_throttle_ratio[engine_in]^2 - + 9.989724112918770E-01 * simDR_throttle_ratio[engine_in]^3 + -4.927345191979758E-01 * simDR_throttle_ratio[engine_in]^4) * thrust_ratio_factor + --throttle_angle = (3.022549485226715E-03 + 1.441727698320892E+00 * simDR_throttle_ratio[engine_in] + -9.568752920557220E-01 * simDR_throttle_ratio[engine_in]^2 + -- + 9.989724112918770E-01 * simDR_throttle_ratio[engine_in]^3 + -4.927345191979758E-01 * simDR_throttle_ratio[engine_in]^4) * thrust_ratio_factor - local N1_target=B747_rescale(0.0, 0.75, 0.88, 2.05, throttle_angle) + --local N1_target=B747_rescale(0.0, 0, 1.0, 116.0, throttle_angle) + local N1_target=B747_rescale(0.0, 31.0, 1.0, 116.0, simDR_throttle_ratio[engine_in]) if B747DR_log_level == -1 then print("Thrust Factor = ", thrust_ratio_factor) print("TRA = ", throttle_angle) diff --git a/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.RR.lua b/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.RR.lua index 91773483a..49eec68a7 100644 --- a/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.RR.lua +++ b/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.RR.lua @@ -65,7 +65,7 @@ function throttle_resolver_angle_RR(engine_in) end return EPR_actual]]-- - local EPR_target=B747_rescale(0.0, 1.0, 1.0, B747DR_display_EPR_max[engine_in], simDR_throttle_ratio[engine_in]) + local EPR_target=B747_rescale(0.0, 1.0, 0.9, B747DR_display_EPR_max[engine_in]*0.99, simDR_throttle_ratio[engine_in]) return EPR_target end diff --git a/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.lua b/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.lua index a836b1fcc..03cbce9c7 100644 --- a/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.lua +++ b/plugins/xtlua/scripts/B747.42.xt.EEC/B747.42.xt.EEC.lua @@ -20,10 +20,12 @@ simDR_version=find_dataref("sim/version/xplane_internal_version") dofile("pid.lua") local computeRate=0.0333 -- handle low FPS local lastCompute=0 +local lastThrottleCompute=0 local doCompute=0 local throttlePid = newPid() + throttlePid.minout=0 -throttlePid.maxout=1 +throttlePid.maxout=1.05 throttlePid.target=0 throttlePid.input = 0 throttlePid:compute() @@ -32,6 +34,22 @@ B747DR_pidthrottleHP = find_dataref("laminar/B747/flt_ctrls/pid/throttle/highp") B747DR_pidthrottleLP = find_dataref("laminar/B747/flt_ctrls/pid/throttle/lowp") B747DR_pidthrottleI = find_dataref("laminar/B747/flt_ctrls/pid/throttle/i") B747DR_pidthrottleD = find_dataref("laminar/B747/flt_ctrls/pid/throttle/d") +B747DR_pideccI = find_dataref("laminar/B747/flt_ctrls/pid/ecc/N1/i") +B747DR_pideccD = find_dataref("laminar/B747/flt_ctrls/pid/ecc/N1/d") +B747DR_pideccP = find_dataref("laminar/B747/flt_ctrls/pid/ecc/N1/p") +B747DR_pidepr_eccI = find_dataref("laminar/B747/flt_ctrls/pid/ecc/epr/i") +B747DR_pidepr_eccD = find_dataref("laminar/B747/flt_ctrls/pid/ecc/epr/d") +B747DR_pidepr_eccP = find_dataref("laminar/B747/flt_ctrls/pid/ecc/epr/p") +local eccPid ={} +for i = 0, 3 do + eccPid[i]=newPid() + eccPid[i].minout=0 + eccPid[i].maxout=1.2 + eccPid[i].target=0 + eccPid[i].input = 0 + eccPid[i]:compute() +end + simDR_ind_airspeed_kts_pilot = find_dataref("laminar/B747/gauges/indicators/airspeed_kts_pilot") --B747DR_ap_ias_bug_value = find_dataref("laminar/B747/autopilot/ias_bug_value") @@ -707,13 +725,68 @@ function ecc_spd() --print("---ECC SPD---") local input=1 local target=1 - B747DR_pidthrottleP=B747DR_pidthrottleHP + if simDR_override_throttles == 0 then + simDR_override_throttles = 1 + end + local diffSpeed=2 + for i = 0, 3 do + + + if B747DR_engineType==1 then --GE, n1 target + eccPid[i].kp=B747DR_pideccP + eccPid[i].ki=B747DR_pideccI + eccPid[i].kd=B747DR_pideccD + eccPid[i].input = B747DR_display_N1[i] + eccPid[i].target = B747DR_throttle_resolver_angle[i] + else --PW or RR, EPR target + eccPid[i].input = 50.0*B747DR_display_EPR[i] + eccPid[i].target = 50.0*B747DR_throttle_resolver_angle[i] + eccPid[i].kp=B747DR_pidepr_eccP + eccPid[i].ki=B747DR_pidepr_eccI + eccPid[i].kd=B747DR_pidepr_eccD + diffSpeed=4 + end + + end + + --local diffSpeed=30/(0.1+math.abs(input-target)) + --print(diffSpeed) + if (simDRTime-lastCompute)>computeRate then + for i = 0, 3 do + eccPid[i]:compute() + end + lastCompute=simDRTime + + end + for i = 0, 3 do + if eccPid[i].output~=nil then + local tValue=round(eccPid[i].output*100)/100 + if simDR_engine_running[i] ==1 then + --if B747DR_ap_FMA_autothrottle_mode==3 then diffSpeed=15 end + simDR_engn_thro_use[i]=B747_interpolate_value(simDR_engn_thro_use[i],eccPid[i].output,0,1.1,diffSpeed) + else + simDR_engn_thro_use[i]=0 + end + --print(i.." throttle target="..eccPid[i].target.. " current "..eccPid[i].input.." AT retval "..eccPid[i].output .. " t="..simDR_engn_thro_use[i].. " diffSpeed="..diffSpeed) + end + end +end +function ecc_throttle() + --print("---ECC Throttle---") + local input=1 + local target=1 + + --B747DR_pidthrottleP=B747DR_pidthrottleHP --idle - if B747DR_ap_FMA_autothrottle_mode==2 and simDR_radarAlt1<40 then + --[[if B747DR_ap_FMA_autothrottle_mode==2 and simDR_radarAlt1<40 then input=simDR_ind_airspeed_kts_pilot target=0 --spd - elseif B747DR_ap_FMA_autothrottle_mode==3 then + else]]-- + + throttlePid.ki=B747DR_pidthrottleI + + if B747DR_ap_FMA_autothrottle_mode==3 then --[[if B747DR_engineType~=1 and math.max(B747DR_display_EPR[0],B747DR_display_EPR[1],B747DR_display_EPR[2],B747DR_display_EPR[3])> math.max(B747DR_display_EPR_max[0],B747DR_display_EPR_max[1],B747DR_display_EPR_max[2],B747DR_display_EPR_max[3]) @@ -724,53 +797,54 @@ function ecc_spd() else]] input=simDR_ind_airspeed_kts_pilot target=simDR_autopilot_airspeed_kts - + throttlePid.kp=B747DR_pidthrottleP + throttlePid.kd=B747DR_pidthrottleD --end else + throttlePid.kd=0 + throttlePid.kp=0 --some kind of thrust target if B747DR_engineType==1 then --GE, n1 target - input=math.max(B747DR_display_N1[0],B747DR_display_N1[1],B747DR_display_N1[2],B747DR_display_N1[3]) - target=simDR_N1_target_bug[0] + input=5*math.max(B747DR_throttle_resolver_angle[0],B747DR_throttle_resolver_angle[1],B747DR_throttle_resolver_angle[2],B747DR_throttle_resolver_angle[3]) + target=5*simDR_N1_target_bug[0] else --PW or RR, EPR target local targetBug=math.min(simDR_EPR_target_bug[0],simDR_EPR_target_bug[1],simDR_EPR_target_bug[2],simDR_EPR_target_bug[3], - B747DR_display_EPR_max[0]-0.1,B747DR_display_EPR_max[1]-0.1,B747DR_display_EPR_max[2]-0.1,B747DR_display_EPR_max[3]-0.1) - local inputBug=math.max(B747DR_display_EPR[0],B747DR_display_EPR[1],B747DR_display_EPR[2],B747DR_display_EPR[3]) + B747DR_display_EPR_max[0],B747DR_display_EPR_max[1],B747DR_display_EPR_max[2],B747DR_display_EPR_max[3]) + local inputBug=math.max(B747DR_throttle_resolver_angle[0],B747DR_throttle_resolver_angle[1],B747DR_throttle_resolver_angle[2],B747DR_throttle_resolver_angle[3]) input=200.0*inputBug target=200.0*targetBug - B747DR_pidthrottleP=B747DR_pidthrottleLP + --B747DR_pidthrottleP=B747DR_pidthrottleLP --print("throttle target="..target.. " current "..input.." targetBug "..targetBug.." inputBug "..inputBug) end end -- --simDR_override_throttles = 1 - throttlePid.kp=B747DR_pidthrottleP - throttlePid.ki=B747DR_pidthrottleI - throttlePid.kd=B747DR_pidthrottleD + throttlePid.input = input throttlePid.target= target local diffSpeed=30/(0.1+math.abs(input-target)) --print(diffSpeed) - if (simDRTime-lastCompute)>computeRate then + if (simDRTime-lastThrottleCompute)>computeRate then throttlePid:compute() - lastCompute=simDRTime - + --print("compute") + lastThrottleCompute=simDRTime end if throttlePid.output~=nil then - local tValue=round(throttlePid.output*100)/100 + --local tValue=round(throttlePid.output*100)/100 --print("throttle target="..target.. " current "..input.." AT retval "..throttlePid.output) - --print("AT retval "..tValue.." simDR_ind_airspeed_kts_pilot "..input.." B747DR_ap_ias_bug_value "..target) + --print("AT retval simDR_ind_airspeed_kts_pilot "..input.." B747DR_ap_ias_bug_value "..target) --if math.max(simDR_engn_thro[0],simDR_engn_thro[1],simDR_engn_thro[2],simDR_engn_thro[3])>0.9 then - if math.abs(input-target)<5 then + --[[if math.abs(input-target)<5 then diffSpeed=diffSpeed+40 --print("rate lim throttle") - end - if diffSpeed<15 and B747DR_ap_FMA_autothrottle_mode==3 then diffSpeed=15 end + end]] + --if diffSpeed<15 and B747DR_ap_FMA_autothrottle_mode==3 then diffSpeed=15 end if diffSpeed<5 then diffSpeed=5 end for i = 0, 3 do - simDR_engn_thro[i]=B747_interpolate_value(simDR_engn_thro[i],tValue,0,1,diffSpeed) + simDR_engn_thro[i]=B747_interpolate_value(simDR_engn_thro[i],throttlePid.output,0,1.00,diffSpeed) end end @@ -895,7 +969,7 @@ function throttle_management() -- HOLD Mode elseif (B747DR_ap_autothrottle_armed == 1 or simDR_override_throttles == 1 ) and B747DR_ap_FMA_autothrottle_mode == 1 and EEC_status == 0 then --Give throttle control back to the user - simDR_override_throttles = 0 + --simDR_override_throttles = 0 B747DR_ref_line_magenta = 0 --hold_mode = 1 @@ -909,7 +983,7 @@ function throttle_management() elseif B747DR_ap_autothrottle_armed == 0 and B747DR_ap_FMA_autothrottle_mode == 3 and EEC_status == 0 then --Give throttle control back to the user --hold_mode = 0 - simDR_override_throttles = 0 + --simDR_override_throttles = 0 if B747DR_autothrottle_active == 1 then B747DR_autothrottle_active = 0 @@ -925,12 +999,13 @@ function throttle_management() --Autothrottle has been disabled for some reason B747DR_autothrottle_active = 0 end + ecc_spd() if B747DR_ap_autothrottle_armed == 1 and B747DR_ap_FMA_autothrottle_mode > 1 then --not none or HOLD --new SPD - ecc_spd() + ecc_throttle() else - simDR_override_throttles = 0 + --simDR_override_throttles = 0 B747DR_ref_line_magenta = 0 @@ -982,10 +1057,17 @@ function hasSimConfig() return setSimConfig end function flight_start() - B747DR_pidthrottleHP = 0.030 - B747DR_pidthrottleLP = 0.0030 + B747DR_pidthrottleP = 0.10 B747DR_pidthrottleI = 0.001 - B747DR_pidthrottleD = 0.01 + B747DR_pidthrottleD = 0.001 + + B747DR_pideccI = 0.01 + B747DR_pideccD = 0.001 + B747DR_pideccP = 0.06 + + B747DR_pidepr_eccI = 0.01 + B747DR_pidepr_eccD = 0.001 + B747DR_pidepr_eccP = 0 end function after_physics() if debug_ecc>0 then return end diff --git a/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.lua b/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.lua index 267343218..9c441b1e5 100644 --- a/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.lua +++ b/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.lua @@ -2443,11 +2443,11 @@ function B747_ap_fma() -- AUTOTHROTTLE ------------------------------------------------------------------------------------- if B747DR_ap_autoland == 1 and simDR_radarAlt1 < 25 then - simDR_override_throttles = 0 + --simDR_override_throttles = 0 B747DR_ap_FMA_autothrottle_mode = 2 --IDLE elseif B747DR_toggle_switch_position[29] == 0 or B747DR_autothrottle_fail > 0 then B747DR_ap_FMA_autothrottle_mode = 0 - simDR_override_throttles = 0 + --simDR_override_throttles = 0 elseif (B747DR_engine_TOGA_mode > 0 and simDR_ind_airspeed_kts_pilot < 65) or B747DR_ap_autoland < 0 or (B747DR_ap_vnav_state == 0 and B747DR_ap_thrust_mode > 0) @@ -2455,7 +2455,7 @@ function B747_ap_fma() if B747DR_engine_TOGA_mode == 1 then B747DR_engine_TOGA_mode = 0 B747DR_ap_FMA_autothrottle_mode = 0 - simDR_override_throttles = 0 + --simDR_override_throttles = 0 else B747DR_ap_FMA_autothrottle_mode = 5 --THR REF end @@ -2480,7 +2480,7 @@ function B747_ap_fma() B747DR_ap_FMA_autothrottle_mode = 1 --HOLD else B747DR_ap_FMA_autothrottle_mode = 0 - simDR_override_throttles = 0 + --simDR_override_throttles = 0 end end diff --git a/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.monitor.lua b/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.monitor.lua index 987c1004a..9494c3083 100644 --- a/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.monitor.lua +++ b/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.monitor.lua @@ -317,7 +317,7 @@ function B747_monitor_THR_REF_AT() if B747DR_toggle_switch_position[29] ~= 1 then return end if ((B747DR_ap_thrust_mode == 0 and simDR_autopilot_flch_status>0) or (simDR_radarAlt1>2000 and( simDR_pressureAlt1< simDR_autopilot_altitude_ft+B747DR_alt_capture_window and simDR_pressureAlt1> simDR_autopilot_altitude_ft-B747DR_alt_capture_window))) and B747DR_autothrottle_active == 0 then print("B747_monitor_THR_REF_AT B747DR_ap_thrust_mode " .. B747DR_ap_thrust_mode) - simDR_override_throttles=0 + --simDR_override_throttles=0 B747DR_ap_thrust_mode = 0 --simCMD_autopilot_autothrottle_on:once() B747DR_autothrottle_active=1 @@ -529,7 +529,7 @@ function B747_monitorAT() B747DR_autothrottle_fail=1 end B747DR_engine_TOGA_mode = 0 - simDR_override_throttles = 0 + --simDR_override_throttles = 0 return end @@ -566,7 +566,7 @@ function B747_monitorAT() end if B747DR_autothrottle_active==0 then print("simDR_autopilot_alt_hold_status") - simDR_override_throttles=0 + --simDR_override_throttles=0 --simCMD_autopilot_autothrottle_on:once() B747DR_autothrottle_active=1 B747DR_ap_lastCommand=simDRTime @@ -579,7 +579,7 @@ function B747_monitorAT() or B747DR_ap_FMA_active_pitch_mode == 2 then if B747DR_autothrottle_active==0 then print("B747DR_ap_FMA_active_pitch_mode") - simDR_override_throttles=0 + --simDR_override_throttles=0 --simCMD_autopilot_autothrottle_on:once() B747DR_autothrottle_active=1 if B747DR_engine_TOGA_mode ==1 then B747DR_engine_TOGA_mode = 0 end -- CANX ENGINE TOGA IF ACTIVE diff --git a/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.vnavspd.lua b/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.vnavspd.lua index f98bf4572..98d24caba 100644 --- a/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.vnavspd.lua +++ b/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.vnavspd.lua @@ -319,7 +319,7 @@ function des_aptres_setSpd() B747DR_lastap_dial_airspeed=B747DR_ap_ias_dial_value run_after_time(B747_updateIAS, 0.25) if B747DR_autothrottle_active == 0 and simDR_ind_airspeed_kts_pilot < spdval+5 then -- AUTOTHROTTLE IS "OFF" - simDR_override_throttles=0 + --simDR_override_throttles=0 -- simCMD_autopilot_autothrottle_on:once() B747DR_autothrottle_active=1 B747DR_ap_lastCommand = simDRTime