# Mechatronic Modelling of Industrial AGVs: A Complex System Architecture

Authors: J. Enrique Sierra-García; Matilde Santos
Journal: Complexity
 (2020)

---

## Abstract

Automatic guided vehicles (AGVs) are unmanned transport vehicles widely used in the industry to substitute manned industrial trucks and conveyors. They are now considered to play a key role in the development of the Industry 4.0 due to their temporal and spatial flexibility. However, in order to deal with the AGV as a potential mobile robot with high capacities and certain level of intelligence, it is necessary to develop control-oriented models of these complex and nonlinear systems. In this paper, the modelling of this vehicle as a whole is addressed. It can be considered composed of several interrelated subsystems: control, safety, driving, guiding and localization, power storage, and charging systems. The kinematics equations of a tricycle vehicle are obtained, and a controller is proposed. An extended hybrid automata formalism is used to define the behaviour of the safety and the control systems, as well as their interaction. In addition, the electrical equivalent circuit of the batteries, charger, and the motors is studied. The architecture of the holistic model is presented. Simulation results of the AGV in a workspace scenario validate the model and prove the efficiency of this approach.


---

## Body

## 1. Introduction

Automatic guided vehicles (AGVs) are unmanned transport vehicles widely used in the industry to substitute manned industrial trucks and conveyors [1]. They have been proved an efficient element in factory workspaces, helping to reduce logistic errors and operative costs.Many researchers in manufacturing systems recognize the following Industry 4.0 (I4.0) design principles: interoperability, virtualization, decentralization, real-time capability, service orientation, and modularity. All these principles are connected in some way with the operative of the AGVs. For example, AGVs can easily readjust their program ensuring real-time reaction to unexpected changes in the logistic flows of the production plan. They can also operate in a decentralized way, without any central server commanding orders.On the other hand, several I4.0 key enabling technologies have been identified in the literature to make these principles possible: autonomous robots, additive manufacturing, simulation, system integration, cloud computing, Internet of things, cybersecurity, augmented reality, and big data. AGVs are included into the category of autonomous robots as one of these technologies. In addition, this AGV can be easily interconnected and integrated with other machines and devices in the plant by its input/output subsystem. Moreover, these AGVs generate a large amount of data which are transported by IOT protocols such as MQTT, stored and processed by cloud computing systems, and can be exploited by big data technologies to obtain KPIs and optimize the production.For all these reasons, they are now considered to play a key role in the development of the Industry 4.0. Even more, the new concept of collaborative mobile robots seeks the convergence of AGVs and collaborative robots [2].However, this synergy demands to deal with the AGV as a potential mobile robot with high capacities and certain level of intelligence. Thus, the necessity of control-oriented models of these complex and strong nonlinear systems is clear. Even more, to take these robots to a further step, understanding their behavior and establishing safety requirements are a must. This will allow them to advance from assembly tasks to a genuine human-robot collaboration.An AGV is a multivariable complex mechatronic system composed of several subsystems and with a strongly coupled dynamics. Each of the main elements of an AGV influences its dynamics. The power storage affects the control performance and the motion of the AGV. In turn, the control influences the power consumption and thus the power storage. An AGV usually works in a space shared with other robots, so these other vehicles or even people are perceived as obstacles by the safety subsystem that modifies the working conditions accordingly.Even more, AGVs are normally used to automate logistics and production flows. These processes involve managing a fleet of robots traveling on the same scenario. Indeed, it is considered a multilayer problem [3], where several issues have to be addressed: the design of the layouts, the warehouse and the production plant, the storage strategies, the traffic scheduling, algorithms to share the charging stations, path planning, navigation, routes assignation, and so on. To take all of these simultaneous processes into account, a global model is necessary. This model will also allow to improve the efficiency of these vehicles and the production optimization.In this paper, we address the modelling and simulation of an AGV as a whole. First, an architecture that relates all the subsystems that are part of the AGV is proposed. Then, each of them has been described and mathematically modelled: the control, safety, driving, guiding and localization, power storage, and charging systems. Besides, the kinematics and dynamics equations of the vehicle are developed. They have been implemented for a real industrial complex AGV, a hybrid tricycle-differential one. This holistic approach gives realistic results in the simulations of the vehicle, which allows us to validate the models.The main contributions of this work can be summarized as follows:(i)
The development of a general and high level of the abstraction model of an AGV. It has been divided into subsystems whose models can be used to implement different types of AGVs.(ii)
The identification of all the interactions between the subsystems and its integration.(iii)
The development of the mathematical model of the dynamics of a hybrid differential-tricycle AGV (this hybrid differential-tricycle AGV has not been previously studied in the literature).(iv)
The mathematical description of the safety subsystem and the control subsystem based on the hybrid automata formalism. This approach is completely original.(v)
The implementation of this general model into a specific model of a real industrial AGV, the Unibot AGV of the company ASTI Mobile Robotics [4].(vi)
The integration of the kinematics, dynamics, and electrical equations in the simulation of this type of AGV.The rest of the paper is organized as follows. Section2 presents a brief state of the art on the AGV modelling. In Section 3, the architecture of the AGV is developed. The description and equations of the different subsystems which compose it are presented in Section 4. Simulation results on a working scenario are discussed in Section 5. The document ends with the conclusions and future works.


## 2. Related Works

The first paper published on the design and operation of AGV systems was the work by Maxwell and Muckstadt, in 1982 [5], where a methodological framework for specifying the operational characteristics of an automatic guided vehicle system was presented. Since then, the research on this topic has not stopped growing. Nevertheless, the works found in the literature mainly tackle the system focusing on individual aspects of the AGV: kinematics, control, charging, and so on, that are not independent. Indeed, the majority focus on its kinematics and control, or the localization algorithms, or the power storage, or the charging system, but they lack a holistic approach of the guided vehicle as a whole system.There have been several attempts to model the AGV, for example, Veiga et al. compared vehicle models of a tugger-trolleys system with three linked towed. One model is a complete multibody model of the system. The second is a simplified version composed of vertical and handling models for motion in a plane, assuming no planar forces on the trolleys' front wheels and linking the vehicles with multibody joints and body, representing the coupling arms, developed in Modelica language. Results show good agreement between the models but the second one was much faster and provided more stable results [6].A kinematical and dynamical analysis of a mobile robot belonging to the configuration classical tricycle is shown in [7]. For the kinematical analysis, authors consider a robot capable of locomotion on a surface by the action of wheels mounted on the robot. The dynamics of the nonholonomic mobile robot is obtained based on the Euler–Lagrange methodology. The paper is focused on the analysis of global asymptotic stability of a new position controller for this wheeled mobile robot.In [8], authors state that the complexity of AGV dynamics and the difficulty of obtaining the actual vehicle dynamic parameters have led them to use two nonmodel-based control approaches. The robot is equipped with a front-centered steerable wheel and fixed parallel rear wheels. They present a comparison of control techniques for robust docking maneuvers of an AGV, specifically, fuzzy control and vector pursuit that do not require a mathematical model of the vehicle dynamics.Recently, Montazerijouybari et al. proposed a mathematical model based on the kinematics of 2-DOF AGVs with differential driving wheels and caster wheels in order to predict the behaviour of the robot when the vehicle is carrying heavy loads not well distributed on it.A trajectory tracking control of an AGV based on sliding mode control with an improved reaching law is proposed in [9]. The AGV in this paper has two driving wheels and two universal wheels. They consider a fully functional AGV composed of the motion mechanism, the sensing system, and the control system. Authors do not consider the rest of the systems of the vehicle. The work designs a double closed-loop control method to control the vehicle to track the given trajectory. With the same control-oriented aim, in [10], the analysis of the kinematics and dynamics of a four-wheel omnidirectional automated guided vehicle is presented.There are other AGV-related topics that are dealt with in this paper, such as localization and navigation. In many cases, the routes implemented by these vehicles are subject to constant changes and are adapted to the currently assigned task. Thus, the sensors that allow the AGV to follow the path are an important element of the guided vehicle. Although usually the vehicle sensors are not modelled, the most common ones have been studied. Just a couple of examples are as follows. An intelligent path recognition system for vision-guided AGVs, able to tackle noise in the images captured by using a CCD camera, is presented in [11]. The paper addresses some of the most challenging problems for a vision-based AGV running in a complex workspace and improves the accuracy and reliability of vision recognition of guide paths for AGVs by means of artificial intelligence methods. Authors in [12] proposed an interesting method to measure the wheel radius. This radius is not constant, and in the case of automated guided vehicles using odometry, this is a key information to calculate the position of the vehicle. Stetter et al. designed virtual sensors that estimate forces and torques acting on an AGV [13]. However, this AGVs consists of four sprung arms that each dispose of one drive motor. For this system, they obtain a simple description of the AGV dynamics and then develop a set of virtual sensors that enables estimation of the forces and torques. Indeed, authors say that they try to avoid the use of complex tire models. The study is meant for several diagnostic purposes such as fault detection or fault prevention.Another AGV component, the charging system, has been also the object of study by some authors. For instance, a battery management simulation is developed for evaluating battery-related costs under various AGV operation modes and for designing battery management strategies [14]. Hou et al. developed a novel energy modelling method which allows to calculate and predict the AGV energy consumption [15]. However, in this work,we do not consider energy efficiency either the design of the battery, but the simulation of the electrical performance of the AGV's battery. The charging method is out of the scope of this paper.Finally, there are several works about the control of a fleet of AGVs. A detailed state of art on the design and control of several AGVs is presented in [16]. In this paper, author discusses the literature concerning the usage of AGVs in manufacturing and other new areas of these vehicle application, namely, distribution, transshipment, and transportation systems. As a conclusion, the author states that the most important differences between the usage of AGVs in manufacturing areas and in other environments can be noticed in the number of AGVs used. Besides, the author claims the necessity of analytical and simulation models which simultaneously address multiple design and control problems. Different vehicle platooning control strategies are presented in [17, 18].As shown above, most of the studies found in the literature are mainly focused on individual aspects of the AGV design problem: kinematics, control, guiding, energy, and so on. However, these components are not independent; indeed, these subsystems are highly coupled. Therefore, a holistic and complete vision of these automatic vehicles is missing, where the interactions among their various elements are evident in the models used so that the simulation is realistic.


## 3. Description of the Industrial AGV Architecture

There are different ways to split up an AGV into its different parts. We have considered the following interconnected subsystems that describe the whole behaviour of the vehicle: driving system, guiding and localization system, safety system, motors, power storage and charging, and control system. These elements interact with the working environment. Figure1 shows the AGV architecture with all the mentioned systems and their relationships.Figure 1
Subsystems AGV architecture.The control system can be considered the brain of the AGV. Depending on the localization, on the external inputs and the current state, it adjusts the charging system, generates target signals for the driving system, commands the outputs, and adjusts the safety system. The driving system collects the dynamic and kinematic of the AGV motion; it changes the position and orientation of the AGV and modifies the working environment. It also gives information about the current to the control system in order to close the control loop. The driving system is the component that demands more energy from the power system.The safety system detects obstacles in the safety zone and warns the control system; it can even trigger an emergency stop. The charging system is responsible for recovering the energy of the power storage system. This subsystem is usually placed out of the vehicle when there is not enough space in the AGV. The power storage is in charge of providing energy to the electronic components and the motors.The guiding and localization system (GLS) manages AGV position and attitude measures, which are used by the control system. Depending on the technologies used to implement the GLS, this information will have greater precision. There are technologies, such as simultaneous localization and mapping (SLAM), which provide information about the absolute coordinates (x, y, angle) of the AGV with high accuracy. Others only provide the deviation respect to a predefined trajectory, either marked on the floor or buried, such as magnetic antennas, optical sensors, and so on, and must be complemented with a localization system such as RFID tag sensors (low accuracy) or UWB devices (medium accuracy) to know the absolute position.On the other hand, the input/output system allows to introduce information to the AGV from other external sources: machines, operators, and so on, and extract information. Finally, the workspace represents the external environment and everything that can produce any changes to the AGV behaviour.In this paper, we are going to model a hybrid differential-tricycle AGV. This vehicle has been selected because nowadays is one of the most used AGVs in the industry. An example of this type of AGVs is the Unibot AGV of the company ASTI Mobile Robotics [4], represented in Figure 2.Figure 2
Unibot AGV.The Unibot is mainly used to convey loads by pulling carts. This vehicle is robust, simple, flexible, and reliable and well-established in the market vehicles. Though with reduced dimensions, it has great load capacity. It is fully connected in real time.This industrial tow AGV can be used in whatever industry where medium loads need to be towed. However, it achieves its full potential in enterprises where recurrent flows of pieces and/or products exist. They can be applied in any SMEs and large companies (for further information on enterprise categories see [19]) although it is commonly found in the automotive industry as it is one of the most automatized sectors. Moreover, it is easy to include them in already functioning enterprises as these automatic guided vehicles do not require to modify the infrastructure in order to implement the layout. Indeed, the layout can be usually easily removed and moved to adapt it to changes in the production plant. However, also in companies that are going to start the production, it is possible to design the plant taking into account the layouts of the AGVs to optimize the intralogistics.In addition, it has many other functionalities such as magnetic guidance/navigation system (surface/buried), online charging system, safety laser for internal environment, safety PLC, and emergency stop button, among others.This is a complex system because it has two wheels as a differential robot and a tricycle configuration in the front part. Most of the models found in the literature work as differential robots.


## 4. Modelling of the AGV’s Subsystems

### 4.1. Driving System

There are many types of AGVs regarding the kinematics, but four different models can be typically identified: tricycle, differential, quad, and omnidirectional. Figure3 shows some standard configurations of the wheels for these AGVs. Depending on the number and type of the wheels, the kinematic constraints and the control variables of the vehicle will vary. The drive wheels provide traction but cannot change its direction. The steer wheels can change the direction but cannot provide traction. The steer and drive wheels provide both things, and they are also called motor-wheels.Figure 3
Wheel configurations in AGVs: (a) differential; (b) tricycle; (c) quad; (d) omnidirectional.All of these wheels are subjected to nonholonomic constraints to prevent wheel lateral slipping. This can disrupt the control of the vehicle and must be avoided. By contrast, the omnidirectional wheels only provide traction, but they are not affected by the nonholonomic constraints. In fact, the omni-wheels are equipped with rollers to enable the lateral slipping.The Unibot AGV [4] is a mixture of tricycle and differential. The traction head is a differential robot; meanwhile, the body is linked with the traction unit by an axle, and it performs as a tricycle. The wheels of the body do not provide traction but support the weight of the vehicle and allow the body to follow the traction head.As said before, the driving system includes the dynamics and the kinematics of the AGV motion. Therefore, in this section, both the kinematic and dynamic models of the hybrid tricycle-differential AGV are developed. To do it, the kinematic equations of the individual traction tricycle and differential units are combined in a novel way as the hybrid tricycle-differential AGV has not been previously studied in the literature. In addition, the dynamic model of the vehicle has been developed by the authors using the Newton–Euler fundamental equations of the translational and rotational dynamics.Figure4 represents the mechanical components of this AGV and the coordinate system (traction head, green square and AGV body, blue rectangle). The center of the wheels of the traction head in the inertial coordinate system is represented by xh,yh, and the position of the center of the wheels of the body is xb,yb, both in m. In this inertial frame, the attitude of the body is Φb (rad) and the attitude of the head is Φh (rad); the angle between the body and the head is γ (rad). Lb is the distance between xb,yb and xh,yh in m, and Lh is the distance between the wheels of the traction unit in m.Figure 4
Unibot AGV driving system and the coordinate system.The equations of the traction head are given by the kinematic model of a differential robot [20]. That is,(1)x˙h=Vl+Vr2cosΦh,y˙h=Vl+Vr2sinΦh,Φ˙h=Vr−VlLh.On the other hand, the motion of the body follows the equations of a tricycle:(2)x˙b=vhcosγcosΦb,y˙b=vhcosγsinΦbΦ˙b=vhLbsinγ,where vh is the longitudinal velocity of the steering drive (m/s), i.e., the traction head speed. These equations (1) and (2) are linked by the following expressions:(3)vh=x˙h2+y˙h2=Vl+Vr2,γ=Φh−Φb,γmin≤γ≤γmax,where γmin and γmax are the mechanical limits of the angle of the traction head (rad). These mechanical limits are set to avoid damage in the wires between the body and the traction head.Besides, in order to prevent sliding in the wheels, the following constraints must be met, equation (4) for the rear wheels and equation (5) for the front wheels:(4)x˙bsinΦb−x˙bcosΦb=0,(5)x˙bsinΦb+γ−x˙bcosΦb+γ−Φ˙bLbcosΦb=0,with Lb is the distance between the center of the traction head and the rear axle.By the translational and rotational Newton–Euler dynamic equations, the following expressions that represent the forces and momentums are obtained:(6)mT⋅Rh2mT⋅Rh2Ih⋅RhLh−Ih⋅RhLhθ¨rθ¨l=Mer+Mel2Rh−frTMer−MelLh2Rh−MrR,frT=0.5⋅δair⋅SAGV⋅Caero⋅vh2⋅signvh+g⋅mT⋅Croll⋅signvh,MrR=Fvh⋅Φ˙h+Fsh⋅signΦ˙h,Mer=Mr−Fvw⋅θ˙r−Fsw⋅signθ˙r,Mel=Ml−Fvw⋅θ˙l−Fsw⋅signθ˙l,where mT (kg) is the total mass of the system, that is, the mass of the AGV, mAGV (kg), plus the mass of the load, mL (kg); the radius of the wheels in the traction unit is Rh (m); Ih is the rotational inertia of the traction unit (kg m2); θ¨r and θ¨l are the angular accelerations of the right and left wheel of the traction unit (rad/s2), respectively;Mer and Mel are the effective torques in the right and left wheel of the traction unit (Nm); frT is the translational friction force (N); MrR is the friction torque (Nm); δair is the density of the air (Kg/m3); SAGV is the front surface of the air (m2); Caero is the aerodynamic coefficient; Croll is the rolling coefficient; g is the acceleration of the gravity; Fvh and Fsh are the viscous and static friction coefficients in the traction unit (Nm and Nms/rad); Fvw and Fsw are the viscous and static friction coefficients in the wheels (Nm and Nms/rad); Mer and Mel are the torques produced by the motors (Nm); and sign is the sign function. The effect of the inertia of the wheels has been neglected. It has been supposed that the AGV is working in an indoor environment, and the wind speed is zero.Moreover, in the simulations, the slippage has been considered. The slippage happens when the traction force exceeds the surface friction force. The traction forces in the front wheels are given byMer/Rh and Mel/Rh. Therefore, to avoid the slippage, the following constraints must be fulfilled:(7)MerRh<g⋅mTμ4,MelRh<g⋅mTμ4,where μ is the friction coefficient. The number 4 that appears in the denominator means that the weight of the AGV is equally distributed into the four wheels.


### 4.2. Safety System

In this section, we develop the mathematical model of a general safety subsystem applying a new approach to do this, the hybrid automata formalism. The safety system is in charge of preventing collisions with humans and objects. The safety norms establish that the AGV must stop in the near presence of obstacles. This normally leads to introduce a processor in the safety system to take the control and trigger an emergency stop command when the control system is not operative.Figure5 shows the interactions between the driving, the safety, and the control systems. The safety system monitors the velocities of the wheels vl,vr by encoders. If the current longitudinal velocity is higher than the predefined current safety velocity, vsafe, during a configurable period of time, then the safety system fires an emergency stop procedure. This is represented in Figure 5 as the stop signal. Normally, this is carried out by acting directly on the brake of the vehicle or on the motors. The control system is also informed about this anomaly situation by the stop signal.Figure 5
Interactions between driving system, safety system, and the control system.Figure 6
Guiding sensor of the AGV.Figure 7
The control system and the interaction with other subsystems.Figure 8
Equivalent circuit of an AGV and charger (a) and of one motor (b).On the other hand, the control system notifies the safety system about what type of safety zones must be activated at each moment. These safety zones are polygonal areas where there cannot be obstacles. Each zone has acode∈N and a maximum velocity, vsafe∈ℛ (m/s), which is calculated considering the deceleration rate of the AGV to ensure that it is able to stop before a collision. The control system knows the location of the AGV and, for instance, if the AGV is towing a trolley, the safety zones must be big enough to cover it. Moreover, if the AGV is going to turn left, the safety zones must be defined on this side of the AGV. If the safety system detects an obstacle inside the safety perimeter, it automatically sends the code of the zone to the control system, with the signal code, and updates the safety velocity.The AGV safety system is equipped with different types of sensors: mechanical, ultrasounds, infrared, or LIDAR, to detect the obstacles. In the Unibot AGV, the safety system has a PLC and a LIDAR sensor installed in the front of the vehicle. The safety zones can be mathematically defined as a setZi⊆ℛ4 of pairs of points relative to the center of the LIDAR (xLID, yLID). In addition, each safety zone can be classified as warning zone or error zone. Therefore, by the union of all zones, it is possible to conform the set Zones⊆Zi×N×ℛ.The LIDAR returns a set of distance measures,PDIST, that are defined in polar coordinates as follows:(8)PDIST⊂r,θ∈R<rmax×θC|,∀r1,θ1,r2,θ2θ1=θ2⇒r1=r2,θC⊂θ∈R|θ=i−1⋅res+θmin,i∈N≤Np.The size of this set isNp=res⋅θmax−θmin, where res is the angular resolution, and θmin and θmax are minimum and maximum angles detected by the LIDAR. This set may be transformed to Cartesian coordinates by the following function:(9)fxy:PDIST⟶R2,PXY=fxyr,θ=rcosθ,ρsinθ.(1)
The subset of allowed zones,ZonesEN⊆Zones, is obtained according to the type of zone, typezone, selected by the control system. The safety PLC checks if any of the points in PXY belongs to the set of allowed zones by the function: fzone:PXY⟶ZonesEN (9).(10)fzonex,y=∅,0,vsmax,∀z,c,v∈ZonesEN|x,y∉Polygonz,z,c,v∈ZonesEN|x,y∈Polygonz,∃z,c,v∈ZonesEN|x,y∈Polygonz,where the functionPolygonz:Zi⟶R,RM gives the list of points within the perimeter of the safety zone. If there is not any obstacle in an allowed safety zone, the zone given by (10) is ∅,0,vsmax, being vsmax (m/s) the AGV maximum velocity. This vsmax is usually defined in the datasheet of the vehicle, and it normally goes from 0.8 m/s to 2 m/s.If more than one zone is obtained by (10), the safety velocity, vsafe, is set as the minimum safe velocity. This can be expressed as follows:(11)vsafe=MINv|z,c,v=fzonex,y,∀x,y∈PXY.The model of the safety controller can be described by the hybrid automata formalism. A hybrid automata is a formal model that combines discrete control graphs, usually called finite state automata, with continuously evolving variables. An extension to the hybrid automata H defined in [21] is a tuple H=Q,X,U,Y,Init,D,Dom,E,G,R, where(i)
Q is a set of discrete variables, and Q is countable. Also it is also known as the set of discrete states of the automata.(ii)
X is a set of continuous variables, that is, the set of continuous state variables of the automata.(iii)
U is a set of input variables.(iv)
Y is a set of output variables.(v)
Init⊆Q×X×U is a set of initial states.(vi)
D:Q×X×U⟶TX is a vector field of the differential equations.(vii)
Dom:Q⟶P(X) assigns a domain to each q∈Q.(viii)
E⊂Q×Q is a collection of discrete transitions.(ix)
G:E⟶PX×U,X×U assigns a guard condition to each e=q,q′∈E.(x)
R:E×X×Y⟶PX×Y assigns a reset relation to each e=q,q′∈E and x∈X.LetQ=q1,q2,q3,q4 be the set of discrete variables; X=t is the set of continuous variables; U=vl,vr,typezone,PDIST is the set of input variables; Y=stop∈0,1,vsafe,code is the set of output variables, and Init=q1,t=0,stop=0∈Q×X×U is the initial. When the variable stop=1, the emergency stop is triggered. As expected, the safety controller receives as inputs the velocity of the wheels, the type of allowed zones, and the points measured by the LIDAR; its output is the stop signal, the current safe velocity, and the code of the active safety zone.The differential equations are given by(12)Dq1,x=Dq3,x=0,Dq2,x=Dq4,x=1.The domains areDomq1=Domq3=0, Domq2=t∈R<t2, and Domq4=t∈R<t4. In addition, the discrete transitions are given by(13)E=q1,q2,q2,q1,q2,q3,q3,q4,q4,q3,q4,q1.The guard conditions are the following:(14)Gq1,q2=t,vl,vr,typezone,PDIST∈X×U|vl+vr2>vsafetypezone,PDIST,Gq2,q1=t,vl,vr,typezone,PDIST∈X×U|vl+vr2≤vsafetypezone,PDIST,Gq2,q3=t,vl,vr,typezone,PDIST∈X×U|t≥t2,Gq3,q4=t,vl,vr,typezone,PDIST∈X×U|vl+vr2≤vsafetypezone,PDIST,Gq4,q3=t,vl,vr,typezone,PDIST∈X×U|vl+vr2>vsafetypezone,PDIST,Gq4,q1=t,vl,vr,typezone,PDIST∈X×U|t≥t4,wherevsafe is calculated as a function of typezone and PDIST by equations (9)–(11) and t2 and t4 are parameters of the safety controller which can be adjusted by the user.The reset relations can be expressed as follows:(15)Rq1,q2,x,stop=0,stop=0,Rq2,q1,x,stop=t,stop=0,(16)Rq2,q3,x,stop=t,stop=1,Rq3,q4,x,stop=0,stop=1,(17)Rq4,q3,x,stop=t,stop=1,Rq4,q1,x,stop=t,stop=0.The outputs:vsafe and code, are calculated in the same way for all discrete states, by equations (10) and (11); thus, they have not been included in (15)–(17).To summarize, if an obstacle is detected in a warning zone, the maximum allowed speed is reduced. If the obstacle is in an error zone, the maximum speed is automatically set to zero. In both cases, the control system receives a warning, and it must follow the commands of the safety system. If the safety system detects that the AGV velocity is higher than the allowed speed for a period of time, the safety chain is broken and the vehicle is stopped.


### 4.3. Guiding and Localization System

The guiding and localization functionalities of the AGV can be implemented by only one device, such as a navigation system based on laser reflectors or the SLAM navigation systems. Both technologies are commonly complemented with the use of an accurate odometry of the vehicle [22]. To combine this information that come from different sensors, a Kalman filter or another similar mathematical tool can be used. However, there are situations, such as slippage produced by an inadequate load distribution or a slippery surface, where the estimation of the speed using only the encoders of the wheels is not possible. In these cases, an inertial measurement unit (IMU) embedded in the vehicle can help to estimate the AGV velocity. However, this solution increases the cost of the AGV, and thus many mobile robots are not equipped with the IMU neither implement a Kalman filter. This is the case of the AGV studied here. As it will be explained below, in this AGV, guiding and localization are decoupled. Guiding (understood as deviation from the expected trajectory without localization) is provided by the magnetic sensor, and the localization is provided by a RFID reader.The guiding system allows us to know the deviation between the AGV and the path defined in the working environment. There are different types of guiding sensors: optical ones (to follow a painted line), magnetic ones (to follow a magnetic tape), inductive ones (to follow a buried wire), and so on. In the AGV used in the study, the guiding is based on a magnetic sensor.The localization system detects points of reference placed in the working environment, with a known specific location on the plane. These reference points may be sensed by an optical device (QR codes), a magnetic device (magnetic spots), an electromagnetic device (RFID tags), and so on. This way the AGV can know its own location through references. The accuracy of the localization system is half the distance between two points. In the standard Unibot robot, the localization is RFID-based.The traction unit of the AGV equipped with the guiding sensor and the magnetic tape on the floor is shown in Figure6. The guiding sensor gives the error signal errgui, that is, the deviation respect to the planned trajectory. If the sensing point is at the right of the magnetic tape, the error is considered positive; otherwise, it is negative.


### 4.4. Control System

The main contribution of this section is the formal description of a general control subsystem of the AGV, as well as the identification of the interactions with the other subsystems. Figure7 shows the interaction between the subsystems driving and safety, the guiding and location systems, as well as the internal structure of the control system (orange dashed rectangle). The control system has three internal blocks: the control unit, the velocity control, and a block called MIN that calculates the minimum of its inputs.The control unit has as inputs thelocalization variable from the GLS and the stop signal from the safety system. Its outputs are the reference of the cruise velocity, vref, and the type of safety zone, typezone, associated to the section of the route where the AGV is currently located.The inputs of the MIN block arevref and vsafe (from the safety system). It selects the minimum of them and calculates the effective velocity that the AGV should have, vfoll.Finally, the velocity control module is in charge of generating the control signals for the motorsul,ur in order to track the reference longitudinal velocity vfoll and to minimize the error signal, errgui. To do it, it receives the velocity of the wheels vl,vr from the driving system and the error signal errgui from the GLS. Even more, it is notified if the stop signal is triggered, and it also receives the references for the wheel speeds man,uml,umr directly from the user if the manual controller is on. It interacts with the workspace through a set of input/output signals (IOsignals).The velocity control is carried out by the functionfvcon, which receives as inputs vfoll (m/s) from the MIN block, errgui (m) from the GLS, vl,vr (m/s) from the driving system, uml,umr (m/s) from an external control device, and the digital signals stop,man∈0,12. The stop signal, as it was explained, comes from the safety system. The man signal is generated in an external control device. It is 1 when the manual external controller device is on and 0 otherwise. The output of the fvcon function is the pair of control signals for the motors ul,ur∈u∈ℛ|−1≤u≤12. Thus, this function fvconvfoll,errgui,vl,vr,uml,umr,stop,man:ℛ6×0,12⟶u∈ℛ|−1≤u≤12 can be defined as follows:(18)Φ˙href=PIDerrgui=KΦP⋅errgui+KΦD⋅err˙gui+KΦI∫errgui,(19)vlref=vfoll−Φ˙href⋅Lh2,vrref=vfoll+Φ˙href⋅Lh2,(20)ul,ur=fvcon…=0,0,if stop=1,uml,umr,if stop=0∧man=1,PIvlref,vl,PIvrref,vr,if stop=0∧man=0.As it may be observed in (19), when stop signal is active, the motor targets are set to 0. However, when the manual mode is active, the external velocity control signals uml,umr are changed to ul,ur. On the other hand, if the automatic mode is on (last statement in (20)), the control output is generated by a couple of PID controllers, in particular a PI controller per wheel. The targets for the left and right wheels are vlref and vrref, respectively. These targets are calculated by equation (19) using as inputs the longitudinal velocity reference, vfoll, and the angular velocity reference, Φ˙href. The angular reference is computed by a PID to compensate the guiding error, errgui.As explained before, the control unit is in charge of assigning the type of safety zone,typezone, and a cruise velocity reference, vref. A lookup table is generated by the user with localization as input and this information.Likewise with the safety controller, the control unit can be modelled as a hybrid automata. It has three macrostates: automatic, manual, and safety stop. Therefore, the set of discrete states isQCS=auto,manual,safestop; the set of continuous variables is XCS, that is, defined by the user according to the actions to be carried out by the AGV. UCS=Localization,man,inpprog is the set of input variables and YCS=typezone,vref,outprog, where the inputs inpprog and outputs outprog are configured by the user in the lookup table. The initial state is InitCS=auto,typezone=0,vref=0∈QCS×XCS×UCS.The set of discrete transitions is given by(21)ECS=auto,manual,auto,safestop,manual,auto,manual,safestop,safestop,auto,safestop,manual.The set of guard conditions are given by(22)GCSauto,manual=Gsafestop,manual=man=1⋀stop=0,GCSmanual,auto=Gsafestop,auto=man=0⋀stop=0,GCSauto,safestop=Gmanual,safestop=stop=1.The hybrid automata is defined for each macrostate:Hauto, Hman, and Hstop by a tuple H=Q,X,U,Y,Init,D,Dom,E,G,R, as defined before. In this work, we are going to focus on Hauto because it has more interactions with the rest of subsystems. When in the automatic macrostate, the set of discrete states is QCSauto=wconi,marchii∈N<Nloc, where Nloc is the number of known localizations. In other words, the number of microstates is 2⋅Nloc. The parameter Nloc is configured by the user for each application. The discrete variables wconi mean “waiting for conditions,” and the variables marchi mean “the AGV is in motion.” Therefore, for each localization defined in the lookup table, the AGV will be either waiting for conditions or in motion once the conditions are fulfilled.The set of continuous variables in this macrostate,XCSauto, and its corresponding vector field of differential equations, DCSauto, are defined by the user according to the actions to be carried out by the AGV. The user can associate to each localizationi in the lookup table a set of inputs inpiprog, a set of outputs outiprog, a set of conditions Condi, a cruise velocity reference viprog, and a type of safety zone tsfiprog. Thus, the set of inputs in this macrostate is UCSauto=Localization∪inpprog, and the set of outputs is YCSauto=typezone,vref,∪outprog.The set of discrete transitions in the automatic mode is as follows:(23)ECSauto=wconi,marchii∈N<Nloc∪marchi,condji,j∈ℜprog,whereℜprog is a user-defined relationship. This relationship defines the sequence of localization values of an action and so it is necessary to specify a pair of microstates marchi,condi. As shown in (23), the jump between two microstates can only be done if its sequence appears in ℜprog.From the relationshipℜprog, the set of guards is automatically generated as follows:(24)GCSautowconi,marchi=Condi,i∈N<Nloc,(25)GCSautomarchi,wconj=localization=j∧i,j∈ℜprog,i,j∈N2<Nprog,i∈Nloc,whereCondii∈N<Nloc is a set of conditions. It is possible to observe in (23) and (24) how the AGV in the microstate wconi waits for the meeting of condition Condi. When they are fulfilled, it switches to the microstate marchi. And vice versa, when it is at marchi state and it reaches a localization defined in ℜprog, it changes to wconj.Finally the set of reset relations is given by(26)RCSautowconi,marchi=typezone=tsfiprog,vref=viprog,outprog=outiprog,i∈N<Nloc.(27)RCSautomarchi,wconj=typezone=tsfjprog,vref=0,outprog=outjprog,i,j∈ℜprog.As expressed in (26), when the AGV reaches the microstate marchi, it sets vref to the value viprog stored in the lookup table associated to localizationi.


### 4.5. Electrical System: Charging, Power Storage, and Motors

The novelty of this section is the integration of the electrical models of the battery, the charger, the motors, and the drives. The most frequently power storage technologies used in AGVs are the lead-based and lithium batteries. More recently, supercaps, electric capacitors with an unusually high power density, are being used for very high charging currents demand. However, still lead batteries are the most widely used because they are much cheaper than the other options. There are several mathematical models of these batteries, each one considering different aspects. The electrical model is adapted from [23, 24] to include the charger and the motors, as shown in Figure 8.The electrical model of the motors (Figure8) is adapted from [25–27]:(28)Vmoti=Imoti⋅Rm+Lm⋅I˙moti+Km⋅wmoti,i∈L,R,J⋅w˙moti+Kr⋅wmoti+MXi=Km⋅Imoti,i∈L,R,Mi=Km⋅Imoti,i∈L,R,(29)Vmoti=ui⋅Vbat,i∈L,R,(30)absVmoti⋅Imoti=η⋅Vbat⋅IMi,i∈L,R.Regarding motori, Vmoti (V) and Imoti (A) are the voltage and the current; Rm is the motor winding resistor (Ω); Lm is the motor inductance (H); Km is the electromotive constant (kgm2s−2A−1); wmoti is the rotor angular velocity (rad/s); J is the moment of inertia of the rotor (kgm2); Kr is the coefficient of rotation resistance; MXi is the load moment (kg m2/s2); η is the performance coefficient; IMi is the input current (A); and abs is the absolute value function; the control signals of the motors uL and uR are calculated by equation (33), and they are the inputs of the motor drivers.The main equations of the equivalent electrical circuit of the AGV and the charger are as follows:(31)Ibat+Ic⋅uc=VbatRc⋅uc+Istop+IML+IMR,IR2=Ip+Ibat,IR2=IR1+Ic1,IC1=−C1⋅V˙C,Embat=Vc+R2⋅IR2+R0⋅Ibat+Vbat,Embat˙=−Ibat3600⋅Cn,whereIbat (A) and Vbat (V) are the current and the voltage in the terminals of the battery; Istop (A) is the current consumed by the AGV when it is stopped; Ic (A) is the current given by the charging station; Rc (Ω) is the equivalent resistance of the charger;Ip (A) is the parasitic current in the battery when is charging; Embat (V) is the voltage in the open circuit of the battery; R1(Ω), R2(Ω), and C1(F) are internal parameters of the battery; and Cn (Ah) is the capacity of the battery. The control signal uc is active, uc = 1, when the AGV is in a charging station. For more details of these variables and parameters, see [23].


### 4.6. Workspace

The workspace, although is not embedded in the AGV as the rest of the subsystems, plays an important role in the performance of the automatic vehicle. It represents the environment where the AGV moves. It collects information about the ground, the obstacles, and other possible AGVs and provides information to the safety system, the guiding and localization system, the driving system, and the control system.Figure9 shows the interaction among these subsystems. The workspace gives the landmarks and references to the GLS to calculate the guiding error errgui and localization. It also detects obstacles that will be handled by the safety system. In addition, it interacts with the driving systems by the friction coefficients and the ramps of the ground. In turn, the driving system moves the AGV, changing its position coordinates x,y. Finally, the workspace sends IO signals to the control system that may come from other machines [28], AGVs, and human operators, and it also receives commands from the control system.Figure 9
Interaction between the workspace and the AGV subsystems.The workspace can be simulated as a lookup table, where the inputs of the table are the AGV position coordinatesx,y, and the output is a set that provides information about the obstacles, the landmarks and references, the friction coefficients, the ramps, and the IO signals in that spatial location.


## 4.1. Driving System

There are many types of AGVs regarding the kinematics, but four different models can be typically identified: tricycle, differential, quad, and omnidirectional. Figure3 shows some standard configurations of the wheels for these AGVs. Depending on the number and type of the wheels, the kinematic constraints and the control variables of the vehicle will vary. The drive wheels provide traction but cannot change its direction. The steer wheels can change the direction but cannot provide traction. The steer and drive wheels provide both things, and they are also called motor-wheels.Figure 3
Wheel configurations in AGVs: (a) differential; (b) tricycle; (c) quad; (d) omnidirectional.All of these wheels are subjected to nonholonomic constraints to prevent wheel lateral slipping. This can disrupt the control of the vehicle and must be avoided. By contrast, the omnidirectional wheels only provide traction, but they are not affected by the nonholonomic constraints. In fact, the omni-wheels are equipped with rollers to enable the lateral slipping.The Unibot AGV [4] is a mixture of tricycle and differential. The traction head is a differential robot; meanwhile, the body is linked with the traction unit by an axle, and it performs as a tricycle. The wheels of the body do not provide traction but support the weight of the vehicle and allow the body to follow the traction head.As said before, the driving system includes the dynamics and the kinematics of the AGV motion. Therefore, in this section, both the kinematic and dynamic models of the hybrid tricycle-differential AGV are developed. To do it, the kinematic equations of the individual traction tricycle and differential units are combined in a novel way as the hybrid tricycle-differential AGV has not been previously studied in the literature. In addition, the dynamic model of the vehicle has been developed by the authors using the Newton–Euler fundamental equations of the translational and rotational dynamics.Figure4 represents the mechanical components of this AGV and the coordinate system (traction head, green square and AGV body, blue rectangle). The center of the wheels of the traction head in the inertial coordinate system is represented by xh,yh, and the position of the center of the wheels of the body is xb,yb, both in m. In this inertial frame, the attitude of the body is Φb (rad) and the attitude of the head is Φh (rad); the angle between the body and the head is γ (rad). Lb is the distance between xb,yb and xh,yh in m, and Lh is the distance between the wheels of the traction unit in m.Figure 4
Unibot AGV driving system and the coordinate system.The equations of the traction head are given by the kinematic model of a differential robot [20]. That is,(1)x˙h=Vl+Vr2cosΦh,y˙h=Vl+Vr2sinΦh,Φ˙h=Vr−VlLh.On the other hand, the motion of the body follows the equations of a tricycle:(2)x˙b=vhcosγcosΦb,y˙b=vhcosγsinΦbΦ˙b=vhLbsinγ,where vh is the longitudinal velocity of the steering drive (m/s), i.e., the traction head speed. These equations (1) and (2) are linked by the following expressions:(3)vh=x˙h2+y˙h2=Vl+Vr2,γ=Φh−Φb,γmin≤γ≤γmax,where γmin and γmax are the mechanical limits of the angle of the traction head (rad). These mechanical limits are set to avoid damage in the wires between the body and the traction head.Besides, in order to prevent sliding in the wheels, the following constraints must be met, equation (4) for the rear wheels and equation (5) for the front wheels:(4)x˙bsinΦb−x˙bcosΦb=0,(5)x˙bsinΦb+γ−x˙bcosΦb+γ−Φ˙bLbcosΦb=0,with Lb is the distance between the center of the traction head and the rear axle.By the translational and rotational Newton–Euler dynamic equations, the following expressions that represent the forces and momentums are obtained:(6)mT⋅Rh2mT⋅Rh2Ih⋅RhLh−Ih⋅RhLhθ¨rθ¨l=Mer+Mel2Rh−frTMer−MelLh2Rh−MrR,frT=0.5⋅δair⋅SAGV⋅Caero⋅vh2⋅signvh+g⋅mT⋅Croll⋅signvh,MrR=Fvh⋅Φ˙h+Fsh⋅signΦ˙h,Mer=Mr−Fvw⋅θ˙r−Fsw⋅signθ˙r,Mel=Ml−Fvw⋅θ˙l−Fsw⋅signθ˙l,where mT (kg) is the total mass of the system, that is, the mass of the AGV, mAGV (kg), plus the mass of the load, mL (kg); the radius of the wheels in the traction unit is Rh (m); Ih is the rotational inertia of the traction unit (kg m2); θ¨r and θ¨l are the angular accelerations of the right and left wheel of the traction unit (rad/s2), respectively;Mer and Mel are the effective torques in the right and left wheel of the traction unit (Nm); frT is the translational friction force (N); MrR is the friction torque (Nm); δair is the density of the air (Kg/m3); SAGV is the front surface of the air (m2); Caero is the aerodynamic coefficient; Croll is the rolling coefficient; g is the acceleration of the gravity; Fvh and Fsh are the viscous and static friction coefficients in the traction unit (Nm and Nms/rad); Fvw and Fsw are the viscous and static friction coefficients in the wheels (Nm and Nms/rad); Mer and Mel are the torques produced by the motors (Nm); and sign is the sign function. The effect of the inertia of the wheels has been neglected. It has been supposed that the AGV is working in an indoor environment, and the wind speed is zero.Moreover, in the simulations, the slippage has been considered. The slippage happens when the traction force exceeds the surface friction force. The traction forces in the front wheels are given byMer/Rh and Mel/Rh. Therefore, to avoid the slippage, the following constraints must be fulfilled:(7)MerRh<g⋅mTμ4,MelRh<g⋅mTμ4,where μ is the friction coefficient. The number 4 that appears in the denominator means that the weight of the AGV is equally distributed into the four wheels.


## 4.2. Safety System

In this section, we develop the mathematical model of a general safety subsystem applying a new approach to do this, the hybrid automata formalism. The safety system is in charge of preventing collisions with humans and objects. The safety norms establish that the AGV must stop in the near presence of obstacles. This normally leads to introduce a processor in the safety system to take the control and trigger an emergency stop command when the control system is not operative.Figure5 shows the interactions between the driving, the safety, and the control systems. The safety system monitors the velocities of the wheels vl,vr by encoders. If the current longitudinal velocity is higher than the predefined current safety velocity, vsafe, during a configurable period of time, then the safety system fires an emergency stop procedure. This is represented in Figure 5 as the stop signal. Normally, this is carried out by acting directly on the brake of the vehicle or on the motors. The control system is also informed about this anomaly situation by the stop signal.Figure 5
Interactions between driving system, safety system, and the control system.Figure 6
Guiding sensor of the AGV.Figure 7
The control system and the interaction with other subsystems.Figure 8
Equivalent circuit of an AGV and charger (a) and of one motor (b).On the other hand, the control system notifies the safety system about what type of safety zones must be activated at each moment. These safety zones are polygonal areas where there cannot be obstacles. Each zone has acode∈N and a maximum velocity, vsafe∈ℛ (m/s), which is calculated considering the deceleration rate of the AGV to ensure that it is able to stop before a collision. The control system knows the location of the AGV and, for instance, if the AGV is towing a trolley, the safety zones must be big enough to cover it. Moreover, if the AGV is going to turn left, the safety zones must be defined on this side of the AGV. If the safety system detects an obstacle inside the safety perimeter, it automatically sends the code of the zone to the control system, with the signal code, and updates the safety velocity.The AGV safety system is equipped with different types of sensors: mechanical, ultrasounds, infrared, or LIDAR, to detect the obstacles. In the Unibot AGV, the safety system has a PLC and a LIDAR sensor installed in the front of the vehicle. The safety zones can be mathematically defined as a setZi⊆ℛ4 of pairs of points relative to the center of the LIDAR (xLID, yLID). In addition, each safety zone can be classified as warning zone or error zone. Therefore, by the union of all zones, it is possible to conform the set Zones⊆Zi×N×ℛ.The LIDAR returns a set of distance measures,PDIST, that are defined in polar coordinates as follows:(8)PDIST⊂r,θ∈R<rmax×θC|,∀r1,θ1,r2,θ2θ1=θ2⇒r1=r2,θC⊂θ∈R|θ=i−1⋅res+θmin,i∈N≤Np.The size of this set isNp=res⋅θmax−θmin, where res is the angular resolution, and θmin and θmax are minimum and maximum angles detected by the LIDAR. This set may be transformed to Cartesian coordinates by the following function:(9)fxy:PDIST⟶R2,PXY=fxyr,θ=rcosθ,ρsinθ.(1)
The subset of allowed zones,ZonesEN⊆Zones, is obtained according to the type of zone, typezone, selected by the control system. The safety PLC checks if any of the points in PXY belongs to the set of allowed zones by the function: fzone:PXY⟶ZonesEN (9).(10)fzonex,y=∅,0,vsmax,∀z,c,v∈ZonesEN|x,y∉Polygonz,z,c,v∈ZonesEN|x,y∈Polygonz,∃z,c,v∈ZonesEN|x,y∈Polygonz,where the functionPolygonz:Zi⟶R,RM gives the list of points within the perimeter of the safety zone. If there is not any obstacle in an allowed safety zone, the zone given by (10) is ∅,0,vsmax, being vsmax (m/s) the AGV maximum velocity. This vsmax is usually defined in the datasheet of the vehicle, and it normally goes from 0.8 m/s to 2 m/s.If more than one zone is obtained by (10), the safety velocity, vsafe, is set as the minimum safe velocity. This can be expressed as follows:(11)vsafe=MINv|z,c,v=fzonex,y,∀x,y∈PXY.The model of the safety controller can be described by the hybrid automata formalism. A hybrid automata is a formal model that combines discrete control graphs, usually called finite state automata, with continuously evolving variables. An extension to the hybrid automata H defined in [21] is a tuple H=Q,X,U,Y,Init,D,Dom,E,G,R, where(i)
Q is a set of discrete variables, and Q is countable. Also it is also known as the set of discrete states of the automata.(ii)
X is a set of continuous variables, that is, the set of continuous state variables of the automata.(iii)
U is a set of input variables.(iv)
Y is a set of output variables.(v)
Init⊆Q×X×U is a set of initial states.(vi)
D:Q×X×U⟶TX is a vector field of the differential equations.(vii)
Dom:Q⟶P(X) assigns a domain to each q∈Q.(viii)
E⊂Q×Q is a collection of discrete transitions.(ix)
G:E⟶PX×U,X×U assigns a guard condition to each e=q,q′∈E.(x)
R:E×X×Y⟶PX×Y assigns a reset relation to each e=q,q′∈E and x∈X.LetQ=q1,q2,q3,q4 be the set of discrete variables; X=t is the set of continuous variables; U=vl,vr,typezone,PDIST is the set of input variables; Y=stop∈0,1,vsafe,code is the set of output variables, and Init=q1,t=0,stop=0∈Q×X×U is the initial. When the variable stop=1, the emergency stop is triggered. As expected, the safety controller receives as inputs the velocity of the wheels, the type of allowed zones, and the points measured by the LIDAR; its output is the stop signal, the current safe velocity, and the code of the active safety zone.The differential equations are given by(12)Dq1,x=Dq3,x=0,Dq2,x=Dq4,x=1.The domains areDomq1=Domq3=0, Domq2=t∈R<t2, and Domq4=t∈R<t4. In addition, the discrete transitions are given by(13)E=q1,q2,q2,q1,q2,q3,q3,q4,q4,q3,q4,q1.The guard conditions are the following:(14)Gq1,q2=t,vl,vr,typezone,PDIST∈X×U|vl+vr2>vsafetypezone,PDIST,Gq2,q1=t,vl,vr,typezone,PDIST∈X×U|vl+vr2≤vsafetypezone,PDIST,Gq2,q3=t,vl,vr,typezone,PDIST∈X×U|t≥t2,Gq3,q4=t,vl,vr,typezone,PDIST∈X×U|vl+vr2≤vsafetypezone,PDIST,Gq4,q3=t,vl,vr,typezone,PDIST∈X×U|vl+vr2>vsafetypezone,PDIST,Gq4,q1=t,vl,vr,typezone,PDIST∈X×U|t≥t4,wherevsafe is calculated as a function of typezone and PDIST by equations (9)–(11) and t2 and t4 are parameters of the safety controller which can be adjusted by the user.The reset relations can be expressed as follows:(15)Rq1,q2,x,stop=0,stop=0,Rq2,q1,x,stop=t,stop=0,(16)Rq2,q3,x,stop=t,stop=1,Rq3,q4,x,stop=0,stop=1,(17)Rq4,q3,x,stop=t,stop=1,Rq4,q1,x,stop=t,stop=0.The outputs:vsafe and code, are calculated in the same way for all discrete states, by equations (10) and (11); thus, they have not been included in (15)–(17).To summarize, if an obstacle is detected in a warning zone, the maximum allowed speed is reduced. If the obstacle is in an error zone, the maximum speed is automatically set to zero. In both cases, the control system receives a warning, and it must follow the commands of the safety system. If the safety system detects that the AGV velocity is higher than the allowed speed for a period of time, the safety chain is broken and the vehicle is stopped.


## 4.3. Guiding and Localization System

The guiding and localization functionalities of the AGV can be implemented by only one device, such as a navigation system based on laser reflectors or the SLAM navigation systems. Both technologies are commonly complemented with the use of an accurate odometry of the vehicle [22]. To combine this information that come from different sensors, a Kalman filter or another similar mathematical tool can be used. However, there are situations, such as slippage produced by an inadequate load distribution or a slippery surface, where the estimation of the speed using only the encoders of the wheels is not possible. In these cases, an inertial measurement unit (IMU) embedded in the vehicle can help to estimate the AGV velocity. However, this solution increases the cost of the AGV, and thus many mobile robots are not equipped with the IMU neither implement a Kalman filter. This is the case of the AGV studied here. As it will be explained below, in this AGV, guiding and localization are decoupled. Guiding (understood as deviation from the expected trajectory without localization) is provided by the magnetic sensor, and the localization is provided by a RFID reader.The guiding system allows us to know the deviation between the AGV and the path defined in the working environment. There are different types of guiding sensors: optical ones (to follow a painted line), magnetic ones (to follow a magnetic tape), inductive ones (to follow a buried wire), and so on. In the AGV used in the study, the guiding is based on a magnetic sensor.The localization system detects points of reference placed in the working environment, with a known specific location on the plane. These reference points may be sensed by an optical device (QR codes), a magnetic device (magnetic spots), an electromagnetic device (RFID tags), and so on. This way the AGV can know its own location through references. The accuracy of the localization system is half the distance between two points. In the standard Unibot robot, the localization is RFID-based.The traction unit of the AGV equipped with the guiding sensor and the magnetic tape on the floor is shown in Figure6. The guiding sensor gives the error signal errgui, that is, the deviation respect to the planned trajectory. If the sensing point is at the right of the magnetic tape, the error is considered positive; otherwise, it is negative.


## 4.4. Control System

The main contribution of this section is the formal description of a general control subsystem of the AGV, as well as the identification of the interactions with the other subsystems. Figure7 shows the interaction between the subsystems driving and safety, the guiding and location systems, as well as the internal structure of the control system (orange dashed rectangle). The control system has three internal blocks: the control unit, the velocity control, and a block called MIN that calculates the minimum of its inputs.The control unit has as inputs thelocalization variable from the GLS and the stop signal from the safety system. Its outputs are the reference of the cruise velocity, vref, and the type of safety zone, typezone, associated to the section of the route where the AGV is currently located.The inputs of the MIN block arevref and vsafe (from the safety system). It selects the minimum of them and calculates the effective velocity that the AGV should have, vfoll.Finally, the velocity control module is in charge of generating the control signals for the motorsul,ur in order to track the reference longitudinal velocity vfoll and to minimize the error signal, errgui. To do it, it receives the velocity of the wheels vl,vr from the driving system and the error signal errgui from the GLS. Even more, it is notified if the stop signal is triggered, and it also receives the references for the wheel speeds man,uml,umr directly from the user if the manual controller is on. It interacts with the workspace through a set of input/output signals (IOsignals).The velocity control is carried out by the functionfvcon, which receives as inputs vfoll (m/s) from the MIN block, errgui (m) from the GLS, vl,vr (m/s) from the driving system, uml,umr (m/s) from an external control device, and the digital signals stop,man∈0,12. The stop signal, as it was explained, comes from the safety system. The man signal is generated in an external control device. It is 1 when the manual external controller device is on and 0 otherwise. The output of the fvcon function is the pair of control signals for the motors ul,ur∈u∈ℛ|−1≤u≤12. Thus, this function fvconvfoll,errgui,vl,vr,uml,umr,stop,man:ℛ6×0,12⟶u∈ℛ|−1≤u≤12 can be defined as follows:(18)Φ˙href=PIDerrgui=KΦP⋅errgui+KΦD⋅err˙gui+KΦI∫errgui,(19)vlref=vfoll−Φ˙href⋅Lh2,vrref=vfoll+Φ˙href⋅Lh2,(20)ul,ur=fvcon…=0,0,if stop=1,uml,umr,if stop=0∧man=1,PIvlref,vl,PIvrref,vr,if stop=0∧man=0.As it may be observed in (19), when stop signal is active, the motor targets are set to 0. However, when the manual mode is active, the external velocity control signals uml,umr are changed to ul,ur. On the other hand, if the automatic mode is on (last statement in (20)), the control output is generated by a couple of PID controllers, in particular a PI controller per wheel. The targets for the left and right wheels are vlref and vrref, respectively. These targets are calculated by equation (19) using as inputs the longitudinal velocity reference, vfoll, and the angular velocity reference, Φ˙href. The angular reference is computed by a PID to compensate the guiding error, errgui.As explained before, the control unit is in charge of assigning the type of safety zone,typezone, and a cruise velocity reference, vref. A lookup table is generated by the user with localization as input and this information.Likewise with the safety controller, the control unit can be modelled as a hybrid automata. It has three macrostates: automatic, manual, and safety stop. Therefore, the set of discrete states isQCS=auto,manual,safestop; the set of continuous variables is XCS, that is, defined by the user according to the actions to be carried out by the AGV. UCS=Localization,man,inpprog is the set of input variables and YCS=typezone,vref,outprog, where the inputs inpprog and outputs outprog are configured by the user in the lookup table. The initial state is InitCS=auto,typezone=0,vref=0∈QCS×XCS×UCS.The set of discrete transitions is given by(21)ECS=auto,manual,auto,safestop,manual,auto,manual,safestop,safestop,auto,safestop,manual.The set of guard conditions are given by(22)GCSauto,manual=Gsafestop,manual=man=1⋀stop=0,GCSmanual,auto=Gsafestop,auto=man=0⋀stop=0,GCSauto,safestop=Gmanual,safestop=stop=1.The hybrid automata is defined for each macrostate:Hauto, Hman, and Hstop by a tuple H=Q,X,U,Y,Init,D,Dom,E,G,R, as defined before. In this work, we are going to focus on Hauto because it has more interactions with the rest of subsystems. When in the automatic macrostate, the set of discrete states is QCSauto=wconi,marchii∈N<Nloc, where Nloc is the number of known localizations. In other words, the number of microstates is 2⋅Nloc. The parameter Nloc is configured by the user for each application. The discrete variables wconi mean “waiting for conditions,” and the variables marchi mean “the AGV is in motion.” Therefore, for each localization defined in the lookup table, the AGV will be either waiting for conditions or in motion once the conditions are fulfilled.The set of continuous variables in this macrostate,XCSauto, and its corresponding vector field of differential equations, DCSauto, are defined by the user according to the actions to be carried out by the AGV. The user can associate to each localizationi in the lookup table a set of inputs inpiprog, a set of outputs outiprog, a set of conditions Condi, a cruise velocity reference viprog, and a type of safety zone tsfiprog. Thus, the set of inputs in this macrostate is UCSauto=Localization∪inpprog, and the set of outputs is YCSauto=typezone,vref,∪outprog.The set of discrete transitions in the automatic mode is as follows:(23)ECSauto=wconi,marchii∈N<Nloc∪marchi,condji,j∈ℜprog,whereℜprog is a user-defined relationship. This relationship defines the sequence of localization values of an action and so it is necessary to specify a pair of microstates marchi,condi. As shown in (23), the jump between two microstates can only be done if its sequence appears in ℜprog.From the relationshipℜprog, the set of guards is automatically generated as follows:(24)GCSautowconi,marchi=Condi,i∈N<Nloc,(25)GCSautomarchi,wconj=localization=j∧i,j∈ℜprog,i,j∈N2<Nprog,i∈Nloc,whereCondii∈N<Nloc is a set of conditions. It is possible to observe in (23) and (24) how the AGV in the microstate wconi waits for the meeting of condition Condi. When they are fulfilled, it switches to the microstate marchi. And vice versa, when it is at marchi state and it reaches a localization defined in ℜprog, it changes to wconj.Finally the set of reset relations is given by(26)RCSautowconi,marchi=typezone=tsfiprog,vref=viprog,outprog=outiprog,i∈N<Nloc.(27)RCSautomarchi,wconj=typezone=tsfjprog,vref=0,outprog=outjprog,i,j∈ℜprog.As expressed in (26), when the AGV reaches the microstate marchi, it sets vref to the value viprog stored in the lookup table associated to localizationi.


## 4.5. Electrical System: Charging, Power Storage, and Motors

The novelty of this section is the integration of the electrical models of the battery, the charger, the motors, and the drives. The most frequently power storage technologies used in AGVs are the lead-based and lithium batteries. More recently, supercaps, electric capacitors with an unusually high power density, are being used for very high charging currents demand. However, still lead batteries are the most widely used because they are much cheaper than the other options. There are several mathematical models of these batteries, each one considering different aspects. The electrical model is adapted from [23, 24] to include the charger and the motors, as shown in Figure 8.The electrical model of the motors (Figure8) is adapted from [25–27]:(28)Vmoti=Imoti⋅Rm+Lm⋅I˙moti+Km⋅wmoti,i∈L,R,J⋅w˙moti+Kr⋅wmoti+MXi=Km⋅Imoti,i∈L,R,Mi=Km⋅Imoti,i∈L,R,(29)Vmoti=ui⋅Vbat,i∈L,R,(30)absVmoti⋅Imoti=η⋅Vbat⋅IMi,i∈L,R.Regarding motori, Vmoti (V) and Imoti (A) are the voltage and the current; Rm is the motor winding resistor (Ω); Lm is the motor inductance (H); Km is the electromotive constant (kgm2s−2A−1); wmoti is the rotor angular velocity (rad/s); J is the moment of inertia of the rotor (kgm2); Kr is the coefficient of rotation resistance; MXi is the load moment (kg m2/s2); η is the performance coefficient; IMi is the input current (A); and abs is the absolute value function; the control signals of the motors uL and uR are calculated by equation (33), and they are the inputs of the motor drivers.The main equations of the equivalent electrical circuit of the AGV and the charger are as follows:(31)Ibat+Ic⋅uc=VbatRc⋅uc+Istop+IML+IMR,IR2=Ip+Ibat,IR2=IR1+Ic1,IC1=−C1⋅V˙C,Embat=Vc+R2⋅IR2+R0⋅Ibat+Vbat,Embat˙=−Ibat3600⋅Cn,whereIbat (A) and Vbat (V) are the current and the voltage in the terminals of the battery; Istop (A) is the current consumed by the AGV when it is stopped; Ic (A) is the current given by the charging station; Rc (Ω) is the equivalent resistance of the charger;Ip (A) is the parasitic current in the battery when is charging; Embat (V) is the voltage in the open circuit of the battery; R1(Ω), R2(Ω), and C1(F) are internal parameters of the battery; and Cn (Ah) is the capacity of the battery. The control signal uc is active, uc = 1, when the AGV is in a charging station. For more details of these variables and parameters, see [23].


## 4.6. Workspace

The workspace, although is not embedded in the AGV as the rest of the subsystems, plays an important role in the performance of the automatic vehicle. It represents the environment where the AGV moves. It collects information about the ground, the obstacles, and other possible AGVs and provides information to the safety system, the guiding and localization system, the driving system, and the control system.Figure9 shows the interaction among these subsystems. The workspace gives the landmarks and references to the GLS to calculate the guiding error errgui and localization. It also detects obstacles that will be handled by the safety system. In addition, it interacts with the driving systems by the friction coefficients and the ramps of the ground. In turn, the driving system moves the AGV, changing its position coordinates x,y. Finally, the workspace sends IO signals to the control system that may come from other machines [28], AGVs, and human operators, and it also receives commands from the control system.Figure 9
Interaction between the workspace and the AGV subsystems.The workspace can be simulated as a lookup table, where the inputs of the table are the AGV position coordinatesx,y, and the output is a set that provides information about the obstacles, the landmarks and references, the friction coefficients, the ramps, and the IO signals in that spatial location.


## 5. Simulation Results and Discussion

Several simulations have been carried out to validate the analytical modelling approach [29] and analyze the AGV model. The model has been implemented with Matlab/Simulink software package. In order to reduce the discretization error, a variable simulation step size has been used, with maximum step size set to 25 ms. The control sample time Tc has been also fixed to 25 ms. The AGV parameters used in the simulations are listed in Table 1. The load mass mL is set to 500 kg.Table 1
Parameters of the wind turbine model.
ParameterDescriptionValue/unitsLhDistance between wheels of the AGV30 cmLbDistance between rear wheels and traction unit100 cmRhRadius of front wheels6 cmRbRadius of rear wheels9 cmmAGVMass of the AGV100 kgIhInertia of traction unit0,11 kg m2CrollRolling coefficient0.01CaeroAerodynamic coefficient0.35FshStatic friction coefficient of traction unit0.1 NFvhViscous friction coefficient of traction unit0.01 Ns/radFswStatic friction coefficient of traction wheels2.94e − 2FvwViscous friction coefficient of traction wheels5e − 4 Ns/radgAcceleration of the gravity9.8 m/s2ηPerformance coefficient of the motor driver0.9IstopCurrent when AGV is stopped1.5 ARCResistance of the charger10 KΩR0, R1, R2Resistances of the electrical model[0.05, 0.1, 0.05] ΩC1Capacitance of the battery1500 FIpParasitic intensity50 mARmResistance of the motor1.2 ohmLmInductance of the motor5.8e − 4HKmElectromotive constant of the motor0.66 kgm2s−2A−1CnCapacity of the battery150 Ah[Kvp,KvI]PID constants for velocity control of wheels[2, 0.1]KΦp,KΦD,KΦI]PID constants for angular velocity control of the traction unit[9.8, 1, 0.1]The simulation scenario is represented in Figure10. It is a magnetic tape loop (green line) with a charging station and a traffic light. The charging station supplies the energy to the vehicle, so the AGV does not need to leave the circuit to reload. This component, part of the workspace, has been included in the electrical equations of Section 4.5 due to its electrical nature.Figure 10
Simulation scenario.A typical element that interacts with the AGV through the IO System is a traffic controller (shown in Figure10 as a traffic light). When the AGV arrives at an intersection, it stops; then, it requests crossing priority to the traffic controller, and when the intersection is free, the traffic controller informs the AGV and the vehicle continues moving.The trajectory proposed in Figure10 is Bernoulli’s lemniscate. This trajectory is interesting because the curvature radius is variable and even more, it has an intersection point as it happens in many real layouts. It can be described as the set of P points where the product of the distance to two focus, F1 and F2, located at a distance 2a between them, is a2.(32)x2+y22−2a2x2−y2=0.The intersection between the straight line projected by the guiding sensor and the lemniscate is used to calculate the guiding error. To calculate the crossing points, we substitute the well-known straight-line equationy=mx+b in (32) and obtain a fourth-degree polynomial (33), with the constants k0 to k4 defined in the following:(33)k4x4+k3x4+k2x4+k1x+k0=0,(34)k4=m4+2m2+1,(35)k3=4m3b+4mb,(36)k2=b22+6m2−2a21+m2,(37)k1=4mb3+a2b,(38)k0=b4+2a2b2.The solution of this polynomial gives thex coordinate of the intersection points. As it is fourth-degree polynomial, the analytical solution is not evident so it is solved by numerical methods.During the simulation, it has been supposed that there are not ramps in the environment, all the localizations have the same friction coefficient, and friction coefficients are considered constant due to the large system time constants.For the sake of clarity, the inputs and outputs of the simulation blocks used during the experiments are shown in Table2.Table 2
Inputs and outputs of the simulation blocks.
SubsystemInputsOutputsControl systemvsafe, errgui, stop, localizationul,ur, typezoneSafe systemtypezone, xb,yb, Φb, obstaclesvsafe,stopElectrical systemul,urMl,MrDriving systemMl,Mrxb,yb, Φb, xh,yh, Φh, θ˙l,θ˙rGuiding and localization systemxh,yh, Φh, layouterrgui, localizationWorkspacexb,ybLayout, obstacles


### 5.1. Kinematic Behaviour Simulation

Figure11 shows the trajectory followed by the traction unit (Figure 11(a)) and the body of the AGV (Figure 11(b)) when reference is a lemniscate curve with a sinusoidal velocity profile, with vref = 0.4 m/s of amplitude and 0.4 m/s of mean value. In this experiment, the a parameter of the lemniscate is set to 5, and the initial position of the AGV is (3.144, 2.5) with an angle of 0° in the traction unit and the body.Figure 11
Movement of the traction unit (a) and movement of the body of the AGV (b).
(a)(b)This figure represents 200 steps of the AGV motion on the XY plane, between the initial and the final position. It is possible to observe how the positions described by the traction unit follow a lemniscate-shaped trajectory. This type of representation is very useful to design the layout where the AGV is going to travel in a factory or workhouse. It allows to foresee, among other cases, whether the AGV will be blocked by an obstacle, get stuck in a narrow corridor, or if it will reach correctly a station.The trajectories followed by the traction unit (red line) and the body (orange line) of the AGV are represented in Figure12, with the reference (blue line). The trajectory on the plane is shown on the left, and the evolution of each coordinate is represented on the right. The coordinates (xH,yH) represent the center of the traction unit, and (xB,yB) are the coordinates of the middle of the rear axle.Figure 12
Trajectory of the AGV (a) andx-y coordinates of the traction unit and the body (b)
(a)(b)The traction unit follows reasonably well the lemniscate-shaped magnetic tape; thus, the reference and the traction unit lines are overlapped in Figure12(a). Nevertheless, the body of the AGV follows a lemniscate curve closer than the reference. This difference decreases with the width of the lemniscate, parameter a in (30). This effect is more visible in the edges of the lemniscate, and it is not shown at the intersection.Looking closely at Figure12(b), local maximums and minimums appear at x≈7 m, x≈−7 m, y≈2.5 m, and y≈−2.5 m, the extremes of the lemniscate, as expected. It is also interesting to note how when the AGV is in the first and third quadrant, from t = 0 to t ≈ 10 s and from t around 60 s to 100 s, xH seems to be delayed respect to xB. However, when it is in the second and fourth quadrants, the opposite happens.Figure13(a) represents the same trajectory as in Figure 12 in order to help to understand the angles shown in Figure 13(b). On the right side of this Figure 13, the angle of the traction unit (blue line) and of the body (red line) of the AGV is shown.Figure 13
Trajectory of the AGV (a) and angle of the AGV (b).
(a)(b)The angle of the body of the AGV decreases up to 225° aroundt = 28 s when the straight part of the lemniscate starts, and it keeps constant until that straight part of the lemniscate end about to t = 40 s. After this point, the AGV turns counterclockwise, which increases the angle up to approximately t = 70 s when the straight part of the lemniscate starts again. On the other hand, the angle of the traction unit is related to the radius of curvature. At the top and bottom edges of the lemniscate, this radius slightly varies and the angle of the traction unit keeps practically constant at −25° from t = 10 s up to t = 25 s and at 25° from t = 50 s up to t = 65 s. This angle is positive when the AGV turns clockwise and negative otherwise. In the straight part of the lemniscate, as expected, the angle of the traction unit is 0°.So, these results validate the model as the AGV moves as expected.


### 5.2. Dynamic Behaviour Simulation

The model of the dynamics of the AGV has been also implemented. Figure14(a) shows the angular velocity of the traction unit (red line) and its reference (blue line). Figure 14(b) represents the reference of vref (blue line) and the longitudinal velocity (red line). When the AGV starts moving, the angular speed reference, that is, generated by the controller, oscillates due to error of the velocity. Once the reference speed is reached, at t = 8 s, the oscillations are much smaller and the mean value is around 0. In any case, the angular velocity reference is well tracked, with a slight oscillation (smaller than 0.5 rad/s). The sinusoidal profile of vfoll (Figure 14(b) is well followed by the controller. The biggest error appears at the beginning of the simulation as the AGV is stopped, and it starts accelerating to reach the reference speed.Figure 14
Angular velocity of the traction unit (a) and longitudinal velocity of wheels (b).
(a)(b)In order to reach these angular and longitudinal velocities, the corresponding wheel speeds are calculated. Figure15(a) shows these references, and Figure 15(b) shows the effective wheel velocities. The blue lines represent the right wheel and the red lines the left one. As it is possible to see, the controller is able to track the wheel speed references. The largest error appears at the beginning of the simulation as it is necessary to overcome system inertia. Once the reference value is achieved, the biggest difference between the velocities of the wheels appears at the inflection points of the angle of the traction unit. This happens approximately at t = 25 s, 45 s, 65 s, and 85 s. At these points, if the angular velocity of the traction unit is positive, the speed of the right wheel is bigger than the left one, and it is smaller in the opposite case.Figure 15
Wheel angular speed references (a) and effective wheel angular velocities (b).
(a)(b)In order to follow the wheel speed references (Figure15(a)), the control has to generate the right power values. Figure 16(a) shows the control signals which are the inputs of the electrical model equation (27); in Figure 16(b), the torque of the wheels is represented. As explained before, this torque is the result of subtracting the friction forces from the torque provided by the motors. The blue lines represent the right wheel and the red lines the left one. The range of the control signals is [−1, 1]. These control signals are inputs in equation (29), and they are dimensionless; they represent the percentage of battery voltage that is applied in the motors.Figure 16
Control signals for each wheel (a) and torque of the wheels (b).
(a)(b)At the beginning of the simulation, both control signals are saturated to 1, as the initial state of the AGV is stopped. These values are maintained until the wheel speed reference is reached; from this point, the control signals show a sinusoidal behaviour similar to the reference but slightly noisier. Negative peaks appear at t≈30 s, 50 s, 70 s, and 90 s. These values match with the peaks of Figure 14(a). They correct the angular velocity of the traction unit to maintain the angle when the AGV gets close to the top and bottom edges of the lemniscate trajectory. Due to this, the curvature radius is practically constant (Figure 13).As expected, the shape of the effective torque in the wheels is similar to the control signals but with different amplitude. At the beginning, when the control signals are saturated to 1, the value of the torque is maximum. Then, the effective torque decreases although the control signals are constant due to the effect of the viscous friction forces which increase with the velocity.


### 5.3. Electrical Behaviour Simulation

In this section, the same experiment is carried out but the analysis is focused on the electrical model. At the initial state, the voltage in the capacitor isVc = −4V, and Embat is set to 24 V, that are the common values after the charging. The initial current in the motors is 0 A.Figure17 shows the current in the motors on the left and the effective torque on the right. The blue lines represent the right motor and the red lines the left one. As expected from equation (26), the absolute value of the effective torque is practically proportional to the current. The difference comes from the friction forces. In the simulations, the current of the motor is considered always positive no matter the sign of the control signal. The sign of the torque in each motor is equal to the sign of its control signal.Figure 17
Motor current (a) and effective torque in wheels (b).
(a)(b)In addition to the current of the motors, it is also interesting to study the current and the voltage in the battery terminals. This helps us to scale up the layout and the production cycles, as well as to foresee the battery life. Figure18 shows the current and voltage in the battery terminals (blue and red lines), the voltage in open circuit of the battery (yellow line), and the voltage in the equivalent capacitor (purple line). As expected, the battery current follows a sinusoidal signal. Although sometimes the current in the motors is 0 A, the current in the battery is bigger due to the consumption of the other electronic devices of the AGV. This consumption is considered constant and modelled by Istop. The negative peaks of the torque can be seen in the battery current as positive peaks at the bottom part of the signal.Figure 18
Current and voltage in the battery.The battery voltage measured in terminals varies with the current; when the battery current increases, the voltage decreases due to the effect of the internal resistance, producing an observable sinusoidal curve. When the system is working, the absolute value of the voltage in the capacitor decreases. This also produces a decreasing trend in the battery voltage. On the other hand, theEmbat slightly decreases as well but this is not noticeable due to the high capacity of the battery, i.e., the bigger the capacity, the slower the decreasing trend.Another interesting effect is that when the battery voltage decreases, the voltage applied to the motor for the same control value also decreases. And if the motor voltage decreases, its speed also decreases. This forces to increase the control signal to get the same motor velocity. In turn, the increment of the control makes the consumed current to increase, as it is possible to see in Figure18. This effect is less significant when the capacitor is discharged since the decreasing trend of the battery voltage is much smaller.Figure19 shows the total accumulated current in Ah (Figure 19(a)) and the percentage (%) of the battery (Figure 19(b)). As expected, the sinusoidal current in the battery terminal produces a sinusoidal total current. It is a usual practice to calculate the percentage of the battery using the total consumed current. In this case, the capacity of the battery is 150 Ah; thus, a total current of 0.3 Ah is equivalent to 0.2% battery, as shown in Figure 19(b). This provides an autonomy of approximately 13.8 h. This is an approximation since it has been seen, the battery voltage also affects the current.Figure 19
Total consumed current (a) and percentage of battery (b).
(a)(b)


### 5.4. Influence of the Mass of the Load

The effect of the load on the AGV has also to be analyzed. To do it, different experiments varying the load mass have been carried out with two different speed profiles: a sinusoidal one, as before, and a constant speed of 0.8 m/s. All these experiments are configured as in the previous sections but the mass. In the previous experiments, the load massmL was set to 500 kg.Figure20 represents the variation of the average battery power with the mass (Figure 20(a)) and the variation of the average current (Figure 20(b)). The blue lines represent the values for a sinusoidal speed profile and the red lines for a constant velocity. As expected, the bigger the load mass, the larger the power and current. This effect is more marked when the speed is constant. As the AGV travels more time at a bigger speed, it needs more energy.Figure 20
Variation of the average power (a) and average current (b) with load mass.
(a)(b)Figure21 shows the variation of the MSE guiding error (Figure 21(a)) and the variation of the standard deviation of the total torque in the wheels (Figure 21(b)). The color code is the same as in Figure 20. These indicators have been calculated using the following equations:(39)MSEcm=1001Tsim∑ierrguii2Tsi,(40)Me¯Nm=1Tsim∑iMeLi+MeRiTsi,(41)SDMeNm=1Tsim∑iMeLi+MeRi−Me¯2Tsi,where Tsi is the sampling time at i and Tsim is the total simulation time. This period Tsi is necessary since a variable simulation step has been used. This way the MSE gives the mean squared value of the guiding error in cm. The standard deviation of the total torque can give us an idea of the degradation of the electromechanical pieces, as larger total torque means bigger degradation.Figure 21
Variation of the MSE (a) and the standard deviation of the torque (b) with the load mass.
(a)(b)In Figure21, it is possible to observe how the MSE is not affected by the mass until certain mass threshold is surpassed. This value is around 300 kg for the sinusoidal speed profile and 150 kg for the constant speed. This may be explained as the average velocity with the sinusoidal profile is approximately half than the obtained with the constant speed. However, the effect of the mass on the standard deviation of the torque is worse. The sinusoidal speed profile produces bigger deviations, and moreover, the influence of the mass is bigger.


### 5.5. Influence of the AGV Velocity

Finally, the effect of using two AGV velocity profiles, sinusoidal and constant, is studied. The mean amplitude of the sinusoidal signal is half the value fixed for the constant one. The load mass is 500 kg. The rest of parameters of the experiment have been configured as in previous sections.Figure22 represents the variation of the average battery power with the velocity (Figure 22(a)) and the variation of the average current (Figure 22(b)). The color code is the same as in the previous experiments. Again, as expected, bigger velocity produces larger power and bigger current. However, in this case, the sensitivity, defined as the derivative of the measured variable respect to the parameter that is modified by the sweep, is smaller.Figure 22
Variation of the average power (a) and average current (b) with the cruise velocity.
(a)(b)The sensitivity is denoted byβparvar, where var is the measured variable and par is the parameter that is modified in the experiment. In particular, βmLPow is 0.4 W/kg, βvfollPow is 0.18 W⋅s/cm, βmLIbat is around 0.016 W/kg, and βvfollIbat is 0.007 W⋅s/cm, approximately.Figure23 shows the variation of the MSE (Figure 23(a)) and of the standard deviation of the total torque in the wheels (Figure 23(b)). The color code is the same as in Figure 22. It is remarkable how the error is related to the cruise velocity; lower speeds produce smaller errors. This is so in general, but there exist an inferior limit related to the accuracy of the encoders that measure the velocity. The velocity is also related to the torque, as shown in Figure 23(b), where larger velocities demand bigger effective torque. This is not a general rule since the torque is directly related to the acceleration; in order to increase the acceleration of the AGV, it is necessary to increase the effective torque of the wheels. However, a bigger velocity does not necessarily entail a bigger torque since a higher velocity can be reached with the same acceleration and torque but spending more time. However, in this case, the AGV cannot leave the magnetic circuit; thus, bigger accelerations are necessary to maintain the cruise velocity and that increases the effective torque.Figure 23
Variation of the MSE (a) and the standard deviation of the torque (b) with the cruise velocity.
(a)(b)


## 5.1. Kinematic Behaviour Simulation

Figure11 shows the trajectory followed by the traction unit (Figure 11(a)) and the body of the AGV (Figure 11(b)) when reference is a lemniscate curve with a sinusoidal velocity profile, with vref = 0.4 m/s of amplitude and 0.4 m/s of mean value. In this experiment, the a parameter of the lemniscate is set to 5, and the initial position of the AGV is (3.144, 2.5) with an angle of 0° in the traction unit and the body.Figure 11
Movement of the traction unit (a) and movement of the body of the AGV (b).
(a)(b)This figure represents 200 steps of the AGV motion on the XY plane, between the initial and the final position. It is possible to observe how the positions described by the traction unit follow a lemniscate-shaped trajectory. This type of representation is very useful to design the layout where the AGV is going to travel in a factory or workhouse. It allows to foresee, among other cases, whether the AGV will be blocked by an obstacle, get stuck in a narrow corridor, or if it will reach correctly a station.The trajectories followed by the traction unit (red line) and the body (orange line) of the AGV are represented in Figure12, with the reference (blue line). The trajectory on the plane is shown on the left, and the evolution of each coordinate is represented on the right. The coordinates (xH,yH) represent the center of the traction unit, and (xB,yB) are the coordinates of the middle of the rear axle.Figure 12
Trajectory of the AGV (a) andx-y coordinates of the traction unit and the body (b)
(a)(b)The traction unit follows reasonably well the lemniscate-shaped magnetic tape; thus, the reference and the traction unit lines are overlapped in Figure12(a). Nevertheless, the body of the AGV follows a lemniscate curve closer than the reference. This difference decreases with the width of the lemniscate, parameter a in (30). This effect is more visible in the edges of the lemniscate, and it is not shown at the intersection.Looking closely at Figure12(b), local maximums and minimums appear at x≈7 m, x≈−7 m, y≈2.5 m, and y≈−2.5 m, the extremes of the lemniscate, as expected. It is also interesting to note how when the AGV is in the first and third quadrant, from t = 0 to t ≈ 10 s and from t around 60 s to 100 s, xH seems to be delayed respect to xB. However, when it is in the second and fourth quadrants, the opposite happens.Figure13(a) represents the same trajectory as in Figure 12 in order to help to understand the angles shown in Figure 13(b). On the right side of this Figure 13, the angle of the traction unit (blue line) and of the body (red line) of the AGV is shown.Figure 13
Trajectory of the AGV (a) and angle of the AGV (b).
(a)(b)The angle of the body of the AGV decreases up to 225° aroundt = 28 s when the straight part of the lemniscate starts, and it keeps constant until that straight part of the lemniscate end about to t = 40 s. After this point, the AGV turns counterclockwise, which increases the angle up to approximately t = 70 s when the straight part of the lemniscate starts again. On the other hand, the angle of the traction unit is related to the radius of curvature. At the top and bottom edges of the lemniscate, this radius slightly varies and the angle of the traction unit keeps practically constant at −25° from t = 10 s up to t = 25 s and at 25° from t = 50 s up to t = 65 s. This angle is positive when the AGV turns clockwise and negative otherwise. In the straight part of the lemniscate, as expected, the angle of the traction unit is 0°.So, these results validate the model as the AGV moves as expected.


## 5.2. Dynamic Behaviour Simulation

The model of the dynamics of the AGV has been also implemented. Figure14(a) shows the angular velocity of the traction unit (red line) and its reference (blue line). Figure 14(b) represents the reference of vref (blue line) and the longitudinal velocity (red line). When the AGV starts moving, the angular speed reference, that is, generated by the controller, oscillates due to error of the velocity. Once the reference speed is reached, at t = 8 s, the oscillations are much smaller and the mean value is around 0. In any case, the angular velocity reference is well tracked, with a slight oscillation (smaller than 0.5 rad/s). The sinusoidal profile of vfoll (Figure 14(b) is well followed by the controller. The biggest error appears at the beginning of the simulation as the AGV is stopped, and it starts accelerating to reach the reference speed.Figure 14
Angular velocity of the traction unit (a) and longitudinal velocity of wheels (b).
(a)(b)In order to reach these angular and longitudinal velocities, the corresponding wheel speeds are calculated. Figure15(a) shows these references, and Figure 15(b) shows the effective wheel velocities. The blue lines represent the right wheel and the red lines the left one. As it is possible to see, the controller is able to track the wheel speed references. The largest error appears at the beginning of the simulation as it is necessary to overcome system inertia. Once the reference value is achieved, the biggest difference between the velocities of the wheels appears at the inflection points of the angle of the traction unit. This happens approximately at t = 25 s, 45 s, 65 s, and 85 s. At these points, if the angular velocity of the traction unit is positive, the speed of the right wheel is bigger than the left one, and it is smaller in the opposite case.Figure 15
Wheel angular speed references (a) and effective wheel angular velocities (b).
(a)(b)In order to follow the wheel speed references (Figure15(a)), the control has to generate the right power values. Figure 16(a) shows the control signals which are the inputs of the electrical model equation (27); in Figure 16(b), the torque of the wheels is represented. As explained before, this torque is the result of subtracting the friction forces from the torque provided by the motors. The blue lines represent the right wheel and the red lines the left one. The range of the control signals is [−1, 1]. These control signals are inputs in equation (29), and they are dimensionless; they represent the percentage of battery voltage that is applied in the motors.Figure 16
Control signals for each wheel (a) and torque of the wheels (b).
(a)(b)At the beginning of the simulation, both control signals are saturated to 1, as the initial state of the AGV is stopped. These values are maintained until the wheel speed reference is reached; from this point, the control signals show a sinusoidal behaviour similar to the reference but slightly noisier. Negative peaks appear at t≈30 s, 50 s, 70 s, and 90 s. These values match with the peaks of Figure 14(a). They correct the angular velocity of the traction unit to maintain the angle when the AGV gets close to the top and bottom edges of the lemniscate trajectory. Due to this, the curvature radius is practically constant (Figure 13).As expected, the shape of the effective torque in the wheels is similar to the control signals but with different amplitude. At the beginning, when the control signals are saturated to 1, the value of the torque is maximum. Then, the effective torque decreases although the control signals are constant due to the effect of the viscous friction forces which increase with the velocity.


## 5.3. Electrical Behaviour Simulation

In this section, the same experiment is carried out but the analysis is focused on the electrical model. At the initial state, the voltage in the capacitor isVc = −4V, and Embat is set to 24 V, that are the common values after the charging. The initial current in the motors is 0 A.Figure17 shows the current in the motors on the left and the effective torque on the right. The blue lines represent the right motor and the red lines the left one. As expected from equation (26), the absolute value of the effective torque is practically proportional to the current. The difference comes from the friction forces. In the simulations, the current of the motor is considered always positive no matter the sign of the control signal. The sign of the torque in each motor is equal to the sign of its control signal.Figure 17
Motor current (a) and effective torque in wheels (b).
(a)(b)In addition to the current of the motors, it is also interesting to study the current and the voltage in the battery terminals. This helps us to scale up the layout and the production cycles, as well as to foresee the battery life. Figure18 shows the current and voltage in the battery terminals (blue and red lines), the voltage in open circuit of the battery (yellow line), and the voltage in the equivalent capacitor (purple line). As expected, the battery current follows a sinusoidal signal. Although sometimes the current in the motors is 0 A, the current in the battery is bigger due to the consumption of the other electronic devices of the AGV. This consumption is considered constant and modelled by Istop. The negative peaks of the torque can be seen in the battery current as positive peaks at the bottom part of the signal.Figure 18
Current and voltage in the battery.The battery voltage measured in terminals varies with the current; when the battery current increases, the voltage decreases due to the effect of the internal resistance, producing an observable sinusoidal curve. When the system is working, the absolute value of the voltage in the capacitor decreases. This also produces a decreasing trend in the battery voltage. On the other hand, theEmbat slightly decreases as well but this is not noticeable due to the high capacity of the battery, i.e., the bigger the capacity, the slower the decreasing trend.Another interesting effect is that when the battery voltage decreases, the voltage applied to the motor for the same control value also decreases. And if the motor voltage decreases, its speed also decreases. This forces to increase the control signal to get the same motor velocity. In turn, the increment of the control makes the consumed current to increase, as it is possible to see in Figure18. This effect is less significant when the capacitor is discharged since the decreasing trend of the battery voltage is much smaller.Figure19 shows the total accumulated current in Ah (Figure 19(a)) and the percentage (%) of the battery (Figure 19(b)). As expected, the sinusoidal current in the battery terminal produces a sinusoidal total current. It is a usual practice to calculate the percentage of the battery using the total consumed current. In this case, the capacity of the battery is 150 Ah; thus, a total current of 0.3 Ah is equivalent to 0.2% battery, as shown in Figure 19(b). This provides an autonomy of approximately 13.8 h. This is an approximation since it has been seen, the battery voltage also affects the current.Figure 19
Total consumed current (a) and percentage of battery (b).
(a)(b)


## 5.4. Influence of the Mass of the Load

The effect of the load on the AGV has also to be analyzed. To do it, different experiments varying the load mass have been carried out with two different speed profiles: a sinusoidal one, as before, and a constant speed of 0.8 m/s. All these experiments are configured as in the previous sections but the mass. In the previous experiments, the load massmL was set to 500 kg.Figure20 represents the variation of the average battery power with the mass (Figure 20(a)) and the variation of the average current (Figure 20(b)). The blue lines represent the values for a sinusoidal speed profile and the red lines for a constant velocity. As expected, the bigger the load mass, the larger the power and current. This effect is more marked when the speed is constant. As the AGV travels more time at a bigger speed, it needs more energy.Figure 20
Variation of the average power (a) and average current (b) with load mass.
(a)(b)Figure21 shows the variation of the MSE guiding error (Figure 21(a)) and the variation of the standard deviation of the total torque in the wheels (Figure 21(b)). The color code is the same as in Figure 20. These indicators have been calculated using the following equations:(39)MSEcm=1001Tsim∑ierrguii2Tsi,(40)Me¯Nm=1Tsim∑iMeLi+MeRiTsi,(41)SDMeNm=1Tsim∑iMeLi+MeRi−Me¯2Tsi,where Tsi is the sampling time at i and Tsim is the total simulation time. This period Tsi is necessary since a variable simulation step has been used. This way the MSE gives the mean squared value of the guiding error in cm. The standard deviation of the total torque can give us an idea of the degradation of the electromechanical pieces, as larger total torque means bigger degradation.Figure 21
Variation of the MSE (a) and the standard deviation of the torque (b) with the load mass.
(a)(b)In Figure21, it is possible to observe how the MSE is not affected by the mass until certain mass threshold is surpassed. This value is around 300 kg for the sinusoidal speed profile and 150 kg for the constant speed. This may be explained as the average velocity with the sinusoidal profile is approximately half than the obtained with the constant speed. However, the effect of the mass on the standard deviation of the torque is worse. The sinusoidal speed profile produces bigger deviations, and moreover, the influence of the mass is bigger.


## 5.5. Influence of the AGV Velocity

Finally, the effect of using two AGV velocity profiles, sinusoidal and constant, is studied. The mean amplitude of the sinusoidal signal is half the value fixed for the constant one. The load mass is 500 kg. The rest of parameters of the experiment have been configured as in previous sections.Figure22 represents the variation of the average battery power with the velocity (Figure 22(a)) and the variation of the average current (Figure 22(b)). The color code is the same as in the previous experiments. Again, as expected, bigger velocity produces larger power and bigger current. However, in this case, the sensitivity, defined as the derivative of the measured variable respect to the parameter that is modified by the sweep, is smaller.Figure 22
Variation of the average power (a) and average current (b) with the cruise velocity.
(a)(b)The sensitivity is denoted byβparvar, where var is the measured variable and par is the parameter that is modified in the experiment. In particular, βmLPow is 0.4 W/kg, βvfollPow is 0.18 W⋅s/cm, βmLIbat is around 0.016 W/kg, and βvfollIbat is 0.007 W⋅s/cm, approximately.Figure23 shows the variation of the MSE (Figure 23(a)) and of the standard deviation of the total torque in the wheels (Figure 23(b)). The color code is the same as in Figure 22. It is remarkable how the error is related to the cruise velocity; lower speeds produce smaller errors. This is so in general, but there exist an inferior limit related to the accuracy of the encoders that measure the velocity. The velocity is also related to the torque, as shown in Figure 23(b), where larger velocities demand bigger effective torque. This is not a general rule since the torque is directly related to the acceleration; in order to increase the acceleration of the AGV, it is necessary to increase the effective torque of the wheels. However, a bigger velocity does not necessarily entail a bigger torque since a higher velocity can be reached with the same acceleration and torque but spending more time. However, in this case, the AGV cannot leave the magnetic circuit; thus, bigger accelerations are necessary to maintain the cruise velocity and that increases the effective torque.Figure 23
Variation of the MSE (a) and the standard deviation of the torque (b) with the cruise velocity.
(a)(b)


## 6. Conclusions and Future Works

Automatic guided vehicles are complex systems with highly coupled internal variables. Their use has lately grown exponentially due to the Industry 4.0 paradigm, as these are industrial devices and play a key role in process flow and in the logistic sector. However, some of their safety requirements depend on the dynamics and control of these vehicles. Therefore, a holistic modelling approach of the AGV is necessary in order to better understand its performance and to design efficient controllers.In this paper, a complete model of a hybrid AGV has been developed. The vehicle is a general one, widely used, that is a mixture of tricycle and differential robots. The different subsystems of the AGV have been described and mathematically modelled, particularly, the control system, the safety system, the driving system, the guiding and location system, the charging, the power storage, and the motors. Even more, the interactions among them have been identified and represented in the proposed architecture of the AGV.Simulations results, varying some of the vehicle parameters, have allowed it to validate the models as the global performance of the AGV is as expected.Among other possible future works, we may highlight the study of the influence of the deformation of the wheels and the design of neural-controllers to improve the performance provided by the current PIDs. Besides, rollover conditions depending on the load could be estimated to ensure the safety of these systems.



---

*Source: 6687816-2020-12-30.xml*