New generic PID component

More
02 Oct 2019 22:35 #146908 by scotta
As part of the development of my 3D printing setup I have ported the very popular Arduino PID v1.2.1, by Bret Beauregard, controller code into a HAL component.

Why? It is a simple controller with one feature that it very useful for integrating processes, like 3D printer extruders. Proportional on Measurement. This allows for Zero overshoot to be achieved.

The component is available on my GitHub page at PIDcontroller.c

I hope others find this useful as well.
The following user(s) said Thank You: tommylight, pl7i92

Please Log in or Create an account to join the conversation.

More
03 Oct 2019 08:14 #146958 by pl7i92
Replied by pl7i92 on topic New generic PID component
thank you
can you give a quick workaround how to impplement and get it to work on stepper output
mabe a pinout discription

Please Log in or Create an account to join the conversation.

More
04 Oct 2019 02:42 - 04 Oct 2019 02:47 #147082 by scotta
Replied by scotta on topic New generic PID component
I'll put together some documentation when I have a chance. Below is an example of using Proportion on Measurement in the loop. 100% controller output giving max heating rate then with a nice glide into the set point with no overshoot needed to cancel out the integral term.



Scott
Attachments:
Last edit: 04 Oct 2019 02:47 by scotta.

Please Log in or Create an account to join the conversation.

More
04 Oct 2019 10:41 #147108 by pl7i92
Replied by pl7i92 on topic New generic PID component
so it is used for a 3D printing mashine in your case

Please Log in or Create an account to join the conversation.

More
04 Oct 2019 13:47 #147114 by Todd Zuercher
Just curious why this was needed? Why couldn't the regular PID component that comes with Linuxcnc be used? In other words what does your new PID do that the old one can't, or why is it better for your situation?

Please Log in or Create an account to join the conversation.

More
04 Oct 2019 21:22 #147140 by scotta
Replied by scotta on topic New generic PID component
The standard PID component has only the option to use Proportional on Error in the PID calculation. To avoid heating overshoot on a 3D printer extruder, Proportional on Measurement can achieve this.

From brettbeauregard.com/blog/2017/06/introdu...onal-on-measurement/

"There are processes out there that are known as “Integrating Processes.” These are processes for which the output from the pid controls the rate of change of the input. In industry these comprise a small percentage of all processes, but in the hobby world these guys are everywhere: Sous-vide, linear slide, and 3D printer extruder temperature are all examples of this type of process. "

And it works!

Scott

Please Log in or Create an account to join the conversation.

More
08 Oct 2019 05:54 #147428 by andypugh
Replied by andypugh on topic New generic PID component

scotta wrote: "There are processes out there that are known as “Integrating Processes.” These are processes for which the output from the pid controls the rate of change of the input. In industry these comprise a small percentage of all processes, but in the hobby world these guys are everywhere:


I suspect he has a very narrow view of "industry"

A couple of years ago I had the task of controlling oil pressure using a variable displacement pump where my control input was current to a proportional solenoid valve which fed the same oil into a chamber which varied the stroke of the pump. This was still contollavbe by standard PID, albeit that the P I and D terms were variable factors based on current oil pressure, pump speed and oil temperature.

I am not trying to argue that this approach is valueless, I would have to think about it a lot harder than I feel equipped to do right now. But to imagine that the hobby world is bigger than the industrial world seems naive.
The following user(s) said Thank You: Mike_Eitel

Please Log in or Create an account to join the conversation.

Time to create page: 0.124 seconds
Powered by Kunena Forum