Built-in Components

Warning

This page is under construction and will be ready later.

Linear System Models

System

# States

# control inputs

# outputs

Motor Speed

2

1

1

RLC Circuit

2

1

1

Aircraft Pitch

3

1

1

Quadrotor

12

4

1

1. Motor Speed [1]_

A common actuator in control systems is the DC motor. It directly provides rotary motion and, coupled with wheels or drums and cables, can provide translational motion. The electric equivalent circuit of the armature and the free-body diagram of the rotor are shown in the following figure.

DC motor

State-space model:

\[\begin{split}\begin{gathered} \frac{d}{d t}\left[\begin{array}{c} \dot{\theta} \\ i \end{array}\right]=\left[\begin{array}{cc} -\frac{b}{J} & \frac{K}{J} \\ -\frac{K}{L} & -\frac{R}{L} \end{array}\right]\left[\begin{array}{l} \dot{\theta} \\ i \end{array}\right]+\left[\begin{array}{c} 0 \\ \frac{1}{L} \end{array}\right] V \\ y=\left[\begin{array}{ll} 1 & 0 \end{array}\right]\left[\begin{array}{l} \dot{\theta} \\ i \end{array}\right] \end{gathered}\end{split}\]

where \(\theta\) is the angular position of the motor shaft, \(i\) is the current through the motor, \(V\) is the voltage applied to the motor, \(J=0.01 kg.m^2\) is the moment of inertia of the motor, \(b=0.1 N.m.s\) is the motor viscous friction constant, \(K=0.01 N.m/Amp\) is the motor torque constant, and \(R=1 Ohm\) and \(L0.5 H\) are the electrical resistance and inductance of the motor, respectively.

2. RLC Circuit [2]_

A basic RLC circuit contains a resistor, an inductor, and a capacitor connected in series. An adjustable voltage source is connected to form a closed loop circuit. The system dynamics are modeled by the right equation such that state \(x_1\) denotes the voltage across the capacitor and state \(x_2\) denotes the electric current in the loop. The control input \(u\) is considered the voltage of the voltage source.

RLC

State-space model:

\[\begin{split}\begin{gathered} \left[\begin{array}{c} \dot{x}_1 \\ \dot{x}_2 \end{array}\right]=\left[\begin{array}{cc} 0 & \frac{1}{C} \\ -\frac{1}{L} & -\frac{R}{L} \end{array}\right]\left[\begin{array}{l} x_1 \\ x_2 \end{array}\right]+\left[\begin{array}{c} 0 \\ \frac{1}{L} \end{array}\right] u \end{gathered}\end{split}\]

3. Aircraft Pitch [2]_

The system ODE describes the longitudinal dynamics of motion for the aircraft. The \(x_1\) denotes the angle of attack, \(x_2\) denotes the pitch rate, and \(x_3\) denotes the pitch angle. The control input \(u\) is the elevator deflection angle.

Aircraft Pitch

State-space model:

\[\begin{split}\begin{gathered} \left[\begin{array}{l} \dot{x}_1 \\ \dot{x}_2 \\ \dot{x}_3 \end{array}\right]=\left[\begin{array}{ccc} -0.313 & 56.7 & 0 \\ -0.0139 & -0.426 & 0 \\ 0 & 56.7 & 0 \end{array}\right]\left[\begin{array}{l} x_1 \\ x_2 \\ x_3 \end{array}\right]+\left[\begin{array}{c} 0.232 \\ 0.0203 \\ 0 \end{array}\right] u \end{gathered}\end{split}\]

4. Quadrotor [3]

We consider a linear quadrotor model described in [3]. The system consists of 12 state variables: \((x, y, z)\) denotes the (relative) position, \((𝜙, θ, ψ)\) denotes the angles of roll, pitch and yaw respectively, \((u, v, w)\) and \((p, q, r)\) are the velocity and angular velocity of the quadrotor. The controller produces 4 inputs which are ft: total thrust, and \([τ_x, τ_y, τ_z]\) control torques caused by differences of rotor speeds.

DC motor

References:

Nonlinear System Models

1. Quadrotor

The nonlinear dynamics of the quadrotor relate its attitude and position with 12 states same as the linear quadrotor model above.

\[\begin{split}\begin{gathered} \begin{array}{ll} \dot{\phi}=w_\phi, & \dot{w}_\phi=\frac{\tau_\phi}{I_x}+\dot{\theta} \dot{\psi}\left(\frac{I_y-I_z}{I_x}\right) \\ \dot{\theta}=w_\theta, & \dot{w}_\theta=\frac{\tau_\theta}{I_y}+\dot{\phi} \dot{\psi}\left(\frac{I_z-I_x}{I_y}\right) \\ \dot{\psi}=w_\psi, & \dot{w}_\psi=\frac{\tau_\psi}{I_z}+\dot{\phi} \dot{\theta}\left(\frac{I_x-I_y}{I_z}\right) \\ \dot{x}=v_x, & \dot{v}_x=\frac{f_t}{m}(\cos (\phi) \sin (\theta) \cos (\psi)+\sin (\phi) \sin (\psi) \\ \dot{y}=v_y, & \dot{v}_y=\frac{f_t}{m}(\cos (\phi) \sin (\theta) \sin (\psi)-\sin (\phi) \cos (\psi)) \\ \dot{z}=v_z, & \dot{v}_z=\frac{f_t}{m} \cos (\phi) \cos (\theta)-g \end{array} \end{gathered}\end{split}\]

2. Vessel

The vessel dynamics characterize a standard ship with 3 degrees of freedom. The state-space model is derived from the Marine Cybernetics lecture notes, and the high-fidelity simulator is based on the NTNU AUR-lab’s development, incorporating Matlab scripts from the VESSELS catalog of the MSS toolbox. The simulator replicates the vessel with essential ship components such as the engine, propeller, and rudder, treating the entire model as a system. The system comprises 8 states, including east and north positions, yaw, their velocities, the angular shaft speed of the propeller, and the DC motor’s current.

vessel

References:

3. Pendulum

The dynamics of the inverted pendulum on a cart is described by a nonlinear model. The objective is to stabilize the inverted pendulum towards the upright position by applying force to the cart. The cart position is denoted by x, velocity by v, pendulum angle by θ, angular velocity by ω, pendulum mass by m, cart mass by M, pendulum arm by L, gravitational acceleration by g, friction damping on the cart by δ, and control force applied to the cart by u.

\[\begin{split}\begin{gathered} \begin{array}{ll} \dot{x}=v, \\ \dot{v}=\frac{-m^2 L^2 g \cos (\theta) \sin (\theta)+m L^2\left(m L \omega^2 \sin (\theta)-\delta v\right)+m L^2 u}{m L^2\left(M+m\left(1-\cos (\theta)^2\right)\right)} \\ \dot{\theta}=\omega \\ \dot{\omega}=\frac{(m+M) m g L \sin (\theta)-m L \cos (\theta)\left(m L \omega^2 \sin (\theta)-\delta v\right)-m L \cos (\theta) u}{m L^2\left(M+m\left(1-\cos (\theta)^2\right)\right)} \end{array} \end{gathered}\end{split}\]
pendulum

4. CSTR

In the dynamics of a CSTR, the exothermic reaction of species A → B is analyzed using the concentration of A (\(C_A\)) and the reactor temperature (\(T\)) as states. The control input is determined by the temperature of the cooling jacket (\(T_C\)). The precise dynamics, considering different system parameters are outlined below.

\[\begin{split}\begin{gathered} \begin{array}{ll} V\dot{C}_A & =q\left(C_{a f}-C_A\right)-k_0 \exp \left(\frac{-E}{R T}\right) V C_A \\ \rho C_p V \dot{T} & =\rho C_p q\left(T_f-T\right)+\Delta H k_0 \exp \left(\frac{-E}{R T}\right) V C_A \\ & +U A\left(T_C-T\right) \end{array} \end{gathered}\end{split}\]
CSTR

References:

Controllers

PID

A proportional–integral–derivative controller (PID controller or three-term controller) is a control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications requiring continuously modulated control.

LQR

The settings of a (regulating) controller governing either a machine or process (like an airplane or chemical reactor) are found by using a mathematical algorithm that minimizes a cost function with weighting factors supplied by a human (engineer). The cost function is often defined as a sum of the deviations of key measurements, like altitude or process temperature, from their desired values. The algorithm thus finds those controller settings that minimize undesired deviations. The magnitude of the control action itself may also be included in the cost function.

MPC

Model predictive control (MPC) is an optimal control technique in which the calculated control actions minimize a cost function for a constrained dynamical system over a finite, receding, horizon.

Formal Methods

Safety Analysis

When applying a sequence of control inputs \(\textbf{u}_0,\dots, \textbf{u}_{T-1} \in \mathcal{U}\) to a physical system, the system state evolves according to its dynamics \(\psi\), i.e., \(\textbf{x}_{t+1} = \psi (\textbf{x}_t,\textbf{u}_t)\). The sequence of evolving states is called emph{State Trajectory} \(\xi\), where \(\xi_i\) denotes the \(i\)-th state in the trajectory. By applying all possible control sequences within \(T\) control steps, we can have all possible state trajectories \(\Xi(\textbf{x}_0,T)\) as \(\Xi(\textbf{x}_0,T) = \{\xi:\xi_0=\textbf{x}_0, \xi_{t+1}=\psi (\xi_t,\textbf{u}_t)\}\), where \(\textbf{u}_t \in \mathcal{U}\), \(t \in \{0,\dots, T-1\}\), and \(\textbf{x}_0\) is an initial state. Then, the reachable set \(\mathcal{R}\) includes all possible system states in \(\Xi(\textbf{x}_0,T)\).

The Unsafe State Set \(\mathcal{F}\) is a region within the state space, in which the physical system is unsafe and may cause serious consequences. For example, the distance from a vehicle to an obstacle is less than zero where the unsafe state includes all negative distance values. The complementary set of \(\mathcal{F}\) is the safe state set \(\mathcal{S}\). To keep the system safe, the reachable set of a system from a certain initial state \(\textbf{x}_0\) is required not to intersect with the unsafe state set, i.e., \(\mathcal{R}\cap \mathcal{F}= \emptyset\). Unfortunately, it is very expensive to compute the exact reachable set. Instead, we usually compute an over-approximation of the reachable set, denoted by \(\bar{\mathcal{R}}\) and \(\bar{\mathcal{R}} \supseteq \mathcal{R}\). If \(\bar{\mathcal{R}} \cap \mathcal{F}=\emptyset\), then we can guarantee that \(\mathcal{R} \cap \mathcal{F}= \emptyset\), i.e., the system is guaranteed to be safe.

Reachability Analysis for Linear Systems

By utilizing the Taylor model-based reachability computation on a past state, we can obtain an overapproximate estimation of the state at a subsequent time. We begin by taking the most recent reliable state, \(x_w\), as the starting point. Next, we analyze the historical control sequence utilized from the time \(t_w\) to \(t_f\) and calculate an interval set (or box), \(X\). This set is guaranteed to contain the system state at \(t_f\).

State Estimate Reconstruction

At time \(t_f\) , the system state estimates cannot reflect the actual system states because of sensor attacks. Therefore, the predictor must rebuild the current state reachable set \(X_f\) from a reliable \(x_w\) state, as provided by the checkpointer.

State Estimate Reconstruction

Deadline Estimation

We conduct reachability analysis to determine a deadline, \(t_d\), at which point the system may touch the unsafe set.

Deadline Estimation

Noise / Disturbance

We have implemented uniform noise.

Attack Simulator

We consider three attack scenarios: bias, delay, and replay. A bias attack typically involves intentionally introducing systematic errors or biases into a system. This type of attack is especially pertinent in systems relying on sensor data or algorithmic decision-making. A delay attack focuses on manipulating the timeliness of information within CPSs. The attacker intentionally introduces delays in transmitting vital data or commands, thereby causing a disruption in the regular operation of the system. A replay attack entails the capture of valid data transmissions, which are then retransmitted at a later time. The crucial element of this attack lies in the legitimacy of the data itself; however, it is reused or replayed at an unsuitable moment or in an incorrect context.