From b2022d8d5e706f3584975a9920fcada854ef8c05 Mon Sep 17 00:00:00 2001 From: cs-powell <142438185+cs-powell@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:05:28 -0500 Subject: [PATCH] Wisdom of Raju --- Python3/src/cognitiveModel.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Python3/src/cognitiveModel.py b/Python3/src/cognitiveModel.py index 988387f..42d9ea1 100644 --- a/Python3/src/cognitiveModel.py +++ b/Python3/src/cognitiveModel.py @@ -8,6 +8,10 @@ class scaleFactor(): SCALEYOKESTEER = 10 SCALERUDDER = 10 SCALETHROTTLE = 1000 + + + +###Define variables/parameters for aircraft class/category : Wisdom of Raju class AircraftLandingModel(pyactr.ACTRModel): def __init__(self,client): super().__init__() @@ -51,8 +55,8 @@ class AircraftLandingModel(pyactr.ACTRModel): # Integral gains (tune these values for performance) self.Kp = 0.1 # Proportional gain - # self.Ki = 0.01 # Integral gain - self.Ki = 0 # Integral gain + self.Ki = 0.01 # Integral gain + # self.Ki = 2 # Integral gain @@ -165,9 +169,11 @@ class AircraftLandingModel(pyactr.ACTRModel): throttle = 0.15 - if(self.altitude < 100): ## Integrate using the control equations;; A goal state update + + ##INTEGRAL CONTROL + if(self.altitude < 350): ## Integrate using the control equations;; A goal state update throttle = 0.1 - yoke_pull = 0.3 + yoke_pull = 0.7 if(self.altitude < 70): ## Integrate using the control equations;; A goal state update @@ -176,26 +182,25 @@ class AircraftLandingModel(pyactr.ACTRModel): if(self.altitude < 50): ## Integrate using the control equations;; A goal state update throttle = 0 - yoke_pull = 0.4 + yoke_pull = 0.7 if(self.airspeed < self.target_airspeed): - #Method 2: Travel Limits (0 --> 0.2) - # yoke_pull = max(-0.2, yoke_pull) + #Method 2: Travel Limits (0 --> 0.2) + # yoke_pull = max(-0.2, yoke_pull) #Invert Throttl Temporarily self.printControls(1,0,yoke_pull,yoke_steer,rudder,throttle) - # Send all controls simultaneously to X-Plane + + # Send all controls simultaneously to X-Plane self.send_controls_to_xplane(yoke_pull, yoke_steer, 0, throttle) if(self.airspeed > self.target_airspeed): - - #Method 2: Travel Limits (0 --> 0.2) + # Method 2: Travel Limits (0 --> 0.2) # yoke_pull = min(0.2, yoke_pull) - self.printControls(1,0,yoke_pull,yoke_steer,rudder,throttle) self.send_controls_to_xplane(yoke_pull, yoke_steer, 0, throttle)