final

Dependencies:   MatrixMath Matrix ExperimentServer QEI_pmw MotorShield

Files at this revision

API Documentation at this revision

Comitter:
saloutos
Date:
Thu Oct 01 14:53:18 2020 +0000
Parent:
27:5d60c6ab6d0a
Child:
29:8b4fd3d36882
Commit message:
Reset mass matrix elements for template code

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Oct 01 13:54:16 2020 +0000
+++ b/main.cpp	Thu Oct 01 14:53:18 2020 +0000
@@ -237,10 +237,10 @@
                 float vMult = 0;
                 if( t < start_period) {
                     if (K_xx > 0 || K_yy > 0) {
-                        K_xx = 50; 
-                        K_yy = 50; 
-                        D_xx = 2;  
-                        D_yy = 2;  
+                        K_xx = 100; 
+                        K_yy = 100; 
+                        D_xx = 5;  
+                        D_yy = 5;  
                         K_xy = 0;
                         D_xy = 0;
                     }
@@ -295,9 +295,9 @@
                 float fy = 0;
                 
                 // Calculate mass matrix elements
-                float M11 = I1 + I2 + I3 + I4 + Ir + Ir*pow(N,2) + pow(l_AC,2)*m4 + pow(l_A_m3,2)*m3 + pow(l_B_m2,2)*m2 + pow(l_C_m4,2)*m4 + pow(l_OA,2)*m3 + pow(l_OB,2)*m2 + pow(l_OA,2)*m4 + pow(l_O_m1,2)*m1 + 2*l_C_m4*l_OA*m4 + 2*l_AC*l_C_m4*m4*cos(th2) + 2*l_AC*l_OA*m4*cos(th2) + 2*l_A_m3*l_OA*m3*cos(th2) + 2*l_B_m2*l_OB*m2*cos(th2);
-                float M12 = I2 + I3 + pow(l_AC,2)*m4 + pow(l_A_m3,2)*m3 + pow(l_B_m2,2)*m2 + Ir*N + l_AC*l_C_m4*m4*cos(th2) + l_AC*l_OA*m4*cos(th2) + l_A_m3*l_OA*m3*cos(th2) + l_B_m2*l_OB*m2*cos(th2);
-                float M22 = Ir*pow(N,2) + m4*pow(l_AC,2) + m3*pow(l_A_m3,2) + m2*pow(l_B_m2,2) + I2 + I3;
+                float M11 = 0; 
+                float M12 = 0; 
+                float M22 = 0;
                 
                 // Populate mass matrix
                 MassMatrix.Clear();
@@ -327,8 +327,6 @@
 
 
 
-                
-                
                 // Form output to send to MATLAB     
                 float output_data[NUM_OUTPUTS];
                 // current time