.Modelica_LinearSystems2.Controller.UsersGuide.GettingStarted

Information

The Controller package provides input/output blocks where every block is available in a continuous and a discrete (sampled) representation. A block is defined via its continuous parameterization. By specifying a discretization method and a sample time, the discrete representation is automatically derived from the continuous form.

The advantage is that, e.g., the continuous representation of a controller is used in detailed non-linear models of a plant. Since the controller is continuous, the simulation is usually much faster because the step size is not constrained by the sample period of the controller. For evaluation and fine tuning purposes, a more detailed representation can be used by switching to its discrete form and adding additional effects such as AD/DA converter, noise, computing delay, etc.

The defaults of the most important options, such as block type (Continuous/Discrete) or base sample time for all blocks are set in the global SampleClock component (via inner/outer). As a result, it is, e.g., easy to switch quickly between a continuous and a discrete representation of all blocks of a controller, by setting the option in the sampleClock component.

Examples to demonstrate the technique are given in sublibrary Examples. Especially, the continuous or discrete control of a simple flexible drive with a P-PI cascade controller is demonstrated in example SimpleControlledDrive.

A screen shot of the diagram layer is shown in the next figure:

Every block has a continuous input and a continuous output. The block might be sampled with the base sampling period defined in sampleClock or with an Integer multiple of it. For example, the PI controller in the above example has the following parameter menus:

By setting, e.g., parameters blockType to "Discrete" and sampleFactor to 10 in the "Advanced" menu, results in a block where the input and the output of the block is sampled by a sampling time that is 10 times slower as the base sample time of the global sampleClock component.


Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos