DEVELOPMENT OF DIRECTIONAL ALGORITHM FOR THREE- WHEEL OMNIDIRECTIONAL AUTONOMOUS MOBILE ROBOT

An omnidirectional algorithm has been developed to control autonomous mobile robots with three wheels. The implementation system consists of three planet DC motors with a rated power of 80 W for three wheels, three encoders for speed feedback, one encoder for distance feedback, and one digital compass sensor for angle feedback. The main system with an STM32F407 microcontroller is designed for directional control of wheels based on the signal received from compass sensor and encoder, and then controls three subsystems to adjust the steering speed of each wheel. The subsystem is built to control only one DC motor for each wheel with the built-in proportional integral derivative controller (PID) algorithm by an STM32F103 microcontroller. Furthermore, the directional control algorithm is developed for three omnidirectional wheels and a PID algorithm is designed to control the speed of DC motor for each wheel. It can be seen from the results obtained that the proposed system has several advantages: (1) automatically adjusting the angle and position; (2) erasing the sensor for tracking line of the automobile robot; (3) being self-developed; (4) ensuring reliable accuracy.


INTRODUCTION
The international ABU Asia-Pacific Robot Contest (ABU Robocon) is a scientific challenge to apply the advanced research for both development and implementation of mobile robots with the preset task in the fields of automation, electronics, computer vision and image processing, as well as mechatronics system. The motion of autonomous mobile robot with high accuracy is very important. Furthermore, the wheel of autonomous robot is either Mecanum wheel or Omni wheel because it is designed for movement with omni-direction and flexibility. The structure of the two wheels is shown in Fig. 1.
In this work, the Omni directional wheels are applied to create the motion of mobile robot system. The advanced DC motors are utilized to control wheel torques independently and thus are capable of simultaneous and independent control over their rotational and translational motion. In recent years, several researches were focused on the Mecanum and Omni wheels as listed in Table 1.   Table 2 shows the motion equation with 3 and 4 Omni wheels.      Galicki. 2019 [9] In this study, the proportional integral derivative controller (PID) algorithm is applied for the speed control of each wheel, angle and distance algorithms are applied to control directional position using both STM32F407 and STM32F103 MCUs, respectively. The main part of this paper includes a description of the system configuration in section 2, followed by section 3 revealing the development of directional algorithm and section 4 showing the diagram of algorithm and hardware development. Discussions and brief conclusions are represented in section 5 and section 6, respectively. Figure 2 shows the schematic diagram of the three-wheel Omni directional system which consists of a mechanical system, the main control interface circuitry with a STM32F407 MCU, three sub control systems with a STM32F103 MCU-based interface circuitry, and a C## programming platform. The three encoder subsystems can give feedback on the speed of each wheel under practical operation conditions for the PID control through an interface circuitry builtin with a STM32F107 MCU. In addition, a compass sensor is built for measuring the angular motion of system and an encoder transfers the distance data through an interface circuitry of STM32F407 MCU-based main system which is configured in the C## program.  The main interface circuitry is designed with the self-developed algorithm for both angle and distance control to calculate the speed and angle of each wheel based on the feedback data of the compass sensor and encoder system. Furthermore, the interface circuitry of the control sub-system is the built-in PID algorithm through an STM32F103 MCU for the speed control of each wheel.

Omnidirectional wheels
The omnidirectional wheels are designed on the basis of alternating passive rollers around the circumference which are perpendicular to the turning direction (see Fig. 3.). The result is that the wheel can be driven with full force, but will also slide laterally with great ease.

Equation of motion
Omni-directional drives have been realized in several innovative ways such as the Newton's laws of motion (Kalmár et al. [10]) and the equation of motion (Tamás Kalmár [11]) as follows: The state variables  , , y x are the linear and angular displacements, m is the mass of the vehicle, i v is the input voltage of motor to drive the i th wheel. The characteristic constants of the motors are denoted by  and  . The variable L is the distance.

Development of the equation of voltage input for each wheel
One of the important parameters to develop directional algorithm for Omnidirectional three-wheel is the voltage input of DC motor for each wheel, which can be given by [8 -11]:

Development of the equation of rotation angle of autonomous robot
It is assumed that at the beginning the autonomous robot has the angle ( ), angular direction (  ), and angle responded from compass sensor ( where a  is the angular adjustment.

PID equation
The PID controller in a feedback control loop continuously calculates an error signal ) (t e , which is the difference between a desired set point and a measured output variable, and applies a correction based on proportional, integral and derivative terms. The function of PID controller can be written as [12]:   The algorithm of the omnidirectional three-wheel is developed as shown in Fig. 4. First, the angle and speed of the autonomous robot are initialized. The system will calculate voltage inputs for each wheel based on the Eqs. (5)(6)(7) and then check the current speed. If false, the voltage for each wheel will be increased or decreased until current speed equals to the desired speed.

The diagram of algorithm
Furthermore, the importance of omnidirectional control is the direction of an autonomous robot. In this case, if the current angle of the autonomous robot is not equal to the desired one, the system calculates the rotation angle.

Hardware implementation
The hardware implementation of the proposed system includes a STM32F407 MCU-based main control interface circuitry, a STM32F103 MCU-based control subsystem, four kinds of hardware devices for encoder system, and a compass sensor as shown in Fig. 5.
Firstly, three Planet DC motors with the rated 24 V, 60 W, 9000 rpm are built as omnidirectional wheels in the mobile robot. The speed of wheel motor is measured using an encoder with the rated 13 ppr. Secondly, the encoder for feedback on the distance was HEDS 5540 500 implse 3 Kamal (http://www.alldatasheet.com/datasheet-pdf/pdf/88208/HP/HEDS5540.html)  SRAM, and three 12-bit ADCs. With the embedded universal synchronous/ asynchronous receiver transmitters (USART) and ST-LINK/V2 interfaces and the sub, the interface circuitry is developed by STM32F103VG using the Cortex-M3 core, at a maximum CPU speed of 72 MHz. The portfolio covers from 16 kbytes to 1 Mbyte of Flash with motor control peripherals, USB full-speed interface and CAN.

RESULTS AND DISCUSSION
The auto mobile robot is desired to operate at an angle of 30 o and a motor rate ranging from 2000 to 0 rpm depending on encoder feedback for directionally forwarding and backwarding. From the results, the auto mobile robot needs 2 seconds to adjust the angle and 6 seconds to increase from 0 to 2000 rpm when moving forward (feedback from the encoder). It takes the same duration for the robot to decrease from 2000 to 0 rpm when moving backward. Figure 7 and Fig.  8 show that the 0 h directional wheel has a mission of adjusting the moving direction of the mobile robot, so the speed of this wheel is lower than that of 4 h and 8 h directional wheels and Fig. 9 show the time respond at difference angles from 30 to 60 0 . Apart from that, as can be seen from  In order to easily assess the precision of the proposed system, the difference between the results of measurement and calculation for omnidirectional autonomous robot output speed and angle is defined as where i x and i x are the i th values of measurement and calculation, n is the total number of observations. The results of difference analysis for the omnidirectional output speed for each wheel are depicted in Fig. 10.  The difference ranges for the omnidirectional output speed of each wheel are listed in Table  3. Furthermore, the corresponding root mean square errors (RMSE) with reference to the simulation are given by [13].   Table 3 reveals the RMSE results of omnidirectional output speed of 1.66 rpm, 0.59 rpm and 1.40 rpm for 0 h, 4 h and 8 h wheels, respectively. Based on the confidence in algorithm for omnidirectional devices, the proposed system is validated to have a sufficient degree of precision and confidence in the control ability.

CONCLUSIONS
This paper presented the self-development of a directional algorithm to control three omnidirectional wheels of autonomous mobile robot system including the encoder system and compass sensor based STM32F407 and STMF103MCU with interface circuitry. From a practical viewpoint, the directional algorithm to control three omnidirectional wheels of autonomous mobile robots has many practical advantages including self-adjust the angle and position; erase the sensor for tracking line of the automobile robot; self-developed; ensure reliable accuracy. In the other way, another important practical implication is that the effectiveness of the low-level controller results in simplification of the high-level one.
CRediT authorship contribution statement. Phan Le Phuong Truong: methodology and experiments, Huan Laing Tsai: Reviewing and Editing; Huynh Cao Tuan: Supervision.
Declaration of competing interest. The authors declare that, they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.