Announcement

Collapse
No announcement yet.

DoMore PID loops with LERPs

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • DoMore PID loops with LERPs

    I have a project where I need to servo control two linear actuators and am looking at using PIDs. What's different is the second servo is "slaved" to the first meaning the position (PV) of the first servo determines the command setpoint (SP) of the second. This sounds like a perfect use of the LERP function in the DoMore.

    Can I use LERP to feed the SP variable in a PID loop? Also, I'm also guessing that I need to run the LERP instruction immediately before the PID instruction?


  • #2
    I thought I answered this earlier...sorry.

    Yes, absolutely.

    Comment



    • #3
      Thanks BobO.

      You may have answered another poster and I didn't search back far enough.

      Comment



      • #4
        Originally posted by stgislander View Post
        Thanks BobO.

        You may have answered another poster and I didn't search back far enough.
        No. I had written the response, got distracted, and never posted it. Squirrel!

        To add to this, if the relationship between Loop1.PV and Loop2.SP isn't linear, LERP is a great tool for implementing the non-linear function.

        Comment



        • #5
          Thanks again BobO.

          One additional questions since it's on the subject of PIDs.

          I do not see where/how does one tells the PID structure where the setpoint (SP) data comes from. I'm looking at the PID - Closed Loop Controller explanation and I don't see it. I can see in the "Scale to" and "Scale from" windows that I can select location PV comes from and Output goes. Would I use something like the MAPIO instruction to copy the location where the SP value is, for example R0, into MyPID.SP?

          Comment



          • #6
            Originally posted by stgislander View Post
            Thanks again BobO.

            One additional questions since it's on the subject of PIDs.

            I do not see where/how does one tells the PID structure where the setpoint (SP) data comes from. I'm looking at the PID - Closed Loop Controller explanation and I don't see it. I can see in the "Scale to" and "Scale from" windows that I can select location PV comes from and Output goes. Would I use something like the MAPIO instruction to copy the location where the SP value is, for example R0, into MyPID.SP?
            The PV and Output scales are built into the box to simplify going to and from physical I/O (since that is most likely for them), but we don't do that with the SP because it could come from many possible locations...HMI, math calculation, Output of another PID, communications from another PLC, etc. MOVE, COPY, MATH, MAPIO, SCALE, LERP are all perfectly acceptable ways of stuffing MyLoop.SP.

            You might also take a look at the process simulator built into the Do-more simulator. There is an FAQ with a step-by-step walk through: https://www.hosteng.com/FAQFiles/Do-more.htm#FAQ0041

            Comment



            • #7
              Once again... thanks BobO.

              Comment

              Working...
              X