MATLAB: How to tune a PIV controller using MATLAB

control systemControl System ToolboxMATLABRobust Control Toolbox

How should I go about tuning this controller in MATLAB? I am trying to get the system to have a settling time of < 1 second, P.O < 15% and zero steady state error.
MATLAB's SISO tool doesn't have an architecture for a PIV controller with feed forward. I tried using the SISO tool with the fourth control architecture (PIV without a feed forward). But automatic tuning "Could not find a solution that satisfies all constraints" even though my constraints were very "relaxed" (P.O < 50% and settling time < 20 seconds).
Also this method: Specify Control Architecture in Control System Tuner doesn't show you how to add a feed forward or a differentiator (required for C2).

Best Answer

Control System Tuner app works well for this custom controller architecture. The easiest way (at least for me) to create a block diagram specifying this architecture is in Simulink. So:
1. I created a Simulink model shown below:
Instead of using a pure derivative (never a good idea), I used s*N/(s+N) circuit shown in the region highlighted in blue. It basically differentiates the input signal at the lower frequencies, but at the higher frequencies (where you will have a lot of noise in your sensor reading), it adds a first order filter.
I set the gains for PI and Kv to 1,1,1 - default values. The system is unstable with these gains.
2. Now I started Control System Tuner, set PI and KV as blocks to tune, and added a step tracking requirement as shown below:
3. Now press "Tune", and the tool very quickly creates the design meeting requirements. Update block parameters to write the tuned values back to Simulink. Simulate and look at the results:
The model with tuned gains and Control System Tuner session are attached.
HTH. Arkadiy