# Design and Implementation of an Autonomous Charging Station for Agricultural Electrical Vehicles
## 2 Materials and Methods
### Controller's Description
#### 2.4.1 Mobile Platform Controller  
The holonomic constraints of a mobile platform are directly related to the wheel constraints used on this platform, and more precisely the driving wheel constraints (a spherical wheel has no constraints, but yet it cannot be used as a driving wheel without additional mechanisms). To overcome the non-holonomic constraints, namely the lateral motion ones, the driving wheels to be used should be mecanum wheels. The particularity of these wheels is that they allow the vehicle to move freely in any direction in the planar surface, Figure 6 illustrates an example of a mecanum wheel as found on the ACS presented in this paper. The mecanum wheel has rollers attached to the wheel perimeter with axes that are anti-parallel to the main axis of the fixed wheel component [33]. Combined with three similar actuated wheels, the mobile platform motion becomes omnidirectional. These kinds of platforms present an interesting kinematic property: there is no coupling between the \(x\) and \(y\) degrees of freedom of the mobile platform. In other words, this means that platform moves freely in any direction on the 2D plane. The motion and the steering of an omnidirectional mobile platform is related to the speed and sense of rotation of its actuated wheels [34]. In a four wheel configuration, an example of a lateral motion in the direction of \(Y_{R}\) axis can be obtained by rotating facing wheels in opposite directions, as shown in Figure 7.  
Figure 6: A mecanum wheel used on the ACS. Figure 7: A lateral motion example of an omnidirectional UGV. As illustrated in Figure 5, there are two conditions (_MP aligned to wall-plug_, and _MP aligned to vehicle_), this means that the first step before starting the process of plugging/unplugging the power cable is to have the whole ACS (namely the MP) aligned to the wall or the vehicle. To this end, the first control objective is to propose a kinematic controller that fulfills this condition. In order to represent the wall, or the vehicle, we use fiducial markers [35] and the _Aruco_detect_ package from UbiquityRobotics. The output topic of interest from the _Aruco_detect_ package is the _fiducial_transforms_, which gives the relative pose of the marker to the camera. As the pose of the camera is initially known compared to the MP, we can use the information received from the _Aruco_detect_ to align the MP to the wall (or the vehicle). The control objective of the MP can be expressed as follows:  
\[\lim_{t\to\infty}X_{e}(t)=d_{x}\quad\lim_{t\to\infty}Y_{e}(t)=0\quad\lim_{t \to\infty}\alpha(t)=0 \tag{1}\]  
where \(X_{e}\) and \(Y_{e}\) are the pose errors along (\(X_{R},Y_{R}\)) axes. \(d_{x}\) is the predefined distance that we want the MP to stop at before starting the plug/unplug process (where \(x\) can be \(AEV\) or \(wall-plug\)), and \(\alpha\) is the angle between the MP the fiducial marker. As the MP is omnidirectional, a simple proportional controller is sufficient to fulfill the control objective as expressed in (1). \[ \begin{split} V_{x}=d_{0}+(k_{l}*X_{e})\\ V_{y}=k_{l}*Y_{e}\\ V_{a}=k_{a}*\alpha\end{split}  \tag{2}\]  
where \(V_{x}\) and \(V_{y}\) are the linear velocities, and \(V_{a}\) is the angular velocity of the MP; \(k_  
Now that the gripper is at a known location, the second step consists of moving it to a predefined approach waypoint at the same speed as the previous centering step (Figure 9). Each time we send a new waypoint to the robot arm, we wait for the feedback from the latter to signal that the arm has successfully reached that waypoint (if all the joints are at the angle obtained from the inverse kinematic calculation performed by the robot arm processing unit, we assume that the gripper has reach the desired waypoint), and there were no collisions while performing the trajectory calculated from the processing unit of the arm. After that, the gripper is at the approach waypoint, for safety reasons (both the arm, the gripper, and the plug) we initiate the plug action (Figure 10) at a reduced speed.