Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Creating new algorithm like PID

  1. Feb 24, 2015 #1
    I have come across this Proportional Integral- Derivative( PID) control theory. I feel that it is highly beneficial and accurate. I want to create a new algorithm which is more accurate, faster, efficient than PID. Also it should be easily programmable in microcontroller. So what are the prerequisites/ learning materials for a beginner like me.
    Also, I have heard that we have to mathematically prove that a control algorithm converges to a defined value when applied repeatedly. Could you please provide details about the rigorous math needed.
  2. jcsd
  3. Feb 25, 2015 #2
    Sounds like a thesis at least.
  4. Feb 25, 2015 #3
    No it is not a thesis but I want to create a more efficient algorithm for microcontroller applications.
  5. Feb 25, 2015 #4
    I'm saying to be able to do that, it would be worth a thesis for a masters probably even a doctorates. You're not going to magically create a better way of doing it unless you know a lot of math and understand many proofs, even then I'm sure it would take a whole lot of research.
  6. Feb 25, 2015 #5


    User Avatar

    Staff: Mentor

    What is your level of education so far? You will need at least a background in Control Theory, and a strong background in programming microcontrollers of different kinds. A strong background in Digital Signal Processing (DSP) would also be important to have.
  7. Feb 26, 2015 #6
    I am doing bachelor's in engineering. What are the topics to be learnt in DSP?( I have a little background)
  8. Feb 27, 2015 #7
    Don't you think that if it was achievable for someone at your education level to create a new general purpose control algorithm more efficient than PID that it would have been done a thousand times already?

    Why do you need a more efficient control algorithm? If you have a specific application in mind you might be able to create a specialized algorithm that could outperform a basic PID controller for that specific application.
  9. Mar 2, 2015 #8
    Yes, it may take time but will be rewarding. What will be more rewarding if we could control the process efficiently with our own algorithm?

    I want to create a new algorithm which can be used for all applications. If PID control can be proved to converge / be stable, why can't we play with some other function involving error variable and play with it ?

    Also what are the conditions which should be proved?
  10. Mar 2, 2015 #9
    If by efficient you mean quick, there isn't a more efficient algorithm than PID. If efficiency is measured in terms of more accurately regulating the output, There are many other types of feedback control mechanisms that do that better. However, PID is about the simplest you can get with any decent amount of control (PID for me includes PD and PI). Even though microcontrollers can do many more operations per second than they could 10 years ago, you'll still have to use some simplifying assumptions to make it run in real-time. Thus, you're traveling in the direction of PID.

    The only thing more rewarding than writing the algorithm is actually implementing it in a real project. It seems you haven't tried seriously building a controller that even has used PID, because even a simple smooth-running inverted pendulum like the Segway is pretty hard.

    Good luck. There are many control techniques that assume a great many things. For example, not all systems can be said to be LTI (linear time-invariant), which a few techniques assume. Many aren't even linear. There are many control theorists (with PhDs even) that want to come up with that "perfect algorithm", but it's harder than you think.

    All PID loops are NOT stable. In fact, it's very easy for the integrator to cause the system to be unstable. Seems you need to do a bit more reading about feedback control and stability criteria.
  11. Mar 3, 2015 #10

    jim mcnamara

    User Avatar

    Staff: Mentor

    As a rule of thumb - (Ignoring the correctness aspect (proofs), which is very bad) algorithms account for a large part of the efficiency of code. You can add small tweaks to localize data for example. This may improve efficiency by a few percent. However. The more tweaks you add the more likely you will likely lose correctness, lose control of program state, or just plain crash. But you will very definitely lose code readability.

    Based on the way you have asked your questions I would suggest you need way more experience with control theory and software engineering. Not trying to deter you, I am trying to prevent you from wasting your time in an exercise that we can believe will frustrate you. A lot. Today. You need more background. Later, then go for it.!
    Last edited: Mar 4, 2015
  12. Mar 3, 2015 #11


    User Avatar
    2017 Award

    Staff: Mentor

    You underestimate the effort that has been put in research.
    This has been done. With hundreds, probably thousands of different approaches, with researchers that had years to decades of experience in the field. And the result of all this research is PID (and several other methods).
  13. Mar 4, 2015 #12
    Even getting a PID controller set up can be very annoying.
    An undergrad project I worked on was getting a wind tunnel to work at a constant velocity, we read about PID loops and how to choose the parameters.
    Even then we wasted an awful lot of time trying to get a reasonably stable velocity.

    Perhaps a good way to start is building a small experiment to become acquainted with the pitfalls of setting up and the disadvantages of a PID loop.
  14. Mar 4, 2015 #13
    Shannons Theorem.
  15. Mar 7, 2015 #14


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    If you have an interest in PID, then control laws are for you. Aero engineering will have classes in it. Browse a few books on the subject. PID is just the tip of the iceberg. There are multiple input / multiple output systems, nonlinear systems, systems with randomness, classical systems using Laplace transformations, and modern systems using eigenstructures, different types of stability and convergence, -- just to name a few areas of study.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook