Message Boards Message Boards

0
|
15011 Views
|
35 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Stewart Platform

Posted 9 years ago

Hi, I downloaded Stewart Platform demo and I changed Long demonstration motion plan as follows:

demoMotionPlan =
  Block[{dx = 0.05, d\[Theta] = 10 \[Degree]},
   {
    {0, 0, 0, 0, 0, 0},
    {0, dx, 0, 0, 0, 0},
    {0, dx, 0, d\[Theta], 0, 0},
    {0, dx, 0, 0, 0, 0},
    {0, dx, 0, -d\[Theta], 0, 0},
    {0, dx, 0, 0, 0, 0},
    {0, dx, 0, 0, d\[Theta], 0},
    {0, dx, 0, 0, 0, 0},
    {0, dx, 0, 0, -d\[Theta], 0},
    {0, dx, 0, 0, 0, 0},
    {0, dx, 0, 0, 0, d\[Theta]},
    {0, dx, 0, 0, 0, 0},
    {0, dx, 0, 0, 0, -d\[Theta]},
    {0, dx, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0}
    }
   ];

Mathematica generates a file called PlatformPath. Only first and the third angle is calculaced correctly.

Attachments:
POSTED BY: novio8
35 Replies
Posted 9 years ago
POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago

Hi Eric, I copied your Code at the end of the Notebook. Replaced Zeroes with Offset Value and I'v received the following error: Syntax::sntxf: "legoffsets_:" cannot be followed by "{1.1313669977935081,1.1313669977935081,1.1313669977935081,1.1313669977935081,1.1313669977935081,1.1313669977935081}". Mario

POSTED BY: novio8

Hi Mario,

You can try this:

ExportMotionPlan[poses_List, legoffsets_: {0, 0, 0, 0, 0, 0}] :=
 Module[{framerate = 10, lengths, tabledata, time1, time2},
  lengths = {poses[[1, 2 ;; 7]]};
  time1 := poses[[1, 1]];

  Do[
   (
    time2 := wp[[1]];
    lengths = 
     Join[lengths, 
      Rest@PoseRange[{Last[lengths], wp[[2 ;; 7]]}, framerate, time1, 
        time2]];
    time1 = time2;
    ),
   {wp, Rest[poses]}];

  AppendTo[lengths, Last[lengths]];
  lengths = Map[PoseLegLengths, lengths];
  tabledata = 
   MapIndexed[Prepend[#, (First[#2] - 1)/framerate] &, lengths];
  {Export[
    FileNameJoin[{NotebookDirectory[], "DocumentationFiles", 
      "PlatformPath1.txt"}], {{"LegLengths", tabledata}}, 
    "ModelicaCombiTimeTable"], First[Last[tabledata]]};

  lengths = Map[# + legoffsets &, lengths];
  tabledata = 
   MapIndexed[Prepend[#, (First[#2] - 1)/framerate] &, lengths];
  {Export[
    FileNameJoin[{NotebookDirectory[], "DocumentationFiles", 
      "PlatformPath2.txt"}], {{"LegLengths", tabledata}}, 
    "ModelicaCombiTimeTable"], First[Last[tabledata]]}
  ]

I haven't tested this code, of course, because I don't have SystemModeler.

A good value to test the offsets would be -0.17035, the zero-position leg length.

Eric

POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: Updating Name
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8

Hi Mario,

I haven't been able to install SystemModeler on my old XP computer, so I don't have the elements needed to do the export. You'll have to stick to the notebook output for this discussion.

Can you re-phase your problem? Note that subtracting leg lengths will not give the motion that was originally calculated. Why do you want to do this? Or are you just verifying that the path will be different?

Generating a path from the leg lengths is called the forward kinematics. It was this problem that was difficult to solve in 1999 when I discovered that the path of the intended Stewart platform could hit the walls of the pit it was to be housed in.

Maybe you could import the path file back into Mathematica and we could work on it.

Eric

POSTED BY: Eric Johnstone
Posted 9 years ago

Hi Eric, I'm also confused about leg offsets purpose.

What I would like to do is to read PlatformPath.txt that was generated by ExportMotionPlan....

and substract initial leg length or any other arbitrary number from all of leg lengths written in file PlatformPath.txt and save it as PlatformPath 2.txt

Mario

POSTED BY: novio8

Hi Mario,

The purpose legoffsets is not documented. I'm not sure that adding a fixed length to the legs would produce the same motion in the extended actuators that the original actuators produced. For example, suppose each leg is extended 0.17035 units. The height of the platform is 0.15 units and the rest length of the legs (i.e., at neutral position) is 0.17035 units. This would presumably raise the working height of the platform to about twice its original height. But as the lengths of the actuators change, the positions of the extensions (assuming the extensions go from the platform's base to bottoms of the actuators) will change, so the previously fixed base points of the actuators will now be moving.

If actuator extensions are required they should be incorporated before the calculations are made.

For instance, suppose the platformHeight is changed to 0.3 from its original 0,15, the rest lengths are 0.17035 and 0.310675. The difference is 0.140325. If this is added to the 0.17035 lengths by using the legoffsets, the resulting motion is different.

Could someone offer and idea of what the purpose legoffsets might be?

Eric

POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: Updating Name
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago

Hi Eric, I watched Wolfram Video ScreenCast at http://www.wolfram.com/broadcast/video.php?c=202&v=835

and I'm still confused about double flip y,z and Phi.

I also want to change the number of poses per second, originally 10 to 50.

I'v changed frame rate from 10 to 50, but I get the same amount of lines in file PlatformPath.txt.

ExportMotionPlan[poses_List, legoffsets_: {0, 0, 0, 0, 0, 0}] :=

 Module[{framerate = 50, lengths, tabledata},
  lengths = {First[poses]};
  Do[lengths = 
    Join[lengths, 
     Rest@PoseRange[{Last[lengths], wp}, framerate]], {wp, 
    Rest[poses]}]; AppendTo[lengths, Last[lengths]];
  lengths = Map[PoseLegLengths, lengths];
  lengths = Map[# + legoffsets &, lengths];
  tabledata = 
   MapIndexed[Prepend[#, (First[#2] - 1)/framerate] &, 
    lengths]; {Export[
    FileNameJoin[{NotebookDirectory[], "DocumentationFiles", 
      "PlatformPath.txt"}], {{"LegLengths", tabledata}}, 
    "ModelicaCombiTimeTable"], First[Last[tabledata]]}

Mario

POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago

Hi Eric, I tested your workaround and it works. It is also unusual that z vertical is in second position,

so instead x,y,z it is x,z,y. You are right phi get's calculated only if theta is not 0.

Mario

POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
Posted 9 years ago
POSTED BY: Updating Name
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: Updating Name
Posted 9 years ago

Hi, yes it seems that Y is the vertical, which is weird and I can't figure it why. I'v run Evaluate Notebook in Mathematica only, without System Modeler running and it seems OK

It looks like PlatformPath.txt is saved in folder DocumentationFiles that has to be on the same root as Mathematica file StewartPlatform.nb

As I can see you'v saved Mathematica file in to Temp Folder

C:\Documents and Settings\Eric Johnstone\Local Settings\Temp\wz4602\StewartPlatform\DocumentationFiles\PlatformPath.txt. >>

ExportMotionPlan[poses_List, legoffsets_: {0, 0, 0, 0, 0, 0}] :=

 Module[{framerate = 10, lengths, tabledata},
  lengths = {First[poses]};
  Do[lengths = 
    Join[lengths, 
     Rest@PoseRange[{Last[lengths], wp}, framerate]], {wp, 
    Rest[poses]}]; AppendTo[lengths, Last[lengths]];
  lengths = Map[PoseLegLengths, lengths];
  lengths = Map[# + legoffsets &, lengths];
  tabledata = 
   MapIndexed[Prepend[#, (First[#2] - 1)/framerate] &, 
    lengths]; {Export[
    FileNameJoin[{NotebookDirectory[], "DocumentationFiles", 
      "PlatformPath.txt"}], {{"LegLengths", tabledata}}, 
    "ModelicaCombiTimeTable"], First[Last[tabledata]]}
  ]

Mario

POSTED BY: novio8
Posted 9 years ago

Hi Eric, I'm referring to https://www.wolfram.com/system-modeler/industry-examples/industrial-manufacturing/stewart-platform-parallel-manipulator.html Yes it uses System Modeller, but Mathematica generates Motion Data and thats what I'm after. If you look at above example you'll see where the problem is. Inverse Kinematics generates motion data from Long Demonstration Plan. Any help is appreciated especially yours as you already worked with Stewart Mechanism. Thanks Mario

POSTED BY: novio8

Hi Mario,

Which demo are you referring to? If you are using System Modeler, I won't be of much help; I've never used it. If you are interested in the Stewart Platform itself, I can be of help. (But, be warned. I'm 68 years old and took up Mathematica as a retirement project. 35 years of programming microcontrollers in C is a lot procedural thinking to get over!)

Back in 1999, I was tasked with the job of putting a Stewart mechanism in a pit in a new Posture and Gait lab. The professor insisted on buying the hydraulic actuators before the platform was designed. Using Working Model 3D, a new program that could model parallel mechanisms, I found that the Stewart Platform could hit the sides of the pit if it were to satisfy the range of motions required. So I had to invent a new mechanism.

That required learning about parallel mechanisms, and the key to understanding them is degrees of freedom.

The symmetrical design of the Stewart mechanism is not at all necessary. The actuators can be placed any-which-way as long as they aren't parallel at some point. And other degrees of freedom can be used, too. For another project, I invented a 2-degree of freedom motion base keeping x,y,z,and tau fixed.

Eric

POSTED BY: Eric Johnstone

Maybe I should leave this to the experts, but I've dug my hole now.

As above,

platformHeight=1;
relativePlatformPoints := 
 Table[{Cos[\[Theta]], Sin[\[Theta]], 0}, {\[Theta],  Range[0, 5]/6 2 Pi}]

But the RotationTransform seems to be much simpler:

PoseLegEndpoints[{x_,y_,z_,\[Theta]_,\[Phi]_,\[Tau]_}]:=
Table[
    Composition[
        TranslationTransform[{x,y,z}+{0,0,platformHeight}],
        RotationTransform[\[Theta],{1,0,0}],
        RotationTransform[\[Phi],{0,1,0}],
        RotationTransform[\[Tau],{0,0,1}]
    ]
    [p], {p,relativePlatformPoints}
]

    ListPlot3D[PoseLegEndpoints[{0,0,0,0,0,0}]//N,PlotRange->{{-1.5,1.5},{-1.5,1.5},{-1,2}}]

    Manipulate[
     ListPlot3D[
      PoseLegEndpoints[{x, y, z, \[Theta], \[Phi], \[Tau]}] // N, 
      PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1, 2}}], 
        {{x, 0}, -1, 1}, {{y, 0}, -1, 1}, {{z, 0}, -1, 1}, 
        {{\[Theta], 0}, -1, 1}, {{\[Phi], 0}, -1, 1}, {{\[Tau], 0}, -1, 1}]
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
POSTED BY: Eric Johnstone
Posted 9 years ago
POSTED BY: novio8
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract