Stop motion in a joint in an specific desired time?

Carlos Fondevila
Carlos Fondevila Altair Community Member
edited September 17 in Community Q&A

Hello all,

Do you know if it's possible, to act with a motion (displacement, velocity or acceleration) in a joint, during only a range of time, and not in all the simulation time?

I want to move an object in vertical direction, during a time, and then, leave it drop by gravity (cancel the motion in an specific time of the simulation).

Thanks in advance!

Best Answer

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 17 Answer ✓

    Hi Carlos,

    You can change the status of a Motion by using a Template.

    In that Template, you can tell the simulation to run for a specified amount of time and then deactivate the Motion so it will no longer constrain the attached Joint. 

    The Template syntax would resemble something like the following:

    <Simulate
            analysis_type       = "Transient"
            end_time            = "10"
            print_interval      = "0.01"
            />
        <Deactivate
            element_type = "MOTION"
            element_id = "{the_model.mot_0.idstring}"
            />    

    <Simulate
            analysis_type       = "Transient"
            end_time            = "20"
            print_interval      = "0.01"
            />

    A good example can be found here:

    https://2021.help.altair.com/2021/hwdesktop/mv/topics/solvers/ms/understand_seq_sim_intro_t.htm?zoom_highlightsub=Sequential

     

    Hope this helps!

    Adam Reid

Answers

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 17 Answer ✓

    Hi Carlos,

    You can change the status of a Motion by using a Template.

    In that Template, you can tell the simulation to run for a specified amount of time and then deactivate the Motion so it will no longer constrain the attached Joint. 

    The Template syntax would resemble something like the following:

    <Simulate
            analysis_type       = "Transient"
            end_time            = "10"
            print_interval      = "0.01"
            />
        <Deactivate
            element_type = "MOTION"
            element_id = "{the_model.mot_0.idstring}"
            />    

    <Simulate
            analysis_type       = "Transient"
            end_time            = "20"
            print_interval      = "0.01"
            />

    A good example can be found here:

    https://2021.help.altair.com/2021/hwdesktop/mv/topics/solvers/ms/understand_seq_sim_intro_t.htm?zoom_highlightsub=Sequential

     

    Hope this helps!

    Adam Reid

  • Carlos Fondevila
    Carlos Fondevila Altair Community Member
    edited September 12

    Hi Carlos,

    You can change the status of a Motion by using a Template.

    In that Template, you can tell the simulation to run for a specified amount of time and then deactivate the Motion so it will no longer constrain the attached Joint. 

    The Template syntax would resemble something like the following:

    <Simulate
            analysis_type       = "Transient"
            end_time            = "10"
            print_interval      = "0.01"
            />
        <Deactivate
            element_type = "MOTION"
            element_id = "{the_model.mot_0.idstring}"
            />    

    <Simulate
            analysis_type       = "Transient"
            end_time            = "20"
            print_interval      = "0.01"
            />

    A good example can be found here:

    https://2021.help.altair.com/2021/hwdesktop/mv/topics/solvers/ms/understand_seq_sim_intro_t.htm?zoom_highlightsub=Sequential

     

    Hope this helps!

    Adam Reid

    Thank you very much Adam,

    It's the first time that I use the templates, and I write the next text:

    <Simulate

            analysis_type       = "Transient"

            end_time            = "3"

            print_interval      = "0.01"

            />

        <Dectivate

            element_type = "MOTION"

            element_id = "{mot_0.idstring}"

            />   

     

    <Simulate

            analysis_type       = "Transient"

            end_time            = "5"

            print_interval      = "0.01"

            />

    <Stop/>

    But I receive the next message when I run the simulation:

     

    image

    Can you help me?

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 12

    Thank you very much Adam,

    It's the first time that I use the templates, and I write the next text:

    <Simulate

            analysis_type       = "Transient"

            end_time            = "3"

            print_interval      = "0.01"

            />

        <Dectivate

            element_type = "MOTION"

            element_id = "{mot_0.idstring}"

            />   

     

    <Simulate

            analysis_type       = "Transient"

            end_time            = "5"

            print_interval      = "0.01"

            />

    <Stop/>

    But I receive the next message when I run the simulation:

     

    image

    Can you help me?

    Hi Carlos,

    When creating the Template, you must also set where the Template is applied, as shown in the example during Step 3 Part 2: "Set the Type as Write text to solver command file"

    If this is your first time using Templates, please follow the Tutorial provided above.

     

    Hope this helps!

    Adam Reid

  • Chris Coker_20903
    Chris Coker_20903 Altair Community Member
    edited September 12

    There is a small typo in Adam's script. "Dectivate" should be "Deactivate"

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 12

    There is a small typo in Adam's script. "Dectivate" should be "Deactivate"

    Good catch! Thanks Chris

  • Carlos Fondevila
    Carlos Fondevila Altair Community Member
    edited September 12

    Thanks all, yes, the problem was the typo mistake!

     

    I have another question, I want to activate/deactivate the friction of one joint.

    How can I type the, for example the deactivate fuction for the friction?:

    <Deactivate element_type = "JOINT" element_id   = "{<span style="color: #e03e2d;">FRICTION?&iquest;</span>}" />
  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 12

    Thanks all, yes, the problem was the typo mistake!

     

    I have another question, I want to activate/deactivate the friction of one joint.

    How can I type the, for example the deactivate fuction for the friction?:

    <Deactivate element_type = "JOINT" element_id   = "{<span style="color: #e03e2d;">FRICTION?&iquest;</span>}" />

    Hi Carlos,

    You could modify the joint instead:

    <Force_JointFriction
         id                  = "{j_0.idstring}"
         mu_static           = "0.0"
         mu_dynamic          = "0.0"

    />

    However, I'm not sure if the solver will like the 0 settings for the friction.

    I've never had to deactivate friction before as this is not very common practice.

    You may be able to achieve the same conditions with other constraints instead.

     

    Hope this helps!

    Adam Reid

  • Carlos Fondevila
    Carlos Fondevila Altair Community Member
    edited September 12

    Thanks guys, I will try your recomendations.

    My goal here is aply a "brake action" in a rotational joint, simulating the actuation of the motor brake in an specific time.

    I don't know if there are another option to simulate this, without playing with the friction/no friction of the joint in the template. You know?

    Thanks!

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 12

    Thanks guys, I will try your recomendations.

    My goal here is aply a "brake action" in a rotational joint, simulating the actuation of the motor brake in an specific time.

    I don't know if there are another option to simulate this, without playing with the friction/no friction of the joint in the template. You know?

    Thanks!

    Hi Carlos,

    Typically, braking is simulated using a torque applied to the rotating body with a STEP function.

    The independent variable is usually the rotational velocity of the body like so:

    Base Syntax: STEP(independent variable, x1,x1,x2,y2)

    STEP(rotational velocity of body, 0 rad/s, maximum braking torque Nmm, transition velocity rad/s, minimum braking torque Nmm) * braking_demand

    This way, when a braking signal is initiated, the brakes will engage and increase in braking torque until the object is stopped.

    A good example of this is found in the Sedan example model, just look for the Brake Torque (frc_brake_torque). It also takes into account the brake pad properties, so it might be overkill for your use case, but a good example nonetheless. 

     

    Hope this helps!

    Adam Reid

  • Chris Coker_20903
    Chris Coker_20903 Altair Community Member
    edited September 12

    Adam has good suggestions again.

    FWIW, I would be very careful about using joint friction unless you really have a very specific need to model friction in a joint, and you have ALL of the necessary physical properties to properly populate the friction model.  Without the right data, you will almost definitely run into robustness issues.  Attempting to use the default values will more than likely leave you frustrated.  With the right data, you will likely experience significant increase in run times as the joint friction calcs are computationally expensive.  For your application joint friction likely overkill, and Adam's suggestion to use an applied torque is very effective.  In some problem types, just a simple scalar value on the rotational velocity (creating a damping term) is good enough.

  • Carlos Fondevila
    Carlos Fondevila Altair Community Member
    edited September 13

    Thanks guys! I will test with your recommendations.

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 13

    Thanks guys! I will test with your recommendations.

    Hi Carlos,

    Not a problem, always happy to help.

    If the (now corrected) Template script worked for you, please make sure you mark the reply as correct so other Users can quickly find the same answer as well. 

     

    Thanks,

    Adam Reid

  • Carlos Fondevila
    Carlos Fondevila Altair Community Member
    edited September 13

    Hi Carlos,

    Not a problem, always happy to help.

    If the (now corrected) Template script worked for you, please make sure you mark the reply as correct so other Users can quickly find the same answer as well. 

     

    Thanks,

    Adam Reid

    Sorry Adam, I'm triying to find the way to reply as correct your answer but is not possible for me. How can I do that?

  • GTT Adam
    GTT Adam
    Altair Employee
    edited September 13

    Sorry Adam, I'm triying to find the way to reply as correct your answer but is not possible for me. How can I do that?

    Hi Carlos,

    I think it can be found in the three vertical dots next to a reply, or possibly the three vertical dots beside the post title.

     

    Thanks,

    Adam Reid

  • Carlos Fondevila
    Carlos Fondevila Altair Community Member
    edited September 16

    Hi Carlos,

    I think it can be found in the three vertical dots next to a reply, or possibly the three vertical dots beside the post title.

     

    Thanks,

    Adam Reid

    Hi Adam,

    I followed the Help guide:

    https://community.altair.com/community?id=community_blog&sys_id=0ed42df91b6f1890aa8a0f6cdc4bcb9c

     

    But I don't have this validate button.

    I wrote to Altair comunity to solve this problem, when they fix it, I will mark your responses.

    Thanks for all!