Issue with Animation Rotation Block – Incorrect Axis Behavior and Direction

Started by Lino.castanheira, July 01, 2025, 04:42:47 PM

Previous topic - Next topic

Lino.castanheira

I am experiencing an issue with the animation rotation block in Machines Simulator when using analog values to control the rotation.

Problem Description:
•   When I send odd analog values, the object rotates counter-clockwise (CCW).
•   When I send even analog values, it rotates clockwise (CW).
•   Sometimes, instead of rotating around the defined Y axis, the object rotates around the Z axis, even though I have explicitly selected the Y axis in the animation settings.
•   Changing the axis in the animation block does not consistently apply — the rotation often defaults to the Z axis regardless of the selection.
This behavior is inconsistent and seems to depend on the numeric value rather than the axis or direction specified.
What I've Tried:
•   Manually selecting different rotation axes in the animation block.
•   Using both positive and negative analog values.
•   Restarting the software and reloading the simulation.

I would appreciate your guidance or a fix for this issue. Please let me know if any additional information is needed.

EasyPLC_Master


Lino.castanheira

The issue can be reproduced in the project file Portbridge.maq, where the affected rotation axis is axis 5.
As a complement, I am also attaching a short video that demonstrates the behavior clearly.

video:
https://1drv.ms/v/c/1b9f117c3594b4b3/EYjQuC66XShFjUVxz3_TSrwBJMGYgk3PP2DySZKrxP4HTQ?e=FYTSgE

EasyPLC_Master

The problem you're experiencing is because rotations are local, not global.
This means that if you rotate a component along an axis, but it has a parent component that already has a rotation, the rotation will be local to the child component relative to the parent. Therefore, if the parent component has a rotation, change the child's coordinate axis.
To avoid this, you can do two things:
-> Or change the child's coordinate axis. That is, if you want to rotate in Y, change it to Z or X so that the rotation is relative to the inherited axis.
-> Do not modify the rotations of the parent components. You can leave the parent component unrotated and rotate only the 3D model associated with the component.

We were unable to verify your program because you haven't attached the UDC component it uses.


Lino.castanheira

How can I solve this situation without modifying the parent components? Could you show me a visual example to better understand how to work around this issue? I'd prefer not to change the links/connections."

Lino.castanheira

I've realised that to mitigate the issue, I set all the parent and child local axes to be the same, and that solved the problem.
Shouldn't the rotation be applied relative to the current object, regardless of the parent's axis?
Otherwise, if I'm not careful, I could experience the same issue again.
Since I don't fully understand how the parent-to-child inheritance system works, I'll stick with this method for now.

EasyPLC_Master

OK, you applied a good approach to solve the problem.
There's no simple solution, as it involves mathematical calculations involving many case studies.
We'll look for alternatives for future versions.
Thanks for the suggestions.