Trajectory planning of the nursing robot based on the center of gravity for aluminum alloy structure

In this paper, the robot arm is manufactured to increase the structural strength and improve safety. The stability of the nursing robot in the process of carrying out the typical nursing task of holding patients was studied, and the influence of the center of gravity on the movement stability of the nursing robot was analyzed. The mathematical model of the stability of the robot is built by using the inverse kinematics solution of the robot. By studying the trajectory planning of a nursing robot under the condition of ZMP constraint, the robot can move safely and optimally along the prescribed trajectory between two working points. The simulation results show that the algorithm can significantly improve the work safety of the robot. In the experiment, four pressure sensors are used tomeasure the pressure of four wheels on the ground, the data are obtained and substituted into the expression of center of pressure (COP)method. The results show that the stability is in a reasonable moving area without any hidden danger, and its COP value is less than the stable qualitative boundary, which verifies the rationality and effectiveness of the optimal center of gravity stability planning algorithm.


Introduction
The nursing robot has the ability to complete all kinds of nursing tasks safely and stably in the complex living and working environment facing the patients [1]. It is the embodiment of the combination of traditional rehabilitation nursing mechanisms and advanced robot technology [2,3]. It has become a hot issue in the field of rehabilitation nursing to use nursing robots to assist medical staff in rehabilitation nursing and liberate medical staff from heavy physical labor [4,5]. When assisting medical staff to carry out rehabilitation care for patients, the lifting and transferring of patients is the most physical and dangerous task [6], especially in the case of shortage of medical staff, which is the direct cause of the musculoskeletal injury [7]. The nursing robot carries on the nursing task, assists the medical staff to carry on the recovery of the patient, and completes the stable transfer of the patient [8].
Having high strength and good corrosion resistance, 7000 series aluminum alloys are widely utilized in robots. That is why various investigations have studied the robot arm mechanical behavior of this series of Al alloys. Flat rolling is a commonly employed operation for making 7075 Al alloys due to its potential for mass production. This process could be carried out at room temperature as well as at elevated temperatures, depending on the size, material, and type of the initial workpiece. When the necessary forming force and energy should be reduced and the ductility of the material must be enhanced, hot rolling is used. Li et al. found that bending stiffness affects the contribution of machining-induced residual stress and initial residual stress to machining deformation of the thin-walled part [9]. The relatively smaller equivalent stiffness, the more machining deformation contribution to the thin-walled part. Gao et al. developed the influence of workpiece position in the blank to the machining deformation [10].
The strength of mechanical structural materials and movement stability in the whole movement process is the most concerned problem, which is directly related to the success or failure of the nursing task [11].
Stable support is an important condition to obtain ideal motion, which means that the relative acceleration between the wheel and ground is zero, and it is in point contact. When the contact force between the four wheels of the nursing robot and the ground is greater than 0, it means that the four wheels are always in contact with the ground and will not overturn [12]. For the nursing robot, the danger of tipping is much more serious than sideslip. If tipping occurs in the process of holding the patient, the consequences of injury to the patient are unimaginable [13]. Compared with the traditional wheeled robots, the stability of humanoid robots is more worthy of study [14]. There are many types of judgment criteria for the stability of humanoid robots, the most important of which are ZMP, FRI, and COP [15,16]. ZMP is zero moment point, if ZMP falls within the range of the sole of the foot, the robot can walk stably. COP is the center of pressure, if the robot is dynamically stable, ZMP coincides with CoP and can be calculated with CoP by using force sensors on the foot. These kinds of judgment criteria have their limits; up to now, there is not a judgment basis that can completely replace other types [17]. Therefore, in this paper, it is assumed that the wheels of the nursing robot will roll with the ground perfectly without sideslip, and it is analyzed whether it will overturn under different working conditions. To prevent secondary injury to patients and stably with low acceleration and external impact load, it is required that all joints of the nursing robot move smoothly and stably. Under zero load or low speed, the dynamic stability of the nursing robot can be regarded as static stability at all times. The stable region is the projection of a convex polygon formed by the contact points of each wheel of the robot and the ground in the horizontal direction. When the arms, waist, trunk, and head of the humanoid nursing robot are in a certain pose, the whole center of gravity and the projection in the horizontal direction are in the stable region, and the robot is in a stable state.
2 Kinematics analysis of nursing robot system

Structure of nursing robot
The commonly used metal material for robot manufacturing is aluminum alloy, because of its strong acid and alkali resistance, the proportion of stainless steel is small, and aluminum alloy is more convenient to process than stainless steel. Most parts of the robot will be made of 6061 and 7075 aluminum alloy. The 6000 series aluminum alloy represented by 6061 is mainly composed of magnesium and silicon [18]. The aluminum alloy has medium strength, good corrosion resistance, weldability, and good oxidation effect [19]. The 7000 series aluminum alloy represented by model 7075 mainly contains zinc, which is al mg Zn Cu alloy [20]. It belongs to a super hard aluminum alloy and can also be heat treated. It has good wear resistance and good weldability, but its corrosion resistance is poor. It is mostly used in the aviation environment [21]. The wheeled omnidirectional mobile nursing robot designed in this paper is composed of four omnidirectional wheels, chassis frame, waist, trunk, arms, and simple palm. The robot structure is made of 7075 aluminum alloy, it is a kind of cold treatment forging alloy with high strength, far better than mild steel [22]. It has common corrosion resistance, good mechanical properties, better deep drilling performance, and enhanced tool wear resistance [23]. Adding magnesium to the alloy containing 3-7.5% zinc can form MgZn 2 with remarkable strengthening effect, which makes the heat treatment effect of the alloy far better than that of the Al-Zn binary alloy [24].
The design of a nursing robot combines the advantages of the wheeled robot and the humanoid robot, adopts omnidirectional wheel chassis, which is flexible and easy to control, has good stability, and is combined with the trunk mechanical arm to form a composite robot system. It not only increases the flexibility of the nursing robot but also expands its scope of work. The mechanical structure is shown in Figure 1.
Nursing robot covers the advantages of intelligent wheelchairs and nursing beds, which can not only assist medical staff to transfer patients but also meet the diversified needs of daily care in families and hospitals [25]. The cooperation between the two arms and the mobile base greatly expands the scope of the operation ability of the nursing robot. The wide mechanical arm ensures a large contact area with the nursed. The transmission mechanism is driven by a servo motor with a braking system and a planetary reducer, which can stably lift the patient and put him into a wheelchair, transfer between the sickbed and the sickbed, prevent the risk of secondary skin injury and body falling, and increase the safety factor. The omnidirectional wheel chassis is used to assist the nurses to complete the transfer of patients. Its omnidirectional movement ability is very suitable for working in an environment with limited transfer space and narrow passage between the sickbed and sickbed. It has a very flexible movement ability and strong adaptability. It can improve the transfer efficiency of patients, increase the utilization rate of limited space in the sickroom, and reduce the cost of medical staff.

Forward kinematics
Robot kinematics is to control the motion of the manipulator's arm, that is, to control the joint angles of the manipulator's arm the controlled variable is the angle of each joint motion [26]. Robot kinematics is mainly concerned with the motion of each joint of the manipulator without considering the force. Forward kinematics analysis is to determine the relative position and orientation between the end of the manipulator and the base coordinate system according to the joint angle of the manipulator and its component parameters [27].
According to the method of establishing D-H linkage coordinate system and linkage parameters, the linkage coordinate system of nursing service robot is established by the functional requirements of the designed robot [28]. Since there are two methods for establishing coordinate system, there are two different forms for establishing homogeneous coordinate transformation matrix. The coordinate system of the connecting rod established in this paper adopts the upper joint method and is also an improved D-H model [29]. The coordinate system of the linkage is consolidated at the upper joint of each connecting rod, and the origin of the established coordinate system is defined on the axis of the upper joint [30]. Each joint axis and the common perpendicular line between the joint axis i and i +1 or the intersection point between the joint axis i and i + 1 according to the extension line of the joint axis are found out. The intersection point is the origin of the linkage coordinate system {i}. When the first joint variable is 0, {0} and {1} coincide.
When the coordinate systems are transformed into each other, to ensure that there is no relative motion between the two coordinate systems and their corresponding linkages, one coordinate system can be matched by rotation, translation, and rotation, and then the corresponding homogeneous coordinate transformation matrix of each linkage is established, which is defined as T i matrix, Finally, a 4 × 4 homogeneous transformation matrix is obtained as follows: Each homogeneous transformation matrix contains only one unknown variable, θ i , and the others are known structural parameters. According to the above formula, the transformation matrix of each linkage in the independent left arm can be obtained. The position and orientation of the wrist coordinate system for the independent left arm relative to the world coordinate system is as follows:  (3) The linkage parameters of the independent left arm are replaced by the parameters in each transformation matrix of the right arm. The position and orientation of the wrist coordinate system for the independent right arm relative to the world coordinate system is as follows: (4) The forward kinematics equation of the waist-arm structure of the nursing robot is Equation (5) is the coupling relationship between the left arm and the left arm of the robot, in which the origin of the world coordinate system is the midpoint of the axis of the first joint, and the height H from the origin to the ground is not considered in kinematics analysis. From the coupling relationship, it can be seen intuitively that the position and orientation of the wrist joint can be determined by 12 joint variables.

Inverse kinematics solution
The inverse kinematics solution of robots plays an important role in robotics; it is directly related to motion analysis, off-line programming, and motion planning [31]. The inverse kinematics problem of the robot is solved by a genetic algorithm, which is based on the difference of position and orientation of the robot wrist joint as the objective optimization function of the genetic algorithm [32]. Homogeneous transformation can be used to solve the problem of forward kinematics, and the inverse kinematics of the robot can be obtained according to the position and orientation of the robot end-effector. The relationship between forward and inverse kinematics is shown in Figure 3.
The waist arm coupling structure of a nursing robot is the main structure to complete the task of holding, and it is also a difficulty of research. Therefore, in this paper, we mainly study the stability of the center of gravity when the chassis stops and the waist-arm structure moves. The work process of the inverse solution algorithm of the waist-arm coupling is to realize the inverse solution optimization of the robot waist-arm structure system through the continuous constraint and coordination of the independent two-arm joint space. The flow chart is shown in Figure 4.
First, the robot system gets the pose of the dual-arm target according to the information processing of the sensor module and solves the inverse kinematics solution of the pose of each arm endpoint in the joint space according to the genetic algorithm. At this time, the inverse solution algorithm is not only a single optimal solution for calculating the pose error of the arm but also a coupling constraint according to the joint relationship and operation requirements of the robot waist arm structure through the coupling operator. Finally, the inverse solution of the waist arm structure is completed.

Analysis of stability model
The chassis of the nursing robot is regarded as the footboard of the humanoid robot, and the most important stability judgment method of a humanoid robot is used to analyze. According to the relationship between the three judgment criteria and the specific structure of nursing robots, safety and stability analysis is carried out. When the nursing robot holds the patient according to  the planned path, the first consideration is the balance of the center of gravity during the movement of the nursing robot. As the working ground is generally relatively flat, the ZMP point of the whole system is located in the support polygon formed by the contact point between the wheel and the ground, and the nursing robot is in dynamic stability [33].
The contact points between the four omnidirectional wheels of the nursing robot and the ground form a rectangle, with the rectangular center whose edge is parallel to the Z-axis and Y-axis as the origin and the minimum distance r0 from the origin to the rectangular contour boundary as the radius circle. This area is defined as an effective stable and safe area in this paper, as shown in Figure 5.
When the nursing robot is in the initial static state, the ZMP point of the nursing robot system is located in the most stable situation in the effective stable region. When the ZMP point is located in the effective stable region during the movement, the nursing robot is located in the dynamic stable region; otherwise, it cannot be guaranteed whether it is stable. It is necessary to adjust the motion parameters of each component to adjust the ZMP point of the system to a stable and effective area. The judgment formula is as follows: The distance between the end of the two arms and the boundary of the workspace determine the different regions of the center of gravity, as shown in Figure 6.
It can be seen from Figure 6 that the most likely direction for the robot to tip is forward. When the nursing robot holds the object and its arms are extended forward, the dumping boundary D l D r is at the position where the nursing object is 40 kg. If the robot exceeds the boundary line, it will dump, and the unstable area is outside. The boundary line and angle can be obtained from the following: where θ 1 = π/3, θ 2 = π/4, θ 3 = π/3, according to the cosine theorem, The center of gravity parameters of each part of the nursing robot can be measured from Solidworks by setting the real material and quality of the model as shown in Table 1.
According to the mass center and mass parameters of each part of the robot, the position of the unstable boundary can be calculated at the time of holding, as follows: where m C is the load mass, when m C = 40 kg, D max = 330 mm, when m C takes different values, the change of D max at the dumping boundary is shown in Figure 7. It can be seen that when the nursing robot has no holding task, the tipping boundary is the furthest from the stable area, and the possibility of tipping is the least. With the increase of holding load mass, the tipping  boundary is closer and closer to the stable area, the stable area is smaller and smaller, and the tipping is more likely to occur at this time. Force analysis of the platform is shown in Figure 8, and the orientation of the gravity is vertically downward.
The simplified calculation formula of the ZMP point of a nursing robot can be obtained without considering its inertia force and the moment [34].
When r zmp ≤ r 0 = 272 mm, the point P zmp is in the main stable region. To quantitatively analyze the stability degree of different regions, the stability degree of the point in the main stable region is 1, and the stability degree of the sub-stable region is In conclusion, the closer the ZMP point is to the main stability region, the higher the stability coefficient is. Through the above analysis, we can use the theory of center of gravity stability judgment to optimize trajectory planning, as the reference standard of motion planning.

Motion planning for optimal stability of gravity center
The end pose of the nursing robot in this paper is the middle point end of the independent arm; so, the trajectory planning problem of the two arms is transformed into the trajectory planning of the middle point, and the motion relationship of the two arms joint is obtained by the algorithm in the inverse solution [35]. Trajectory planning with the highest stability of the gravity center is one of the optimal control problems of a robot. Its purpose is to plan the optimal trajectory through these key points and meet the corresponding constraints according to the given path points.

Mathematical model of planning objectives
Because different positions have a different center of gravity in different trajectory planning tasks, their trajectory stability should also be different; so, it is necessary to select a robot position configuration that can complete the trajectory planning task and run with the highest stability. According to the ZMP decision theory, to reflect the stability of the whole robot movement process, the time average value of the stability of the robot is selected as the planning goal. We assume that the whole motion   space of the robot is divided into n position points, the average stability of the robot corresponding to the initial position 0 to position i is S ta , and the time of position i is t i , as shown in Figure 9. Based on the above analysis, the mathematical model of the above strategies can be established: Through the mathematical model of the planning objective, the stability of any point can be calculated according to the algorithm of inverse kinematics solution. Through the optimization of stability, that is, the S ti value is the maximum, the path can be optimized.

Optimization analysis of path shape
According to the optimal stability as the objective function, the path points are obtained by a standard genetic algorithm, and then the optimal stability path shape is analyzed. Trajectory planning is the path shape from the current position to the target position, because it is the middle point of the end of the two arms; so, it is necessary to determine the current position and target position from the two arms position [36].
The current pose of the independent left arm is As the starting position of path planning, the above matrix is obtained from the end pose matrix of the left arm and right arm. In this paper, the points in path planning are all the planning of middle point motion.
The main nursing tasks of a nursing robot are holding and transferring, which need to be discussed from the movement forms of two tasks, namely, forward holding and lateral holding, as shown in Figure 10.

Path shape of forward holding motion
The forward holding movement is the simplest movement form of a nursing robot, which mainly extends arms forward to approach the nursing object lying flat. The target pose of the independent right arm is  The planning goal of optimal stability trajectory planning is the average stability S t ; so, the path points can be obtained by using a standard genetic algorithm with S t as the objective optimization function. Setting n = 20 and t = 20 s, the fitting curve by the second-order parabola function in MATLAB simulation is as shown in Figure 11.
It can be seen from Figure 11 that the optimal path tends to be a straight line, and the deviation in the Z-axis is very small; so, this path shape can be used as the theoretical optimal planning path. According to the initial and final pose, two commonly used path shape planning can be selected, that is, using straight lines and arcs to plan the movement from the current position to the target position, as shown in Figure 12.
According to structural parameters, inverse kinematic solution, path shape, and the mathematical model formulas of average stability, the average stability of arc track, S tc = 0.021, and that of straight track, S tl = 0.047 can be obtained. It can be seen that the average stability of the straight path shape is greater than that of the arc path shape, that is to say, the safety of the straight path is better than that of the arc. It can be seen that the shape of the straight-line path is basically consistent with the optimal planning path.

Path shape of lateral holding motion
Lateral holding movement is another movement form of nursing robot, which mainly extends arms forward and inclines to one side to adjust the nursing object.
The target pose of the independent left arm is Similarly, the fitting curve of path points is shown in Figure 13.   It can be seen from Figure 13 that the optimal path basically tends to a straight line and then suddenly downward at the end with little deviation. This path is taken as the theoretical optimal planning path, and the T t T ps section is an arc section in the ZOY plane, as shown in Figure 14.
According to the formula, the average stability of T c T ps track is S tc = 0.032 and that of T c T t T ps track is S tl = 0.040. Although the trajectory of T c T t T ps is the longest and the average stability value is the smallest, it can be seen that the shape of T c T t T ps path is basically consistent with the optimal planning path.

Result analysis
From the above simulation analysis, it can be seen that the closer the path shape is to the Z = 0 plane, the greater the average stability S t is, the easier the optimization process is to approach the plane. The radius r of the security domain determined by ZMP is analyzed, as shown in Figure 15.
In Figure 15, OT i = r1, OT s = r2, T i T s is parallel to Z-axis. It can be seen that OT s is greater than the length of OT i , that is, r 1 is less than r 2 , then in the same Z variable value path points T i and T s , the stability of T s point is less than the stability of T i , so the shape of the safe path is closer to Z = 0 plane.

Experiments
The gravity sensing system is applied to the nursing robot to verify the feasibility of the optimal stability trajectory control theory of the center of gravity of the nursing robot in the process of robot movement. The sensor measures the pressure between the four omnidirectional wheels and the ground, to indirectly measure the stability degree. The gravity test system collects data through a certain frequency and stores the data in Excel format into the computer. When analyzing the data, it can be directly exported from the computer.
To ensure the safety of the personnel in the experiment, the nursing robot carries 20 kg weight on both arms, that is, the physical figure with the total load of 40 kg, as shown in Figure 16.
The six motors of the shoulder joint and elbow joint provide the largest torque in the holding task; so, the curve of the running speed and position of the six motors under load is shown in Figures 17 and 18. Blue is the first shoulder joint, orange is the second shoulder joint, and green is the elbow joint.
It is shown from Figures 17 and 18 that the nursing robot can lift a load of 40 kg normally, which meets the technical requirements of the design.
Before the experiment, it is necessary to determine the theoretical parameters and data, to make a comparative analysis with the experimental results. According to the position of the nursing object in the bed, the initial middle point position and orientation of the nursing robot are set by the sensor equipment.   After the optimal stability path planning of the center of gravity is completed, the paths of these Cartesian spaces must be transformed into the variables of the equivalent joint space. The complete analytical solution of this problem should use inverse kinematics to calculate the position of the joint, use inverse Jacobian matrix to calculate the joint speed, and use inverse Jacobian matrix and its derivative to calculate the angular acceleration.
The optimization results of the genetic algorithm based on MATLAB and the calculation results of ZMP prove that the planned movement can achieve the optimal stability of the center of gravity of the nursing robot. According to the definition of COP, we can install four pressure sensors on the chassis, as shown in Figure 19; t 1 and t 2 are divided into the sensors at the front left and right, h 1 and h 2 are the sensors at the rear left and right, respectively. Therefore, the experiment of holding action is carried out on the experimental platform of a nursing robot, and the pressure changes of four omnidirectional Wheelsets on the ground during the movement are collected by using the gravity test sensor system.
Ten data points were extracted equidistant from the experimental data, then the COP formula is used to get the stability value [37], and finally, the MATLAB is used to fit the change curve.   where F R1 , F R2 , F R3, and F R4 are the pressure values measured by the pressure sensor, and l 1 , l 2 , l 3 , and l 4 are the distance between the pressure sensor and the center of the platform. For two kinds of motion tasks, forward and lateral holding are verified by a physical prototype. The path of forward holding motion is relatively simple, which belongs to the shape of the linear path. The center of gravity moves in the positive direction of the Y-axis and coincides with the Y-axis. Most of the paths of the lateral holding movement are similar to the shape of the forward holding path, but the second joint of the waist will have a lateral angle in the last movement. The change curve between the sensor pressure value corresponding to four omnidirectional wheels and the Y-axis position coordinate of the middle point is shown in Figure 20.
The data acquisition frequency of the gravity measurement system is 1 Hz, and the experiment time is 20 s. The data format exported from the system software is excel data. The list of 10 data extracted is shown in Table 2.
The change data of stability value and y-axis position coordinate of intermediate point can be obtained by substituting the data into COP calculation formula. Then, the second-order parabola function is used to fit the changing relationship in MATLAB, and the curve is shown in Figure 21.
In the process of movement, the pressure value of the front wheel sensor becomes larger and larger, while the pressure value of rear-wheel sensor becomes smaller and smaller. If the pressure value of the rear-wheel sensor is 0, the robot will topple forward. It can be seen from the sensors change the value of the two kinds of motion that the pressure value of the rear wheel sensor is greater than 0, which can ensure safety in the optimal planning motion. In the lateral movement, because the second joint of the waist will have a lateral angle at the end of the movement, the two front wheels and the two rear wheels have different final pressure values, but are still greater than 0, maintaining a stable state. In the change diagram of the COP parameter value, an area I is the main stable area and the stability degree in the area is the same. Area II is the sub stable area and the stability degree changes with the change of the center of gravity position. Area III is the unstable area, and the center of gravity position will fall into this area. It can be seen that the farther away from the center position, the greater COP value, the lower stability, and the closer the end position is to the XOY plane, the smaller COP value, the higher stability.  In this paper, the stability of nursing robots in the process of holding patients is studied, and the influence of the center of gravity on the stability of nursing robots is analyzed.
(1) This paper mainly considers the influence of gravity on the stability of nursing robots for aluminum alloy structure in the process of operation and adopts ZMP dynamic stability criterion, to get the results in line with the actual situation as far as possible.
(2) Taking the optimal stability as the performance index, the stability mathematical model of the robot is constructed by analyzing the stability of the robot and using the inverse kinematics solution of the robot. To make the robot move safely and optimally between two working points or along the prescribed trajectory, the robot trajectory planning is carried out under ZMP constraints. The experiment is based on the gravity sensor system and the control system of EtherCAT. (3) The position control drives the robot to move according to the path of the optimal trajectory planning. At the same time, the gravity test system collects data, and the experimental results are analyzed according to the collected data to verify the rationality of the planning. The results show that the algorithm can significantly improve the work safety of the robot and has a certain theoretical significance for the actual robot trajectory planning.