diff --git a/implementation/SCARA/03_motor/motor_physics2.emx b/implementation/SCARA/03_motor/motor_physics2.emx index 95cabf0..c24a2e4 100644 --- a/implementation/SCARA/03_motor/motor_physics2.emx +++ b/implementation/SCARA/03_motor/motor_physics2.emx @@ -8,7 +8,7 @@ 0 False C:\users\wouter\My Documents\studie\ma\mahd\implementation\SCARA\03_motor\motor_physics2.emx - 2020-7-20 15:06:45 + 2020-7-20 15:58:21 True @@ -32,9 +32,9 @@ initialequations implementation bg submodels Base1 720 184 - description '4.81FalseTrueBond Graph\MR\center_of_mass_v2.emx2020-7-20 14:44:13Baseparameters - real I [3,1] = [1.6399999999999998e-6;4.7e-8;1.61e-6] {N.m.s}; - real m = 0.00455 {kg};'; + description '4.81FalseTrueBond Graph\MR\center_of_mass_v2.emx2020-7-20 15:56:10Baseparameters + real I [3,1] = [7.583333333333335e-7; 3.645833333333334e-8; 7.364583333333335e-7] {N.m.s}; + real m = 0.0035 {kg};'; type Submodel ports power out p [6,1]; @@ -54,20 +54,12 @@ initialequations implementation bg submodels AdHi0 544 400 - description ' - - 4.2 -1 - False - Bond Graph\MTF.emx - 2011-11-29 16:15:31 - -'; + description '4.01False2007-9-25 12:3:3True'; type MTF ports - power in p1; - power out p2; - signal in r; + power in p1 [6,1]; + power out p2 [6,1]; + signal in H [4,4]; restrictions causality constraint not_equal p1 p2; end; @@ -76,50 +68,51 @@ initialequations text 'MTF' 544 400 color 0 18 bold; end; implementation eq -equations - p1.e = r * p2.e; - p2.f = r * p1.f; +variables + real onlyRotH[4,4]; +code + //Only rotations with respect to the inertial system matter! + onlyRotH = H; + onlyRotH[1,4] = 0; + onlyRotH[2,4] = 0; + onlyRotH[3,4] = 0; + + p2.e = transpose(Adjoint(onlyRotH)) * p1.e; + p1.f = Adjoint(onlyRotH) * p2.f; implementation_end; EJS 616 336 - description ' - - 4.2 -1 - False - Bond Graph\MGY.emx - 2011-11-29 16:03:53 - -'; + description '4.01False2007-10-31 11:43:6True'; type MGY ports - power in p1; - power out p2; - signal in r; - restrictions - causality constraint equal p1 p2; + power in p1 [6,1]; end; icon bg top figures text 'MGY' 616 336 color 0 18 bold; end; implementation eq +//EJS / Gyroscopic effects +parameters + real global I[3]; + real global m; +variables + real II[6,6]; //Inertial tensor + real Q[6,6]; + real QI[6,6]; + real Ia[6]; +initialequations + Ia[1:3] = I; + Ia[4:6] = m; + II = diag(Ia); equations - p1.e = r * p2.f; - p2.e = r * p1.f; -implementation_end; + Q = transpose(adjoint(p1.f)); + QI = Q*II; + p1.e = QI*p1.f;implementation_end; Gravity 616 400 - description ' - - 4.2 -1 - False - Bond Graph\Se.emx - 2011-11-29 16:36:49 - -'; + description '4.01False2007-9-25 12:3:26True'; type Se ports - power out p; + power out p [6,1]; restrictions causality fixed out p; end; @@ -129,27 +122,19 @@ implementation_end; end; implementation eq parameters - real effort = 1; + real global m; variables - real flow; + real effort[6]; equations + effort = [0;0;0;0;0;-g_n*m]; p.e = effort; - flow = p.f; implementation_end; InertialTensor 544 288 - description ' - - 4.2 -1 - False - Bond Graph\I.emx - 2011-11-29 15:55:55 - -'; + description '4.01False2007-9-25 12:2:12True'; type I ports - power in p; - signal out state; + power in p [6,1]; + signal out state [6,1]; restrictions causality preferred in p; end; @@ -159,10 +144,18 @@ implementation_end; end; implementation eq parameters - real i = 1; + real global I[3]; + real global m; +variables + real II[6,6]; //Inertial tensor + real Ia[6]; +initialequations + Ia[1:3] = I; + Ia[4:6] = m; + II = diag(Ia); equations - state = int(p.e); - p.f = state / i; + state = int(p.e); //state = generalized momentum + p.f = inverse(II)*state; implementation_end; plug p 472 336; plug Hin 472 496; @@ -191,19 +184,19 @@ equations collect (output) = input; implementation_end; Ta0j 544 336 - description ' - - 4.2 -1 - False - Bond Graph\OneJunction.emx - 2011-11-29 16:17:51 - -'; + description ' + 4.0 + 1 + False + Bond Graph\OneJunction.emx + 2007-9-27 9:51:18 + True + +'; knot OneJunction ports - power knot duplicatable none p [1]; - signal knot out flow [1]; + power knot duplicatable none p [6,1]; + signal knot out flow [6,1]; restrictions causality constraint one_out p; end; @@ -224,6 +217,7 @@ implementation_end; Hin -> Splitter1\input; InertialTensor\p <= Ta0j\p; p <= Ta0j\p; + Splitter1\output -> AdHi0\H; Splitter1\output -> Hout; Ta0j\p => EJS\p1; end; @@ -246,9 +240,9 @@ k = Body fixed frame, principal inertial frame ' 288 280 color 0; implementation_end; Base2 912 120 - description '4.81FalseTrueBond Graph\MR\center_of_mass_v2.emx2020-7-20 14:44:13Baseparameters - real I [3,1] = [1.6399999999999998e-6;4.7e-8;1.61e-6] {N.m.s}; - real m = 0.00455 {kg};'; + description '4.81FalseTrueBond Graph\MR\center_of_mass_v2.emx2020-7-20 15:56:10Baseparameters + real I [3,1] = [0;0;0] {N.m.s}; + real m = 0.015 {kg};'; type Submodel ports power out p [6,1]; @@ -258,30 +252,22 @@ k = Body fixed frame, principal inertial frame icon bg ellipse bottom figures ellipse 888 96 936 144 color 0 fill 16777215 width 2; - line 912 96 912 144 color 0 fill 16777215; line 888 120 936 120 color 0 fill 16777215; + line 912 96 912 144 color 0 fill 16777215; terminals - p 888 104 fixed; - Hin 888 136 fixed; + p 896 96 fixed; + Hin 928 96 fixed; Hout 936 152 fixed; end; implementation bg submodels AdHi0 544 400 - description ' - - 4.2 -1 - False - Bond Graph\MTF.emx - 2011-11-29 16:15:31 - -'; + description '4.01False2007-9-25 12:3:3True'; type MTF ports - power in p1; - power out p2; - signal in r; + power in p1 [6,1]; + power out p2 [6,1]; + signal in H [4,4]; restrictions causality constraint not_equal p1 p2; end; @@ -290,50 +276,51 @@ k = Body fixed frame, principal inertial frame text 'MTF' 544 400 color 0 18 bold; end; implementation eq -equations - p1.e = r * p2.e; - p2.f = r * p1.f; +variables + real onlyRotH[4,4]; +code + //Only rotations with respect to the inertial system matter! + onlyRotH = H; + onlyRotH[1,4] = 0; + onlyRotH[2,4] = 0; + onlyRotH[3,4] = 0; + + p2.e = transpose(Adjoint(onlyRotH)) * p1.e; + p1.f = Adjoint(onlyRotH) * p2.f; implementation_end; EJS 616 336 - description ' - - 4.2 -1 - False - Bond Graph\MGY.emx - 2011-11-29 16:03:53 - -'; + description '4.01False2007-10-31 11:43:6True'; type MGY ports - power in p1; - power out p2; - signal in r; - restrictions - causality constraint equal p1 p2; + power in p1 [6,1]; end; icon bg top figures text 'MGY' 616 336 color 0 18 bold; end; implementation eq +//EJS / Gyroscopic effects +parameters + real global I[3]; + real global m; +variables + real II[6,6]; //Inertial tensor + real Q[6,6]; + real QI[6,6]; + real Ia[6]; +initialequations + Ia[1:3] = I; + Ia[4:6] = m; + II = diag(Ia); equations - p1.e = r * p2.f; - p2.e = r * p1.f; -implementation_end; + Q = transpose(adjoint(p1.f)); + QI = Q*II; + p1.e = QI*p1.f;implementation_end; Gravity 616 400 - description ' - - 4.2 -1 - False - Bond Graph\Se.emx - 2011-11-29 16:36:49 - -'; + description '4.01False2007-9-25 12:3:26True'; type Se ports - power out p; + power out p [6,1]; restrictions causality fixed out p; end; @@ -343,27 +330,19 @@ implementation_end; end; implementation eq parameters - real effort = 1; + real global m; variables - real flow; + real effort[6]; equations + effort = [0;0;0;0;0;-g_n*m]; p.e = effort; - flow = p.f; implementation_end; InertialTensor 544 288 - description ' - - 4.2 -1 - False - Bond Graph\I.emx - 2011-11-29 15:55:55 - -'; + description '4.01False2007-9-25 12:2:12True'; type I ports - power in p; - signal out state; + power in p [6,1]; + signal out state [6,1]; restrictions causality preferred in p; end; @@ -373,10 +352,18 @@ implementation_end; end; implementation eq parameters - real i = 1; + real global I[3]; + real global m; +variables + real II[6,6]; //Inertial tensor + real Ia[6]; +initialequations + Ia[1:3] = I; + Ia[4:6] = m; + II = diag(Ia); equations - state = int(p.e); - p.f = state / i; + state = int(p.e); //state = generalized momentum + p.f = inverse(II)*state; implementation_end; plug p 472 336; plug Hin 472 496; @@ -405,19 +392,19 @@ equations collect (output) = input; implementation_end; Ta0j 544 336 - description ' - - 4.2 -1 - False - Bond Graph\OneJunction.emx - 2011-11-29 16:17:51 - -'; + description ' + 4.0 + 1 + False + Bond Graph\OneJunction.emx + 2007-9-27 9:51:18 + True + +'; knot OneJunction ports - power knot duplicatable none p [1]; - signal knot out flow [1]; + power knot duplicatable none p [6,1]; + signal knot out flow [6,1]; restrictions causality constraint one_out p; end; @@ -438,6 +425,7 @@ implementation_end; Hin -> Splitter1\input; InertialTensor\p <= Ta0j\p; p <= Ta0j\p; + Splitter1\output -> AdHi0\H; Splitter1\output -> Hout; Ta0j\p => EJS\p1; end; @@ -2980,24 +2968,6 @@ implementation_end; time - Submodel3\body_position[1] - Submodel3\body_position[2] - Submodel3\body_position[3] - Submodel3\body_angle[1] - Submodel3\body_angle[2] - Submodel3\body_angle[3] - Submodel3\dimension[1] - Submodel3\dimension[2] - Submodel3\dimension[3] - Submodel4\dimension[1] - Submodel4\dimension[2] - Submodel4\dimension[3] - Submodel4\body_angle[1] - Submodel4\body_angle[2] - Submodel4\body_angle[3] - Submodel4\body_position[1] - Submodel4\body_position[2] - Submodel4\body_position[3] new_joint1\position[1] new_joint1\position[2] new_joint1\position[3] @@ -3022,12 +2992,30 @@ implementation_end; new_joint3\position[2] rectanglepath\output[2] rectanglepath\output[1] + Submodel3\body_position[1] + Submodel3\body_position[2] + Submodel3\body_position[3] + Submodel3\body_angle[1] + Submodel3\body_angle[2] + Submodel3\body_angle[3] + Submodel3\dimension[1] + Submodel3\dimension[2] + Submodel3\dimension[3] + Submodel4\body_position[1] + Submodel4\body_position[2] + Submodel4\body_position[3] + Submodel4\body_angle[1] + Submodel4\body_angle[2] + Submodel4\body_angle[3] + Submodel4\dimension[1] + Submodel4\dimension[2] + Submodel4\dimension[3] D3DPlot - 3 + 1 false 16777215 true @@ -3646,7 +3634,7 @@ implementation_end; - -0.951853185182918 + -0.951853185182919 -0.0364571532071126 @@ -4410,7 +4398,7 @@ implementation_end; GraphPlot - 4 + 2 false 16777215 true @@ -4551,7 +4539,7 @@ implementation_end; GraphPlot - 5 + 3 false 16777215 true @@ -4697,7 +4685,7 @@ implementation_end; Window 1 0 - 4 + 2 Base @@ -4707,7 +4695,7 @@ implementation_end; Window 2 0 - 3 + 1 Base @@ -4717,7 +4705,7 @@ implementation_end; Window 3 0 - 5 + 3 Base