After being in Beta for way too long, the Arduino PID Library is ready (I think) for prime time. The new and improved PID_v1 can be downloaded here.

I made some major changes to the internal code, but what I hope the end-user notices most is that I tried to simplify things. The two biggest examples of this:

I switched to the Kp, Ki, Kd form of the PID. I still like the other version better, but this is what everyone is expecting, and it isn't really about what I want.

There are significantly fewer functions. All that's left is what's absolutely necessary to make the pid work well.

The biggest improvement this time around, and by far the most difficult, is that I've explained myself. In excruciating detail. If you want to know how and why I did things in the code, it's all there.

As always, questions and comments are greatly appreciated.

-Brett

Update: the previous PID thread became a rather unwieldy place for Q&A. In an attempt to have things be a little more organized, I've created a google group.

Yeah absolutely. If it pertains to something addressed in one the blog posts, it probably makes the most sense to post there, so I can respond in context. For more general stuff, here probably makes more sense. But no huge deal. I'm more interested in the feedback than where it's delivered.

Oh that writeup really makes the difference - To most people using the arduino platform, code without a writeup is as useful as no code - they wouldn't know how to use it and therefore wouldn't be able to.

Your writeup obviously goes into a lot more than just how to use it but that's much appreciated - educates us all

It's almost as bad as things like 'proper time'... but I can live with DIRECT - makes sure people read your documentation

I'll let you know if I find any actual issues with it rather than me nitpicking

Having worked in the process control industry I can state that the concept of direct/reverse acting controller can be hard for newcomers to grasp at first. An example might be a simple level controller for a vessel where there is a pump forcing liquid into a vessel and a PID controller reading the level and manipulating a control valve to keep the vessel level at a fixed level. Now depending on if the valve is on the inlet side to the vessel or on the outlet of the vessel will dictate with control action one requires, direct or reverse.

Also control valves come in direct and reverse acting versions and that can also require a flipping of the controller action. In the 'old days' it could be quite confusing to see one valve that would move to full open with 100% output and another valve that would move to fully closed with 100% controller output. Most control valves in industrial service have a 'fail safe' requirement defined by the process engineers for each specific control valve in the plant that would determine which way a pnumatic valve would move with a loss of all control power via internal spring force. Modern computer process control systems have kind of eleminated the confusion for the control operators such that it's always clear on the computer screen what the position of a control valve is regardless of it's control action. But of course the complexity is still where, just transfeered to the control system engineers to configure each controller properly.