From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with getting a closed loop Simulink LQR response same as with an m.file

I know that this is a LabView forum, but maybe someone do know the answer as I would like to use this model later in LabView.

I've a problem with getting response for my LQR regulator. I attach a file with data, which You should run before running a model for creating a statespace matrixes. I get this error.

 

I'm trying to get a closed loop response similar to tha last model here: http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=SimulinkModeling

why is this error occuring when my matrixes are for 2 states? When in mdl I change in State Space a value of matrix A from A to A-B*K I get the same response as in mfile.

 

matlab.png

0 Kudos
Message 1 of 3
(5,076 Views)

@Ryzyk wrote:

I know that this is a LabView forum, ...


No, this is the LabVIEW Mathsript RT Module forum. The LabVIEW forum is over here.

0 Kudos
Message 2 of 3
(5,074 Views)

You most likely don't have the dimensions of your matrices right. Review the sizes and be sure to have the 'dimensions' as expected...

 

If you were using the LabVIEW Control Design and Simulation Module, you could easily see a shipping examples that would demonstrate these operations in LabVIEW:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Control and Simulation\Case Studies\Mechatronics\Inverted Pendulum\Linear Inverted Pendulum Simulation.vi

C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Control and Simulation\Case Studies\Mechatronics\Inverted Pendulum\Regulator_Inverted_Pendulum.vi

C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Control and Simulation\Case Studies\Mechatronics\Cart-Pole\CDEx Cart-Pole Control and Simulation.vi

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 3
(5,054 Views)