Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Analog PID controller from scratch

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
Analog PID controller designed from scratch in a very long journey of trying, failing and learning. It seems, anyway, that I managed to get some reasonable results.

The controller.JPG


Tested today for temperature on the simplest possible plant.

The plant and sensor.JPG


The actuator

The actuator.JPG


The first test in P mode only, maintained a steady difference wrt the setpoint. A second test now in PI mode, added a bit of I. Results below.

Since the details and values had been changing until yesterday, I intend to show a tidy schematic maybe during the next week.

I feel good today. Yes!!
 

Attachments

  • PI controller - 1st tests.pdf
    9.1 KB · Views: 254
Great work!

Gracias Steve

Attached here is the block diagram I had in mind to design the circuit whose schematic follows. Since it is a work in progress, I am not going to comment in detail.

The idea of a windows riding the setpoint, seemed to me a simple and good way to avoid integrator windup in the initial stage immediately after a step change in the setpoint. If that proves to be ridiculous, bear with me. I had to literally learn from scratch most of what you see here. I feared diferentiators / integrators as much as interrupts in micros in the past.

Just two names: Walt G. Jung and Ron Mancini. Thanks to them I solved many many doubts.

-------------------------------------------------------------------------------------------------------

Next step is to test the controller as a full PID, including the derivative component.

In case you think I "tuned" this somehow, really I did NOT: I elected a first, random setting for the Kp's pot and then another one for Ki's pot when doing the PI test. Just sheer luck. That's it.

Later I would like to characterize this so as to try it on a different plant to do a predictable tuning or an attempt at least.

Comment: I noticed some unreasonable quick changes in values that suggest maybe the necessity of better decoupling. Sure I have to work on that.

Enjoyed (and enjoying) the journey.
 

Attachments

  • PID controller 01.pdf
    28.6 KB · Views: 232
With my controller somewhat working, yesterday I rerun tests for P and PI modes still using radnom Kp & Ki values.

I do it manually, reading error and current through the resistor (plant) every 30 seconds. I am afraid I am going to use lot of time. My question:

In a plant, in real life, with processes involving big volumes, the actual calibration, how is it done? Actual tests, could take days, isn't it?

As an example, the PI test took 36 minutes and I had to stop it because of my work. BTW, the graph later showed a nice damped graph with the first two peaks just 7 minutes apart.

Not that I want to skip steps but I have not that much of time all the time.:( Lazy people is said to be sometimes intelligent.

Suggestions accepted and thanked in advance.
 
Actual tests, could take days, isn't it?
Depends very much on the time constants of the processes being controlled. I've no experience of PID control, but I'd hazard a guess that you'd need a test period an order of magnitude greater than the time constant, or the period of any cyclic process.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top