@@ -40,7 +40,7 @@ Vector4 ASTRAv2_Controller(Vector3 PosTarget, Vector16 X, constantsASTRA_t const
4040 Vector3 PosError = PosTarget - X.segment <3 >(4 );
4141
4242 // Velocity Command
43- Vector3 K_P = (Vector3 () << 0.58 , 0.58 , 0.65 ).finished ();
43+ Vector3 K_P = (Vector3 () << 0.7 , 0.7 , 0.65 ).finished ();
4444 Vector3 VelTarget = K_P.cwiseProduct (PosError);
4545
4646 // Velocity Saturation Step
@@ -57,8 +57,8 @@ Vector4 ASTRAv2_Controller(Vector3 PosTarget, Vector16 X, constantsASTRA_t const
5757 Vector3 Clamp = (Vector3 () << 5 , 5 , 5 ).finished ();
5858
5959 // Normalize errors (0 to 1 scale)
60- Vector3 MaxAttError = (Vector3 () << 0.05 , 0.05 , 0.3 ).finished ();
61- Vector3 MaxVelError = (Vector3 () << 0.3 , 0.3 , 0.3 ).finished ();
60+ Vector3 MaxAttError = (Vector3 () << 0.06 , 0.06 , 0.3 ).finished ();
61+ Vector3 MaxVelError = (Vector3 () << 0.3 , 0.3 , 0.6 ).finished ();
6262 Vector3 NormAttErr = lastAttError.cwiseAbs ().cwiseQuotient (MaxAttError);
6363 Vector3 NormVelErr = VelError.cwiseAbs ().cwiseQuotient (MaxVelError);
6464
@@ -72,7 +72,7 @@ Vector4 ASTRAv2_Controller(Vector3 PosTarget, Vector16 X, constantsASTRA_t const
7272 K_I = K_I.cwiseProduct (Gate);
7373 VelErrorI = VelErrorI + K_I.cwiseProduct (VelError) * dT;
7474 VelErrorI = VelErrorI.cwiseMin (Clamp).cwiseMax (-Clamp);
75- K_P = (Vector3 () << 3.1 , 3.1 , 5 ).finished ();
75+ K_P = (Vector3 () << 2.4 , 2.4 , 5 ).finished ();
7676
7777 // Acceleration Target
7878 Vector3 AccelTarget = K_P.cwiseProduct (VelError) + VelErrorI + (Vector3 () << 0 , 0 , constantsASTRA.g ).finished ();
@@ -125,7 +125,6 @@ Vector4 ASTRAv2_Controller(Vector3 PosTarget, Vector16 X, constantsASTRA_t const
125125 Vector3 u_components = -constantsASTRA.K_Att * X_Err;
126126 U[0 ] = u_components[0 ];
127127 U[1 ] = u_components[1 ];
128- // U[2] is set above
129128 U[3 ] = u_components[2 ];
130129
131130 // Controls Saturation
0 commit comments