STABILITY CONTROL MODELLING UNDER DYNAMIC MOTION SCENARIO OF A DIFFERENTIAL DRIVE ROBOT

Intelligence incorporated in many devices makes it easier to achieve self-balancing and autonomous driving in differential drive robot. Basically, differential drive robotic system describes an unstable, nonlinear system related to an inverted pendulum. The research attempts to harness the parameters obtained from a computer-aided design tool (Solid works) to model the system for complete stability control and dynamic motion of the system within a planned trajectory. A linearized dynamic equation is obtained for the overall system design of a mobile robot, and the linear quadratic regulator concept is adopted to obtain an optimum state feedback gain. The simulation results are obtained on MATLAB software interfaced with an Arduino board with deployable sensor technologies. Scenarios of disturbance would be simulated to ascertain the stability conditions of the system at static position or dynamic position. Signal analysis and computer vision techniques serve as leverage to make the design achievable. Localization and navigation referred to as tracking a planned trajectory or moving through paths filled with obstacles in a given space are also included.


INTRODUCTION
The concept of robotics initially hinges on the classical technique of bringing functional parts together to achieve a unified task which could be mechanical based, that is following the conservation of energy or electrical-based, that is adopting actuators among others [1][2]. These robots in a sense are concerned with synthesizing human functions and based on most classical attempt, robot hobbyist tries to model a generalized mathematical equation to depict the behaviour of the robot and further extend it to carry out other tactical functions.
Though this method had been exploited with little success in holistically developing a mathematical model of most complex systems hence, the need for a more suitable method where the system can learn given few training data or boundary value data [3]. Active researches in this area discuss the use of Artificial Intelligence (AI) introduced into most systems which in turn requires ample data set to effectively interpret the behaviour of the system [3]. A more hybridized approach of the two methods could give significant improvement in designing most complex robotic systems. This involves a well-developed mathematical model of the robot in conjunction with a Computer Aided Design (CAD) tool to estimate allowable parameter tolerance and application software (MATLAB/ Simulink) which matches the experimental results with the developed model [4].
Robotic systems are featured in consumer robots (artificial intelligence (AI)-Powered robot assistance), lightweight robots, industrial robots, complex space project robots among others, which are capable of giving more regulation, satisfactory sensitivity, stability and efficiency. [5] describes a new frontier of collaborative robots which allows synch between human teleoperation and complementing robots.
The field of robotics as an area of research is increasingly gaining prominence as the technologies applied in their design grows from the basic theoretical stability concepts of robotic dynamics to more advanced ones targeted towards self-coordinated or autonomous systems, path profile navigation algorithms and feedback control in differential drive or balancing robots. [6] proposed a least square method for non-analytical objective function using redundancy to improve the performance of motion, [7] describes the trajectory planning and tracking control of a 6 degree of freedom rigid robot using a general constrained nonlinear optimization, [8] proposed the use of Linear Quadratic Regulator (LQR) for state feedback and Kalman filter for state estimation of a self-balancing two-wheeled robot design.
The wheeled robot, in particular, has been shown great interest by hobbyist and researchers as it studies how well a nonlinear and unstable system can be controlled to achieve cutting edge tasks such as increased degree of freedom, trajectory planning, tracking and self-balancing tasks [2,[8][9][10][11], and use in navigating highly volatile environment [12]. Wheeled robots are inspired by biological systems whose attribute makes it possible to develop robotic systems which could move through its environment autonomously deciding how, when and where to move [6]. These operations are achieved based on physical interfacing of wheel and other actuators and sensors with a controller. It turns out that the robot rolls over around the wheel axis when no external control is introduced to it and tries to maintain a vertical position with tilt angle 0 0 in the presence of a controller. The mobile robot shown in Figure 1 was first modelled mathematically, having in mind the two variations of the differential drive system that exist, that is; a system with the wheel axis aligning with the center of gravity and the other, having a distance 'd' away from the center of gravity but augmented with a castor wheel or steering wheel. The model is supported by visual representation on SolidWorks (CAD software) from which allowable design tolerances of the system are generated and exported to MATLAB/ Simulink software. The simulation and physical implementation of the system are then carried out to obtain simulated and experimental results which are matched with the mathematical and visualization model. This is followed by control analysis of the system on MATLAB/ Simulink before finally deployed on a hardware system of choice (Arduino Microcontroller) to establish its appropriate real-time system behavior.

EXPERIMENTAL SETUP
The conceptualized two-wheel physical model is designed with a wooden base of dimension 15 cm x 14 cm x 1.5 cm, weight 0.15 kg, wheel axis aligning with the center of gravity of the base and the wheels placed at midpoints of the 15 cm length, and augmented with a NEMA17 stepper motor and wooden wheels shown in Figure 2.

System modelling
The model includes the mathematical representation of static and dynamic equations. The kinematic equations of differential drive robots are given in equations (1) -(5).
These were extended by identifying the positions of the left and right wheels with axis on the center of gravity expressed by equations (6) - (9).
With the velocity representation of the base and wheel kinematic equations, the constraints of the non-holonomic system are expressed as equations (10a) -(10b) [13].
Computing the dynamic equations using Lagrange formula as expressed in equation (11) and eliminating the coefficient of the Lagrange multiplier ) (q T  , a generalized mathematical model for a differential drive robot in terms of left and right wheel is obtained as equation (12a) -(12c). This expression can be extended to differential drive robots, having the wheel axis, some distance "d" away from the center of gravity and supported by a castor wheel. The positions of the left and right wheels can be expressed by equations (13) - (16).

SolidWorks CAD modelling
In order, to transform the conceptualized physical model into a visualization model capable of interfacing platforms, for example, from the CAD software to MATLAB software for further analysis, SolidWorks Premium 2014 software was used. Figure 3 illustrates the assembly of the different parts that makes a differential drive robot. With the intention of placing a robotic arm on the wooden base for future study, iron support with bearing is placed on the wooden base. Each 'part' of the assembly is assigned a material type to depict a real-life system. The assembly is further constrained in 3D space using the 'mate' function. The motor actuator shafts are further constrained to be floating in order, to carry out motion analysis on them. For control simulation, motion study is required on the model. This involves selecting motion analysis menu where the motion profile of time: 5 s, motor type: rotary motor actuator and speed: 25 RPM are selected for the actuator shafts with attached wheels. The model is finally exported to MATLAB via the Simscape Multibody link Add-Ins where STEP for First Generation (1G) or STL files are generated on MATLAB interface.

Importing SolidWorks file
To import and load the STL files on MATLAB, the SolidWorks Add-On must be installed. Using MATLAB Professional R2017a (64-bit), the STL file was imported using mech_import('DiffDRobotie.xml') which generate subfolders. On running the Simulink file, Figure 4 is generated which represents the individual 'part' blocks and relationship with other 'parts' with respect to the types of joints (revolute or prismatic) and the environment. After running the overall model, Figure 5 is obtained which is a MATLAB/ Simulink visualization of the Differential Drive Robot.

Joint actuation
The imported block serves as the plant or process model for a control system as shown in Figure 7. Although in Figure 4, a pre-actuation control or test signal was introduced at the shaft-wheel revolute joint to cause a dynamic motion of the wheel shown in Figure 6. This describes a differentiable test signal to ensure continuous-time function of the system. It inputs the angular position, speed and acceleration into the revolute joints.
In order, to actuate a stepper motor, a microcontroller (Arduino) and a driver circuit (A4988) are required. Using the Simscape toolbox on Simulink Figure 8 illustrates the actuation of a stepper or bipolar motor.
The function of the microcontroller extends beyond generating a pulse signal (PWM) to actuate the motor driver, it also serves as the overall system controller needed for the physical model coordination.

Introducing controls to the system
Introducing the self-balancing concept of wheeled robot [4,8,15] with dynamics shown in equation (21) placed in cascade with the differential drive robot dynamics, the tilt angle of the robot is observed as  and with an accelerometer sensor a feedback signal is obtained.
The scheme helps to obtain an optimum feedback gain described by the Riccati matrix described by equation (23b) [16].
where P is a square symmetric matrix and K is the feedback gain. Figure 9 depict the result obtained for motion study for a period of 5 seconds, which corresponds with the output of Figure 5 when a sine wave signal (with differentiable profile) in Figure 4 was used to actuate the revolute joint at the two wheels. The output from Figure 4 (SolidWorks transformed to MATLAB/Simulink) illustrates the angular position (rad), velocity (rad/s), acceleration (rad/s 2 ), computed torque (Nm), reaction torque (Nm) and reaction force (N) with respect to the reaction at the base as shown in Figure 10 for the left and right wheel in response to an input sine wave. Introducing a torque sensor to Figure 8, an output torque in Nm is obtained with results shown in Figure 11.  The angular speed obtained from a bipolar stepper motor is shown in Figure 12 in response to a PWM control input from a microcontroller. The microcontroller requires written codes (instruction codes) in C language, inputted and compiled on an Arduino IDE software, and the output of the code is after successful compilation is upload to the real-time microcontroller. The instruction code contains the controller optimum gains obtained from the LQR control scheme to set the tilt angle to zero in relations to the vertical axis and control inputs to actuate bipolar stepper motor specifying the steps and direction pins. Once the compiler successfully runs the program code an equivalent machine code (hex file) is generated. This is then uploaded to the microcontroller via an external control mode.

CONCLUSIONS
This paper has given a modular design concept of a mobile robot which involves importing a modelled system from SolidWorks into MATLAB/Simulink and validating the system with an equivalent mathematical model. The joint actuation was observed with respect to a smooth differentiable sine wave and a modelled bipolar stepper motor. Experimental analysis was carried out involving an interfaced Simulink with an emulator (Arduino Real-Time Operating System). Parameter estimation toolbox on Simulink also helped to penalise a developed cost function to match the physical model to an experimental model. The LQR control scheme was further used to establish the stability of the system and maintain the tilt angle to zero degrees using the self-balancing model estimates.