PID Controller

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lancef
    Member
    • Jul 2016
    • 31

    PID Controller

    Hello,

    I saw in the release notes that an option to implement a PID controller has been added. That's great news! Is there an example file available I could look at that makes use of this functionality?

    Thank you,
    Lance
  • maas
    Lead Code Developer
    • Nov 2007
    • 3400

    #2
    Hi Lance,

    I've attached a simple example that uses a PID controller to control a force between two rigid bodies that tries to reach a desired orientation. I realize we don't have any documentation of this feature yet. I'll try to add some soon, but here is a brief description of the parameters:

    * var: the model variable that the PID controller tracks.
    * target: the desired value of the tracked variable.
    * Kp: the scale factor for the "proportional" part of the PID controller.
    * Ki : the scale factor for the "integration" part of the PID controller.
    * Kd: the scale factor for the "derivative" part of the PID controller.

    In this example, the PID controller is attached to the f0 parameter of the "RigidConnector2" constraint, which is the actual parameter whose values is modified by the PID controller. Please take a look and let me know if you have any questions.

    Cheers,

    Steve
    Last edited by maas; 09-08-2020, 03:13 PM. Reason: (removed attachment)
    Department of Bioengineering, University of Utah
    Scientific Computing and Imaging institute, University of Utah

    Comment

    • lancef
      Member
      • Jul 2016
      • 31

      #3
      Hi Steve,

      Thanks for the quick reply. The latest version of FEBioStudio is giving the error ' unrecognized value "rigid revolute joint for attribute contraint.type" ' upon import.

      Lance

      Comment

      • maas
        Lead Code Developer
        • Nov 2007
        • 3400

        #4
        Hi Lance,

        It looks like that file had some formatting issues. I've fixed them and uploaded the new file. That said, the new load controllers, including the PID controllers, are not yet supported in FEBio Studio. I'll try to get to that soon and to make sure it stays on my radar, I've made an issue on our github page:

        Implement support for FEBio3's load controllers, including the "math" controller, and the PID controller.


        Cheers,

        Steve
        Attached Files
        Department of Bioengineering, University of Utah
        Scientific Computing and Imaging institute, University of Utah

        Comment

        • lancef
          Member
          • Jul 2016
          • 31

          #5
          Thanks, Steve! Looking forward to it.

          Lance

          Comment

          • lancef
            Member
            • Jul 2016
            • 31

            #6
            Steve,

            As a follow-up to this. Is there a resource available that lists the variables that can be interfaced with the PID controller? Or can I assume any measurable variables are compatible, such as stress in a certain element. Now that I think about it, I may want to use the peak stress in a part, or perhaps the average over the part. I'm also wondering if the PID controller can have a dynamic target that changes based on other variables. For example, can a load curve be used as the target?

            Thanks!
            Lance

            Comment

            • maas
              Lead Code Developer
              • Nov 2007
              • 3400

              #7
              Hi Lance,

              The supported variables are any model input parameter (i.e. any parameter that can be defined in the input file), and a limited number of output variables. There is another mechanism, which is currently still under development, for accessing additional output data and you could get to the element stress. (Peak stress or average stress is not yet possible, but I'll look into that.) If you could tell me a little bit more about what you are trying to do, I'll try to make a simple demo model that illustrates the approach.

              You can attach a load curve to the target parameter to make it time-dependent, but you cannot make it depend on other variables. Of course, I'm happy to look into that as well.

              Cheers,

              Steve
              Department of Bioengineering, University of Utah
              Scientific Computing and Imaging institute, University of Utah

              Comment

              • lancef
                Member
                • Jul 2016
                • 31

                #8
                Hi Steve,

                The first thing I'd like to do as assign a load curve that describes the kinematics of something. In that example file you sent me - instead of the target rotation being a set 90 degrees, I'd like to start out by having the target be a time vs position curve. I've been trying to modify the file to do that, but I don't know what the proper syntax should be to assign a load curve to the target. I've since modified that file so instead of a rigid force providing the contraction, I've put in a trans iso mooney rivlin model with active contraction and would like to control the activation curve using the PID.

                I can follow up with you either here or through email about the stress providing the feedback to the controller - that application is a bit more involved.

                Thanks!
                Lance

                Comment

                • lancef
                  Member
                  • Jul 2016
                  • 31

                  #9
                  Steve,

                  To follow-up my last post - I've successfully attached a load curve to the target parameter in the PID controller using your example file you sent me. However, I'm still unable to get the trans iso mooney rivlin model to run with its active contraction feature attached to a PID controller.

                  Lance

                  Comment

                  • maas
                    Lead Code Developer
                    • Nov 2007
                    • 3400

                    #10
                    Hi Lance,

                    Can you please send me your model (steve dot maas at utah dot edu). I'll take a look at it and see if I can get it to run.

                    Thanks,

                    Steve
                    Department of Bioengineering, University of Utah
                    Scientific Computing and Imaging institute, University of Utah

                    Comment

                    Working...
                    X
                    😀
                    😂
                    🥰
                    😘
                    🤢
                    😎
                    😞
                    😡
                    👍
                    👎