Skip to content

Commit 69cfacc

Browse files
Further tuning
Further tuning
1 parent b883d14 commit 69cfacc

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

GainsController.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ def MRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_area_est
6060
KD_tran_PD_baseline = np.matrix(1 * np.diag([8,8,3]))
6161

6262
# **Rotational** baseline parameters
63-
KP_rot = np.matrix(1 * np.diag([100,100,50]))
63+
KP_rot = np.matrix(1e2 * np.diag([1,1,0.5]))
6464

6565
# **Rotational** parameters for the PI baseline controller (Moment_baseline_PI)
66-
KP_rot_PI_baseline = np.matrix(40 * np.diag([1,1,0.5]))
66+
KP_rot_PI_baseline = np.matrix(40 * np.diag([1,1,1]))
6767
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
6868
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
6969

70-
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,2]))
70+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
7171

7272
# ----------------------------------------------------------------
7373
# Translational Parameters MRAC
@@ -118,11 +118,11 @@ def MRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_area_est
118118
B_ref_rot = np.matrix(np.eye(3))
119119

120120
# **Rotational** parameters Lyapunov equation
121-
Q_rot = np.matrix(7e-3 * np.diag([1,1,1]))
121+
Q_rot = np.matrix(7e-3 * np.diag([1,1,2]))
122122
P_rot = np.matrix(linalg.solve_continuous_lyapunov(A_ref_rot.T, -Q_rot))
123123

124124
# **Rotational** adaptive parameters
125-
Gamma_x_rot = np.matrix(1e1 * np.diag([1,1,1])) # Adaptive rates
125+
Gamma_x_rot = np.matrix(1e1 * np.diag([1,1,10])) # Adaptive rates
126126
Gamma_r_rot = np.matrix(1e-4 * np.diag([1,1,1])) # Adaptive rates
127127
Gamma_Theta_rot = np.matrix(1e0 * np.diag([1,1,1,1,1,1])) # Adaptive rates
128128

@@ -166,7 +166,7 @@ def TwoLayerMRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_
166166
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
167167
KI_rot_PI_baseline = np.matrix(10 * np.diag([1,1,0.5]))
168168

169-
K_P_omega_ref = np.matrix(5e-3 * np.diag([5,5,2]))
169+
K_P_omega_ref = np.matrix(5e-3 * np.diag([5,5,10]))
170170

171171
# ----------------------------------------------------------------
172172
# Translational Parameters MRAC
@@ -287,7 +287,7 @@ def RobustMRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_ar
287287
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
288288
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
289289

290-
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,2]))
290+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
291291

292292
# ----------------------------------------------------------------
293293
# Translational Parameters MRAC
@@ -402,7 +402,7 @@ def RobustTwoLayerMRACwithBASELINE(mass_total_estimated,air_density_estimated,su
402402
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
403403
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
404404

405-
K_P_omega_ref = np.matrix(1.5e-2 * np.diag([5,5,2]))
405+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
406406

407407
# ----------------------------------------------------------------
408408
# Translational Parameters MRAC
@@ -472,7 +472,7 @@ def RobustTwoLayerMRACwithBASELINE(mass_total_estimated,air_density_estimated,su
472472
K_transient_rot = np.matrix(K_transient_rot.gain_matrix)
473473
A_transient_rot = A_rot - B_ref_rot*K_transient_rot # Eigenvalues of A_transient should be further on the left in the complex plane of those of A_ref!!!!
474474

475-
Q_rot_2Layer = np.matrix(8e-4 * np.diag([1,10,1]))
475+
Q_rot_2Layer = np.matrix(8e-4 * np.diag([1,1,1]))
476476
P_rot_2Layer = np.matrix(linalg.solve_continuous_lyapunov(A_transient_rot.T, -Q_rot_2Layer))
477477

478478
Gamma_g_rot = np.matrix(1e1 * np.diag([1,1,1])) # Adaptive rates
@@ -542,7 +542,7 @@ def HybridMRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_ar
542542
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
543543
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
544544

545-
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,2]))
545+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
546546

547547
# ----------------------------------------------------------------
548548
# Translational Parameters MRAC
@@ -658,7 +658,7 @@ def HybridTwoLayerMRACwithBASELINE(mass_total_estimated,air_density_estimated,su
658658
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
659659
KI_rot_PI_baseline = np.matrix(10 * np.diag([1,1,0.5]))
660660

661-
K_P_omega_ref = np.matrix(5e-3 * np.diag([5,5,2]))
661+
K_P_omega_ref = np.matrix(5e-1 * np.diag([5,5,10]))
662662

663663
# ----------------------------------------------------------------
664664
# Translational Parameters MRAC
@@ -804,7 +804,7 @@ def HybridRobustMRACwithBASELINE(mass_total_estimated,air_density_estimated,surf
804804
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
805805
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
806806

807-
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,2]))
807+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
808808

809809
# ----------------------------------------------------------------
810810
# Translational Parameters MRAC
@@ -935,7 +935,7 @@ def HybridRobustTwoLayerMRACwithBASELINE(mass_total_estimated,air_density_estima
935935
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
936936
KI_rot_PI_baseline = np.matrix(10 * np.diag([1,1,0.5]))
937937

938-
K_P_omega_ref = np.matrix(5e-3 * np.diag([5,5,2]))
938+
K_P_omega_ref = np.matrix(5e-1 * np.diag([5,5,10]))
939939

940940
# ----------------------------------------------------------------
941941
# Translational Parameters MRAC
@@ -1099,7 +1099,7 @@ def FunnelMRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_ar
10991099
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
11001100
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
11011101

1102-
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,2]))
1102+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
11031103

11041104
# ----------------------------------------------------------------
11051105
# Translational Parameters MRAC
@@ -1172,7 +1172,7 @@ def FunnelMRACwithBASELINE(mass_total_estimated,air_density_estimated,surface_ar
11721172

11731173
# **Rotational** Funnel parameters
11741174
eta_max_funnel_rot = 1
1175-
M_funnel_rot = np.matrix(1e-2 * np.diag([1,1,1])) # n x n
1175+
M_funnel_rot = np.matrix(1e-3 * np.diag([1,1,1])) # n x n
11761176
Moment_max = 5
11771177
Moment_min = 0
11781178
Delta_Moment_min = 0.01
@@ -1219,7 +1219,7 @@ def FunnelTwoLayerMRACwithBASELINE(mass_total_estimated,air_density_estimated,su
12191219
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
12201220
KI_rot_PI_baseline = np.matrix(10 * np.diag([1,1,0.5]))
12211221

1222-
K_P_omega_ref = np.matrix(5e-3 * np.diag([5,5,2]))
1222+
K_P_omega_ref = np.matrix(5e-1 * np.diag([5,5,10]))
12231223

12241224
# ----------------------------------------------------------------
12251225
# Translational Parameters MRAC
@@ -1355,14 +1355,14 @@ def MRACwithBASELINE_SafetyMechanism(mass_total_estimated,air_density_estimated,
13551355
KD_tran_PD_baseline = np.matrix(1 * np.diag([8,8,3]))
13561356

13571357
# **Rotational** baseline parameters
1358-
KP_rot = np.matrix(1 * np.diag([100,100,50]))
1358+
KP_rot = np.matrix(1e2 * np.diag([1,1,0.5]))
13591359

1360-
# **Rotational** parameters for the PID baseline controller (Moment_baseline_PI)
1361-
KP_rot_PI_baseline = np.matrix(40 * np.diag([1,1,0.5]))
1360+
# **Rotational** parameters for the PI baseline controller (Moment_baseline_PI)
1361+
KP_rot_PI_baseline = np.matrix(40 * np.diag([1,1,1]))
13621362
KD_rot_PI_baseline = np.matrix(0 * np.diag([1,1,0.5]))
13631363
KI_rot_PI_baseline = np.matrix(0.1 * np.diag([1,1,0.5]))
13641364

1365-
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,2]))
1365+
K_P_omega_ref = np.matrix(1.5e-1 * np.diag([5,5,10]))
13661366

13671367
# ----------------------------------------------------------------
13681368
# Translational Parameters MRAC
@@ -1413,11 +1413,11 @@ def MRACwithBASELINE_SafetyMechanism(mass_total_estimated,air_density_estimated,
14131413
B_ref_rot = np.matrix(np.eye(3))
14141414

14151415
# **Rotational** parameters Lyapunov equation
1416-
Q_rot = np.matrix(7e-3 * np.diag([1,1,1]))
1416+
Q_rot = np.matrix(7e-3 * np.diag([1,1,2]))
14171417
P_rot = np.matrix(linalg.solve_continuous_lyapunov(A_ref_rot.T, -Q_rot))
14181418

14191419
# **Rotational** adaptive parameters
1420-
Gamma_x_rot = np.matrix(1e1 * np.diag([1,1,1])) # Adaptive rates
1420+
Gamma_x_rot = np.matrix(1e1 * np.diag([1,1,10])) # Adaptive rates
14211421
Gamma_r_rot = np.matrix(1e-4 * np.diag([1,1,1])) # Adaptive rates
14221422
Gamma_Theta_rot = np.matrix(1e0 * np.diag([1,1,1,1,1,1])) # Adaptive rates
14231423

@@ -1427,16 +1427,16 @@ def MRACwithBASELINE_SafetyMechanism(mass_total_estimated,air_density_estimated,
14271427

14281428
# Mu - sphere intersection
14291429
sphereEpsilon = 1e-2
1430-
maximumThrust = 85 # [N]
1430+
maximumThrust = 85 # [N] 85
14311431

14321432
# Mu - elliptic cone intersection
14331433
EllipticConeEpsilon = 1e-2
1434-
maximumRollAngle = math.radians(30) # [rad]
1435-
maximumPitchAngle = math.radians(45) # [rad]
1434+
maximumRollAngle = math.radians(20) # [rad] 25
1435+
maximumPitchAngle = math.radians(20) # [rad] 25
14361436

14371437
# Mu - plane intersection
14381438
planeEpsilon = 1e-2
1439-
alphaPlane = 0.9 # [-] coefficient for setting the 'height' of the bottom plane. Must be >0 and <1.
1439+
alphaPlane = 0.95 # [-] coefficient for setting the 'height' of the bottom plane. Must be >0 and <1.
14401440

14411441

14421442
return [number_of_states,size_DATA,KP_tran,KD_tran,KI_tran,KP_tran_PD_baseline,KD_tran_PD_baseline,KP_rot,KP_rot_PI_baseline,

0 commit comments

Comments
 (0)