rotate to a certain degree

Asked by nobody on 2020-01-29

Hi all,

I want to put a shaft into a soil sample with a vertical velocity and a rotational velocity at the same time.

I know that Rotationengine and Helixengine can rotate an object.

Right now I can rotate the shaft a full round.

I'm wondering if we can rotate the shaft back and forth. for instance, rotate in a clockwise direction for 300 degrees and then 100 degrees in the anticlockwise direction. while keeping the vertical speed all the time.

I didn't find any parameters in Rotationengine and Helixengine can set the directions and the degrees.

could you please give me some suggestions?

thanks!
Yong

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
2020-01-29
Last query:
2020-01-29
Last reply:
2020-01-29
Jérôme Duriez (jduriez) said : #1

Hi,

The shaft has its movements 100% controlled by yourself ?
If yes, you can look at https://yade-dev.gitlab.io/trunk/user.html#motion-constraints

Jérôme

Best Jan Stránský (honzik) said : #2

> I didn't find any parameters in Rotationengine and Helixengine can set the directions and the degrees.

RotationEngine.angularVelocity
positive / negative value change the sense of rotation w.r.t. rotation axis

"the degrees" is a more tricky, you will have to check regularly the state (probably something like b.state.ori) and change the angluarVelocity at suitable times/values.

cheers
Jan

nobody (nobody01) said : #3

Hi Jerome,

Yeah, the movement of the shaft is controlled by myself. I want the shaft rotates, for instance, 300 degrees in a clockwise direction and then 100 degrees in a counterclockwise direction.

In your opinion, Body.dynamic can control this?

best,
Yong

nobody (nobody01) said : #4

Hi Jan,

Do you mean that we can use B.state.ori to calculate the orientation, which means rotation degree, regularly and check the calculated rotation degree and compare it with the value that I want?

best,
Yong

Jan Stránský (honzik) said : #5

> Body.dynamic can control this?

no, it would have opposite effect - the motion would be influenced by interactions

> Do you mean that we can use B.state.ori to calculate the orientation, which means rotation degree, regularly and check the calculated rotation degree and compare it with the value that I want?

yes, exactly

cheers
Jan

nobody (nobody01) said : #6

Thanks Jan Stránský, that solved my question.