Design and Implementation of Inverse Kinematics and Motion Monitoring System for 6DoF Platform

: Six-axis motion platforms have a low contraction height and a high degree of freedom. First of all, the designed six-axis crank arm platform, including the motor, reducer, crank arm, link, platform support arm, and upper and lower platforms, can be designed for different bearing requirements. Secondly, it uses a coordinate transform and kinematics theory to derive each motor rotor angle. A set of platform data acquisition (DAQ) monitoring modules was established, and the LabVIEW programming language was used to write measurement software. The monitoring items include displacement, speed, and acceleration, which can be displayed on the screen and recorded by an industrial computer in real time and dynamically. Then, an RS-485 or RS-232 communication transmission interface was used to provide the control system with the related movement information. Finally, an industrial computer combined with a motion control card was used as a control kernel to realize the control algorithms, internet module function, I/O write and read signals, ﬁrmware integration, and human–machine interface message. The experimental results validate the appropriateness of the proposed method.


Introduction
Simulators continue to progress toward high performance, high fidelity, and complex, realistic scenes [1]. A motion platform with six degrees of freedom (DoF) simulates the dynamic motion of several vehicles to be perceived by passengers. In addition to visual effects, sound effects, and force, adding motion to professional training simulators can make the simulations more realistic as well as improving the effectiveness of training and exempting trainees from having to readapt to the motion of real vehicles. Regarding entertainment systems, adding motion can increase excitement, enhance interaction, and increase the value of the systems. Motion platforms with six DoF are commonly driven by one of the following devices: (1) A linear actuator, which is composed of motors, belts, and lead screws. This structure includes six electric cylinders, three pneumatic cylinders, upper and lower platforms, and a platform controller. (2) A 6DoF crank arm platform, which is created by combining a crank arm mechanism-composed of a servo motor, a gear box, and a crank arm-with a reducer, a rocker arm, a platform support arm, upper and lower platforms, and a control system. Though they possess the advantages of simple control, high DoF, high efficiency, and high loading capacity (ton) [2], linear actuators have high production costs, and the height of the platform to be positioned in the center is overly high. With approximately half the development cost of linear actuators, 3DoF and 4DoF crank arm platforms have comparable high-fidelity motion, which reduces manufacturing costs, and can be applied in professional training simulators (e.g., of ships and vehicles) and entertainment simulators, which may serve as a point device at amusement parks [3,4].
In 1965, Stewart from the United Kingdom proposed a 6DoF, six-axis motion platform structure [5], which was first used as a flight simulator. The potential advantages and application prospects of parallel platforms received considerable attention and inspired numerous studies. In 1980, Fichter and Mcdowell proposed a parallel mechanism derived from Stewart's platform and discussed the inverse kinematics of said mechanism [6], which represented the earliest discussion of inverse kinematics. In 1985, Mohamed and Duffy published a study on the relationship between the end effector speed of a six-axis motion platform and the drive input speed [7]. In 1992, Kumer clarified the relationship between the speed and acceleration of a six-axis platform and the drive. In 1993, Liu proposed a comprehensive analysis of forward kinematics and inverse kinematics of a six-axis motion platform [8]. Ji et al. analyzed the inverse kinematics of a 3-RRPS 6DoF Stewart platform [9]. By that time, most kinematics problems related to the general type of 6DoF Stewart platform had been resolved. Studies after 2010 have generally addressed means of controlling parallel architectures, such as artificial neural network control [10], and predictive control [11][12][13]. Studies after 2010 have also explored numerical solutions. For example, the spatial position and the center of the upper platform can be obtained by applying forward kinematics [14]. In addition, [15] proposed a real-time algorithm for solving the six motors' angular update command problem caused by multithreading. The algorithm is advantageous in that it increases the computing speed and reduces the running time, which enables the motors' angular update commands of the six-axis platform to provide more timely updates to the six servo drives. The current study applied the dynamic proprioception of real-life situations to achieve a motor sense that is identical or close to that created by real vehicles. Theoretically, the motion cueing effect most closely resembles reality when the motion state of the platform is exactly that of a real vehicle [16,17]. The simulation of motion especially targeted the speed and acceleration perceptible by the human sensory system to achieve a realistic motor sense.
The majority of simulators have been designed based on the 6DoF structure of the Stewart platform [5][6][7][8][9][10][11][12][13][14][15][16][17], which uses linear actuators to achieve a 6DoF overall movement. However, the need to use six linear actuators is expensive. Therefore, this work proposes a six-axis crank arm mechanism for motion systems. There is no formal literature about the design and implementation of an actual crank arm mechanism platform. As in [18], this work's design was based on DIY methods to create a simple model. Limiting the range of movement through the error correction method achieves an effect similar to an integrator. In order to improve the movement stroke of the platform, this study investigated the crank arm motion platform with a monitoring system, in order to propose an inverse kinematics design for virtual cylinders. In addition, a motion monitoring system is proposed for affordable measurement of the platform. For affordability, low-cost sensors are utilized. The software offers functions such as sampling settings, impulse response display, real-time display of measured values, and log file reading and sending. To the best of our knowledge, the ideas we mention have not been presented in previously published papers [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18]. As a result, this paper presents some new ideas on the implementation of motion control systems, including an adjustable speed control system and a middle-distance stroke control system. Related measuring instruments, such as a touch panel, an industrial computer, professional wiring harnesses, sensors, jigs, and auxiliary appliances, are placed in a selfdesigned waterproof storage box to facilitate portability and operation at different venues. Validated through experiments, the proposed algorithm can control different attitudes, human-machine interface operations, network packet reading, and command receiving of the platform and can achieve 6DoF control and monitoring.

Inverse Kinematics Design
For six-axis motion platforms with a parallel structure, when the upper platform changes directions, the crank arm mechanism can bear the evenly divided load. That is, the highly rigid structure has a high load-bearing capacity. For six-axis motion platforms with a serial design, a structure resembling a cantilever beam is formed when the connecting rod is fully extended, and each joint connected in series accumulates errors (which reduces accuracy), possesses a low bearing capacity, and easily wobbles. Accordingly, a parallel structure has greater rigidity and stability and can achieve high-precision positioning in a complex working environment. Kinematics is divided into forward and inverse kinematics. Forward kinematics refers to the rotation angles of the servo motors of a six-axis platform, and numerical methods are used to determine the position, speed, and acceleration corresponding to the platform [19]. Inverse kinematics involves the use of platform position, speed, and acceleration to calculate the rotation angle of servo motors. This is the method adopted in the current study [20]. Figure 1 presents the physical model of the six-axis crank arm motion platform, which comprises six crank arm mechanisms, an upper platform (moving platform), a lower platform (fixed platform), and six support arms. The coordinates of the upper platform, lower platform, and rotation axis of the drive shaft are (xpi, ypi, zpi), (xbi, ybi, zbi), and (xb_Mi, yb_Mi, zb_Mi), respectively, where i = 1, 2-6. Traditional inverse kinematics methods and the proposed inverse kinematics method are explained in the section below.

Traditional Inverse Kinematics
Traditional inverse kinematics changes the endpoint coordinate of the crank arm through the rotation angle of the arm [18], which requires adding together the components of the crank mapped to the platform, components of the connecting rod mapped to the platform, and the coordinates of the rotation axis of the drive shaft and then subtracting the sum from the expected upper platform coordinate to calculate its distance from the rod. Because the length of the support arm is fixed, the endpoint coordinate of the crank arm was adjusted by rotating the crank arm until the distance between the lower and upper platform coordinates aligned with the actual length of the support arm ( Figure 1).
As Figure 2 illustrates, when the upper platform coordinate (xp1, yp1, zp1) of the first axis and inverse kinematics were used to calculate the expected rotating position vector (xp1_1, yp1_1, zp1_1), the coordinate corresponding to the lower platform (xb1_1, yb1_1, zb1_1) was moved from (xb1, yb1, zb1) according to the rotation angle of the crank arm. The virtual support arm (L1) was calculated using (xp1_1, yp1_1, zp1_1) and (xb1, yb1, zb1). If L1 did not equal the actual support arm (L), the two had different lengths. The M1 motor rotation command is obtained according to the change in the error value as where k is the number of sampling points, θ 1 is the angle of the M1 motor, and γ is the weighting factor of the iteration. Then, the angle of the M1 motor had to be adjusted until L1 and L were of the same length. Therefore, the upper platform coordinate (xp1, yp1, zp1) was slowly moved from the virtual support arm (L1) to L by controlling the M1 motor. The length of L was calculated using Equation (1). The software ran Equation (2) until L = L , which indicated that the coordinate of the lower platform (xb1_1, yb1_1, zb1_1) was correct.

Proposed Inverse Kinematics
Because traditional inverse kinematics methods fail in the position control implementation, the upper platform can only be moved approximately to adjust the length of the virtual support arm. To improve the movements of the endpoint coordinates of the motion platform crank arm, an actuating method similar to that of a linear actuator was adopted to obtain the relevant coordinates. The position of the linear actuator was set as the lower fixed point coordinate, and the upper platform coordinate could be changed by adjusting the elongation of six linear actuators. In practice, the elongation required by each electric cylinder can be calculated by subtracting the distance between the upper and lower platform coordinates with elongation from that without elongation. Therefore, this study proposes changing the motion platform of the rotary crank arm to the output end of the crank arm motor as the lower fixed point of the linear actuator, thereby determining di, which is the distance between the upper platform coordinate and the motor coordinate (xb_Mi, yb_Mi, zb_Mi). The vector of di is expressed as follows [21]: where T is the position vector of the upper platform coordinate relative to the lower platform, R denotes the homogeneous transformation matrix, p i = [xpi ypi zpi] represents the position vector of the upper platform, b i = [xb_Mi yb_Mi zb_Mi] is the position vector of the motor rotation axis, and d i denotes the equivalent rod length. Thus, by taking into account the relationship between the lengths of the crank, connecting rod, and support arm, the positions of the motor end and upper platform were bi and pi, respectively, s was the sum of the connecting link length (p) and support arm length (l), and the contact coordinate (A i ) between s and the crank length (a) was projected to the xy plane. In Figure 3, φ i denotes the included angle between the x direction and the crank length. The known conditions, namely, s, a, B i = [x b_Mi y b_Mi z b_Mi ], pi = [x pi y pi z pi ], and φ i , were used to calculate the angle required for each axis to rotate (θ i ), thereby controlling the different virtual cylinder lengths (di), controlling the elongation of the virtual cylinder, and determining the platform attitude required by the 6DoF platform. Because the six sets of crank arm mechanisms were arranged opposite to each other, they were divided into odd and even numbers. The first, third, and fifth axes were controlled at 0-180 degrees, while the second, fourth, and sixth axes were controlled at 180-360 degrees. The odd axes of Ai are expressed as where i = 1, 3, and 5. The even axes of Ai are expressed as y ai = a · cos(180 − θ i ) cos(180 + φ i ) + y b_Mi (8) where i = 2, 4, and 6. As shown in Figure 3, Pythagorean theorem is applied to find s, di, and a, which are expressed as follows: Equations (11) and (12) are substituted into Equation (10) to derive x pi x b_Mi + y pi y b_Mi +z pi z b_Mi + 2x ai x pi − x b_Mi +2y ai y pi − y b_Mi + 2z ai z pi − z b_Mi (13) Equations (4)−(9) are substituted into (13) to derive To facilitate the calculation, the equation is rewritten as follows: where Equation (15) belongs to the trigonometric identity, and θ i can be written as The aforementioned equation demonstrates that the actual rotation angles (19) of the six motors can be directly derived using the known conditions-s, a, bi = [x b_Mi y b_Mi z b_Mi ], pi = [x pi y pi z pi ], φ i , and the distance (di) from the upper platform coordinate to the motor coordinate.

PID Controller
In the synchronous d-q frame, the voltage equations can be expressed as and where v d is the d axis voltage, v q is the q axis voltage, r s is the stator resistance, i d is the d axis current, i q is the q axis current, L d is the d axis inductance, L q is the q axis inductance, d/dt is the differential operator, ω re is the electrical motor speed, and λ m is the flux linkage of the permanent magnet mounted on the shaft rotor. Through realizing i d = 0 by applying field-oriented control, Equations (20) and (21) can be rewritten as and v q = r s i q + L q The electro-magnetic torque is where T e is the electro-magnetic torque of the motor, P is the number of poles of the motor, and K T is the torque constant. The mechanical speed and position of the motor are expressed as d dt and where ω rm is the mechanical speed, θ rm is the mechanical position, J t is the total inertia of the motor and gearbox, T L is the load torque, and B t is the total viscous coefficient of the motor and gearbox. The electrical position and speed, which can be expressed as θ re and ω re , are shown as follows: and The PID control law is where e(t), K P , K I , and K D are the control error, proportional, and integral coefficients, respectively. In Figure 4, G θ , G ω , and G C of the servo driver are the PID controllers, namely, the position loop, speed loop, and current loop controllers, respectively. The control system was designed and applied to each of the six actuators independently.

Monitoring System Design
The six-axis platform monitoring module was developed exclusively for six-axis platform testing. The industrial computer monitoring program was designed under the LabVIEW environment and the interactive property is good. The function of the system reached the expected design requirements, and the cost is low. Combined with the modular design concept, it is integrated in the waterproof box shown in Figure 5. The waterproof box contains a high-speed DAQ, an industrial computer, a touch screen, sensors, professional wiring harnesses, and jigs. The special jig allowed for convenient and rapid installation. Measurement software was written to measure and record various parameters of the six-axis motion platform at high speed.

Gyroscope and Angular Velocity Meter Jig
Three angular velocity sensors were fixed on the cube to measure angular velocity in the x, y, and z directions. The attitude gyroscope and the cube were fixed on a magnetic bottom plate, the magnetic attraction was approximately 47 kg. The adherence distance was adjusted using three screws to avoid the strong impact of direct magnetic adherence from damaging the sensors. Two powerful magnets at the bottom of the jig were adhered to the six-axis platform to be tested. To avoid the impact of powerful magnetic adherence, three knobs were designed. Before adherence, the knobs were turned clockwise to the end such that the three screw threads formed three points of support. After aligning with the x direction of the platform, the jig was adhered to the platform, and the three knobs were turned counterclockwise for the bottom plate to fit closely to the platform, the jig was thus firmly adhered to the platform. The jig could be easily dissembled by turning the three knobs clockwise to the end, as shown in Figure 6.

Laser Displacement and Angular Meters
Three three-section brackets (Figure 7a) were used to adjust the height of the x, y, and z axes of the measurement platform, while three measurement reference plates (Figure 7b) were magnetically adhered to the x, y, and z axes of the six-axis platform. The positions of the brackets or reference plates were adjusted for a red laser dot fired out of the laser displacement meter to hit near the center of the reference plate. Because the six-axis platform had a hexagonal structure design when viewed from above, the x axis was adjusted for the measurement reference plate to magnetically adhere to the x direction, and the x direction displacement was immediately read when the laser hit the measurement reference plate. The y axis was not perpendicular to any plane. Therefore, the reference plate was installed on the side of the six-axis platform, and y direction displacement was obtained through angle correction. The correction method is shown in Figure 7c Figure 8a presents the measurement software setting form, which allows for archive path and measurement speed settings. The five sensor-related settings are as follows: angular velocity sensor and laser displacement meter receiving signals from the voltage input channels (the software enables or disables the function as well as adjusting the channel name, scale, offset, and unit), three-axis accelerometer receiving signals from the IEPE channel (the software enables or disables the function as well as adjusting the channel name, sensor sensitivity, and unit), and attitude gyroscope receiving signals from the RS232 serial port (the software sets the communication port). Figure 8 presents the real-time curve and trend curve for the sensor signals received by the high-speed DAQ. The left side of Figure 8b is the channel display. The operator can manually select the number of measurement channels for continuous and simultaneous measurement, display, and archiving.

Implementation
The implementation block diagram of the platform is displayed in Figure 9. The mechanical structure of the platform was designed to carry a simulator cab of 1500 kg or heavier (Figure 10a). The platform mechanism was divided into upper and lower platforms. The six support arms of the platform achieved the 6DoF stroke required by the simulator cab through crank arm rotation. Fisheye bearing joints were used to connect the upper end of the support arm to the upper platform, while the lower end of the support arm was coupled with the crank arm to drive the upper platform. The prototype of the crank mechanism is shown in Figure 10b. The dimensions are link length = 105 mm, support arm length = 835 mm, and crank length = 250 mm. The parameters of the motor are shown in Table 1. The gearbox ratio is 32.41. The servo motor was connected with a gearbox to magnify the torque output. A motion control card PMDK, produced by ICP Das Co., Ltd, was used with a 5-V PCI bus. The PMDK had six pulse input and output channels, six analog input and output channels, and various digital input and output channels. The PMDK was equipped with a two-wire FRnet IO module, which can be used for remote input and output control.   The monitoring module is shown in Figure 11a,b. The operator opened the waterproof storage box, screwed one end of the wiring harness to the input and output connector and the other end to sensor a, and secured the measurement reference plates and three-section brackets in place (Figure 11a). Figure 11b displays the positions of the angular velocity meter and the gyroscope.
The main program conducts the initial setup, thread enabling, and mode login of the platform. Figure 12a contains a flowchart of the implementation. Under the normal mode, the login mode can be selected using the human-machine interface. When the operator discovers an abnormal alarm or when maintenance personnel need to inspect the electric cylinders, they may select the maintenance mode via the interface. Data can be read and written via Internet transmission, and a thread of network modules is produced (Figure 12b). Operators can issue 6DoF commands to the platform and transmit the 6DoF commands to the platform computer by using Internet cable transmission.   Figure 13 contains photographs of the four strokes under the control of 6DoF. This section validates the accuracy and feasibility of the proposed method by using experimental results. Traditional inverse kinematics and the proposed inverse kinematics were written into the software-only the inverse kinematics software was modified, the hardware was not-to compare the motion of the six-axis crank arm platform when the two algorithms were applied. Then, 6DoF commands were issued to the platform through the humanmachine interface, and the movable range of each DoF was recorded.   Figure 14a. Because the traditional method used the trial-and-error method to control the lower platform coordinate, when the calculated rod length approximated the actual rod length, the movement was completed. The traditional method allowed the actuator to be operated only within the linear region, that is, a position of 60 to 180 degrees. The proposed method opted to directly map the crank arm platform to the Stewart platform, enabling the actuator operating region to reach 50 to 230 degrees. A comparison of the algorithms is presented in Figure 14b, where the subscripts "old" and "new" denote the traditional and proposed methods, respectively. As in the figure, the movable range of the proposed method was larger than that of the traditional method-a front-back distance 60 mm longer, a left-right distance 80 mm longer, and a vertical distance 160 mm longer, which effectively improved the stroke of the platform operation space. The algorithms' controllable angles of rotation-known as roll, pitch, and yaw-were compared, as in Figure 14c. The angles of rotation of the proposed algorithm were wider than those of the traditional algorithm-8 degrees wider in roll, 4 degrees wider in pitch, and 4 degrees wider in heave. An enlarged operating angle implies an increased overall platform space. Figure 12a,b are the 2 DoF ± 300 mm displacement response diagrams, where the motion control command begins at 8 s with a period of 4 s. To observe the relationship between surge and sway-a 90-degree difference-more clearly, they were plotted on the horizontal and vertical axes, respectively, forming a perfect circle (Figure 15b). Figure 16a-c present the displacement, velocity, and acceleration curves of surge conducting 150 mm of forward and reverse rotation, and the velocity was obtained using differential software. Platform operation involved complex mechanical parts as well as the simulator cab. Accordingly, a few spikes were observed in the differential velocity due to discontinuous displacement. Figure 17a,b are the response diagrams of the three translational DoF (surge, sway, and heave) at ±300 mm displacement with an angular difference of 120 degrees between any two. Regarding heave, the laser light of the displacement meter hit the rear of the upper platform. Due to the unfavorable mechanism smoothness, ripples were observed in the extracted signals. A 3D circle was formed when the three translational DoF were spatially plotted. Figure 18a-d are the response diagrams of the three other DoF at ±26 degrees with an angular difference of 120 degrees between any two. In Figure 18b, RS232 is used to read the angular velocity of the gyroscope, which has an amplitude of ±12 degrees/s. The roll, pitch, and yaw were spatially plotted, forming a 3D circle. Figure 19 shows the x, y, and z axis accelerations of the test platform, and the impulse responses were captured by the accelerometer. The platform performed x axis acceleration and deceleration alternately at 5-15 s, and the acceleration was approximately 0.5 g, whereas the platform performed y and z axis acceleration and deceleration alternately at 22-23 s and 43-55 s, respectively, and the acceleration was also approximately 0.5 g.

Conclusions
This study discussed the inverse kinematics of a six-axis motion platform, and the development of a monitoring system. The main contribution of this study is the design of a 6DoF crank arm mechanism to replace the expensive 6DoF linear actuator Stewart platform, 3DoF crank arm platform, and 4DoF crank arm platform, and the result of obtaining a comparable movement experience to the Stewart system. The algorithm was applied to the motion control of a 6DoF platform to control the elongation of the virtual cylinder and to determine the platform attitude required by the 6DoF platform. Unlike the conventional method, which relies on approximation to obtain the required angle, this study proposed a more accurate, real-time, and highly dependent processing method. In addition, this study used LabVIEW to create a set of testing equipment that integrates different sensors and jigs to read the angle, angular velocity, displacement, and linear acceleration of the platform in motion. Subsequently, the differential equation and sampling rate were used to calculate the angular acceleration and linear velocity. The testing equipment data were transmitted to the platform computer via RS-485 or RS-232 digital communication, allowing the platform to control the state of motion at all times. Finally, the experimental results prove the proposed algorithm capable of improving the operation of the platform stroke and thus applicable to simulators with higher specification requirements. Moreover, the implementation of the platform was based on the PID controller. Because of its simple structure, strong robustness, and good stability, the PID controller is still widely used in various fields of industrial control. However, the modern control theory of the platform is not the main topic of this study that will be considered to evaluate the design in future work.
Funding: This research received no external funding.

Conflicts of Interest:
The author has no conflict of interest to declare.