Jul 12, 2015

Estimated MIMO feedback control in Simulink

I've used the full-state Luenberger observer successfully in my control problems, using Digital Control of Dynamic Systems, 2nd edition, Franklin et. al., chapter 6 as my reference.  The key block diagram that allows for control commands and current estimation is this:
Although this structure does NOT have error integral portion and may therefore have a non-zero steady-state error, the later part of the above mentioned chapter does give the modified solution, and besides in my experience, integral control ALWAYS requires anti-windup correction, so the simpler feedback gain formulation given above is a good first attempt at a non-full-state-feedback MIMO (multi-input, multi-output) control problem.

I in fact learned about the observers from Control System Design Guide, George Ellis, who to his credit, tried to make a dent against the perversely pedantic approach to control engineering, by creating an excellent control system simulation software (for nearly free!).  In my opinion, for SISO (single-input-single-output) design, the Visual Model Q is superior to Matlab/Simulink because it helps (forces?) me to understand what is going on under the hood.

Unfortunately, I have to solve MIMO control, estimation, and optimization problems, and Matlab toolboxes are a faster way to tackle those problems.  And after avoiding Simulink all these years, I finally bought into it recently.  Part of the entry fee into the Simulink was implementing the above block diagram in Simulink.  Here is my first attempt (where problem specific--proprietary--labels are erased):
The predictor that is driven by U (control input into the openloop model) and Y (measurement, or observation) is fairly standard, with the predictor's system matrix A modified to (A - Lp C), and the B matrix B modified to [B Lp], where Lp is the predictor feedback gain.  The 2 inputs on the left is the R vector to follow, the 2 independent commands in this problem.

But there are some important differences:

  • I did not put in Nx, because in this problem, Nx = I.  But adding a matrix gain between R and the difference junction (circle above) is easy; its gain parameter will just be the Nx matrix, available in Matlab workspace.
  • Feedback is calculated only on the subset of the full Xest, so I use another gain (a 2x5 matrix consisting of only 2 rows from a 5x5 identity matrix).
  • Because controller saturation is so important, I explicitly modeled it.  In fact, when the saturation limit varies as a function of the states, I modeled that relationship as well, and feed Simulink's dynamic saturation block.

Future work

Note that I don't deal with the system or the measurement noise, by using the Kalman filter, for example.  The full-state predictor/estimator in fact averages out noise nicely, but the Kalman filter will dynamically adjust the optimal weight for the current vs. past estimates.



Jul 11, 2015

Xilinx Vivado compile false warnings

Whenever I come across an Xilinx FPGA tutorial that says: "make sure your design is free of validation errors/warnings", I get skeptical about the writer's experience level, because I've NEVER come across a non-trivial Xilinx design without hundreds of warnings, and a dozen or more critical warnings.  The best I can hope for is to be free of outright errors.  Consider the following critical error in my Vivado design:

[BD 41-967] AXI interface pin /axi_i2s_adi/DMA_ACK_RX is not associated to any clock pin. It may not work correctly.
...

I've been living with this warning ever since I got a Zedboard.  Recently, I finally looked it up on the Xilinx forum.  These are false alarms, according to a Xilinx forum discussion.