# State Estimation of Over-Sensored Systems Applied to a Low-Cost Robotic Manipulator
## 2 Models
### Inertial Measurement Unit  
An inertial measurement unit (IMU) is, in its simplest form, a device composed of accelerometers, capable of measuring specific force (acceleration subtracted by the acceleration of gravity), and gyroscopes, capable of measuring angular velocity. With these measurements, position and orientation can be determined at any moment in time given an initial position, velocity, and orientation. Most IMU sensors are built from 3 accelerometers and 3 gyroscopes, although some include 3 magnetometers as well. These trios of sensors are unaligned to provide measurements in all 3 spatial dimensions. However, these are not perfectly orthogonal to one another. This means that a measurement in one sensor might correspond to a value in more than one axis. Even if the axes were orthogonal, they still might not be aligned with the chosen referential. Another issue in modeling an IMU is the existence of the parameters of its model that depend on the specific conditions under which it is working, such as temperature and magnetic interference. Regarding the IMU model, the parameters on which each of the IMU's sensors depend are the gain (\(g\)) and bias (\(b\)). These relate the electric signal measured by the sensor (\(m\)) and the value of the quantity being measured (\(v\)) by Equation (1). \[v=g\times(m-b) \tag{1}\]where \(v\) is usually expressed in m/s\({}^{2}\) (when measuring acceleration), rad/s (when measuring angular velocity), or uT (when measuring the magnetic field) and \(m\) is usually expressed in mV. An especially troublesome parameter in this model is the bias. If it is not accounted for or if it is not correctly determined, it causes a systematic error in the measurements of the inertial sensors. This error accumulates when determining position and orientation since these are calculated by integrating the original measurements. As a consequence, a drift is accumulated in the position and orientation state variables. This is the affine relation that models single axis sensors. However, as previously stated, the IMU is not made up of just one sensor. Moreover, each sensor can influence more than one axis of the chosen referential. This implies that each measurement (\(m_{i}\), \(i=\{x,y,z\}\)) is influenced by each value (\(v_{i}\), \(i=\{x,y,z\}\)). That is:  
\[v_{i} =g_{ix}(m_{x}-b_{x})+g_{iy}(m_{y}-b_{y})+g_{iz}(m_{z}-b_{z}) \tag{2}\] \[i =\{x,y,z\} \tag{3}\]  
Assuming \(V=[v_{x}\quad v_{y}\quad v_{z}]^{T}\) and \(M=[m_{x}\quad m_{y}\quad m_{z}]^{T}\), the new model equation is:  
\[V=G\times(M-B_{*}) \tag{4}\]  
where \(G\) is a 3 \(\times\) 3 matrix with entry \((i,j)\) equal to \(g_{ij}\) for \(i=\{x,y,z\}\) and \(B_{*}=[b_{x}\quad b_{y}\quad b_{z}]^{T}\). Alternatively, the previous equation is often written as:  
\[V=G\times M+B \tag{5}\]  
with \(B=-G\times B_{*}\). With the non-diagonal elements in the gain matrix (\(G\)), scaling factors and misalignments between the axes and the reference frame are all accounted for. The calibration process for the IMU is finding the parameters \(G\) and \(B\). This is usually done by reading several measurements in a multitude of scenarios and attempting to find the parameters that match the real values with the measurements. Even though this problem seems to be solvable by simply using algebra to solve the equations for the parameters, two problems stand in the way of using this method. First, all measurements are noisy, which means that if there are more measurements than parameters, the system of equations probably will not be solvable. Second, the use of these equations assumes the real values being measured are known. Since acquiring the real values, often referred to as the ground truth, is theoretically impossible, instead of trying to achieve perfect real values, high precision instruments are used to obtain practically acceptable ones. However, with the creation of low-cost microelectromechanical system (MEMS) IMUs, the devices have become more popular among hobbyists.