控制系统基础

备注

This article includes sections of Controls Engineering in FRC by Tyler Veness with permission.

The Need for Control Systems

控制系统无处不在,我们每天都与之互动。您可能会看到一小部分,包括带有恒温器的加热器和空调,巡航控制和汽车上的防抱死制动系统(ABS),以及现代笔记本电脑上的风扇速度调节。控制系统监视或控制此类系统的行为,并且可以由直接控制它们的人(手动控制)或仅由机器(自动控制)组成。

All of these examples have a mechanism which does useful work, but cannot be directly commanded to the state that is desired.

For example, an air conditioner’s fans and compressor have no mechanical or electrical input where the user specifies a temperature. Rather, some additional mechanism must compare the current air temperature to some setpoint, and choose how to cycle the compressor and fans on and off to achieve that temperature.

Similarly, an automobile’s engine and transmission have no mechanical lever which directly sets a particular speed. Rather, some additional mechanism must measure the current speed of the vehicle, and adjust the transmission gear and fuel injected into the cylinders to achieve the desired vehicle speed.

Controls Engineering is the study of how to design those additional mechanisms to bridge the gap from what the user wants a mechanism to do, to how the mechanism is actually manipulated.

例如,在存在不确定性的情况下,我们如何证明自动驾驶汽车上的闭环控制器能够安全运行并满足期望的性能规格?控制理论是一种代数和几何的应用,用来分析和预测系统的行为,使它们按照我们的要求做出反应,并使它们对干扰和不确定性具有鲁棒性。

简单来说,控制工程是应用于控制理论的工程过程。因此,它不仅仅是应用数学。虽然控制理论背后有一些漂亮的数学运算,但是控制工程学是一门工程学,就像其他任何取舍一样。控制理论给出的解决方案应始终通过我们的性能规格进行检查和了解。我们不需要完美;我们只需要能满足我们的规格即可。

命名法

大多数高级工程主题的资源都需要具备一定的知识水平。部分问题在于术语的使用。虽然它能有效地与业内人士交流想法,但不熟悉它的新人却会迷失方向。

由控制系统控制的执行器系统或集合称为“工厂”。控制器用于将设备从其当前状态驱动到某些所需状态(参考)。不包含开环控制器,即从工厂输出中测得的信息的控制器

从工厂的输出反馈信息的控制器称为闭环控制器或反馈控制器。

A diagram of a basic feedback plant

备注

从工厂的角度定义系统的输入和输出。所示的负反馈控制器将基准与输出之间的差(也称为误差)驱动为零。

什么是增益?

*增益*是一个比例值,表示稳态时输入信号的大小与输出信号的大小之间的关系。许多系统包含一种方法,通过该方法可以更改增益,从而为系统提供或多或少的“功率”。

下图显示了一个具有假设输入和输出的系统。由于输出是输入幅度的两倍,因此系统的增益为2。

A system diagram with hypothetical input and output

What is a Model?

A model of your mechanism is a mathematical description of its behavior. Specifically, this mathematical description must define the mechanism’s inputs and outputs, and how the output values change over time as a function of its input values.

The mathematical description is often just simple algebra equations. It can also include some linear algebra, matrices, and differential equations. WPILib provides a number of classes to help simplify the more complex math.

Classical Mechanics defines many of the equations used to build up models of system behavior. Many of the values inside those equations can be determined by doing experiments on the mechanism.

方框图

在设计或分析控制系统时,以图形方式对建模很有用。框图用于此目的。它们可以被系统地操纵和简化。

A figure of a block diagram

开环增益是从输入(圆)处的求和节点到输出分支的总增益。如果断开反馈环路,这将是系统的增益。反馈增益是从输出返回到输入求和节点的总增益。总和节点的输出是其输入的总和。

下图是在反馈配置中具有更正式表示法的框图。

An image of a block diagram with a more formal notation

:math:`mp`表示“减号或加号”,其中减号表示负反馈。

A Note on Dimensionality

For the purposes of the introductory section, all systems and controllers (except feedforward controllers) are assumed to be “single-in, single-out” (SISO) - this means they only map single values to single values. For example, a DC motor is considered to take an input of a single scalar value (voltage) and yield an output of only a single scalar value in return (either position or velocity). This forces us to consider position controllers and velocity controllers as separate entities - this is sometimes source of confusion in situations when we want to control both (such as when following a motion profiles). Limiting ourselves to SISO systems also means that we are unable to analyze more-complex “multiple-in, multiple-out” (MIMO) systems like drivetrains that cannot be represented with a single state (there are at least two independent sets of wheels in a drive).

Nonetheless, we restrict ourselves to SISO systems here to be able to present the following tutorials in terms of the PID Controller formalism, which is commonly featured in introductory course material and has extensive documentation and many available implementations.

The state-space formalism is an alternate way to conceptualize these systems which allows us to easily capture interactions between different quantities (as well as simultaneously represent multiple aspects of the same quantity, such as position and velocity of a motor). It does this, roughly, by replacing the single-dimensional scalars (e.g. the gain, input, and output) with multi-dimensional vectors. In the state-space formalism, the equivalent of a “PID” controller is a vector-proportional controller on a single vector-valued mechanism state, with a single gain vector (instead of three different gain scalars).

If you remember that a state-space controller is really just a PID controller written with dense notation, many of the principles covered in this set of introductory articles will transfer seamlessly to the case of state-space control.