4.80FalseC:\users\wouter\My Documents\studie\ma\mahd\implementation\submodel\SCARA\spike\inverse_kinematics.emx2020-7-9 16:58:55
';
type Mainmodel
end;
implementation bg
submodels
inverse_kinematics 352 184
description '4.0Template\Submodel-Equation.emx1False2007-11-1 22:32:1False';
type 'Submodel-Equation'
ports
signal in input [2,1] {m} ;
signal out angle1 {rad} ;
signal out angle2 {rad} ;
signal out a {rad} ;
signal out b {rad} ;
signal out c {rad} ;
signal out phi {rad} ;
end;
implementation eq
parameters
real global A_length; // length of first arm
real global B_length; // length of second arm
real to_rad = 1 {rad};
variables
real x {m}, y {m};
real C_length {m}; // length to x and y.
real angle_sum {rad}; // test angle
equations
x = input[1];
y = input[2];
phi = atan2(y, x);
C_length = sqrt(x^2 + y^2);
a = arccos ((B_length^2 + C_length^2 - A_length^2) / (2 * B_length * C_length));
b = arccos ((A_length^2 + C_length^2 - B_length^2) / (2 * A_length * C_length));
c = arccos ((A_length^2 + B_length^2 - C_length^2) / (2 * A_length * B_length));
angle1 = b + phi;
angle2 = angle1 - pi * to_rad + c;
implementation_end;
rectanglepath 112 184
description '4.0Template\Submodel-Equation.emx1False2007-11-1 22:32:1False';
type 'Submodel-Equation'
ports
signal out output [2,1];
end;
implementation eq
/*
This will generate coordinates for the box that has to be drawn
*/
parameters
real w = 0.07{m} ;
real h = 0.05 {m};
real t = 1 {s};
real origin[2] = [0.05,0.05]{m};
variables
real v {m/s};
real t_w {s};
real t_h {s};
real period {s};
real test1, test2, test3;
initialequations
v = (2*w + 2*h)/t;
t_w = w / v;
t_h = h / v;
equations
period = floor(time / t) * t;
output[1] = v*(ramp(period+t_h) - ramp(period + t_w+t_h) - ramp(period + t_w + t_h + t_h)) + origin[1];
output[2] = v*(ramp(period) - ramp(period + t_h) - ramp(period + t_h + t_w) + ramp(period + 2 * t_h + t_w))+ origin[2];
implementation_end;
Submodel2 560 184
description '4.0Template\Submodel-Equation.emx1False2007-11-1 22:32:1False';
type 'Submodel-Equation'
ports
signal in angle1;
signal in angle2;
end;
implementation eq
parameters
real global A;
real global B;
variables
real joint1[2]{m};
real joint2[2]{m};
real end_effector[2]{m};
equations
joint1 = A*[cos(angle1);sin(angle1)];
joint2 = B*[cos(angle2);sin(angle2)];
end_effector = joint1 + joint2;
implementation_end;
end;
connections
inverse_kinematics\angle1 -> Submodel2\angle1;
inverse_kinematics\angle2 -> Submodel2\angle2;
rectanglepath\output -> inverse_kinematics\input;
end;
implementation_end;
]]>
Experiment 14.8timeSubmodel2\end_effector[2]Submodel2\joint1[2]Submodel2\end_effector[1]Submodel2\joint1[1]rectanglepath\output[1]rectanglepath\output[2]rectanglepath\test1rectanglepath\test2rectanglepath\test3Constant\output[1]Constant\output[2]GraphPlot1false16777215truetrue15780518126242600101010false16777215true1modeltrueArial12344000000Arial12344000000Arial10344000000Arial12344000000truetruefalse-0.0499999310629048040.12000000000000034true30.0199999999999999970.12true20.05.0true20.05.0true23355111133551110true111truetrueSubmodel2\end_effector[1]trueSubmodel2\end_effector[2]6076255160762550true111truetrueSubmodel2\joint1[1]trueSubmodel2\joint1[2]125530351125530350true111truetrueConstant\output[1]trueConstant\output[2]true016777215GraphPlot2false16777215truetrue15780518126242600101010false16777215true1model(1)trueArial12344000000Arial12344000000Arial10344000000Arial12344000000truetruefalse0.040.0true30.030.13true2-4.01.0true2-4.01.0true2-4.01.0true2-4.01.0true23355111133551110true111truetruetimetruerectanglepath\output[1]6076255160762550true111truetruetimetruerectanglepath\output[2]125530351125530350true111truetruetimetruerectanglepath\test1150863201150863200true111truetruetimetruerectanglepath\test2157901501157901500true111truetruetimetruerectanglepath\test3true016777215D3DPlot3false16777215true3D Animation137truefalse4294967295Gradients\BlueWhite.pngtrue1.01.0111trueReference FrameBryantfalsefalsefalsefalsefalsefalse111falseDefault Lights and CamerasBryantfalsefalsefalsefalsefalsefalsefalseAmbient11Direct3Dfalsefalsefalsefalsefalsefalse00.30.30.3111true0.30.30.3111truetruefalsefalsefalseParallel-3530.457495710997814-0.762492851663023-0.4574957109978140.235379601434674-0.3922993357244560.889211827642101Direct3Dfalsefalsefalsefalsefalsefalse30.50.50.5111true1.00.00.00.50.50.5111true0.50.50.5111truefalsetruetruefalseSpot Light 1-3-510.507092552837110.845154254728517-0.1690308509457030.08696565534786730.1449427589131120.985610760609162Direct3Dfalsefalsefalsefalsefalsefalse20.50.50.5111true1.00.050.051.04719755119659761.04719755119659760.00.50.50.5111true0.50.50.5111truefalsetruetruefalseSpot Light 22-3-1-0.5345224838248490.8017837257372730.2672612419124240.14824986333222-0.222374794998330.963624111659432Direct3Dfalsefalsefalsefalsefalsefalse2111111true1.00.050.051.57079632679489661.57079632679489660.0111111true0.50.50.5111truefalsetruetruefalseCamera Looking at Origin5.17039612254131-0.7212799664593812.88738681298299-0.8666791281711140.120903365560907-0.483993455522493-0.4793516529247630.06687045556074020.875071617075652Direct3Dfalsefalsefalsefalsefalsefalse0.01100.0true0.00392699081698724245.0-10.010.010.0-10.0truetrue1truetruetruefalseFront(XY)-Camera10-11Direct3Dfalsefalsefalsefalsefalsefalse0.01100.0true9.99999999999999845.0-9.9999999999999989.9999999999999989.999999999999998-9.999999999999998truetrue1truefalsefalsefalseSide(YZ)-Camera10-11Direct3Dfalsefalsefalsefalsefalsefalse0.01100.0true9.99999999999999845.0-9.9999999999999989.9999999999999989.999999999999998-9.999999999999998truetrue1truefalsefalsefalseTop(XZ)-Camera10-11Direct3Dfalsefalsefalsefalsefalsefalse0.01100.0true9.99999999999999845.0-9.9999999999999989.9999999999999989.999999999999998-9.999999999999998truetrue1truefalsefalse101010falseSceneryBryantfalsefalsefalsefalsefalsefalse3.0Submodel2\joint1[1]-0.0011199998032978117Submodel2\joint1[2]0.0999937278055007115truefalse111true1111.0111true0.50.50.515falsefalseLineBryantfalsefalsefalsefalsefalsefalse3.0Submodel2\end_effector[1]0.09888000000000007Submodel2\end_effector[2]0.0999999999999999215truefalse111true1111.0111true0.50.50.515falsefalseLineSubmodel2\joint1[1]-0.0011199998032978117Submodel2\joint1[2]0.09999372780550071Bryantfalsefalsefalsefalsefalsefalse1trueWindow 1012Base2trueWindow 203Base
0.411979 0.22037 0.885938 0.85
0.0703125 0.135185 0.686979 0.717593
0.010.0falsefalsefalsefalse0.11.0e-61.0e-7falsetrueEuler0.01falseBackwardEuler1.0e-51.0e-51.0e-51.0e-50.011.0AdamsBashforth0.01falseRungeKutta20.01falseRungeKutta40.01falseRungeKutta8false0.001false1.01.0e-61.0e-60.90.336.00.0false100000false1000RungeKuttaFehlbergfalse0.001false1.01.0e-61.0e-6VodeAdamsfalse0.001false1.01.0e-61.0e-6truetrueBDFMethod1.0e-51.0e-51.0e-51.0e-5false0.001false1.0MeBDFiMethod1.0e-51.0e-51.0e-51.0e-5false0.001false1.0810falsetruetruefalsetrue00.0trueMultipleRuntrueUseEndValue0.001BroydonFletcherGoldfarbShannotruetruetruetruefalse