4.8 0 False C:\users\wouter\My Documents\studie\ma\mahd\implementation\SCARA\01_kinematics\kinematics.emx 2020-7-10 15:12:13 '; type Mainmodel end; implementation bg submodels Differentiate 432 256 description '4.01False Signal\Block Diagram\Differentiate.emx 2007-9-26 12:9:46 '; type 'Differentiate-Default' ports signal in input; signal out output; end; icon bg bottom figures group rectangle 416 240 448 272 color 0 fill 15132390; text 'd/dt' 432 256 color 16711680 13 bold; end; end; implementation eq parameters real initial = 0; // initial value equations output = ddt (input, initial); implementation_end; Differentiate1 432 112 description '4.01False Signal\Block Diagram\Differentiate.emx 2007-9-26 12:9:46 '; type 'Differentiate-Default' ports signal in input; signal out output; end; icon bg bottom figures group rectangle 416 96 448 128 color 0 fill 15132390; text 'd/dt' 432 112 color 16711680 13 bold; end; end; implementation eq parameters real initial = 0; // initial value equations output = ddt (input, initial); implementation_end; inverse_kinematics 312 184 description ' 4.8 SCARA\inverse_kinematics_v1.emx 1 False 2020-7-10 12:26:18 False '; 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; kinematics 536 184 description '4.0 Template\Submodel-Equation.emx 1 False 2007-11-1 22:32:1 False '; type 'Submodel-Equation' ports signal in angle1; signal in angle2; end; implementation eq parameters real global A_length = 0.065; real global B_length = 0.05; variables real joint1[2]{m}; real joint2[2]{m}; real end_effector[2]{m}; equations joint1 = A_length*[cos(angle1);sin(angle1)]; joint2 = B_length*[cos(angle2);sin(angle2)]; end_effector = joint1 + joint2; implementation_end; rectanglepath 136 184 description ' 4.8 setpoint\rectanglepath.emx 1 False 2020-7-10 12:30:38 False '; 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.01;0.03] {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; Splitter1 432 200 description '4.0 Signal\Block Diagram\Splitter.emx 2008-01-17 11:28:29 1 False '; knot Splitter ports signal knot duplicatable out output [1]; signal knot in input [1]; end; icon bg ellipse figures ellipse 428.8 196.8 435.2 203.2 color -1 fill 0; ellipse 427.7 195.7 436.3 204.3 color -1; terminals input 432 200 fixed; end; implementation eq equations collect (output) = input; implementation_end; Splitter2 432 176 description '4.0 Signal\Block Diagram\Splitter.emx 2008-01-17 11:28:29 1 False '; knot Splitter ports signal knot duplicatable out output [1]; signal knot in input [1]; end; icon bg ellipse figures ellipse 428.8 172.8 435.2 179.2 color -1 fill 0; ellipse 427.7 171.7 436.3 180.3 color -1; terminals input 432 176 fixed; end; implementation eq equations collect (output) = input; implementation_end; end; connections inverse_kinematics\angle1 -> Splitter1\input; inverse_kinematics\angle2 -> Splitter2\input; rectanglepath\output -> inverse_kinematics\input; Splitter1\output -> Differentiate\input; Splitter1\output -> kinematics\angle1; Splitter2\output -> Differentiate1\input; Splitter2\output -> kinematics\angle2; end; implementation_end; ]]> Experiment 1 4.8 time kinematics\end_effector[2] kinematics\joint1[2] kinematics\end_effector[1] kinematics\joint1[1] rectanglepath\output[1] rectanglepath\output[2] rectanglepath\test1 rectanglepath\test2 rectanglepath\test3 Constant\output[1] Constant\output[2] rectanglepath\origin[1] rectanglepath\origin[2] rectanglepath\w rectanglepath\h inverse_kinematics\angle1 inverse_kinematics\angle2 Differentiate\output Differentiate1\output GraphPlot 1 false 16777215 true true 15780518 12624260 0 10 10 10 false 16777215 true 1 model true Arial 12 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 Arial 10 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 true true false -0.03999969673692048 0.08000000000000007 true 3 0.009999999999999992 0.10999999999999999 true 2 0.0 5.0 true 2 0.0 5.0 true 2 3355111 1 3355111 0 true 1 1 1 true true kinematics\end_effector[1] true kinematics\end_effector[2] 6076255 1 6076255 0 true 1 1 1 true true kinematics\joint1[1] true kinematics\joint1[2] 12553035 1 12553035 0 true 1 1 1 true true Constant\output[1] true Constant\output[2] true 0 16777215 GraphPlot 2 false 16777215 true true 15780518 12624260 0 10 10 10 false 16777215 true 1 model(1) true Arial 12 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 Arial 10 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 true true false 0.0 1.2 true 3 -3.469446951953614e-18 0.09999999999999999 true 2 -4.0 1.0 true 2 -4.0 1.0 true 2 -4.0 1.0 true 2 -4.0 1.0 true 2 3355111 1 3355111 0 true 1 1 1 true true time true rectanglepath\output[1] 6076255 1 6076255 0 true 1 1 1 true true time true rectanglepath\output[2] 12553035 1 12553035 0 true 1 1 1 true true time true rectanglepath\test1 15086320 1 15086320 0 true 1 1 1 true true time true rectanglepath\test2 15790150 1 15790150 0 true 1 1 1 true true time true rectanglepath\test3 true 0 16777215 D3DPlot 3 false 16777215 true 3D Animation 137 true false 4294967295 Gradients\BlueWhite.png true 1.0 1.0 1 1 1 true Reference Frame Bryant false false false false false false 1 1 1 false Default Lights and Cameras Bryant false false false false false false false Ambient 1 1 Direct3D false false false false false false 0 0.3 0.3 0.3 1 1 1 true 0.3 0.3 0.3 1 1 1 true true false false false Parallel -3 5 3 0.457495710997814 -0.762492851663023 -0.457495710997814 0.235379601434674 -0.392299335724456 0.889211827642101 Direct3D false false false false false false 3 0.5 0.5 0.5 1 1 1 true 1.0 0.0 0.0 0.5 0.5 0.5 1 1 1 true 0.5 0.5 0.5 1 1 1 true false true true false Spot Light 1 -3 -5 1 0.50709255283711 0.845154254728517 -0.169030850945703 0.0869656553478673 0.144942758913112 0.985610760609162 Direct3D false false false false false false 2 0.5 0.5 0.5 1 1 1 true 1.0 0.05 0.05 1.0471975511965976 1.0471975511965976 0.0 0.5 0.5 0.5 1 1 1 true 0.5 0.5 0.5 1 1 1 true false true true false Spot Light 2 2 -3 -1 -0.534522483824849 0.801783725737273 0.267261241912424 0.14824986333222 -0.22237479499833 0.963624111659432 Direct3D false false false false false false 2 1 1 1 1 1 1 true 1.0 0.05 0.05 1.5707963267948966 1.5707963267948966 0.0 1 1 1 1 1 1 true 0.5 0.5 0.5 1 1 1 true false true true false Camera Looking at Origin 4.35387542422191 -1.03177117653434 3.945815567335 -0.729811191908371 0.172948942896729 -0.661410830963772 -0.643586272446143 0.152515563910921 0.750023808077992 Direct3D false false false false false false 0.01 100.0 true 0.003926990816987242 45.0 -10.0 10.0 10.0 -10.0 true true 1 true true false false Front(XY)-Camera 10 -1 1 Direct3D false false false false false false 0.01 100.0 true 9.999999999999998 45.0 -9.999999999999998 9.999999999999998 9.999999999999998 -9.999999999999998 true true 1 true false false false Side(YZ)-Camera 9.99973746487942 0.555944228939501 0.542469812062668 -0.999973746487937 0.00440557710604975 0.00575301879373315 0.00575296296112807 -2.53457873294314e-005 0.999983451250449 Direct3D false false false false false false 0.01 100.0 true 1.8901386620278369 45.0 -1.8901386620278369 1.8901386620278369 1.8901386620278369 -1.8901386620278369 true 0.599999999999999 0.6 true 1 true false true false Top(XZ)-Camera 10 -1 1 Direct3D false false false false false false 0.01 100.0 true 9.999999999999998 45.0 -9.999999999999998 9.999999999999998 9.999999999999998 -9.999999999999998 true true 1 true false false 10 10 10 false Scenery Bryant false false false false false false 3.0 kinematics\joint1[1] 0.023995909562154565 kinematics\joint1[2] 0.06040857823426156 15 true false 1 1 1 true 0.447058823529412 0.113725490196078 0.945098039215686 1.0 1 1 1 true 0.5 0.5 0.5 15 false false Line Bryant false false false false false false 3.0 kinematics\end_effector[1] 0.06999782466573422 kinematics\end_effector[2] 0.08000000000000002 15 true false 1 1 1 true 0.243137254901961 0.0392156862745098 0.945098039215686 1.0 1 1 1 true 0.5 0.5 0.5 15 false false Line kinematics\joint1[1] 0.023995909562154565 kinematics\joint1[2] 0.06040857823426156 Bryant false false false false false false 1 1 1 false Square -0.001 rectanglepath\origin[1] 0.01 rectanglepath\origin[2] 0.03 -1.5707963267949 Bryant false false false false false false true 1.0 1.0 true 20 rectanglepath\h 0.05 rectanglepath\w 0.07 1 true 1 1 1 1.0 1 1 1 true 0.498039215686275 0.498039215686275 0.498039215686275 14.298713684082 false false Square Bryant false false false false false false GraphPlot 5 false 16777215 true true 15780518 12624260 0 10 10 10 false 16777215 true 1 Plot true Arial 12 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 Arial 10 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 true true false 0.0 1.2 true 3 -25.0 25.0 true 2 0.0 10.0 true 2 3355111 1 3355111 0 true 1 1 1 true true time true inverse_kinematics\angle1 12553035 1 12553035 0 true 1 1 1 true true time true Differentiate\output true 0 16777215 GraphPlot 4 false 16777215 true true 15780518 12624260 0 10 10 10 false 16777215 true 1 model(2) true Arial 12 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 Arial 10 34 400 0 0 0 0 Arial 12 34 400 0 0 0 0 true true false 0.0 1.2 true 3 -30.0 20.0 true 2 -2.0 3.0 true 2 6076255 1 6076255 0 true 1 1 1 true true time true inverse_kinematics\angle2 15086320 1 15086320 0 true 1 1 1 true true time true Differentiate1\output true 0 16777215 1 true Window 1 0 1 2 Base 2 true Window 2 0 3 Base 3 true Window 3 0 5 4 Base 0.108854 0.0953704 0.701562 0.813889 0.194792 0.208333 0.811458 0.790741 0.254688 0.165741 0.833333 0.786111 0.0 1.2 false false false false 0.1 1.0e-6 1.0e-7 false true Euler 0.01 false BackwardEuler 1.0e-5 1.0e-5 1.0e-5 1.0e-5 0.01 1.0 AdamsBashforth 0.01 false RungeKutta2 0.01 false RungeKutta4 0.01 false RungeKutta8 false 0.0 false 0.0 1.0e-6 1.0e-6 0.9 0.33 6.0 0.0 false 100000 false 1000 RungeKuttaFehlberg false 0.0 false 0.0 1.0e-6 1.0e-6 VodeAdams false 0.0 false 0.0 1.0e-6 1.0e-6 true true BDFMethod 1.0e-5 1.0e-5 1.0e-5 1.0e-5 false 0.0 false 0.0 MeBDFiMethod 1.0e-5 1.0e-5 1.0e-5 1.0e-5 false 0.0 false 0.0 8 10 false true true false true 0 0.0 true MultipleRun true UseEndValue 0.001 BroydonFletcherGoldfarbShanno true true true true false 1.0