The design of the arm is made in Autodesk's Fusion360 software, which is 40 cm long, where the arm and forearm occupy 20 cm each, the materials for the structures are PVC tubes of 20 mm in diameter and pieces 3D printed. An important aspect is that of the torque that each of the motors must exert, which makes it possible not to move the structure itself and to be able to manipulate objects, by a simple torque analysis it is known that the base motors always (that one in the shoulder) will be the one that exerts the most force per unit of distance at the time by carrying out the movements, for this reason, it was decided to use two NEMA 17 motors with 3D printed cycloidal reducers, while for the elbow a servomotor is simply used, the end effector consists of a clamp with one degree of freedom (open and close). In Figure 1 you can see the complete design.
As it is the M1 motor that has the highest load in terms of force, it was decided to base the design of the gearbox on it, to include the weight of this element and add a safety factor, the mass of the center C3 was increased to 0.45 kg, while to include the weight of the structure and the hand, a mass of 0.6 kg is selected for the center C4, then the estimated maximum torque is the one calculated in Equation 1.
As M1 is associated with the stopping torque of the motor, it is necessary to choose a reduction level that makes the magnitude of interest exceed this value, for practical purposes and to eliminate any possibility of failure, a gearbox with a 20: 1 ratio is designed. This generates that at the output of the servomotor a maximum of 80 kg-cm is generated, this criterion is maintained for the rest of the motors, which leaves a margin of ideally 0.725 kg-cm to lift objects at a distance of 40 cm from the motor M1.
Concerning the control part, it is possible to implement the FABRIK algorithm correctly in MATLAB (code in github), to test the ability to generate spatially and temporally coherent movements, that is, that there are no large angular differences in the space of arm configurations that at each moment is established, the end effector is made to follow a series of points belonging to a pure or deformed circumferential curve in the generated 3D space. The parametric curves can be seen in Equations 2, 3, 4, and 5.
The results are shown in Figure 2.
Regarding the control of the arms, it can be said that the NEMA motors move by angular step control, that is, an H bridge sends signals so the motor moves 1.8 degrees per step in a certain direction until it reaches the desired angular position, proportional control is not applied directly, since the speed of the NEMA motor will vary depending on the error, this would generate a series of problems in the torque made because it is dependent on the angular speed, for this reason, the speed is left fixed and only steps are performed for the control, as regards the elbow, it uses a servomotor which already has a proportional position control in its chip, so it only needs to be given the desired angle in PWM format through a digital output of the Arduino.
Regarding the electronics itself, it should be known that each control signal is made by an Arduino mega independent of the one in the base, this configuration is preferred since it facilitates the task of separating the torso from the base, in addition, the amount of digital inputs and outputs required makes the addition of one of these microcontrollers imperative, each NEMA motor consumes a theoretical maximum of 1.2 A per phase with square signals of 5 V amplitude, which are controlled with an H-bridge whose output maximum continuous current per phase is 2 A, the difference in power between the maximum and that consumed by the actuators is sufficient so that no additional cooling is needed. To measure the angular positions of each of the degrees of freedom, a series of potentiometers are used that are fed by a buck reducer as well as the associated servo motors.
Naturally, the NEMA motor cannot exert the necessary amount of torque by itself, for this reason, the use of mechanical speed reducers is necessary, for budget reasons and ease of prototyping, it is decided to use a cycloidal reducer printed in PLA with a 3D printer. As it must have a reduction of 20: 1, it is immediately known that the number of lobes the internal gear of the reducer must be 21, therefore the external achievements must be 20, as the equations of the profile that it must have are already known, the operation of this type of mechanism can be implemented with a curve in Matlab and exported in SVG format to Fusion360 and then finish designing the rest of the pieces, the complete model can be seen in Figure 3.
FABRIK is not designed for robotic mechanisms, therefore, it is necessary to implement a series of modifications to be able to restrict the movement of each of the degrees of freedom of the arm.
Although the author  proposes a series of limitations through the projection of cones or the generation of planes in 3D space, he does not specify in detail how to apply each of these, even becoming somewhat confusing. Given the structure that is proposed in this work, it is possible to make a much simpler and equally efficient modification, which consists in limiting the development of the algorithm in a 2D plane, to achieve this, a rotation of the objective point is made along from the x-axis to bring it to the ZY plane (Figure 4A), and so that FABRIK does not move the joints freely, a translation of the positions of the vectors representing the arm is made towards the same plane (Figure 4B), in this way a 2D FABRIK remains (Figure 4C).
To check that no erratic behavior is generated by the modifications to the original algorithm in matlab, a lopsided ellipse in a 3D Cartesian space is entered as target points, the result can be seen in Figure 5.
So if the entire algorithm process is done in 2D space, how can it be possible that the result is still in 3D space? This is achieved because once the angles of the degrees of freedom corresponding to the y-axis have been found, both the target and the vectors representing the arm are performed an inverse rotation, in this way both these points and the angles leading to the target point can be obtained.
ROS integration and signal filtering
As is well known, it is an Arduino Mega that carries out the control commands for the different servo-actuated motors, therefore, it is necessary to implement an interface between it and the Jetson Nano, thanks to the use of ROS this can be easily implemented through the Rosserial package, which enables the microcontroller to generate nodes to publish or receive the data through topics.
With all the elements implemented and programmed, a movement test is carried out, which presents problems because the potentiometer that measures the angular position has a noise level large enough to generate errors in the closed-loop control, this is solved by implementing a first-order low-pass digital IIR filter, in Figure 6 you can see the noisy signal in blue and the filtered signal in red.
Where the difference equation used is: