# Nonlinear Dynamics and Machine Learning for Robotic Control Systems in IoT Applications
## 2 Materials and Methods
### Mathematical Foundation and Dynamic Modeling  
The flyer model was adapted, which is extensively detailed in the literature [23] and serves as the basis for the implemented software representing a complete humanoid mechanism. Figure 2 illustrates the basic model serving as the foundation for the software in MATLAB's implementation. In this schematic representation of the humanoid robot, contact with the ground is facilitated by a cart with the specified dimensions. The primary segment of the mechanism is the pelvis, which is rigidly attached to the stationary cart. This modeling approach aligns with techniques used in robotic manipulator design, where, typically, a single open kinematic chain is sufficient to represent the manipulator. In this case, however, due to the complexity of the humanoid structure, multiple kinematic chains are required, each originating from specific segments of the mechanism. Figure 2: Architecture of mobile robot and code for generating flier object. Figure 2 depicts the mechanism as consisting of three kinematic chains, indicated by curved lines with arrows showing the direction of the chain extension. Chain I comprises the pelvis, torso, and head; chain II, the pelvis, torso, and right arm; and chain III, the pelvis, torso, and left arm. Each chain is composed of segments (numbered: torso--4, head--7, right upper arm--10, right forearm--12, right hand--14, left upper arm--17, left forearm--19, left hand--21) in Figure 2. All other segments are imaginary with approximately zero dimensions, as well as negligible dynamic characteristics so as not to affect the real part of the mechanism (masses m and moments of inertia J, have values of 0). This division into kinematic chains is a functional approach for this model. The head and torso segments are separated, introducing three additional degrees of freedom between them, replicating realistic movement. A rotational degree of freedom around the \(z\)-axis is introduced between the pelvis and torso, providing a third degree of freedom at the waist. The arm complexity is increased by adding two more degrees of freedom at the shoulders (allowing rotation around the \(y\)-axis) and incorporating triangular joints along the \(z\)-axis in both arms. The model includes hands, which can rotate relative to the forearm, achieved through a combination of rotations around the \(x\)- and \(y\)-axes. The resulting structure, thus, provides a total degree of freedom as given by N = 20i + 6. The state of the robotic system is defined by the vector X [23; 39], which includes the joint angles, angular velocities, and accelerations. The pose of a base segment in space is given by the following equation:  
\[X=[x,\ y,\ z,\varphi,\theta,\ \psi]^{T} \tag{1}\]  
The vector contains six components that describe the position and orientation in a three-dimensional space: \(x\ y\ z\) represent the Cartesian coordinates of the position in space. \(\varphi\ \theta\ \psi\) represent angles that are typically Euler angles, describing the orientation of the segment in space (\(\varphi\)--roll rotation around \(x\)-axis; \(\theta\)--pitch rotation about the \(y\)-axis; and \(\psi\)--yaw rotation about the \(z\)-axis). \[\varphi(roll)=atan\left(2\cdot(\omega\cdot x+y\cdot z),1-2\cdot\left(x^{2}+y^{2 }\right)\right) \tag{2}\]  
\[\theta(pitch)=asin(2\cdot(\omega\cdot z+x\cdot y)) \tag{3}\]  
\[\psi(yaw)=atan2\left(2\cdot(\omega\cdot z+x\cdot y),1-2\cdot\left(y^{2}+z^{2 }\right)\right) \tag{4}\]  
This vector describes the spatial positioning and orientation of an object (such as a robot) in terms of the translational coordinates \(x,y,z\) and rotational coordinates \(\varphi\ \theta\ \psi\). It is used for determining the location and orientation in space, suitable for tasks like navigation, positioning, and alignment in a fixed reference frame.