final

Dependencies:   MatrixMath Matrix ExperimentServer QEI_pmw MotorShield

Files at this revision

API Documentation at this revision

Comitter:
saloutos
Date:
Tue Oct 06 01:02:31 2020 +0000
Parent:
28:22530fdc149b
Child:
30:833008a20edd
Commit message:
Commented out matrix inversions to start, since mass matrix is initialized to all zeros

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Oct 01 14:53:18 2020 +0000
+++ b/main.cpp	Tue Oct 06 01:02:31 2020 +0000
@@ -299,6 +299,8 @@
                 float M12 = 0; 
                 float M22 = 0;
                 
+                
+                
                 // Populate mass matrix
                 MassMatrix.Clear();
                 MassMatrix << M11 << M12
@@ -309,17 +311,21 @@
                 Jacobian << Jx_th1 << Jx_th2
                          << Jy_th1 << Jy_th2;
                 
+                // Once you have copied the elements of the mass matrix, uncomment the following section
+                
                 // Calculate Lambda matrix
-                JacobianT = MatrixMath::Transpose(Jacobian);
-                InverseMassMatrix = MatrixMath::Inv(MassMatrix);
-                temp_product = Jacobian*InverseMassMatrix*JacobianT;
-                Lambda = MatrixMath::Inv(temp_product); 
+//                JacobianT = MatrixMath::Transpose(Jacobian);
+//                InverseMassMatrix = MatrixMath::Inv(MassMatrix);
+//                temp_product = Jacobian*InverseMassMatrix*JacobianT;
+//                Lambda = MatrixMath::Inv(temp_product); 
                 
                 // Pull elements of Lambda matrix
-                float L11 = Lambda.getNumber(1,1);
-                float L12 = Lambda.getNumber(1,2);
-                float L21 = Lambda.getNumber(2,1);
-                float L22 = Lambda.getNumber(2,2);               
+//                float L11 = Lambda.getNumber(1,1);
+//                float L12 = Lambda.getNumber(1,2);
+//                float L21 = Lambda.getNumber(2,1);
+//                float L22 = Lambda.getNumber(2,2);               
+                                
+                                
                                 
                 // Set desired currents             
                 current_des1 = 0;