A General Design Method of Cam Proﬁle Based on Cubic Splines and Dynamic Model: Case Study of a Gravity-Driven Tricycle

: This paper proposes a general design method for cams based on the kinematics and dynamics of a mechanical system. According to the actuator’s trajectory, the cam proﬁle is generated in reverse based on the kinematic model of the system. Firstly, the cam design’s optimising problem is converted into the execution trajectory’s optimisation to obtain the optimum operation trajectory according to the actuator’s requirements. Secondly, the relationship between the cam proﬁle and the actuation trajectory is modelled based on the kinematics and dynamics of the mechanical system. Then, applying the cubic spline interpolation method, the cam proﬁle is generated, and the error compensation methods are illustrated through numerical analysis. Finally, the validity of the presented design method is veriﬁed through experiments, which demonstrate the reliability of this method.


Introduction
The development of modern machinery has been gradually increasing speed, efficiency, and reliability requirements. In terms of mechanism selection, the applicable motion trajectories of crank-rocker mechanism and sine generator are limited; intermittent mechanisms such as slotted wheel mechanism and incomplete gears output less smooth motion, and their research applications are narrow. The mainstream mechanisms that can realise arbitrary trajectory motion in the plane are the cam mechanism and the RSSR space four-rob mechanism. Among them, the RSSR space four-rod mechanism consists of two Rotating subs (R) and two Spherical subs (S), of which the structure is relatively complex. The relationship between the length of each rod of the mechanism and the motion of the output axis is nonlinear [1]. Therefore, the process of reverse derivation of each rod length for a given trajectory is complicated, and the assembly and adjustment are troublesome.
Cam mechanisms are widely used in packaging machines, cam manipulators, textile machinery, agricultural machinery, CNC machine tools, and automatic machine tool feeders. In contrast, the cam mechanism is compact and saves much space, and it is suitable for small and miniature devices. It also has various functions such as transmission, guidance, and control. Moreover, its adjustment is more effortless, so the error requirements for machining and assembly are not too high. Studies of cams have been further deepened and expanded. A variety of traditional functions can be used to describe follower motion, such as harmonics [2], cycloid [3], trapezoidal acceleration function [4], polynomials [5], segmented polynomials [6], and Fourier series [7]. A typical design approach is to translate kinematic curve synthesis problems into algebraic problems with the spline interpolation function as the destination [8,9], e.g., cubic splines [10], Bezier curves [11,12], triangular splines [13], Hermite splines [14], B splines [15,16], and Non-Uniform Rational B-Splines (NURBS) curves [16,17]. In addition, kinematic and dynamical methods have been applied to the design of cam mechanisms [18,19]. In order to obtain kinematic curves with good dynamic properties under arbitrary design requirements, the kinematic model parameters are obtained by optimising the dynamic performance [20,21]. Currently, there are also many relevant software packages to create cam systems to facilitate the design of cam mechanisms, e.g., CAD/CAM [22][23][24], UG [25], and SOLIDWORKS [26,27].
In the design of cam mechanisms, the cam profile design is one of the primary tasks. The desired motion pattern of the follower or the actuator can only be achieved with an appropriate cam profile. There are two broadly used cam profile design methods, the graphical and the analytical methods. The traditional graphical method is laborious and inaccurate. Using data obtained from manual tests, depicting the curve could lead to significant errors. On the other hand, the analytical method allows calculating the coordinates of the points on the contour line precisely with more minor errors. There is much research on using the graphical methods for plate cam profile design [28], where applied reverse engineering using kinematics. The Cartesian coordinate system is the main tool for the graphical methods [29][30][31][32]. Wu et al. [24] proposed a design of a variable speed translational cam profile [33]. Two approximate analysis methods were given to determine the plate cam profile with a roller follower [34]. In the first analysis method, the mean position is defined by two tangent lines of three roller positions, and the cam profile is obtained by interpolating these roller positions. In the second analysis method, the cam profile is obtained by intersecting the centre of curvature with the centre of the roller. Jung-Fa Hsieh [35] presented a systematic method for designing and analysing cams with three circular profiles. Hseih [36] illustrated a simple and comprehensive approach to designing cam profiles using coordinate transformations. A finite element method was used to design cam profiles based on the positioning of the follower [37]. However, the previous traditional design method is to set various parameters such as base circle radius, thrust, and return of the cam, which does not apply to the cam design for arbitrary given trajectory in the plane. Zhou et al. proposed a high-speed cam mechanism design method based on the Fourier series, but the Fourier series is an infinite term, so the theoretical design error always exists [7]. Hseih et al., on the basis of the previous, developed a system design and analysis method for triclinic cams [36]; however, this method cannot conveniently realise the transformation from the given trajectory of the moving parts to the cam profile. Forrest came up with a closed-form modified trapezoidal cam motion function with adjustable positive and negative acceleration [9], which has some limitations that cannot be applied to more complex motion laws. In addition, cam mechanisms are chosen in Wu et al.'s design of a three-degree-of-freedom fast parallel robot [38], Yixin et al.'s gait rehabilitation machine [39], and Giuk et al.'s design of an integral gravity compensation mechanism [40]. Although their studies did not focus on the design and validation of cam profile algorithms, their research did prove that cam mechanism design plays a vital role in broad application areas and various research fields. This paper proposes a method for designing cam mechanisms based on a kinematic modelling of the whole system. According to the characteristics of the task, the kinematic and dynamical properties of the machinery are considered in the optimised design of the actuator trajectory. The expression of the relationship between the cam profile and the trajectory is established utilising a kinematic model of the mechanical system, and the coordinates of the cam profile are inversely resolved by applying a cubic spline interpolation method. Thus, an arbitrary-demanded-trajectory cam can be obtained. Guidance on compensating for the system errors is also given based on the numerical analysis of the theoretical model. The proposed method is verified by a case study of a gravity-driven tricycle. In this paper, the design and mathematical modelling of the core part of the steering control device are carried out in Section 2. Then, the algorithm of cam profile applicable to arbitrarily given trajectory is developed in Section 3 by combining mathematical modelling and interpolation calculation. Finally, the general method of designing the fine-tuning mechanism according to the allowable error range is given, and the prototype test is carried out in Section 4.

Device Construction
As shown in Figure 1, the drive wheel A is the movement rule input, which is transmitted to the cam through the drive mechanism, a set of gears; the steering wheel C is the steering motion output, and the final motion trajectory is the movement output. In Figure 1, the drive wheel A and the driving wheel B are installed on the rear shaft while the steering wheel C is perpendicular to this shaft; the horizontal distance between each of these rear wheels and the steering wheel C is D. The gear set is on the side of drive wheel A, and the cam and steering rod are on the side of driving wheel B. When this device moves straight forward, the steering rod axis is parallel with the rear shaft axis and the vertical distance is L; then, the radius of the corresponding cam curve is the reference radius r b , and the steering wheel C is parallel to the cam with a distance of d. The device parameters when moving straight forward are as shown in Table 1.

Steering System Model
As shown in Figure 2, the rotation angle of the steering wheel C is α, and then the turning radius of the point O AB is R, then Set the radius variation of the cam curve ∆r, then ∆r = d· tan α. The radius of the cam curve ρ at this time will be ρ = ∆r + r b , among which, r b stands for the reference radius of the cam curve. That means when the rotation angle α of the steering wheel C equals zero, ρ = r b . Therefore, the relationship between the cam curve radius and turning radius R can be described as:

Motion Trajectory Modelling
Assuming that the drive wheel rotates at a constant speed and so does the cam, set the distance travelled in per unit time ds and the cam rotation angle in per unit time dθ. Then, the travel distance s is linearly related to the cam rotation angle dθ. Moreover, when the cam rotated a whole circle 2π, the device finished a period with a travel distance of S.
Therefore, ds = S 2π ·dθ. The corresponding coordinate changes of O AB (x, y) are: According to the device structure parameters, coordinates of every point in the device can be derived.
Drive wheel A (x a , y a ): Driven wheel B (x a , y a ): Steering wheel C (x c , y c ):

Calculation of Cam Profile Curves
The trajectory-based cam profile algorithm is built in accord with the known trajectory function. For a periodic function f (x), only the cam profile corresponding to one period (0, l) needs to be solved. When it comes to non-periodic functions, the whole definition domain can be considered one period. To solve the cam profile is to solve the relationship between its radius ρ and corresponding angle ϑ, which can be replaced by calculating the corresponding sequence ρ i of a uniform-equal-step sequence ϑ i .
The parametric equations of trajectory function y = f (x) are: Furthermore, the length is: Since the drive wheel and the cam both rotate at a constant speed, the distance travelled and the angle that the cam turned in per unit time are also constant. That is, the linear speed v of the drive wheel is proportional to the angular speed ω of the cam, i.e., v The sequence S i can be derived through the sequence ϑ i and Equation (10). Applying cubic the spline interpolation method, a sequence X i can be acquired, which corresponds to the sequence S i in uniformly equal steps. Then, the sequence Y i can be obtained by the trajectory function y = f (x), which gives a set of parametric equations: Furthermore, trajectory curvature k can be calculated by: Among which, ∆x(ϑ) and ∆ 2 x(ϑ) stand for the first-order and second-order differences of the function x(ϑ), respectively, while ∆y(ϑ) and ∆ 2 y(ϑ) stand for that of the function y(ϑ), respectively.
Substituting R = 1 k into Equation (3) yields: The sequence of ρ i , which corresponds to the uniform-equal-step sequence ϑ i , can be obtained by substituting sequences X i and Y i into Equations (12) and (13). That gives the coordinates of those points on the cam profile.

Experimental Validation
In the hypothetical, there is an obstacle with a diameter of 20 mm in every meter of a straight line, where the obstacle at an odd position is fixed, and the obstacle at an even position will move randomly within a range of ±( 200 ∼ 300)mm based on the original position ( Figure 3). The robot is supposed to make an opposite side detour for the obstacle at odd and even positions, that is, an S-shape obstacle avoidance. The prototype for experiment is shown in Figure 4. Based on the scenario assumed in the experiment, the safety distance radius for obstacle avoidance is set to 50 mm and test values are listed in Table 2.  Distance between rear wheels D = 50 mm 3 Active length of the steering rod d = 3 mm 4 Distance between steering wheel C and the rear shaft L = 77 mm 5 Radius of the steering rod r d = 1.5 mm 6 Reference radius of the cam profile r b = 75.5 mm 7 Tooth number and module of the gear on the rear shaft Z 1 = 20, m = 5 8 Tooth number and module of the gear on the camshaft Z 2 = 20, m = 5 9 Radius of the drive wheel A R A Note that the gear ratio Z 2 Z 1 and the radius of the drive wheel R A is connected such that once one of them is defined, the other can be derived.
Substituting test values into Equation (13) yields an expression for the curvature radius of the cam with respect to that of the trajectory.
Through optimisation using the GA algorithm with the goal of minimum travel distance, the following trajectory function is used as an example for verification: Substituting Equation (15) into Equation (9)   It can be seen in Figure 6, in the ideal condition (without assembly errors), that the simulated trajectory fully meets the targeted requirements and conforms to the theoretically designed trajectory within acceptable errors. However, various machining and assembly errors cannot be avoided in the actual situation. These errors affect the travel trajectory and the device's intended function.

Design of the Fine-Tuning Mechanism
Since the manufacturing errors may disrupt the practical trajectory, it is necessary to design a fine-tuning mechanism to compensate for the errors. These errors can be classified into three types as follows, depending on how they affect the trajectory:

•
Errors that cause uneven distribution of the steering's left and right rotation angles. The initial rotation angle error can cause these errors during steering wheel assembly, the axial position error during steering wheel assembly, the position error between the camshaft and the steering rod, and the change in the contact point between the steering rod and the cam during the push and return caused by the cam thickness, etc.; • Errors that make the sum of the steering wheel rotation angles too large or too small. This can be led by axial position error during cam assembly, etc.; • Assembly errors that produce both of the effects above, manufacturing errors of the cam profile, etc.
The function of this fine-tuning mechanism is to enable to adjust the error that exceeds the permissible error range, to some extent, to be within the range. First of all, the index value of this fine-tuning mechanism needs to be decided. Set the permissible deviation error of the driving trajectory under the premise of the expected number of obstacles avoided ±δ, the size of the actual trajectory error beyond the permissible error range be E , and the index value of this fine-tuning mechanism e, then ∀ε > 0, ∃e ∈ {x|x > 0, x ∈ R}, n ∈ N * makes: That is e ≤ 2δ. Take the deviation of ±0.01 • , for example, i.e., 0 < e ≤ 0.02 • , to perform the design.
The fine-tuning mechanism under this index value is very precise. Considering there is friction between the steering wheel and the ground and between the steering parts during the driving process, the fine-tuning mechanism is supposed to have a self-locking feature.
In the meantime, it should be convenient to adjust, so the worm is chosen. The specific design is shown in Figure 7: the worm wheel is fixed on the steering shaft cooperated with the worm, and there is an adjustment knob with scales installed on the side of the steering shaft, which can drive the worm to rotate by turning manually; then the worm drives the worm wheel to realise the left or right fine-tuning of the steering wheel. Set the tooth number of the worm wheel Z 3 , and then the gear ratio is 1 : Z 3 when the worm is the drive. Assuming that the knob can be turned exactly one degree at a time minimally, then there is: 1 Substituting 0 < e ≤ 0.02 • into Equation (17) yields Z 3 ≥ 50. Therefore, the tooth number of the worm gear is 50 at least. In addition, a micro-indexing head can be used for coarse adjustment. It can be assembled on the camshaft to change the axial position of the cam (Figure 8). In this way, the active length of the steering rod d can be adjusted so that the rotation amplitude is adjustable. For the first type of error, "errors that cause uneven distribution of the steering's left and right rotation angles", the designed worm mechanism can eliminate the error by directly finely adjusting the steering wheel's left and right rotation angle distribution. From Figure 9, it can be seen that when the first half-period length of the trajectory is larger than the second half-period length, the trajectory is skewed to the left (distribution +0.1 • ); when the first half-period length of the trajectory is smaller than the second half-period length, the trajectory is skewed to the right (distribution −0.1 • ). For the second type of error, "errors that make the sum of the steering wheel rotation angles too large or too small", in addition to the direct adjustment of the active length of the steering rod using the micro-indexing head, indirect compensation can also be made through the worm, especially when the deviation is no larger than +1.7 • − −1 • (Figure 10). When the steering amplitude increases, the trajectory has a tendency to deviate to the right (Trajectory A, amplitude +1.7 • ), and the steering wheel needs to be fine-tuned to the left (Trajectory B, amplitude +1.7 • , distribution +0.1 • ). Similarly, when the rotation amplitude decreases, the trajectory has a tendency to deviate to the left (Trajectory C, amplitude +1.7 • ), and the steering wheel needs to be fine-tuned to the right (Trajectory D, amplitude −1.0 • , distribution −0.1 • ). The simulation results show that the fine-tuning device can compensate for the errors that occur in machining and assembly and ensure that the device travels on the pre-set trajectory. With this as the basis for the test, the experiment plan is designed as follows. A prototype is manufactured and assembled according to the values in Table 2. A 1 kg standard weight (Φ 50 × 65 mm, made of carbon steel) is suspended on the device as the power source, and the drop height of the weight is 400 ± 2 mm. The standard weight is always carried by the trolley and does not fall from it. The weight is lowered by a rope that drives the drive wheel. An ink-dropping device is also suspended on the device to record the actual trajectory. Based on the length of one period of the actual operation of the experimental device, this period was measured in 40 equal parts, and the first measurement results are listed in Table A1 (Appendix A).
It can be seen in Figure 11 that the amplitude of the actual trajectory is larger than the amplitude of the ideal trajectory, and the actual period is longer than 2000 mm. According to the simulation results, it is caused by the steering angle being too large and the micro-indexing head can be used to reduce this error. Moreover, to keep the general direction straight, the worm should be used to turn the steering wheel slightly to the right while reducing the rotation angles. After adjustment, the measurement is still performed as aforementioned ( Figure 12) and recorded in Table A2 (Appendix A). It can be seen in Figure 13 that the adjustment has moved both the period length and the amplitude substantially closer to the ideal trajectory.   After adjustment, the scenario is simulated as required ( Figure 14). The obstacles are plastic round bars of 20 mm diameter and 200 mm height, one obstacle is placed at each odd position and one obstacle at each of the even position +300 mm and −300 mm limits. The device is required to go around the right side of the obstacles at the odd position and the left side at the even position, without touching them or passing between the two adjacent obstacles at even positions. During the test, the device completed the required operation of the pre-set trajectory without touching any obstacle in 10 periods.

Conclusions
In this paper, mathematical optimisation was applied for kinematics (the task performed by the cam) and dynamics (first and second order derivatives) while reverse resolving the cam profile. Through the simulation of the theoretical model, guidance in error analysis was presented. A case study of a gravity-driven tricycle was used for validation, and this method can also be used in applications such as robotic arms. In the case where the trajectory is known or can be derived, the advantages of the purely mechanical open-loop steering control system are reflected in the simple structure, low cost, and high accuracy. Meanwhile, it has broader applications, such as an environment with constant electromagnetic interference or unstable power sources (rehabilitation apparatus, manpower apparatus, etc.). The cam mechanism has the characteristics of compact structure and simple adjustment methods and can theoretically realise any trajectory's motion in a plane. This paper combined mathematical modelling and interpolation algorithm and proposed the cam profile algorithm based on the trajectory method. Nearly any motion trajectory in the plane can be obtained from the corresponding disk cam profile by this method, and the obtained data can be imported into computer-aided design (CAD) software packages to generate cam parts, and also into computer numerical control (CNC) machine tools for manufacturing. The open-loop system does not have the self-adjustment ability, and the error always exists in the actual machining and assembly, so this paper proposed an error compensation method for the open-loop system. Firstly, the error is classified based on how they affect the device. Then, the individual and mixed effects of all error types are acquired through simulation, based on which the fine-tuning mechanism is designed, with the purpose of directly or indirectly offsetting the influence of the error on the trajectory. The results of the simulation can also guide the commissioning of the actual device. Future work could focus on introducing artificial intelligence (AI) algorithms to analyse where and how much the errors are and give optimised adjustment guidance. Moreover, there can be many arguments about the plane's most typical or representative trajectory.
There are also some limitations in this paper. Because of the COVID-19 epidemic situation, experiment conditions are extremely limited. The manufacturing and assembly of the test device could not meet the requirements of precise instruments as they should. The roughness and smoothness of the test surface also have significant influences on the results. Because of the lack of adequate research resources, a representative or practical case study cannot be found for verification or application demonstration. This paper discussed the general design idea and approach of cam-based tracking robots based on the trajectory method and verified the feasibility through simulation analysis and prototype experiments. The research methods of this paper can be applied to the tracking control of any trajectory in the plane, and compared with the typical tracking schemes, the scheme given in this paper does not depend on sensors or any other electronic control systems, which gives a mechanical control scheme reference for the design cases of unconventional motion trajectories in the plane, and gives an example of open-loop system adjustment scheme design based on simulation. Generally speaking, this paper is more inclined to a theoretical design and validation of it. It is needed to point out that a simplification of trajectory is necessary for more practical application. That is to say, the trajectory model in this research is highly customised. As in the model of this paper, obstacles represent the edges of safe distance instead of the actual geometric centre.