Electric cars have experienced explosive growth in recent years owing to global carbon-neutrality targets and the progressive phase-out of internal-combustion-engine vehicles. Many leading countries have announced ambitious roadmaps for electrifying road transport, and the number of electric cars on the road continues to rise. However, the deployment of charging infrastructure has lagged far behind, especially in public parking garages and highway service areas. The shortage of charging piles frequently results in long queues and an uneven distribution of charging resources. To alleviate this pressure and improve the convenience of electric cars, an automatic charging manipulator that implements a “one-pile-multiple-charging” concept has become an effective solution. A typical parking-lot charging environment for electric cars is shown below.

Although automatic charging is a promising idea, public parking areas are open spaces in which many unknown obstacles may exist. The presence of misplaced electric cars, stored goods, charging cables, posts, or even animals can be critical for the motion of an automatic charging manipulator. If a charging manipulator is not able to avoid these obstacles, the mission may fail and the system may be damaged. Thus, robust obstacle avoidance and trajectory planning are two of the key technical bottlenecks for a practical automatic charging station. In this article, we present a systematic study of trajectory planning and optimization for a six-degree-of-freedom serial manipulator dedicated to charging electric cars. We first design the manipulator architecture, then establish its kinematic model, and subsequently develop a novel adaptive rapidly-exploring random-tree (RRT) path-planning algorithm with hybrid sampling. We further synthesize the time-optimal joint-space trajectory using fifth-order B-spline interpolation and a genetic algorithm. Finally, a prototype experiment is conducted to validate the proposed planning framework.
Mechanical System Design for the Charging Manipulator
Our design begins with a detailed analysis of the automatic charging scenario. The manipulator should be able to serve multiple parking positions and should be compatible with the charging-port locations of mainstream electric cars. To understand the required geometric envelope, we investigated parking habits in typical public charging lots. The distance from the wheel stop to the parking-space boundary, the distance from the boundary to the front or rear of the vehicle, and the average height of charging ports are important parameters. Considering a broad survey of popular electric cars such as Tesla Model 3, BYD Qin, BYD Yuan, XPeng P7, and related models, the charging-port height is around 890 mm above the ground, and the longitudinal offset from the nearest vehicle end is around 667 mm. Combining these values with the acceptable parking-space dimensions, we determined that the total length of the manipulator should be 2300 mm, while the base height should be roughly 800 mm above the ground, close to the averaged charging-port height. This design ensures that the manipulator can reach the charging ports of a wide range of electric cars with minimal vertical motions.
The manipulator configuration is selected as a six-revolute (6R) spatial arm. The first three revolute joints decide the position of the wrist reference point, while the last three revolute joints, whose axes intersect, determine the orientation of the charging gun. Six degrees of freedom are sufficient for the insertion operation because the charging socket requires both a precise Cartesian position and a specific approach orientation. We adopted a modular joint concept in which each joint contains a servo motor, a harmonic reducer, a link flange, a connecting flange, and a standardized housing. The modular architecture dramatically reduces manufacturing costs and enables rapid reconfiguration when the manipulator is deployed in different types of charging stations.
To select the driving sources, we performed a static load analysis for every joint. The maximum torque occurs when a joint is horizontal; thus the demanded torque of joint \(i\) can be expressed as
$$
M_i = G_i g L_i + T_i g L_i,
$$
where \(G_i\) is the equivalent mass of the links and motors supported by joint \(i\), \(T_i\) is the load mass at the end effector, \(L_i\) is the corresponding moment arm, and \(g\) is the gravitational acceleration. The demanded power is proportional to the product of the rated torque and the reference angular velocity. The resulting requirements and the selected motor–reducer combinations are summarized in Table 1.
| Joint | Motor brand | Motor type | Rated power (W) | Reducer brand | Reduction ratio | Reducer model |
|---|---|---|---|---|---|---|
| 1 | Chaochuan | CC-M3H010-BN14 | 100 | Laifual | 50 | LSS-20 |
| 2 | Siemens | 1FL6-052-2AF | 1500 | Laifual | 50 | LSS-25 |
| 3 | Chaochuan | CC-M3H010-BN14 | 100 | Laifual | 50 | LSS-20 |
| 4 | Chaochuan | CC-M3H040-NN14 | 400 | Laifual | 50 | LSS-25 |
| 5 | Chaochuan | CC-M3H005-BN14 | 50 | Laifual | 50 | LSS-14 |
| 6 | Chaochuan | CC-M3H005-BN14 | 50 | Laifual | 50 | LSS-14 |
The highest rated power is 1500 W for the second joint, while the minimum required power is only 50 W for the wrist joints. The selected servo motors provide high positioning accuracy, smooth low-speed motion, and low noise, which are essential for reliably inserting a charging gun into the charging socket of an electric car.
Kinematic Modeling and Workspace Analysis
Kinematic analysis lays a mathematical foundation for path and trajectory planning. We adopted the modified Denavit–Hartenberg (D-H) convention to model the relative motion of adjacent links. In this convention, a coordinate frame is attached to the proximal end of each link. The transformation from frame \(\{i-1\}\) to frame \(\{i\}\) is obtained by four basic transformations:
$$
{}^{i-1}_{i}T = \operatorname{Rot}_x(\alpha_{i-1})\operatorname{Trans}_x(a_{i-1})\operatorname{Rot}_z(\theta_i)\operatorname{Trans}_z(d_i).
$$
This yields the homogeneous transformation matrix as
$$
{}^{i-1}_{i}T =
\begin{bmatrix}
\cos\theta_i & -\sin\theta_i & 0 & a_{i-1} \\[3pt]
\sin\theta_i \cos\alpha_{i-1} & \cos\theta_i \cos\alpha_{i-1} & -\sin\alpha_{i-1} & -d_i \sin\alpha_{i-1} \\[3pt]
\sin\theta_i \sin\alpha_{i-1} & \cos\theta_i \sin\alpha_{i-1} & \cos\alpha_{i-1} & d_i \cos\alpha_{i-1} \\[3pt]
0 & 0 & 0 & 1
\end{bmatrix}.
$$
For the designed 6R charging manipulator, the link parameters are listed in Table 2. The ranges of the joint angles account for the requirement that the manipulator must reach charging ports located on the sides, front, or rear of electric cars in a parking lot.
| Link \(i\) | \(\theta_i\) (deg) | \(d_i\) (mm) | \(a_{i-1}\) (mm) | \(\alpha_{i-1}\) (deg) | Joint range (deg) |
|---|---|---|---|---|---|
| 1 | \(\theta_1\) | 0 | 0 | 0 | -165 to 180 |
| 2 | \(\theta_2\) | \(d_2\) | 0 | 90 | -135 to 80 |
| 3 | \(\theta_3\) | 0 | \(a_2\) | 0 | -125 to 125 |
| 4 | \(\theta_4\) | \(d_4\) | \(a_3\) | 0 | -170 to 170 |
| 5 | \(\theta_5\) | 0 | 0 | -90 | -120 to 120 |
| 6 | \(\theta_6\) | 0 | 0 | -90 | -180 to 180 |
Postmultiplying the link transformations gives the forward-kinematics relation between the joint vector \(\boldsymbol{\theta} = [\theta_1,\dots,\theta_6]^T\) and the end-effector pose:
$$
{}^{0}_{6}T = {}^{0}_{1}T {}^{1}_{2}T {}^{2}_{3}T {}^{3}_{4}T {}^{4}_{5}T {}^{5}_{6}T =
\begin{bmatrix}
n_x & o_x & a_x & p_x \\
n_y & o_y & a_y & p_y \\
n_z & o_z & a_z & p_z \\
0 & 0 & 0 & 1
\end{bmatrix}.
$$
For example, the position coordinates of the charging-gun reference point are obtained as
$$
p_x = s_1 (d_2 + d_4 c_{23} + a_3 c_3 + a_2 c_2) + a_2 s_1 c_2 + a_3 s_1 c_{23} + d_4 s_1 c_{23},
$$
$$
p_y = – s_1 (d_2 + a_2 c_2 + a_3 c_3 + d_4 c_{23}) + c_1 (a_2 c_2 + a_3 c_3 + d_4 c_{23}),
$$
$$
p_z = -a_2 s_2 – a_3 s_{23} – d_4 s_{23},
$$
where \(s_i = \sin\theta_i\), \(c_i = \cos\theta_i\), \(s_{23} = \sin(\theta_2+\theta_3)\), and \(c_{23} = \cos(\theta_2+\theta_3)\). The inverse kinematics of the 6R manipulator are analytically solvable because the wrist axes intersect. Starting from the known pose matrix, we multiply both sides of the forward-kinematics equation by the inverse of the first joint transformation and equate the corresponding matrix entries. The first joint angle is obtained as
$$
\theta_1 = \arctan\!\left(\frac{p_y}{p_x}\right),
$$
while the third joint angle is derived from
$$
a_3 c_3 + d_4 s_3 = K,
$$
with
$$
K = \frac{p_x^2 + p_y^2 + p_z^2 + a_2^2 – a_3^2 – d_4^2 – d_2^2 + 2 a_2 \left(p_x c_1 + p_y s_1\right)}{2 a_2}.
$$
Using the substitution \(a_3 = \rho \cos\gamma\), \(d_4 = \rho\sin\gamma\), where \(\rho = \sqrt{a_3^2+d_4^2}\) and \(\gamma = \arctan(d_4/a_3)\), we obtain
$$
\theta_3 = \arctan\!\left(\frac{d_4}{a_3}\right) \pm \arctan\!\left(\frac{\sqrt{K^2 – \rho^2}}{\rho}\right).
$$
Subsequently, \(\theta_2\) is computed from \(\theta_{23} = \theta_2+\theta_3\) by using the remaining position components. The wrist angles \(\theta_4,\theta_5,\theta_6\) are then found from the entries of the rotation matrix. The complete closed-form solutions allow a direct generation of joint-space waypoints that correspond to Cartesian charging-port poses of electric cars.
To evaluate the reachable region of the manipulator, we applied the Monte Carlo method. Within the allowed joint range, we randomly generate 10,000 joint-angle samples, substitute them into the forward-kinematics equations, and record the Cartesian positions of the end-effector. The resulting point cloud represents the three-dimensional workspace of the charging manipulator. The workspace is symmetric with respect to the \(x\)-\(z\) plane and is sufficiently large to cover a broad range of charging-port positions of parked electric cars. This point-cloud analysis also provides an important geometric boundary for the path-planning algorithms presented in the next section.
Obstacle-Avoidance Path Planning for Electric Cars Charging Applications
The path-planning layer is responsible for finding a collision-free geometric path in the joint space or the Cartesian space from an initial configuration to the desired charging configuration. The classical RRT algorithm has been widely used because of its probability completeness and easy implementation. However, it suffers from poor goal orientation, low environmental adaptability, and non-optimal path quality. Several improved variants exist, including goal-biased RRT (GB-RRT), bidirectional RRT (Bi-RRT), and RRT*. Each of them has certain strengths. GB-RRT adds a target bias by sampling the goal with a fixed probability. Bi-RRT builds two trees from the start and the goal and connects them to improve convergence. RRT* introduces a rewiring procedure to asymptotically reduce the path cost, but it is computationally expensive.
We propose a novel adaptive RRT algorithm, referred to as hybrid-sampling global-adaptive RRT (HSGA-RRT), specifically designed for the obstacle-rich charging environments of electric cars. The algorithm contains three major improvements: a hybrid sampling method that couples environment-feature awareness with probability-model adaptation, a global adaptive step-size strategy that adjusts to the local complexity, and a heuristic straight-line detection scheme that accelerates convergence. A flowchart of the algorithm is summarized as follows:
Initialize the random tree with the start configuration. Then, repeatedly sample a configuration, compute an adaptive step length, generate a candidate node, perform collision detection, and add valid nodes to the tree. Instead of simply reaching the goal neighborhood, the algorithm also checks whether an existing tree node can be directly connected to the goal by a collision-free straight line. When this condition holds, the tree is immediately connected to the goal and the search terminates.
Hybrid Sampling Strategy
To overcome the inefficiency of uniform sampling, the sampling probability density function (PDF) is expressed as a mixture of a uniform distribution over the configuration space \(C\) and \(K\) adaptive Gaussian components:
$$
p(x) = \lambda U(C) + (1-\lambda) \sum_{k=1}^{K}\omega_k \mathcal{N}(\mu_k,\Sigma_k),
$$
where \(\lambda \in [0,1]\) controls the trade-off between global exploration and local refinement, \(\mu_k\) denotes the center of the \(k\)-th Gaussian, \(\Sigma_k\) is its covariance matrix, and \(\omega_k\) is the mixture weight satisfying \(\sum_k \omega_k = 1\).
The environment is described by an obstacle-sensitivity function. Let \(o_i\) be a set of obstacle surface points and \(N_b\) the number of such points. We compute
$$
\rho(x) = \frac{1}{N_b} \sum_{i=1}^{N_b} \exp\left(-\frac{\|x-o_i\|^2}{2\sigma_o^2}\right),
$$
where \(\sigma_o\) is the environment-perception radius. Then the passability coefficient of the \(k\)-th Gaussian component is
$$
\alpha_k = 1 – \frac{1}{V_k}\int_{V_k} \rho(x)\,dx,
$$
where \(V_k\) is the volume of the effective region of the component. In addition, a path-growth benefit is measured by
$$
\beta_k = \frac{N_{\text{success}}^{(k)}}{N_{\text{attempt}}^{(k)} + \epsilon},
$$
where \(N_{\text{success}}^{(k)}\) and \(N_{\text{attempt}}^{(k)}\) are the numbers of successful expansions and total attempts in the region of component \(k\), and \(\epsilon\) is a small constant. The mixture weight is then updated by fusing the environment feature and the growth information:
$$
\omega_k^{(t+1)} = \gamma \frac{\alpha_k\beta_k}{\sum_{i=1}^K\alpha_i\beta_i} + (1-\gamma)\omega_k^{(t)},
$$
where \(\gamma\in(0,1)\) is a learning rate. The covariance matrices are adapted in an anisotropic manner according to the obstacle-density gradient:
$$
\Sigma_k = \sigma_{\min}^2 I + \left(\sigma_{\max}^2-\sigma_{\min}^2\right)
\frac{\nabla\rho(\mu_k)\nabla\rho(\mu_k)^T}{\|\nabla\rho(\mu_k)\|^2},
$$
where \(\sigma_{\min}\) and \(\sigma_{\max}\) are the lower and upper bounds of the covariance scale. The above design compresses the Gaussian component along the direction of the maximum obstacle-density increase while stretching it in the tangent direction. This behavior creates sampling strips that are particularly suitable for passing through narrow corridors. The center of each Gaussian is shifted by a weighted mean-shift iteration:
$$
\mu_k^{(t+1)} =
\frac{\sum_{i=1}^{M} x_i\, G\left(\|x_i-\mu_k^{(t)}\|/\sigma_k\right)}
{\sum_{i=1}^{M} G\left(\|x_i-\mu_k^{(t)}\|/\sigma_k\right)},
$$
where \(G(\cdot)\) is an Epanechnikov kernel and \(x_i\) are the recent successful nodes in the corresponding region. This dynamic mechanism carefully balances exploration and exploitation in obstacle-rich charging lots.
Global Adaptive Step-Size
We also devised a global adaptive step-size schedule that is sensitive to the local environmental complexity. Let \(\rho(q)\) denote the obstacle-density field defined at a candidate extension direction. The step length is selected as
$$
\Delta s(q) = s_{\max} – (s_{\max}-s_{\min})\tanh\!\left(\alpha \rho(q)\right),
$$
where \(-\tanh(\cdot)\) produces a smooth monotone reduction from \(s_{\max}\) to \(s_{\min}\) when the robot approaches obstacles. The maximum allowed step is also limited by the distance to the goal:
$$
s_{\max} = \min\!\left(s_{\text{base}}, \frac{\|q_{\text{goal}}-q_{\text{current}}\|}{K}\right),
$$
where \(K\) is a segmentation coefficient. The minimum step is constrained by the motion resolution and the required precision for charging electric cars:
$$
s_{\min} = \max\!\left(\frac{\delta}{M}, s_{\min}^0\right).
$$
In addition, the step-size sequence is smoothed to avoid sudden jumps:
$$
\Delta s_{\text{new}} = \lambda_s \Delta s_{\text{prev}} + (1-\lambda_s)\Delta s_{\text{calc}},
$$
where \(\lambda_s\in[0,1]\) is an inertia factor. This procedure enables the manipulator to move quickly in free open spaces and to search carefully in the vicinity of the car body, charging posts, and temporary obstacles.
Heuristic Straight-Line Termination
Finally, a heuristic convergence criterion accelerates the search in simple environments. Let \(x_{\text{goal}}\) be the desired configuration and \(x_{\text{tree}}^{\text{centroid}}\) the geometric centroid of all nodes in the RRT. A dynamic detection radius is defined as
$$
r_{\text{detect}} = \eta \left\|x_{\text{tree}}^{\text{centroid}} – x_{\text{goal}}\right\|,
$$
with \(\eta\in(0,1)\). For every node \(x_c\) of the tree that satisfies
$$
\|x_c – x_{\text{goal}}\| \le r_{\text{detect}},
$$
we construct a straight segment from \(x_c\) to \(x_{\text{goal}}\). If this segment lies entirely in the free space, the goal is directly connected to that node and the tree search stops. This strategy turns the passive waiting for tree growth into an active detection of a collision-free connection, significantly increasing the planning speed in relatively uncluttered scenarios.
Simulation Results in Two-Dimensional and Three-Dimensional Spaces
To evaluate the proposed HSGA-RRT algorithm, we conducted extensive simulations in both two-dimensional (2D) and three-dimensional (3D) environments. The experimental platform was an AMD Ryzen 5 2600X processor running Windows 10 and MATLAB. In the 2D map, the start point was \((10,90)\) and the goal point was \((80,20)\) in a \(100\times100\) space. We set \(\lambda=0.4\), \(k=100\), \(w=0.15\), and a base step of \(5\). We ran the standard RRT, GB-RRT, Bi-RRT, RRT*, and HSGA-RRT algorithms for 50 independent trials and summarized the averaged results in Table 3.
| Algorithm | Planning time (s) | Path cost (m) |
|---|---|---|
| RRT | 10.58 | 169.36 |
| GB-RRT | 4.45 | 147.24 |
| Bi-RRT | 3.27 | 164.56 |
| RRT* | 11.78 | 133.12 |
| HSGA-RRT (proposed) | 1.49 | 132.24 |
Compared with the classical RRT, the mean path cost of our algorithm is reduced by 21.9% and the planning time by 85.9%. With respect to GB-RRT, the proposed scheme lowers the path cost by 10.2% and the time by 66.5%. Relative to Bi-RRT, the improvements are 19.6% in path cost and 54.4% in time. Compared with RRT*, the proposed algorithm achieves a nearly equal path cost but reduces the planning time by 87.4%.
We also tested the algorithms in a \(600\times600\times600\) 3D environment with start point \((50,50,50)\), goal point \((500,500,500)\), and an obstacle field mimicking a parking garage with several static obstacles. Each experiment was repeated 50 times. The averaged results are listed in Table 4.
| Algorithm | Planning time (s) | Path cost (m) |
|---|---|---|
| RRT | 2.46 | 1217.26 |
| GB-RRT | 0.58 | 986.12 |
| Bi-RRT | 0.56 | 1150.45 |
| RRT* | 3.57 | 889.87 |
| HSGA-RRT (proposed) | 0.48 | 903.56 |
In the 3D scenario, our algorithm provides a good balance between path quality and computational efficiency. Its path cost is 903.56 m, which is only slightly worse than the asymptotic optimum of RRT* (889.87 m), but the planning time is only 0.48 s, which is considerably shorter than that of RRT* (3.57 s). The proposed adaptive step-size and hybrid-sampling mechanisms avoid the redundant random explorations that often occur in obstacle-rich areas, making it well-suited for the fast and robust charging of electric cars in crowded public parking environments.
Time-Optimal Trajectory Planning Based on B-Spline Interpolation and a Genetic Algorithm
After the path planner returns a discrete sequence of collision-free waypoints, it is necessary to transform these spatial waypoints into a continuous time-dependent joint motion with bounded velocities, accelerations, and jerks. In this work, the trajectories are planned directly in joint space. Given the waypoint sequence obtained by the inverse-kinematics mapping of the planned Cartesian poses, we interpolate the joint angles using fifth-order B-spline basis functions, which provide a globally smooth curve with continuous derivatives up to the desired order.
Fifth-Order B-Spline Interpolation
A fifth-order B-spline curve is written as
$$
p(u) = \sum_{i=0}^{n} d_i N_{i,5}(u),
$$
where \(d_i\) are the control points, \(u\) is the parameter, and \(N_{i,5}(u)\) is the fifth-order B-spline basis function. The basis is defined recursively as
$$
N_{i,0}(u) =
\begin{cases}
1, & u_i \le u < u_{i+1},\\
0, & \text{otherwise},
\end{cases}
$$
$$
N_{i,k}(u) =
\frac{u-u_i}{u_{i+k}-u_i}N_{i,k-1}(u) +
\frac{u_{i+k+1}-u}{u_{i+k+1}-u_{i+1}}N_{i+1,k-1}(u).
$$
For a curve of order \(k=5\), the knot vector \(\mathbf{u}=[u_0,\dots,u_{n+10}]\) is constructed with clamped ends:
$$
u_0 = u_1 = \cdots = u_5 = 0,\quad u_{n+1}=u_{n+2}=\cdots=u_{n+10}=1.
$$
Interior knots are obtained by applying the chord-length parameterization over the time grid \(t_i\). If the waypoints are given at time instants \(t_0<t_1<\cdots<t_m\), p="" then
$$
u_{i+5} = \frac{\sum_{j=1}^{i}\Delta t_j}{\sum_{j=1}^{m-1}\Delta t_j},\quad i=1,\dots,m-5,
$$
where \(\Delta t_j = t_{j+1}-t_{j}\). To generate a B-spline that passes through all prescribed joint waypoints, we need to reverse-evaluate the control-point vector. Let \(\boldsymbol{\theta}_j\) denote the joint-angle vector at the \(j\)-th waypoint. The interpolation condition can be written symbolically as
$$
\mathbf{N}\mathbf{d} = \boldsymbol{\theta}_{\text{waypoint}},
$$
where \(\mathbf{N}\) is the basis-function matrix and \(\mathbf{d}\) is the unknown control-point vector. Additional boundary conditions are specified for velocity and acceleration at the start and the end. For a robot that starts and stops with zero velocity and zero acceleration, we impose
$$
\dot{p}(0)=0,\quad \dot{p}(1)=0,\quad \ddot{p}(0)=0,\quad \ddot{p}(1)=0.
$$
By appending these constraints, the well-determined linear system is solved to obtain all control points. Once the control points are known, the joint position, velocity, and acceleration profiles are evaluated analytically from the B-spline derivatives.
Time-Optimal Optimization Model for Charging Motions
The basic interpolation described above assumes a designated time interval between consecutive waypoints. However, a uniform time interval is generally not optimal because different portions of the charging motion may be executed with different permissible velocities. To minimize the total cycle time for charging electric cars, we introduce the time increment \(T_i\) as the time spent between waypoint \(i\) and waypoint \(i+1\). The total execution time is
$$
T = \sum_{i=1}^{n-1} T_i.
$$
The objective is to minimize \(T\) subject to the kinematic constraints of each joint, i.e.,
$$
|\dot{\theta}_j(t)| \le \dot{\theta}_{j,\max},\quad
|\ddot{\theta}_j(t)| \le \ddot{\theta}_{j,\max},\quad
|\dddot{\theta}_j(t)| \le \dddot{\theta}_{j,\max}.
$$
The maximum velocity and acceleration for each joint are listed in Table 5.
| Joint | Joint range (deg) | Maximum velocity (deg/s) | Maximum acceleration (deg/s^2) |
|---|---|---|---|
| 1 | -165 to 180 | 150 | 90 |
| 2 | -135 to 80 | 100 | 70 |
| 3 | -125 to 125 | 120 | 95 |
| 4 | -170 to 170 | 95 | 70 |
| 5 | -120 to 120 | 100 | 80 |
| 6 | -180 to 180 | 95 | 85 |
We applied a genetic algorithm (GA) to solve this constrained optimization problem. The decision variables are the time increments \(T_i\). The fitness function is constructed as an inverse of a penalized objective. For each candidate chromosome, the joint trajectories are rebuilt with the fifth-order B-spline interpolation and the velocity, acceleration, and jerk profiles are checked against the maximum constraints. If a constraint is violated, a penalty term is added:
$$
\Phi(\mathbf{T}) = \sum_{i=1}^{n-1}T_i +
\xi \sum_{i=1}^{n-1}\max\left(0,\frac{|\dot\theta_j(t_i)|}{\dot\theta_{j,\max}}-1\right) + \cdots,
$$
where \(\xi\) is a penalty factor that is typically set between 0.1 and 0.2. The fitness value is then written as
$$
F(\mathbf{T}) = \frac{1}{\Phi(\mathbf{T})}.
$$
In the genetic search, we adopted an adaptive mechanism for the crossover and mutation probabilities. The crossover probability decays from a maximum \(P_{c,\max}=0.8\) to a minimum \(P_{c,\min}=0.4\), whereas the mutation probability decays from \(P_{m,\max}=0.1\) to \(P_{m,\min}=0.01\). The population size is 100 and the maximum number of generations is 150. This adaptive strategy helps the algorithm to preserve diversity in the early stage and to refine the solution in the late stage.
Optimization Results for a Typical Charging Motion
We tested the proposed optimization on a typical charging path computed by the adaptive RRT planner. The joint-space waypoint sequence is given in Table 6. The initial time interval for each segment was set to 4 s. After applying the genetic algorithm, the optimal time intervals for five consecutive segments were obtained. Table 7 shows three independent optimization runs.
| Waypoint | Joint 1 (deg) | Joint 2 (deg) | Joint 3 (deg) | Joint 4 (deg) | Joint 5 (deg) | Joint 6 (deg) |
|---|---|---|---|---|---|---|
| Start | 50.3 | -68.8 | 4.7 | 10.2 | 5.3 | 10.2 |
| Waypoint 1 | 32.9 | -65.9 | 14.2 | 11.5 | 3.5 | 18.6 |
| Waypoint 2 | 14.6 | -61.6 | 24.8 | 13.7 | 2.6 | 25.2 |
| Waypoint 3 | -5.5 | -58.5 | 34.6 | 14.7 | 1.2 | 33.7 |
| Waypoint 4 | -30.6 | -61.6 | 35.4 | 13.4 | 2.4 | 35.4 |
| Waypoint 5 | -35.9 | -68.3 | 23.5 | 12.7 | 5.5 | 26.5 |
| Waypoint 6 | -42.8 | -72.6 | 12.4 | 9.5 | 8.3 | 18.4 |
| Goal | -48.5 | -81.2 | 3.5 | 6.4 | 11.7 | 9.6 |
| Segment | Initial \(T_i\) (s) | Run 1 | Run 2 | Run 3 |
|---|---|---|---|---|
| 1 | 4 | 2.642 | 2.595 | 2.846 |
| 2 | 4 | 2.784 | 2.869 | 2.546 |
| 3 | 4 | 3.155 | 2.654 | 2.536 |
| 4 | 4 | 2.553 | 2.431 | 2.735 |
| 5 | 4 | 2.613 | 2.531 | 3.244 |
| Total | 20 | 13.747 | 13.245 | 14.042 |
The optimized total motion time is reduced from 20 s to roughly 13.2–14.0 s, corresponding to an improvement of about 30%. After selecting one of the optimized time vectors, we reconstructed the complete trajectory. The resulting joint-angle curves are smooth and satisfy the imposed joint-angle limits. The angular-velocity curves are continuous and lie below the maximum allowable speed. The angular-acceleration curves are also continuous and bounded. These properties guarantee that the charging manipulator can move in a highly efficient yet gentle manner when serving electric cars.
Prototype Validation
To validate the practical feasibility of the complete motion-planning architecture, we established a prototype experimental platform that consists of a six-degree-of-freedom collaborative robot, a control cabinet, and a personal computer. The robot was commanded through the Robot Operating System (ROS), while RViz was used for three-dimensional visualization and motion monitoring. We emulated a parking-lot charging task in which a white rectangular block represented a movable obstacle and a black circular target represented the charging socket. A camera mounted on the end-effector was used only during the actual insertion phase; all path-planning experiments were conducted in a previously mapped environment.
Three complete strategies were compared in the experiment. The first strategy used the classical RRT algorithm for the path planning plus fifth-order B-spline interpolation and a genetic-algorithm-based trajectory optimization. The second strategy used Bi-RRT instead of classical RRT together with the same interpolation and optimization algorithms. The third strategy used the proposed hybrid-sampling adaptive RRT algorithm with the same trajectory-level interpolation and optimization. The total execution time of the manipulator was recorded for each strategy and each run. The averaged results are shown in Table 8.
| Plan | Path planner | Trajectory optimizer | Motion time Run 1 (s) | Motion time Run 2 (s) | Motion time Run 3 (s) |
|---|---|---|---|---|---|
| 1 | Standard RRT | B-spline + GA | 5.874 | 5.237 | 5.356 |
| 2 | Bi-RRT | B-spline + GA | 5.487 | 5.587 | 5.213 |
| 3 | HSGA-RRT | B-spline + GA | 5.196 | 4.431 | 4.618 |
As shown in Table 8, the proposed HSGA-RRT planner consistently yields the shortest motion time among the three strategies. The reason is that HSGA-RRT creates a more cost-effective and tortuosity-reduced geometric path in joint space. A shorter path with fewer unnecessary rotations not only reduces the distance that each joint must travel but also allows the genetic algorithm to find a better allocation of time along the trajectory. In addition, the optimized joint trajectories were successfully compiled and uploaded to the robot controller. The manipulator was able to avoid the rectangular obstacle and insert the charging gun into the target socket smoothly. This physical experiment confirms that the integrated planning algorithms are reliable and efficient for the automatic charging of electric cars.
We repeated the prototype test under different obstacle placements and different starting robot configurations. In every test, the manipulator successfully reached the simulated charging port without collision. The maximum measured joint velocities and accelerations remained within the prescribed limits, and no noticeable vibration or sudden jerk was observed. The results demonstrate that the proposed combination of an adaptive RRT path planner, fifth-order B-spline trajectory generation, and a genetic-algorithm-based time optimizer is a promising solution for actual electric-cars charging stations.
Conclusion
In this article, we have presented a complete trajectory-planning and optimization framework for an automatic charging manipulator dedicated to electric cars. The main conclusions of our research are summarized as follows:
First, we designed a modular six-degree-of-freedom 6R manipulator with a total length of 2300 mm and a base height of 800 mm. The D-H kinematic model was established and the corresponding forward and inverse kinematics were solved analytically. The Monte-Carlo workspace analysis confirms that the reachable region is sufficiently large to reach the charging ports of a wide variety of electric cars.
Second, to enable obstacle avoidance in uncontrolled parking environments, we proposed a hybrid-sampling global-adaptive RRT algorithm. The algorithm introduces an environment-feature-aware sampling distribution, a Gaussian mixture model with dynamically adjusted weights, an obstacle-density-dependent step length, and a heuristic straight-line termination. Comparative simulations in 2D and 3D environments show that the proposed method significantly reduces both the planning time and the path cost. In the 2D benchmark, the path cost was reduced by up to 21.9%, while the planning time was reduced by up to 87.4%. In the 3D benchmark, the new algorithm obtained a balanced trade-off with 903.56 m path cost and 0.48 s planning time.
Third, we connected the discrete path waypoints into a continuous time-domain motion using fifth-order B-spline interpolation. A genetic algorithm with an adaptive penalty function was used to optimize the time distribution among trajectory segments. The optimized trajectories satisfy all joint-velocity, acceleration, and jerk constraints while reducing the total cycle time by approximately 30% compared with a uniform time schedule.
Finally, the prototype experiments on a six-degree-of-freedom robot validated the proposed motion-planning framework. The robot successfully avoided obstacles in a simulated charging-scenario and reached the charging-port target. Compared with the classical RRT- and Bi-RRT-based schemes, the proposed integrated planner achieved the shortest motion time and most reliable collision avoidance performance. The research described in this paper therefore provides a solid methodological foundation for future commercial automatic charging systems that are intended to serve large fleets of electric cars.
Future work will focus on higher-fidelity environmental modeling using real-time point-cloud sensors, dynamic obstacle handling, and multi-objective trajectory optimization that balances time, energy, and smoothness. In addition, we plan to extend the current method to a fleet of charging manipulators operating in a large-scale automated parking infrastructure for electric cars. The ultimate goal is to develop a low-cost, safe, and fully autonomous charging system that helps accelerate the transition toward sustainable electric mobility.
</t_1<\cdots
