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):
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:
My question is: 1. Is there a better way to infer the PID parameters of F than using a numerical simulation + fminsearch (matlab) approach?
- (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?