Ohmyus

15 Reputation

One Badge

0 years, 166 days

MaplePrimes Activity


These are replies submitted by Ohmyus

@Carl Love thank you for your tips. I've tried to follow your suggestions, and now Maple no longer stays calculating for a very long time, but instead outputs [ ] as the solution for my system. Here's the worksheet and again, thank you very much for the help.

 

This document is for figuring out the transformation necessary to get the spacemouse working

restart

Defining the rotation matrix. T is a linearized version assuming small angles, but it's not used.

L := Matrix(3, 3, {(1, 1) = cos(theta)*cos(psi), (1, 2) = cos(theta)*sin(psi), (1, 3) = -sin(theta), (2, 1) = sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi), (2, 2) = sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi), (2, 3) = sin(phi)*cos(theta), (3, 1) = cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi), (3, 2) = cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi), (3, 3) = cos(phi)*cos(theta)}); T := Matrix(3, 3, {(1, 1) = 1, (1, 2) = psi, (1, 3) = -theta, (2, 1) = phi*theta-psi, (2, 2) = phi*psi*theta+1, (2, 3) = phi, (3, 1) = phi*psi+theta, (3, 2) = psi*theta-phi, (3, 3) = 1})

Matrix(3, 3, {(1, 1) = cos(theta)*cos(psi), (1, 2) = cos(theta)*sin(psi), (1, 3) = -sin(theta), (2, 1) = sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi), (2, 2) = sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi), (2, 3) = sin(phi)*cos(theta), (3, 1) = cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi), (3, 2) = cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi), (3, 3) = cos(phi)*cos(theta)})

 

Matrix(%id = 36893490965311603164)

(1)

P_ni is the position vector of a point on the top plate before the transformation, described by a parameter rho_n

p[ni] := Typesetting[delayDotProduct](R, Vector(3, {(1) = cos(rho[n]), (2) = -sin(rho[n]), (3) = 0}), true)

Vector[column](%id = 36893490965311580268)

(2)

p__n := L.p[ni]+(Vector(3, {(1) = u, (2) = v, (3) = w}))

Vector[column](%id = 36893490965311563044)

(3)

Now that p_ni has been transformed and p_n is the transformed point, m_m is the position vector of a point on the bottom plate. These points are not moving at all, and each one is described by a parameter mu_m

m[m] := R*(Vector(3, {(1) = cos(`μ__m`), (2) = -sin(`μ__m`), (3) = h/R}))

Vector[column](%id = 36893490965244196612)

(4)

with(LinearAlgebra)

[`&x`, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CARE, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, CompressedSparseForm, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, FromCompressedSparseForm, FromSplitForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, ProjectionMatrix, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm, SingularValues, SmithForm, SplitForm, StronglyConnectedBlocks, SubMatrix, SubVector, SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix, Trace, Transpose, TridiagonalForm, UnitVector, VandermondeMatrix, VectorAdd, VectorAngle, VectorMatrixMultiply, VectorNorm, VectorScalarMultiply, ZeroMatrix, ZeroVector, Zip]

(5)

Here the distance between the points on the top plate and the bottom plate is calculated, and the distance is left as a function of all the problem's variables and each leg's parameters: ρ_n and μ_n.

`Δp` := p__n-m[m]

Vector[column](%id = 36893490965243727012)

(6)

with(VectorCalculus)

[`&x`, `*`, `+`, `-`, `.`, `<,>`, `<|>`, About, AddCoordinates, ArcLength, BasisFormat, Binormal, ConvertVector, CrossProduct, Curl, Curvature, D, Del, DirectionalDiff, Divergence, DotProduct, Flux, GetCoordinateParameters, GetCoordinates, GetNames, GetPVDescription, GetRootPoint, GetSpace, Gradient, Hessian, IsPositionVector, IsRootedVector, IsVectorField, Jacobian, Laplacian, LineInt, MapToBasis, Nabla, Norm, Normalize, PathInt, PlotPositionVector, PlotVector, PositionVector, PrincipalNormal, RadiusOfCurvature, RootedVector, ScalarPotential, SetCoordinateParameters, SetCoordinates, SpaceCurve, SurfaceInt, TNBFrame, TangentLine, TangentPlane, TangentVector, Torsion, Vector, VectorField, VectorPotential, VectorSpace, Wronskian, diff, eval, evalVF, int, limit, series]

(7)

s[n] := sqrt(`&Delta;p`.`&Delta;p`)

((cos(theta)*cos(psi)*R*cos(rho[n])-cos(theta)*sin(psi)*R*sin(rho[n])+u-R*cos(mu__m))^2+((sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos(rho[n])-(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin(rho[n])+v+R*sin(mu__m))^2+((cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos(rho[n])-(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin(rho[n])+w-h)^2)^(1/2)

(8)

Here the parameters for each leg are defined, and with these values, each leg is given it's distance.

rho[1] := -(1/12)*Pi; rho[2] := (1/12)*Pi; rho[3] := 2*Pi*(1/3)-(1/12)*Pi; rho[4] := (1/12)*Pi+2*Pi*(1/3); rho[5] := 4*Pi*(1/3)-(1/12)*Pi; rho[6] := 4*Pi*(1/3)+(1/12)*Pi

-(1/12)*Pi

 

(1/12)*Pi

 

(7/12)*Pi

 

(3/4)*Pi

 

(5/4)*Pi

 

(17/12)*Pi

(9)

mu[1] := 0; mu[2] := 2*Pi*(1/3); mu[3] := 4*Pi*(1/3)

0

 

(2/3)*Pi

 

(4/3)*Pi

(10)

s[1] := eval(s[n], {`&mu;__m` = mu[1], rho[n] = rho[1]})

((cos(theta)*cos(psi)*R*cos((1/12)*Pi)+cos(theta)*sin(psi)*R*sin((1/12)*Pi)+u-R)^2+((sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos((1/12)*Pi)+(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin((1/12)*Pi)+v)^2+((cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos((1/12)*Pi)+(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin((1/12)*Pi)+w-h)^2)^(1/2)

(11)

s[2] := eval(s[n], {`&mu;__m` = mu[1], rho[n] = rho[2]})

((cos(theta)*cos(psi)*R*cos(rho[m])-cos(theta)*sin(psi)*R*sin(rho[m])+u-R*cos(mu__m))^2+((sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos(rho[m])-(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin(rho[m])+v+R*sin(mu__m))^2+((cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos(rho[m])-(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin(rho[m])+w-h)^2)^(1/2)

(12)

s[3] := eval(s[n], {`&mu;__m` = mu[2], rho[n] = rho[3]})

((-cos(theta)*cos(psi)*R*cos((5/12)*Pi)-cos(theta)*sin(psi)*R*sin((5/12)*Pi)+u+(1/2)*R)^2+(-(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos((5/12)*Pi)-(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin((5/12)*Pi)+v+(1/2)*R*3^(1/2))^2+(-(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos((5/12)*Pi)-(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin((5/12)*Pi)+w-h)^2)^(1/2)

(13)

s[4] := eval(s[n], {`&mu;__m` = mu[2], rho[n] = rho[4]})

((-(1/2)*cos(theta)*cos(psi)*R*2^(1/2)-(1/2)*cos(theta)*sin(psi)*R*2^(1/2)+u+(1/2)*R)^2+(-(1/2)*(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*2^(1/2)-(1/2)*(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*2^(1/2)+v+(1/2)*R*3^(1/2))^2+(-(1/2)*(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*2^(1/2)-(1/2)*(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*2^(1/2)+w-h)^2)^(1/2)

(14)

s[5] := eval(s[n], {`&mu;__m` = mu[3], rho[n] = rho[5]})

((-(1/2)*cos(theta)*cos(psi)*R*2^(1/2)+(1/2)*cos(theta)*sin(psi)*R*2^(1/2)+u+(1/2)*R)^2+(-(1/2)*(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*2^(1/2)+(1/2)*(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*2^(1/2)+v-(1/2)*R*3^(1/2))^2+(-(1/2)*(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*2^(1/2)+(1/2)*(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*2^(1/2)+w-h)^2)^(1/2)

(15)

s[6] := eval(s[n], {`&mu;__m` = mu[3], rho[n] = rho[6]})

((-cos(theta)*cos(psi)*R*cos((5/12)*Pi)+cos(theta)*sin(psi)*R*sin((5/12)*Pi)+u+(1/2)*R)^2+(-(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos((5/12)*Pi)+(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin((5/12)*Pi)+v-(1/2)*R*3^(1/2))^2+(-(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos((5/12)*Pi)+(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin((5/12)*Pi)+w-h)^2)^(1/2)

(16)

equations := [-d[1]^2+s[1]^2 = 0, -d[2]^2+s[2]^2 = 0, -d[3]^2+s[3]^2 = 0, -d[4]^2+s[4]^2 = 0, -d[5]^2+s[5]^2 = 0, -d[6]^2+s[6]^2 = 0]

[(cos(theta)*cos(psi)*R*cos((1/12)*Pi)+cos(theta)*sin(psi)*R*sin((1/12)*Pi)+u-R)^2+((sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos((1/12)*Pi)+(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin((1/12)*Pi)+v)^2+((cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos((1/12)*Pi)+(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin((1/12)*Pi)+w-h)^2-d[1]^2 = 0, -d[2]^2+s[2]^2 = 0, (-cos(theta)*cos(psi)*R*cos((5/12)*Pi)-cos(theta)*sin(psi)*R*sin((5/12)*Pi)+u+(1/2)*R)^2+(-(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos((5/12)*Pi)-(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin((5/12)*Pi)+v+(1/2)*R*3^(1/2))^2+(-(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos((5/12)*Pi)-(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin((5/12)*Pi)+w-h)^2-d[3]^2 = 0, (-(1/2)*cos(theta)*cos(psi)*R*2^(1/2)-(1/2)*cos(theta)*sin(psi)*R*2^(1/2)+u+(1/2)*R)^2+(-(1/2)*(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*2^(1/2)-(1/2)*(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*2^(1/2)+v+(1/2)*R*3^(1/2))^2+(-(1/2)*(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*2^(1/2)-(1/2)*(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*2^(1/2)+w-h)^2-d[4]^2 = 0, (-(1/2)*cos(theta)*cos(psi)*R*2^(1/2)+(1/2)*cos(theta)*sin(psi)*R*2^(1/2)+u+(1/2)*R)^2+(-(1/2)*(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*2^(1/2)+(1/2)*(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*2^(1/2)+v-(1/2)*R*3^(1/2))^2+(-(1/2)*(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*2^(1/2)+(1/2)*(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*2^(1/2)+w-h)^2-d[5]^2 = 0, (-cos(theta)*cos(psi)*R*cos((5/12)*Pi)+cos(theta)*sin(psi)*R*sin((5/12)*Pi)+u+(1/2)*R)^2+(-(sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi))*R*cos((5/12)*Pi)+(sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi))*R*sin((5/12)*Pi)+v-(1/2)*R*3^(1/2))^2+(-(cos(phi)*sin(theta)*cos(psi)+sin(psi)*sin(phi))*R*cos((5/12)*Pi)+(cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi))*R*sin((5/12)*Pi)+w-h)^2-d[6]^2 = 0]

(17)

variables := [u, v, w, psi, theta, phi]

[u, v, w, psi, theta, phi]

(18)

parameters := [d[1], d[2], d[3], d[4], d[5], d[6]]

[d[1], d[2], d[3], d[4], d[5], d[6]]

(19)

solve(equations, variables)

[]

(20)
 

NULL

Download FiguringThingsOut.mw

@C_R, first of all, excuse me for not writing things down clearly. I'm not sure wether my application is the forward or inverse kinematics. 

I do want to simulate a Stewart platform, but instead of calculating the length of each leg given the desired position of the platform, I want to calculate the postion and rotation of the platform given the length of each leg. If that is the forward kinematics problem then I got it wrong on the original question and will correct it. Here's an image of the problem, so it can be understood more easily. Also, I will add the Maple worksheet to the original post.

Page 1 of 1