10-06-2009 04:31 PM
Hi all,
I'd like to implement a state feedback control on MIMO system.
I saw this example:
I anderstant how it works however I'm anoyed by the absence of set_vector. Normally, there is a substractor between u(k) and the setpoint before the estimator. Is it correct to add this substractor?
Further question? how to change the controller to integrate an integral?
thanks
10-09-2009 05:31 PM - edited 10-09-2009 05:31 PM
Hello neil84,
I am attaching two files saved in LabVIEW 8.6 to illustrate the way to implement an LQR controller with Integral Action with estimated states. The assumptions in the code are that the system is SISO. If you need multiple inputs/outputs change the VI to use arrays, taking into consideration the correct dimensions if the system has more than one input and/or one output.
The first file (templateToUse.vi) is just a template that illustrates how the configuration can be made when the signals come and are delivered to a hardware device (or plant). We build the LQR and Kalman filter outside the time loop (SS model) which will represent the controller/estimator inside the time loop.
The second file (exampleToUse.vi) is an example in which a second state model takes the place of the system (as if there are IO blocks). You can run the VI and change the values of the reference. The plot shows the response of the control action (red) as well and the controlled variable (white). Feel free to change the reference yref and check the response.
To retune the controller/estimator you need to stop the VI and change the values. To change the controller values on the fly, you need to place the calculation defined outside the loop, inside.
Look at page 14-14 of the CD user manual for more information about the different configurations.
Hope this helps, please let us know if there are additional questions.
Regards,
Angela M
10-10-2009 04:08 AM
Hello Angela,
Thank you for examples.
There are some problematic points according to me.
The system that I will control is a UAV. I have 6 inputs that are Motor controllers, 4 outputs (Latitude, Longitude, Altitude and Velocity) and 10 state variables (3 orientations, 3 angular rates,+ the 4 outputs).
I can measure all these data.
In the example, it seems that you didn't used state variables to build the controller just the inputs and outputs, Am I correct? with my system, I think that it's important to use orientations and angular rates given by the IMU.
I'm not familiar enough with Kalman Gain. Actually I'm more Familiar with Acker Gain. Assuming my system have 6 inputs, 4 outputs and 10 state variables, A matrix will be 14x14, B 14x6, C 4x14 and D 4x6, what should be Ge, Qe, Re, Qc, Rc and Ki dimensions?
I have further questions about identification, however I will open an other topic for that.
Thak you for help
Neil
10-12-2009 06:52 PM
Hello neil84,
The previous example may not have been quite what you were looking for. Here is another example that is MIMO and performs a tracking operation. Controller_and_Estimator_with_Reference_Tracking_Final.vi is the main example, and Compute_Nx_Nu.vi is a subVI that helps to configure the VI properly. The attached VI is a MIMO controller & estimator structure for a tracking problem, where the objective is that the output y(k) tracks a prescribed trajectory r(k); in this case a step command. Note that this structure uses the implementation VIs and extends the shipping template which you initially referred to, whose objective was regulation, i.e. drive the system states to zero.
Note that in this example the plant is being designed outside using a pole zero placement, in case you are not familiar with that method. This example is also running in a simulation loop set with the time step based on the sampling time from the model.
Hope this is more clear now.
Regards,
Angela M