Path tracking mobile robot using steppers

. In control of mobile robots, precision plays a key role in path tracking. In this paper we have intended to use hybrid stepper motors for precise control of the two wheeled robot. A control algorithm was developed to control the robot along different trajectories. We have found that stepper motors are more accurate for path tracking than normal DC motors with wheel encoders and one can obtain the implicit coordinates of the robot in runtime more precisely. Getting the precise coordinates of the robot at runtime can be used in various SLAM and VSLAM techniques for more accurate 3D mapping of the environment.


Introduction
Robotics has become an indispensable part in our lives from strategic military operations to mundane applications of household and cleaning. Among the various applications of robotics path tracking have been one of the most emerging fields in terms of research. Legged mechanism can be used for most precise mapping of the trajectory. However controlling and operating legged mechanism robots are much more complicated than wheeled robots. Apart from the control systems legged mechanism robots are relatively slower. Differential drive odometry techniques with DC motors and encoders are used for path tracking algorithms. Wheel encoder output gives velocity in which the two wheels move. The bot can be moved along a certain curve by giving the two wheels different velocities. Such a bot will have problems moving along a straight line since both the wheels are independent. Moving both wheels with same velocity is a challenge. So our research is based on a better approach of using stepper motors rather than DC for precise rotation of the wheels and in turn the orientation of the bot. To keep track of orientation of the bot at a particular point a magnetometer is also used. The error caused in the actual orientation of the bot given by magnetometer and the orientation achieved due to movement of stepper motor is also taken in consideration. In traditional differential drive odometry readings from the encoders are sent as a feedback to the system to determine the motion of the wheels and the position of the bot. In our stepper model of the robot stepper motors are used for the precise motion of the bot. The wheels can be independently controlled to change the orientation of the bot at any given instant of time.

Types of stepper motors
Based on construction and working there are three types of stepper motor -

Variable reluctance stepper motor
Soft iron multi tooth rotor and a wound stator is used in the variable reluctance stepper motor [3]. The rotor rotates at a specific angle which minimizes the reluctance between opposite windings in the stator of the stepper motor. This type of stepper motor offers supreme level angular resolution but has low torque.

Permanent magnet stepper motor
Permanent magnets are added to the motor's structure instead of teeth. The rotor is magnetized with alternating north and south poles aligned along the straight lines parallel to the rotor shaft. [4] Permanent magnet stepper motor has better torque characteristics due to increased magnetic flux density provided by the magnetized rotor poles [4]. It has low cost and low resolution as compared to other types.it is an incremental device which responds to discrete commands by rotating the output shaft in small equal steps for each of the discrete command.

Hybrid stepper motors
Features of both Variable reluctance motor and permanent motor are included in a hybrid stepper motor for better efficiency . [7]It has very good angular resolution , speed and torque.Hybrid motor contains a multi tooth rotor which has axially magnetized concentric magnet surrounding its shaft. The magnetic flux is guided to preferred locations in the air gap by the path provided by the teeth on the rotor. This increases the detent and holding torque properties of the motor when compared with other two types of stepper motor.

Stepper vs DC
Normal Dc motors have continuous output whereas stepper motors have step outputs. [2]For precise intrinsic coordinate mapping of our two wheeled mobile robot we found that stepper motors are indeed better than normal dc motors equipped with wheel encoders which give rotations as a feedback in terms of ticks. Which acts as a closed loop control system and renders instability to the overall system.

Solidworks modelling
Traditional differential drive wheeled robots are maneuvered with the help of DC motors. Standard chassis are readily available for these kinds of bots. We have designed our own model of chassis as chassis incorporating stepper motors are not designed previously. [1]Our design is a simple three wheel configuration in which the rear wheels are controlled using stepper motors and the front wheel is a castor wheel. This configuration helps for smooth point roatation and lateral movement of the bot. For our research we made solidworks model of each part i.e. wheels, motors, chassis, battery, etc. separately and then joined them in as assembly model in 1:1 scale. The weight and dimensions for each part is manually entered so that the centre of gravity of the assembly is automatically calculated by solidworks . The position of centre of gravity is critical because the magnetometer is placed in orientation with the centre of gravity to measure the orientation of the robot. The assembly model of the robot was saved in xml file format to import into MATLAB to run simulation.  Following results were obtained after performing the simulation. For our research we used a stepper motor with 1.8 degrees of rotation in a step. For path planning algorithms we need to know the coordinates of the bot at every given frame. The linear displacement of the bot can be calculated by measuring the angular displacements of the stepper motor shaft. At every frame the bot will have some change in its orientation. This change is measured from a magnetometer. The readings obtained from the magnetometer acts as an input for our rotation matrices. Subsequent rotation matrices are multiplied in MATLAB Simulink model to get orientations at any given frame of reference. [8] The rotation matrix along with the given displacement factor and scaling factor acts as the input for our homogeneous transformation matrix. We have multiplied the homogeneous matrices in series just like rotation matrices in series in MATLAB Simulink environment. The implicit coordinates of the bot can be calculated at any given point through this.

Trajectory Mapping
Every trajectory can be expressed in terms of mathematical function. In our research we have considered continuous and differentiable trajectory functions. Trajectories expressed in terms of y=f(x) are sampled along the x axis. Continuous curved trajectories can be sampled via simple commands in MATLAB.Our simulation shows an example of a sine wave sampled along the x axis. At every sampled point x we have found the corresponding value of f(x) in our case sin(x).for very two consecutive points Xn and Xn-1, we get the corresponding f(Xn) and f(Xn-1) values. Using coordinates f(Xn) , f(Xn-1), Xn , Xn-1 and the distance formula, we can obtain the linear distance the bot needs to move between two subsequent points in order to follow the desired trajectory. Distance d is calculated using the equation 1. Using these four coordinates we can determine the change in orientation the bot needs to go through, to reach the adjacent point. In our research we have calculated the change in orientation the bot needs to go through between every two adjacent points, in order to reach the next adjacent point. steps per revolution of stepper = 360°/1.8° (2) At every step the bot is programmed to change its orientation, Instead of changing it's orientation only at the sampled points. This helps to minimise the error in trajectory mapping since the curve traced after subsequent changes in orientation is relatively smoother. [6] For changes in orientation angles lesser than 1.8 degrees we have used half stepping and 1/8th stepping in stepper motors. ½ stepping and 1/8th stepping in stepper motors: Implementation of half stepping and 1/8th stepping helps in precise motion of our bot, since stepping action is not limited to 1.8 degrees. The error is plotted in table 1. For movements that require change orientation between points lesser than 1.8 degrees we have implemented ½ stepping and 1/8th stepping. Illustrated using an example where we considered relatively smoother trajectory in comparison to the sine wave. F(x)= x^2.This is shown in figure 3.

Conclusion
In this research we were able to successfully traverse a sine wave trajectory with 10 points of sampling and 100 points of sampling. Errors observed were much lesser which is plotted in figure 6. than what we observed for traditional differential drive robots with normal DC motor. For angular resolutions lesser than 1.8 degrees concept of half stepping, micro stepping and one eighth stepping can be used. Using stepper motors made the system more energy efficient and stable as it is an open loop control system. Using the coordinates calculated after multiplying rotation matrices we used them for VSLAM. A LIDAR simulation in MATLAB shown in figure 4. We obtained a binary occupancy grid showing free path and obstacles as shown in figure 5.