Transition from revolute joint to contact

José Antonio_21853
José Antonio_21853 Altair Community Member
edited January 2023 in Community Q&A

Good afternoon everyone.

 

I would like to simulate a joint with two transitions:

image

 

Which command will be suitable to apply these restrictions?

Best regards.

Best Answer

  • Praful
    Praful
    Altair Employee
    edited January 2023 Answer ✓

    Hello Jose - "Is this a one sided transition ? That is initially there is a revolute joint and Distance just increases ?"

    In that case you can use a Sensor to track the Distance. Once the Distances surpasses x, the revolute joint can be deactivated and contact activated.

    The process in MotionView  would be 

    1. Create a Sensor that tracks the Distance and set it to Return when the sensor is triggered

    2. Create the revolute joint and the contact

    3. Create a Solver command template that does the following through MotionSolve xml command statements

    1. <Deactivate Contact
    2. <Simulate for some time (which is larger than when distance is expected to reach x value)
    3. Deactivate Revolute joint
    4. <Activate Contact
    5. <Simulate further
    6. Set "Scripted simulation" in Run settings

    If the part behavior would be such that the Distance goes back and forth between <x and > x, then it would need some other way of representation.

    Good luck.

    Regards

    Praful

Answers

  • Praful
    Praful
    Altair Employee
    edited January 2023 Answer ✓

    Hello Jose - "Is this a one sided transition ? That is initially there is a revolute joint and Distance just increases ?"

    In that case you can use a Sensor to track the Distance. Once the Distances surpasses x, the revolute joint can be deactivated and contact activated.

    The process in MotionView  would be 

    1. Create a Sensor that tracks the Distance and set it to Return when the sensor is triggered

    2. Create the revolute joint and the contact

    3. Create a Solver command template that does the following through MotionSolve xml command statements

    1. <Deactivate Contact
    2. <Simulate for some time (which is larger than when distance is expected to reach x value)
    3. Deactivate Revolute joint
    4. <Activate Contact
    5. <Simulate further
    6. Set "Scripted simulation" in Run settings

    If the part behavior would be such that the Distance goes back and forth between <x and > x, then it would need some other way of representation.

    Good luck.

    Regards

    Praful

  • Praful
    Praful
    Altair Employee
    edited January 2023

    Hello Jose - "Is this a one sided transition ? That is initially there is a revolute joint and Distance just increases ?"

    In that case you can use a Sensor to track the Distance. Once the Distances surpasses x, the revolute joint can be deactivated and contact activated.

    The process in MotionView  would be 

    1. Create a Sensor that tracks the Distance and set it to Return when the sensor is triggered

    2. Create the revolute joint and the contact

    3. Create a Solver command template that does the following through MotionSolve xml command statements

    1. <Deactivate Contact
    2. <Simulate for some time (which is larger than when distance is expected to reach x value)
    3. Deactivate Revolute joint
    4. <Activate Contact
    5. <Simulate further
    6. Set "Scripted simulation" in Run settings

    If the part behavior would be such that the Distance goes back and forth between <x and > x, then it would need some other way of representation.

    Good luck.

    Regards

    Praful

    Sorry, I meant to ask  "Is this a one sided transition ? That is intially there is a revolute joint and Distance just increases ?"

    Sorry for the typo

  • José Antonio_21853
    José Antonio_21853 Altair Community Member
    edited January 2023

    Hello Jose - "Is this a one sided transition ? That is initially there is a revolute joint and Distance just increases ?"

    In that case you can use a Sensor to track the Distance. Once the Distances surpasses x, the revolute joint can be deactivated and contact activated.

    The process in MotionView  would be 

    1. Create a Sensor that tracks the Distance and set it to Return when the sensor is triggered

    2. Create the revolute joint and the contact

    3. Create a Solver command template that does the following through MotionSolve xml command statements

    1. <Deactivate Contact
    2. <Simulate for some time (which is larger than when distance is expected to reach x value)
    3. Deactivate Revolute joint
    4. <Activate Contact
    5. <Simulate further
    6. Set "Scripted simulation" in Run settings

    If the part behavior would be such that the Distance goes back and forth between <x and > x, then it would need some other way of representation.

    Good luck.

    Regards

    Praful

    Hello Praful.

     

    Thanks a lot for your response.

    It is only a one side transition. The body 2 will rotate in regard to the joint and after an opening distance is reached the joint will change to contact.

    I created two markers at the following points to measure de distance between them during the opening:

    image

    With the command DM I measured the distance between them (DM(id marker 1,id marker 2)):

    image

    and compared with a defined distance:

    image

    After looking for the suitable command to activate/deactive the joint/contact I could not find a suitable one. My idea is to find an expression to activate/deactivate the joint/contact:

    image

    Is there any command to do that only with one sensor? 

    Best regards and thanks for your help in advance.

  • Praful
    Praful
    Altair Employee
    edited January 2023

    Hello Praful.

     

    Thanks a lot for your response.

    It is only a one side transition. The body 2 will rotate in regard to the joint and after an opening distance is reached the joint will change to contact.

    I created two markers at the following points to measure de distance between them during the opening:

    image

    With the command DM I measured the distance between them (DM(id marker 1,id marker 2)):

    image

    and compared with a defined distance:

    image

    After looking for the suitable command to activate/deactive the joint/contact I could not find a suitable one. My idea is to find an expression to activate/deactivate the joint/contact:

    image

    Is there any command to do that only with one sensor? 

    Best regards and thanks for your help in advance.

    Hello Jose 

    You should be able to deactivate the joint using

    <Deactivate

    element_type = "JOINT"

    element_id = "joint id"

    />

    E.g. If I presume the variable name of the joint to be j_rev, then you can have something like this:

    <Deactivate

    element_type = "JOINT"

    element_id = "{j_rev.id}"

    />

    Similarly, contact can be deactivated using

    <Deactivate

    element_type = "CONTACT"

    element_id = "contact id"

    />

    Few more pointers

    1. You may want to use a DX or DY or DZ function if the criteria is vertical distance.

    2. Set the response to "Return to command file" in the Response tab

    3. You should also deactivate the sensor first when it gets triggered. else, the sensor being active, gets triggered continuously.

     

    Your command template could look something like this.



    <Deactivate

    element_type = "CONTACT"

    element_id = "{con_1.id}"

    />

    <Simulate

    &nbsp;analysis_type = "Transient"

    end_time = "5.0"

    print_interval = "0.01"

    />

    <!-- Deactivate sensor on trigger and deactivate joint -->

    <Deactivate

    element_type = "SENSOR"

    element_id = "{sensor.id}"

    />

    <Deactivate

    element_type = "JOINT"

    element_id = "{j_rev.id}"

    />

    <!-- Activate contact -->

    <Activate

    element_type = "CONTACT"

    element_id = "{con_1.id}"

    />

    <Simulate

    &nbsp;analysis_type = "Transient"

    end_time = "10.0"

    print_interval = "0.01"

    />

    <Stop/>

    <!-- Deactivate contact first -->
  • José Antonio_21853
    José Antonio_21853 Altair Community Member
    edited January 2023

    Hello Jose - "Is this a one sided transition ? That is initially there is a revolute joint and Distance just increases ?"

    In that case you can use a Sensor to track the Distance. Once the Distances surpasses x, the revolute joint can be deactivated and contact activated.

    The process in MotionView  would be 

    1. Create a Sensor that tracks the Distance and set it to Return when the sensor is triggered

    2. Create the revolute joint and the contact

    3. Create a Solver command template that does the following through MotionSolve xml command statements

    1. <Deactivate Contact
    2. <Simulate for some time (which is larger than when distance is expected to reach x value)
    3. Deactivate Revolute joint
    4. <Activate Contact
    5. <Simulate further
    6. Set "Scripted simulation" in Run settings

    If the part behavior would be such that the Distance goes back and forth between <x and > x, then it would need some other way of representation.

    Good luck.

    Regards

    Praful

    Hi Praful.

    Thanks a lot for your support. It helped me a lot.

    Now I am facing an issue with the simulation.

    I attached an image with the code sequence. As I could check, the distance between markers reaches the defined distance (10) and then the sensor triggers. At this point the simulation stops and does not continue with the sequence. 

    Do you have an idea why it does not continue?

    Best regards and thank you in advance.

     

     

     

     

     

     

  • Praful
    Praful
    Altair Employee
    edited January 2023

    Hi Praful.

    Thanks a lot for your support. It helped me a lot.

    Now I am facing an issue with the simulation.

    I attached an image with the code sequence. As I could check, the distance between markers reaches the defined distance (10) and then the sensor triggers. At this point the simulation stops and does not continue with the sequence. 

    Do you have an idea why it does not continue?

    Best regards and thank you in advance.

     

     

     

     

     

     

    Hi Jose

    Could you please share the log file ? and if possible, the model itself? How is the part rotating ? If its a motion on the joint, that may what is troubling after the joint deactivation !

    If you have concerns about confidentiality of your model, please use the filedrop link below to share the model securely. It will be treated as confidential.

    Regards

    Praful

    Sr. Program Manager MotionView

    Altair

    FileDrop

     

  • José Antonio_21853
    José Antonio_21853 Altair Community Member
    edited January 2023

    Hi Jose

    Could you please share the log file ? and if possible, the model itself? How is the part rotating ? If its a motion on the joint, that may what is troubling after the joint deactivation !

    If you have concerns about confidentiality of your model, please use the filedrop link below to share the model securely. It will be treated as confidential.

    Regards

    Praful

    Sr. Program Manager MotionView

    Altair

    FileDrop

     

    Hello Praful.

    I decided to run the simulation removing the transition from revolute joint to a contact and using finally only a contact and removing the revolute joint.

    The result was acceptable so I will stay in this path.

    Thanks a lot for your support.

    Best regards.