(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 15437, 377] NotebookOptionsPosition[ 14951, 354] NotebookOutlinePosition[ 15355, 372] CellTagsIndexPosition[ 15312, 369] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Stewart platform", "Title", CellChangeTimes->{{3.530311179294653*^9, 3.530311182154022*^9}}], Cell["Leo Singer", "Subtitle", CellChangeTimes->{{3.530311186748274*^9, 3.530311188507012*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Zeta]a", ",", "\[Zeta]b", ",", "a", ",", "b", ",", "R"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"R", ":=", RowBox[{ RowBox[{"RotationMatrix", "[", RowBox[{"\[Alpha]", ",", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "]"}], ".", RowBox[{"RotationMatrix", "[", RowBox[{"\[Beta]", ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0"}], "}"}]}], "]"}], ".", RowBox[{"RotationMatrix", "[", RowBox[{"\[Gamma]", ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Zeta]a", "[", "i_", "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"\[LeftFloor]", FractionBox["i", "2"], "\[RightFloor]"}], FractionBox[ RowBox[{"2", "\[Pi]"}], "3"]}], "-", RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"-", "1"}], ")"}], "i"], "\[Alpha]a"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Zeta]b", "[", "i_", "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"\[LeftCeiling]", FractionBox["i", "2"], "\[RightCeiling]"}], FractionBox[ RowBox[{"2", "\[Pi]"}], "3"]}], "-", FractionBox["\[Pi]", "3"], "+", RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"-", "1"}], ")"}], "i"], "\[Alpha]b"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "[", "i_", "]"}], ":=", RowBox[{"ra", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"\[Zeta]a", "[", "i", "]"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"\[Zeta]a", "[", "i", "]"}], "]"}], ",", "0"}], "}"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"b", "[", "i_", "]"}], ":=", RowBox[{"rb", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"\[Zeta]b", "[", "i", "]"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"\[Zeta]b", "[", "i", "]"}], "]"}], ",", "0"}], "}"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Graphics3D", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "[", "i", "]"}], ",", RowBox[{ RowBox[{"R", ".", RowBox[{"a", "[", "i", "]"}]}], "+", RowBox[{"{", RowBox[{"x", ",", "y", ",", "z"}], "}"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "6"}], "}"}]}], "]"}], ",", "0.05"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", RowBox[{"-", "0.05"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}]}], "}"}], ",", RowBox[{"1.25", "rb"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Opacity", "[", "0.5", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y", ",", "z"}], "}"}], ",", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y", ",", "z"}], "}"}], "+", RowBox[{"R", ".", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0.05"}], "}"}]}]}]}], "}"}], ",", RowBox[{"1.25", "ra"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.05"}], ",", "3"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"ImageSize", "\[Rule]", "Large"}]}], "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ra", ",", "0.5", ",", "\"\\""}], "}"}], ",", "0", ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"rb", ",", "1", ",", "\"\\""}], "}"}], ",", "0", ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "\[Alpha]a", ",", "0.1", ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"\[Pi]", "/", "6"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "\[Alpha]b", ",", "0.1", ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"\[Pi]", "/", "6"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "0", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"y", ",", "0", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"z", ",", "1", ",", "\"\\""}], "}"}], ",", "0", ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Gamma]", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"2", "\[Pi]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Beta]", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"2", "\[Pi]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Alpha]", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"2", "\[Pi]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}]], "Input",\ CellChangeTimes->{{3.5303096216867867`*^9, 3.53030963773503*^9}, { 3.5303098358605137`*^9, 3.530310453888473*^9}, {3.5303105333454847`*^9, 3.530310675208489*^9}, {3.53031071042642*^9, 3.530310824229653*^9}, { 3.530310941394858*^9, 3.5303109459495792`*^9}, {3.5303109949026747`*^9, 3.530311001369411*^9}, {3.530311038261388*^9, 3.530311137749013*^9}, { 3.5303112179766703`*^9, 3.530311226851071*^9}, {3.530311266124857*^9, 3.530311283479385*^9}, {3.530311324813944*^9, 3.530311335852027*^9}, 3.530311376573741*^9, {3.530311419386866*^9, 3.530311432602409*^9}, { 3.531751264191276*^9, 3.531751269488648*^9}, {3.532702502139804*^9, 3.53270251638266*^9}}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`ra$$ = 0.5, $CellContext`rb$$ = 1, $CellContext`x$$ = 0, $CellContext`y$$ = 0, $CellContext`z$$ = 1, $CellContext`\[Alpha]$$ = 0, $CellContext`\[Alpha]a$$ = 0.1, $CellContext`\[Alpha]b$$ = 0.1, $CellContext`\[Beta]$$ = 0, $CellContext`\[Gamma]$$ = 0, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`ra$$], 0.5, "Top platform radius"}, 0, 2}, {{ Hold[$CellContext`rb$$], 1, "Bottom platform radius"}, 0, 2}, {{ Hold[$CellContext`\[Alpha]a$$], 0.1, "Top platform joint separation angle"}, 0, Rational[1, 6] Pi}, {{ Hold[$CellContext`\[Alpha]b$$], 0.1, "Bottom platform joint separation angle"}, 0, Rational[1, 6] Pi}, {{ Hold[$CellContext`x$$], 0, "x displacement"}, -2, 2}, {{ Hold[$CellContext`y$$], 0, "y displacement"}, -2, 2}, {{ Hold[$CellContext`z$$], 1, "z displacement"}, 0, 2}, {{ Hold[$CellContext`\[Gamma]$$], 0, "yaw"}, 0, 2 Pi}, {{ Hold[$CellContext`\[Beta]$$], 0, "pitch"}, 0, 2 Pi}, {{ Hold[$CellContext`\[Alpha]$$], 0, "roll"}, 0, 2 Pi}}, Typeset`size$$ = {576., {247., 251.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`ra$353737$$ = 0, $CellContext`rb$353738$$ = 0, $CellContext`\[Alpha]a$353739$$ = 0, $CellContext`\[Alpha]b$353740$$ = 0, $CellContext`x$353741$$ = 0, $CellContext`y$353742$$ = 0, $CellContext`z$353743$$ = 0, $CellContext`\[Gamma]$353744$$ = 0, $CellContext`\[Beta]$353745$$ = 0, $CellContext`\[Alpha]$353746$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`ra$$ = 0.5, $CellContext`rb$$ = 1, $CellContext`x$$ = 0, $CellContext`y$$ = 0, $CellContext`z$$ = 1, $CellContext`\[Alpha]$$ = 0, $CellContext`\[Alpha]a$$ = 0.1, $CellContext`\[Alpha]b$$ = 0.1, $CellContext`\[Beta]$$ = 0, $CellContext`\[Gamma]$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`ra$$, $CellContext`ra$353737$$, 0], Hold[$CellContext`rb$$, $CellContext`rb$353738$$, 0], Hold[$CellContext`\[Alpha]a$$, $CellContext`\[Alpha]a$353739$$, 0], Hold[$CellContext`\[Alpha]b$$, $CellContext`\[Alpha]b$353740$$, 0], Hold[$CellContext`x$$, $CellContext`x$353741$$, 0], Hold[$CellContext`y$$, $CellContext`y$353742$$, 0], Hold[$CellContext`z$$, $CellContext`z$353743$$, 0], Hold[$CellContext`\[Gamma]$$, $CellContext`\[Gamma]$353744$$, 0], Hold[$CellContext`\[Beta]$$, $CellContext`\[Beta]$353745$$, 0], Hold[$CellContext`\[Alpha]$$, $CellContext`\[Alpha]$353746$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`\[Zeta]a$, $CellContext`\[Zeta]b$, \ $CellContext`a$, $CellContext`b$, $CellContext`R$}, $CellContext`R$ := Dot[ RotationMatrix[$CellContext`\[Alpha]$$, {1, 0, 0}], RotationMatrix[$CellContext`\[Beta]$$, {0, 1, 0}], RotationMatrix[$CellContext`\[Gamma]$$, {0, 0, 1}]]; $CellContext`\[Zeta]a$[ Pattern[$CellContext`i$, Blank[]]] := Floor[$CellContext`i$/2] (2 Pi/ 3) - (-1)^$CellContext`i$ $CellContext`\[Alpha]a$$; $CellContext`\ \[Zeta]b$[ Pattern[$CellContext`i$, Blank[]]] := Ceiling[$CellContext`i$/2] (2 Pi/3) - Pi/ 3 + (-1)^$CellContext`i$ $CellContext`\[Alpha]b$$; $CellContext`a$[ Pattern[$CellContext`i$, Blank[]]] := $CellContext`ra$$ { Cos[ $CellContext`\[Zeta]a$[$CellContext`i$]], Sin[ $CellContext`\[Zeta]a$[$CellContext`i$]], 0}; $CellContext`b$[ Pattern[$CellContext`i$, Blank[]]] := $CellContext`rb$$ { Cos[ $CellContext`\[Zeta]b$[$CellContext`i$]], Sin[ $CellContext`\[Zeta]b$[$CellContext`i$]], 0}; Graphics3D[{ Cylinder[ Table[{ $CellContext`b$[$CellContext`i], Dot[$CellContext`R$, $CellContext`a$[$CellContext`i]] + {$CellContext`x$$, \ $CellContext`y$$, $CellContext`z$$}}, {$CellContext`i, 1, 6}], 0.05], Cylinder[{{0, 0, -0.05}, {0, 0, 0}}, 1.25 $CellContext`rb$$], Opacity[0.5], Cylinder[{{$CellContext`x$$, $CellContext`y$$, $CellContext`z$$}, \ {$CellContext`x$$, $CellContext`y$$, $CellContext`z$$} + Dot[$CellContext`R$, {0, 0, 0.05}]}, 1.25 $CellContext`ra$$]}, PlotRange -> {{-3, 3}, {-3, 3}, {-0.05, 3}}, ImageSize -> Large]], "Specifications" :> {{{$CellContext`ra$$, 0.5, "Top platform radius"}, 0, 2}, {{$CellContext`rb$$, 1, "Bottom platform radius"}, 0, 2}, {{$CellContext`\[Alpha]a$$, 0.1, "Top platform joint separation angle"}, 0, Rational[1, 6] Pi}, {{$CellContext`\[Alpha]b$$, 0.1, "Bottom platform joint separation angle"}, 0, Rational[1, 6] Pi}, {{$CellContext`x$$, 0, "x displacement"}, -2, 2}, {{$CellContext`y$$, 0, "y displacement"}, -2, 2}, {{$CellContext`z$$, 1, "z displacement"}, 0, 2}, {{$CellContext`\[Gamma]$$, 0, "yaw"}, 0, 2 Pi}, {{$CellContext`\[Beta]$$, 0, "pitch"}, 0, 2 Pi}, {{$CellContext`\[Alpha]$$, 0, "roll"}, 0, 2 Pi}}, "Options" :> {}, "DefaultOptions" :> {}], ImageSizeCache->{1011., {273., 278.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{{3.530311080680951*^9, 3.5303111381963177`*^9}, { 3.530311227362523*^9, 3.5303112738670473`*^9}, 3.5303113363838453`*^9, 3.530311373043755*^9, {3.5303114276993017`*^9, 3.5303114671220217`*^9}, 3.5317512719757767`*^9, {3.532702517106938*^9, 3.5327025307444687`*^9}}] }, Open ]] }, Open ]] }, WindowToolbars->"EditBar", WindowSize->{1153, 1123}, WindowMargins->{{Automatic, 53}, {Automatic, 0}}, ShowSelection->True, FrontEndVersion->"8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (October 5, \ 2011)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 99, 1, 76, "Title"], Cell[681, 25, 96, 1, 46, "Subtitle"], Cell[CellGroupData[{ Cell[802, 30, 7587, 200, 494, "Input"], Cell[8392, 232, 6531, 118, 568, "Output"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)