go_away

### Author Topic: Problem with one block in Simmechanics  (Read 3542 times)

0 Members and 1 Guest are viewing this topic.

#### cortescunill

• Beginner
• Posts: 5
• Helpful? 0
##### Problem with one block in Simmechanics
« on: November 26, 2009, 11:57:33 AM »
Hello, I'm doing one program to move one cube with one joystick who needs 6 DoF, 3 of transation (x,y,z) and 3 angles for the rotation. For doing that, I'm using the joint "Bushing" in simmechanics (who gives me 6 entrances for the 6 movements). But I have an error when the simulation is started, and I search for that in the Bushing Matlab help and I founded that:

" Warning: A joint with three revolute primitives becomes singular if two or three of the rotation axes become parallel ("gimbal lock"). A joint with two or three prismatic primitives becomes singular if two or three of the translation axes become parallel. The simulation stops with errors in these cases.

A joint with three revolute primitives must be configured in the initial state with the three revolute primitive axes mutually orthogonal. There are no restrictions on the primitive axes once the simulation starts, except to prevent any two of the primitive axes from becoming parallel. "

Someone have any idea what I can do to solve this? I don`t understand where is the error.

Thank you

#### hopslink

• Robot Overlord
• Posts: 202
• Helpful? 14
##### Re: Problem with one block in Simmechanics
« Reply #1 on: November 28, 2009, 07:08:34 PM »
An interesting one... The problem comes from the fact that you are trying to implement a software object with a mechanical simulation library. The math they use for their library (Eulers angles) accurately reflects the mechanical system for rotating an object about a point in 3D (the gimbal). Eulers angles and the gimbal effectively break down under certain specific conditions, see gimbal lock on Wikipedia.

Your cube is a software object and is not subject to these restraints, thus Eulers angles is not the best math to use. One solution is to use quaternions which allow any 3D rotation mathematically.

Wikipedia's quaternions page has the pure math in all it's glory, but that makes my head hurt. There is also a quaternions and spatial rotation page, which is better (for me at least). I also came across this page >CLICKY<. See the Rotations in Three Dimensions tutorial.

Of course Matlab has official quaternion libraries available and there are GPL libraries on the web for the price of a google.

#### cortescunill

• Beginner
• Posts: 5
• Helpful? 0
##### Re: Problem with one block in Simmechanics
« Reply #2 on: December 01, 2009, 09:19:49 AM »
Hi Hopslink!! thank you for your help.

I tried to change the eulers angles for quaternions [0 0 0 1] of the orientation vector in the body and I have the same error in simulation (the singularity problem in Bushing).

Can be possible that the error comes with the initial conditions?

#### hopslink

• Robot Overlord
• Posts: 202
• Helpful? 14
##### Re: Problem with one block in Simmechanics
« Reply #3 on: December 01, 2009, 09:51:47 AM »
Sorry, It is bushing that will (quite correctly) be using Eulers angles and so will always throw this error. The quaternion solution is supposed to replace the use of bushing in the rotation of your cube.

#### cortescunill

• Beginner
• Posts: 5
• Helpful? 0
##### Re: Problem with one block in Simmechanics
« Reply #4 on: December 01, 2009, 10:06:47 AM »
And can you recomend me some block (for change Bushing block) that works with cuaternion? I tried with some others but I canĀ“t find one that works good.

Thank you

#### hopslink

• Robot Overlord
• Posts: 202
• Helpful? 14
##### Re: Problem with one block in Simmechanics
« Reply #5 on: December 01, 2009, 10:58:14 AM »
A quick look round SimMechanics suggests Six-DoF as the correct block as it uses a quaternion for rotation.

#### cortescunill

• Beginner
• Posts: 5
• Helpful? 0
##### Re: Problem with one block in Simmechanics
« Reply #6 on: December 01, 2009, 11:55:13 AM »
Yes, but I cannot use Six-DoF block because it have only 3 entrance for the translation and one for an spherical movement. I can't connect the three join actuators of the rotations to the Six-DoF block ports.

Get Your Ad Here

data_list