Electronic – How to infer equivalent PID controller coefficients from an existing black box ccontroller

control systemoscillationpid controllersimulation

I have a 2 input, 2 output system that I have recorded in response to 1. steps (actually quasi-steps, with 50 ms rise time + some overshoot), and 2. sine waves from 0.5 to 50 Hz, in both open and closed loop. In the open loop configuration, I can infer the internal parameters based on knowledge of the system's structure. In the closed loop configuration, a controller with ~60 ms delay brings the output close to a given target (which is separate from the input signal), but I can't figure out what the controller parameters are. I've attempted to model it as a PID controller using numerical (euler) simulations, but it seems to quickly become unstable when either I or D components are increased. In contrast, I can create the model in transfer function form and predict the frequency response, but I don't know howto then predict the response to arbitrary inputs (such as the quasi-steps, or sine waves where the control signal might differ from the input).

The system (u2 is the "goal/setpoint", F is the controller feedback with 60 ms delay, y2 is just a second output that I use to compare to data to infer H):

Block diagram

For example, here is the output from the transfer function (solid) v. numerical simulation (dashed) of the entire model in closed loop, for a 0.5 Hz input:
Output

My question is:
1. Is there a better way to infer the PID parameters of F than using a numerical simulation + fminsearch (matlab) approach?

  1. (Maybe this is a separate question, sorry). If not, how to think about the discrepancy between the implicitly stable TF response and the oscillating numerical response? How can I avoid the oscillations in the numerical response?

Best Answer

If response of any linear time invariant system to an input is the convolution of the input with the impulse response of the system.

So if you have measured the impulse response then you can find the output using convolution.

If you cant create the conditions to accurately measure an impulse response you can measure the step response. The impulse response is then the derivative of the step response.

http://lpsa.swarthmore.edu/Transient/TransInputs/TransImpulseTime.html

Obviously as time progresses a brute force convolution requires too much computation because you would be numerically integrating over ever longer times.

The solution is typically to either limit the scope of the convolution in time by modeling the system as a Finite Impulse Response system (FIR).

The other way is to use some sort of mathematical shortcut (such as recursion) to determine the next output based on the input signal and the prior output. This is Infinite Impulse Response (IIR).