Adding a control system to a mechanical model

Ironman123
Ironman123 Altair Community Member
edited November 15 in Community Q&A

I have this Linkage:

I would like the linkage pointed out to act as a cylinder. In the position it currently is, the cylinder should be fully compressed, and it should push outwords:

Currently, I have it as a prismatic joint but I need a cylinder to move it back and forth, I tried using the hydraulic blocks with a simple sin wave, or the actuation block but am not able to get it to work. Can someone help me on how I can add a hydraulic control system in this?

This is something else I also tried, but no luck:

I have attached my file.

Thanks!

Answers

  • GTT Adam
    GTT Adam
    Altair Employee
    edited November 15

    Hi @Ironman123,

    For this type of 4-bar linkage, have you considered using an alternative application like Inspire or MotionView? The construction will likely be easier to visualize. An actuator can be added as well to drive the motion as described. If there is to be a control system involved, you can still use Twin Activate in a cosimulation to drive certain components as needed.

    Video:

    Model:

    I quickly mocked up your model using Inspire with some generic values. They can be updated easily using the Variable Manager to reflect your actual sizes.

    Hope this helps!


    Adam Reid

  • Orestis_YB
    Orestis_YB
    Altair Employee

    Hi @Ironman123,

    I would also suggest @GTT Adam's solution on using Inspire. You'll see its full benefits when handling more complex assemblies with lots of bodies and connections.

    Having said that, let's see your model! In order to apply any motion on a joint you need to activate the useAxisFlange option in the parameters of the joint. Then you can attach to it a motion component for example. I updated your model to use the position input in which you need to also check the useSupport parameter and properly connect it to the relative joint.

    I rearranged the model so it looks more like the mechanism. I see also that you are using two body components in cases that you want to add a joint in between. It's working fine but just FYI you can have a body and then use FixedTranslation component to add the joint in the middle of the body. Check the Engine 1a example under Demo Browser (press F6 to bring it up) → Modelica → Mechanical → Loops.


    I've attached the updated model.



    Hope this helps!

    Best regards,
    Orestes.

  • Ironman123
    Ironman123 Altair Community Member

    Hey Orestis_YB

    Thank you so much for your model! I have taken the model and have connected it to an open loop cylinder system as so, and it works great!:

    However, when I combine it with a closed loop PID system, it gives me a PID error (even though the system works fine just by itself in another tab:

    Please let me know if you can help with this!! @Orestis_YB

  • Orestis_YB
    Orestis_YB
    Altair Employee

    Hey @Ironman123,

    the error states that P is not defined. I guess that there are some gains inside the PID block using variables. These variables need to be defined in model initialization script.

    Here you can find Twin Activate Introduction e-Learning. There is a dedicated chapter to model parametrization where you can see how to properly define variables to be used in block parameters.
    Hope this helps!

    Best regards,
    Orestes