News for hackers. Stuff that matters.
Re:PID Without a PhD (2016) [pdf] by BeetleB on Tuesday January 30, 2018 @09:54PM (#16270960)
Oh wow, this brings back memories. I almost wonder if you're the person who sponsored my senior design project.

We were given something almost identical to this, and the customer wanted a control algorithm. I had taken control theory, but there were two problems:

1. A lot of undergrad control theory assumes linear systems.

2. They almost always give you the transfer function.

Our system was likely nonlinear and we had no transfer function.

For simple physical systems, you can use basic physics to derive it. For anything else, figuring out the transfer function is a whole course in itself. I went to the control theory professor and asked for tips and he said "Forget it, it's way beyond the scope of a senior design project. I have students who do it for their MS project". Unfortunately, I couldn't convince the course's professor, and my grade suffered.

Oh well, you learn more in failure and all...

Re:PID Without a PhD (2016) [pdf] by wenc on Wednesday January 31, 2018 @10:18AM (#16274467)
1. Yes, but linear controllers can be applied to nonlinear systems given criteria I listed in a comment above.

2. Yes, but the transfer function is usually only to simulate the system in Simulink or some such software. In the real-world, you never have the transfer function.

So how do people do it?

You either identify the transfer function model using step/impulse tests (covered in undergrad courses and not that hard to do -- the least sophisticated way is to just measure the response to a step and graphically estimate parameters K and tau; it gives you a good starting point), or you can tune a controller by hand starting with a tuning heuristic and then refining. https://en.wikipedia.org/wiki/PID_controller#Loop_tuning

More advanced ways of identifying the transfer function is to collect data (either using pseudorandom binary sequence, i.e. PRBS step tests, or just simple plant step tests) and then doing "system identification", that is, fitting a transfer function model via statistical methods. Matlab's System Identification toolbox is designed for this purpose.

I suspect your course professor did not specialize in control, and/or doesn't have real world experience. This is not unusual of course. Faculty are often assigned courses to teach, and some of these courses are outside their area of expertise.

Re:PID Without a PhD (2016) [pdf] by BeetleB on Thursday February 01, 2018 @10:38AM (#16282573)
>You either identify the transfer function model using step/impulse tests

This is what I tried (step, not impulse). Did not work well. The result was too dependent on the "starting position".

The course professor probably knew less about controls than I did. He was a computer engineering professor.

Re:PID Without a PhD (2016) [pdf] by wenc on Friday February 02, 2018 @11:25AM (#16291759)
> The result was too dependent on the "starting position".

PID controllers always control around a nominal operating point (which you pick), which is why deviation variables are typically used in the mathematical derivation. That's just the basis of the control algorithm.