# Towards Autonomous Bridge Inspection: Sensor Mounting Using Aerial Manipulators
## 4 Control System
### Adaptive Impedance Control  
The objective of the adaptive impedance controller is to ensure a stable physical interaction between the aerial manipulator and the environment [30]. As mentioned earlier, the standard UAV control scheme is based on position and attitude controllers. When interacting with the environment, the desired contact force must be considered. The position controlled system can be extended to follow the desired force by introducing an impedance filter. The design of such a filter is explained here for a single DoF. The behavior of the system is defined by the target impedance as  
\[e(t)=m(\ddot{x}_{c}(t)-\ddot{x}_{r}(t))+b(\dot{x}_{c}(t)-\dot{x}_{r}(t))+k(x_{ c}(t)-x_{r}(t)), \tag{10}\]  
where \(m\), \(b\) and \(k\) are constants, \(x_{r}(t)\) is the referent position, provided to the impedance filter as an input, and \(x_{c}(t)\) is the output of the impedance filter representing the position command. The filter is designed as a linear second-order system with a dynamic relationship between the position and the contact force tracking error \(e(t)\) so that it mimics a mass-spring-damper system. The contact force tracking error is defined as follows:  
\[e(t)=f_{r}(t)-f(t), \tag{11}\]  
where \(f_{r}(t)\) is the other filter input defining the referent force, and \(f(t)\) is the measured (ex-erted) contact force. If the environment is modeled as a first-order elastic system (equivalent spring system) with unknown stiffness \(k_{e}\), the measured force can be approximated as  
\[f(t)=k_{e}(x(t)-x_{e}(t)), \tag{12}\]  
where \(x(t)\) is the position of the manipulator and \(x_{e}(t)\) is the position of the environment in an unexcited state. By substituting Equation (12) in Equation (11), the position of the aerial manipulator can be expressed as follows:  
\[x(t)=\frac{f_{r}(t)-e(t)}{k_{e}}+x_{e}(t). \tag{13}\]  
Figure 4: The overall functional schematic of the system. The aerial manipulator control subsystem is necessary for the controlling position and attitude of the UAV, and manipulator joints. On top of this controller, the adaptive impedance control is employed in order to track the desired force. Motion planning generates an appropriate trajectory based on the target point supplied by the blob detection algorithm. Assuming that the commanded position value can be achieved by the aerial manipulator, i.e., \(x=x_{c}\), the substitution of Equation (13) in Equation (10), the system in the steady state can be described as follows:  
\[e(t)=\frac{k\cdot k_{e}}{k+k_{e}}\bigg{(}\frac{f_{r}(t)}{k_{e}}+x_{e}(t)-x_{r}(t )\bigg{)}. \tag{14}\]  
For a contact force error of zero in the steady state, the following must hold:  
\[x_{r}(t)=\frac{f_{r}(t)}{k_{e}}+x_{e}(t). \tag{15}\]  
In other words, the position setpoint has to be designed in such a way that it compensates for the displacement of the environment due to the exerted contact force. To ensure this, a value of the unknown environment stiffness \(k_{e}\) is needed. Furthermore, \(k_{e}\) plays a fundamental role in the stability of the impedance filter Equation (10), which ultimately affects the stability of the aerial manipulator while in contact with the environment. A stable contact between the aerial manipulator and the environment can be ensured using the Hurwitz stability criterion, by designing the system with \(b/m>0\) and \((k+k_{e})/m>0\). However, since \(k_{e}\) is unknown, an adaptation law for the position setpoint that guarantees the contact stability while compensating for this hidden, unknown parameter is proposed. The adaptation law is derived starting from Equation (15).