Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MatrixMath Matrix ExperimentServer QEI_pmw MotorShield
Diff: main.cpp
- Revision:
- 29:8b4fd3d36882
- Parent:
- 28:22530fdc149b
- Child:
- 30:103aab609fd6
--- 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;