Full text
Alberto José Cibrão Monteiro Modeling and Simulation of a Pick&Place System with OpenModelica Junho de 2023 Modeling and Simulation of a Pick&Place System with OpenModelica Alberto Monteiro UMINHO I 2023
Alberto José Cibrão Monteiro Modeling and Simulation of a Pick&Place System with OpenModelica Master's Dissertation Integrated Master in Mechanical Engineering Project developed under the orientation of Professor PhD José Mendes Machado Coorientation of Professor MSc Filipe Alexandre de Sousa Pereira June 2023
ii COPYRIGHT AND USE CONDITIONS OF THE WORK BY THIRD PARTIES This is an academic work that can be used by third parties as long as the internationally accepted rules and good practices regarding copyright and related rights are respected. Thus, this work may be used under the terms provided in the license below. If the user needs permission to use the work under conditions not foreseen in the license indicated, he should contact the author, through RepositóriUM of University of Minho. License granted to users of this work NOTE: The license can be different! See dispatch! Attribution CC BY https://creativecommons.org/licenses/by/4.0/
iii ACKNOWLEDGMENTS A deep sense of gratitude to my family, for the solid support in the different areas that the academic path implies and that culminated in this project, for all the effort and unconditional support they provided throughout my journey. A deep thank you to my parents and my sister, for whom none of this was possible, through the opportunities they provided me, the values they transmitted to me, and the sacrifices they made so that I could reach my goals. A word of thanks to my friends and colleagues who have been part of this journey, for their patience, mutual help, and personal development, which proved to be indispensable in the resilience needed to conclude this project. Special thanks to Professor José Machado and Professor Filipe Pereira for their guidance, with all the dedication, patience, effort, advice, and knowledge they gave me. I will be eternally grateful for the understanding and motivation that was transmitted to me.
iv Integrity Declaration I declare that I have acted with integrity in the preparation of this academic work and confirm that I have not resorted to the practice of plagiarism or any form of misuse or falsification of information or results in any of the steps leading to its preparation. I further declare that I am aware of and have respected the Code of Ethical Conduct of the University of Minho.
v ABSTRACT Modeling of multi-physical systems is a task that may be particularly complex, especially when the systems under analysis present several technologies such as pneumatics, hydraulics, mechanical systems, electrical systems, among others. This MSc dissertation intends to present an approach for modelling a multi-physics system, using Modelica modeling language, focusing the connection of models, by using programming logic as ever as needed, as well as the obtaining of some guidelines for modelling multiphysical systems in a systematic way. For the mentioned purpose, it is chosen, as basis for starting studies, a Pick&Place system using the modeling language Modelica and the simulation software OpenModelica whose conception was based on a manipulator’s model existing in the main library of OpenModelica software. Based in the initial case study, some approaches are presented for illustration about how to achieve the above-mentioned purpose, by changing and adding information, from initial considered models, to the considered final ones using simulation techniques and interpreting respective obtained results. Throughout this work, the potentialities presented by the language are explored, bringing together the concept of a robotic manipulator inserted in Modelica's main library with the outline of a detailed control, in which the concepts of inverse kinematics and pick&place are inserted. The incorporation with a global system is also scrutinized, in which the manipulator model is associated with a gripper and conveyor belts, designed in a system with logical sequencing. KEYWORDS Inverse Kinematics, Modelica, Modeling Multi-physics Systems, OpenModelica, Pick&Place
vi RESUMO A modelação de sistemas multi-físicos é uma tarefa que pode ser particularmente complexa, especialmente quando os sistemas em análise apresentam diversas tecnologias, tais como pneumática, hidráulica, sistemas mecânicos, sistemas elétricos, entre outros. Esta dissertação de mestrado pretende apresentar uma abordagem para a modelação de um sistema multi-físico, utilizando a linguagem de modelação Modelica, focando na ligação de modelos e recorrendo à lógica de programação sempre que necessário, bem como a obtenção de algumas orientações para a modelação de sistemas multi-físicos de uma forma sistemática. Para o efeito, é escolhido, como base de estudo inicial, um sistema Pick&Place utilizando a linguagem de modelação Modelica e o software de simulação OpenModelica, cuja conceção foi baseada num modelo de manipulador existente na biblioteca principal do software OpenModelica. Com base no caso de estudo inicial, são apresentadas algumas abordagens para ilustrar a forma de atingir o objetivo acima referido, com alteração e adição de informação, desde os modelos iniciais considerados, até aos modelos finais desenvolvidos, utilizando técnicas de simulação e interpretando os respetivos resultados obtidos. Ao longo deste trabalho, as potencialidades apresentadas pela linguagem são exploradas, reunindo o conceito de um manipulador robótico inserido na biblioteca principal de Modelica com o delineamento de um controlo detalhado, em que os conceitos de cinemática inversa e pick&place se inserem. A incorporação com um sistema global também é escrutinada, no qual o modelo do manipulador se encontra associado com um gripper e tapetes transportadores, projetados num sistema com sequenciamento lógico. PALAVRAS-CHAVE Cinemática Inversa, Modelica, Modelação de Sistemas Multifísicos, OpenModelica, Pick&Place
vii CONTENTS Acknowledgments ..................................................................................................................... iii Abstract ...................................................................................................................................... v Resumo ...................................................................................................................................... vi Contents ....................................................................................................................................vii List of Figures ..............................................................................................................................ix List of Tables ............................................................................................................................. xvi 1. Introduction ........................................................................................................................ 1 1.1. Simulation in Industry ................................................................................................ 1 1.2. Modelica modeling language and OpenModelica software ...................................... 3 1.3. Background and Motivation ....................................................................................... 4 1.4. Objectives ................................................................................................................... 5 1.5. Dissertation Structure ................................................................................................ 7 2. System Development in OpenModelica ............................................................................. 8 2.1. Robot .......................................................................................................................... 9 2.1.1. Inverse Kinematics ............................................................................................. 10 2.1.2. Trajectory Definition .......................................................................................... 24 2.1.3. Mechanical Structure ......................................................................................... 47 2.1.4. Thermal Flow – Motor Shafts ............................................................................. 51 2.1.5. Continuation of the Simulations Study – Robot ................................................. 56 2.2. Conveyor Belts.......................................................................................................... 59 2.2.1. Trajectory Definition .......................................................................................... 59 2.2.2. Control and Motor ............................................................................................. 63 2.2.3. Conveyor Belt Structure ..................................................................................... 65 2.2.4. Timing ................................................................................................................. 74 2.2.5. Comparison – Conveyor Belt Modeling ............................................................. 75 2.2.6. Cooling System ................................................................................................... 76 2.2.7. Continuation of the Simulations Study – Conveyor Belts .................................. 85 2.3. Gripper ..................................................................................................................... 93
viii 2.3.1. Gripper Design .................................................................................................... 93 2.3.2. Modeling ............................................................................................................ 96 2.3.3. Gripper – Control .............................................................................................. 102 2.3.4. Simulations Study – Gripper ............................................................................. 106 3. Simulation of the Physical Environment ........................................................................ 110 3.1. Box Transportation - Entry Conveyor Belt ............................................................. 110 3.2. Movement of the Manipulator – Pick .................................................................... 111 3.3. Gripper Movement – Closing ................................................................................. 112 3.4. Movement of the Manipulador - Place .................................................................. 114 3.5. Gripper Movement – Opening ............................................................................... 114 3.6. Box Transportation – Exit Conveyor Belt ............................................................... 115 4. Conclusions and Future Work ........................................................................................ 122 4.1. Conclusions ............................................................................................................. 122 4.2. Future Works .......................................................................................................... 124 5. Bibliographyc References ............................................................................................... 126 Appendix 1 – Trapezoidal Profile Implementation ................................................................ 128 Appendix 2 – Modeling of Robot Control (Structure) ............................................................ 135 Appendix 3 – Axial Control and actuator ............................................................................... 136 Appendix 4 – User’s Manual .................................................................................................. 151
xv Figure 144 - Implemented integrator amplifier and associated nomenclature .................... 143 Figure 145 - Implemented summing amplifier and associated nomenclature ...................... 144 Figure 146 - Inverter amplifier implemented at the end of the circuit ................................. 144 Figure 147 – Servomotor Model ............................................................................................ 145 Figure 148 - Electrical circuitry incorporated in the servomotor ........................................... 146 Figure 149 - Transmission components used ......................................................................... 148 Figure 150 - Adjustment in the transmission rate, providing a correct functioning of the control ................................................................................................................................................ 149 Figure 151 - InitializeFlange component responsible for assigning position, velocity and acceleration values to the output axis flange ........................................................................ 149 Figure 152 - Model that replicates a motion signal lamp on the shaft .................................. 150
xvi LIST OF TABLES Table 1 - Dimensions involved between the different frames of reference ............................ 12 Table 2 - Denavit-Hartenberg parameters relating to the schematization of the distributed coordinate axes in the IRB 140 structure ................................................................................. 13 Table 3 - Calculating the positions along the trapezoidal velocity profile ............................... 30 Table 4 - Calculating the positions along the triangular velocity profile ................................. 33 Table 5 - Components used for the design of the mechanical structure ................................ 48 Table 6 - Components present in the heat flow model ........................................................... 53 Table 7 - Velocity profiles on the different conveyor belts...................................................... 61 Table 8 - Calculation of the different constituent inertias in the inertia of the overall system .................................................................................................................................................. 68 Table 9 - Transmission and inertia component used in the modeling..................................... 69 Table 10 - Description of the components associated with energy losses in the conveyor system ...................................................................................................................................... 72 Table 11 - Modeling Components used in the heat flow to the outside on the conveyor ...... 77 Table 12 - Description of the components present in the cooling system .............................. 82 Table 13 - Trajectory times for the different boxes ................................................................. 93 Table 14 - Pulleys belonging to each of the fingers and their angular variation ..................... 95 Table 15 - Pulleys belonging to each of the fingers and their dimensional proportion .......... 96 Table 16 - Components used in modeling the final gripper structure ..................................... 99 Table 17 - Logical states associated with the modeling of the closing movement logic block ................................................................................................................................................ 105 Table 18 - Logical states associated with the modeling of the force movement logic block 106 Table 19 - Logical states associated with the modeling of the opening movement logic block ................................................................................................................................................ 106 Table 20 - Prints illustrating the routes involved in other options provided ......................... 117 Table 21 - Description of the parameters present in the model excerpt .............................. 129 Table 22 - Calculation of the parameters present in the model excerpt ............................... 130 Table 23 - Equations involved in the different servomotor domains .................................... 146
1 1. INTRODUCTION In this chapter, it is intended to present the area of interest that drove the development of the present work: the simulation of industrial processes using object-oriented modeling. In this sense, a small introduction, with the exposition of fundamental concepts, will be carried out, followed by the presentation and framework of the developed system. 1.1. Simulation in Industry The importance of simulation in an industrial environment, which came later to gain relevance in cyber-physical engineering systems, was already highlighted by the first pioneers in simulation research studies since the 1980s as a top methodology. To calculate the amount of work done, some figures are provided in [1]: from 2002 to 2013, the search process with the keywords "simulation" plus "manufacturing" shows about 3000 published articles. These results are expressive and are confirmed by another survey conducted in the same year in 2014 [1]. The success of simulation is strictly related to the advent of computers [2], but the concept of simulation exists independently. A simple but meaningful definition is provided by [3]: "Simulation is a way to evaluate a proposed system for various parameters within a specific time period." Another full definition, and perhaps the most notable, is: "Simulation is the imitation of the operation of a real-world process or system over time" [4]. With particular focus on object-oriented modeling in the application of simulation in industry, this occurs at the beginning of the Software Development Life Cycle [5], allowing an improvement of the design phase of a system when an object-oriented approach is taken in software development. Simulation applications in industry such as designing a facility or designing a material handling system [1], can be developed using object-oriented modeling. A model can be defined as follows [6]: "A model of a system is anything to which an experiment can be applied in order to give answers to questions about that same system." This definition implies that a model is able to give answers to questions without requiring experiments with the actual, real system itself. In this way, experiments conducted on the model, which turns out to be a simplified version of the real system, are able to reflect properties that may be useful and decisive for a distinct understanding of that same system. The type of models that are used in the OpenModelica software are of the mathematical type.
2 Mathematical models built on a computer are often called virtual models or virtual prototypes. For the construction of the models, the use of the Modelica language allows the simplification of their construction, as well as the reuse of pre-existing models. Its application implies the following attributes by the user. Figure 1 - Usage requirements for virtual modeling and simulation [6] • General Experience - collected knowledge in the science and technology domains found in the literature and made available by different experts in the associated fields. • System Knowledge - observations and familiarity with experiments already conducted on the system. • Application Mastery - mastery of the application area and techniques, enabling one to best exercise the capabilities provided by the application in system modeling. • Software and Engineering Knowledge - generic knowledge about the definition, treatment and representation of models and software. Thus, the appropriate design to be taken into consideration when establishing the model building process, in order to meet the channeling and synthesizing of the information acquired, in the different forms mentioned above, is represented in the following schematization: Mathematical Model - Virtual System Knowledge Application Mastery Software and Engineering Knowledge General Experience
3 Figure 2 - Schematic of the model building process 1.2. Modelica modeling language and OpenModelica software The use of the open-source tool OpenModelica using the Modelica language offers an excellent solution for the simulation and optimization of complex engineering systems. OpenModelica is a modeling tool. With this computational tool its users can create individual components or subsystem models. These models can then be used to predict the behavior of the associated physical system. In addition to being a tool that enables system modeling, it is also a platform capable of performing simulations. Included in the OpenModelica simulation platform, the program features, after processing the different models, the ability to plot, analyze and "animate" the physical process adjacent to the model. This modeling and simulation capability allows users of the computational tool to explore the design environment and confirm its expected performance without the need to build expensive physical prototypes. OpenModelica also supports collaboration with other tools through interoperability adjacent to a set of standards [7]. The language that serves as a reference for any type of work to be developed with OpenModelica, is the Modelica modeling language. Modelica is a high-level declarative language that allows to describe mathematical behaviors [8]. It is usually applied in engineering systems and can be used to easily describe the behavior of different types of components in specific areas. These components in turn can be combined into systems, Subcomponents Components System Existing Libraries Description of the subcomponent elaborated according to natural laws or Mathematical formulations of interaction
4 subsystems and different architectures that can result. Regarding the aspects that set this language apart from others, the ability to describe, in a joint manner, continuous and discrete behaviors in a system, the fact that it supports casual and accidental approximations within the same model, and finally the fact that it is an "open" language whose specification is easily acquired, are highlighted. 1.3. Background and Motivation Pick&Place systems are widely used in industrial manufacturing environments [9]. In fact, such systems are connected with other systems, are based on different technologies and serve as very important sub-systems in common production lines. In the present context of digitalization of equipment, processes and factories, it is important to find approaches and tools for the correct modeling, data collecting and processes’ performance improvement by using, for instance, digital twins [10] and/or integration of cyber-physical systems [11] in a digital simulation environment. One of the approaches that can be used for this purpose is, definitively, Modelica [12] language well adapted for modeling multy-physics systems and processes. Modelica modeling language can be used in different contexts and can be implemented in several softwares specially developed for implementing it. For instance, as professional approach, DYMOLA [13]; or, as free source approach, OpenModelica [14]. For the above-mentioned context, this work is focused in the study of a Pick&Place operating system, based on a detailed study of an already existing model in the Modelica Standard Library, using OpenModelica software. This model [15] is the starting point of the project, since part of its structure serves as a basis for the elaboration of the manipulator model and from which a restructuring and integration with a global system is carried out. In Figure 3 it is possible to see the underlying idea, in which can be observed a remodeling of the system for the robot/manipulator (diagram 2 in Figure 3), with the introduction of new principles in the control domain as well as in the modeling of the physical process of the manipulator itself. A model of the manipulator is thus prepared from scratch, with the purpose of not only integrating some pre-developed modeling principles but also articulating them with new models through programmed logic, and thus creating a more dynamic and intuitive system, with obtaining of greater simplicity in interaction with the user, and still serving the complex
5 purpose of studying a Pick&Place process, which finds its common applicability in industrial processes. Figure 3 - Reference model of the manipulator on the left. Elaborated model of the manipulator on the right, embedded in a global Pick&Place system 1.4. Objectives The main and global objective of this work is to provide a simple approach for modelling a multi-physics system, using Modelica modeling language, focusing the connection of models by using programming logic as ever as needed. For this purpose, the basis for this study starts with studying a simple manipulator model (robotic application) and, step by step, this model is enlarged and being more complex, integrating other simple models and connecting itself with other models’ too. As specific goals, the study and model development of the industrial manipulator, besides a detailed study involved in the reference model already developed in Modelica Standard Library, allows: ➢ Introduction of the concept of Inverse Kinematics, improving the logistics of operation and simulation of the manipulator, for specific tasks (among which, that of Pick&Place). Industrial Manipulator Reference Model Industrial Manipulator Elaborated Model ❶ ❷
6 ➢ Studying and understanding of complementarity presented in the study of the motion profile, designing not only a trapezoidal velocity profile, but also a polynomial (3rd and 5th order) velocity profile. ➢ Designing a fully designed Path Planning for a Pick&Place task, with all the restructurings and improvements that it implies. ➢ Developing a mode with Via Points, trying to portray as much as possible a pick-up and delivery system observed in the industrial world. ➢ Studying of the thermal losses in the axes verified along the manipulator's operation. ➢ Hierarchical restructuring of the controller, making the cascade control system more perceptible and thus facilitating possible improvements. On the other hand, the development of a Global System in which the robot model is inserted, allows: ➢ Conceptualization and development of a Gripper to be coupled to the manipulator, allowing a more realistic projection of the operation of an industrial robot. ➢ Conceptualization and development of conveyor belts, with an integrated cooling system. ➢ Modeling with sequence of operation Conveyor (input) → Robot/Gripper → Conveyor (output) using programmed logic. Operation modes are further developed with distinct definition of functional parameters. Figure 4 - Operating sequence established through the exchange of information between the models of the conveyor belts, the manipulator, and also the gripper
7 1.5. Dissertation Structure With a brief state of the art elaboration, in which a short presentation of the most generic concepts was presented, chapter 2 will discuss the modeling development for each one of the subsystems of the global system. The sub-chapters for each subsystem admit a theoretical component, an implementation component in object-oriented modeling, and finally a graphic study of the simulations is conducted. The first subchapter is dedicated to the industrial manipulator, focusing initially on the control command models, followed by the mechanical structure. In a second subchapter, we have the analysis of the development of each of the sub-models present in the different conveyor belts attached to the system, in which besides the structural and control aspects, the main differences in the elaboration of each of the sub-models are distinguished. Finally, in the last subchapter, the model of the gripper to be coupled to the manipulator is presented, showing not only the mechanical structure of the process, but also its own control circuit. Chapter 3 concerning the visual results of the simulation is written, where the interaction between the different subsystems is observable, succeeded by a final chapter where conclusions and possible improvements to be implemented are drawn.
8 2. SYSTEM DEVELOPMENT IN OPENMODELICA After simulating the physical environment of the system in CoppeliaSim (described, in detail, in a separate user’s manual – appendix 4), allowing for a greater assimilation of the general concepts, inherent to the system from which it’s highlighted an appropriate understanding of the kinematics involved in the movement of the arm as well as studying a simple way to control the arm that can be implemented (appendix 2), the object-oriented modeling of the overall system is then performed, and in this, certain functions are explored more clearly, of which it’s highlighted: - The modeling of the robotic arm, with a built-in inverse kinematics model, thus allowing the movement of the arm along the Pick and Place task, through the cartesian coordinates inserted at the end of the arm. - The modeling of conveyors, responsible for transporting the package along the system. The system is composed of an input conveyor and an output conveyor, and the respective input conveyor has a modeling established according to the user's options. For the input conveyor, there are two possible conveyors with different modeling. One presents a more simplified modeling profile, in contrast to the adjacent conveyor belt, whose modeling of the physical system is slightly more complex, involving a larger number of variables under study. This distinction makes it possible to compare and evaluate different performances for different modeling of the same subsystem.
15 Φ=𝑎𝑡𝑎𝑛2(𝑟21,𝑟11) (3) Ψ= 𝑎𝑡𝑎𝑛2(−𝑟31,√𝑟322+ 𝑟332) (4) 𝜃= 𝑎𝑡𝑎𝑛2(𝑟32,𝑟33) (5) 2.1.1.2. Angular Determination and Implementation in the Model The calculation of each of the angles will now be analyzed from a theoretical point of view with its practical implementation using Modelica, specifically the "Text View" section for model development. Before focusing in detail on each of the angles, the matrices present in (1) and Figure 11 described in the previous section will be implemented. The set of steps performed throughout the implementation will be duly described. ➢ Definition of the length of the links, based on the vector 𝐿 and where the values of the dimensions 𝑑1,𝑎1,𝑎2,𝑑4 and 𝑑6 implied by the Denavit - Hartenberg parameters are included. ➢ Definition of the Pose_tip vector, where the coordinates of the final position of the end-effector (𝑃06) are incorporated in the 3 initial values, and the Roll, Pitch and Yaw (𝑅𝑃𝑌) angles are defined in the 3 final values, which are arbitrated with a value of 0. ➢ Declaration of the rotation matrix 𝑅06, based on the declared values for the 3 angles involved in the end-effector orientation (𝑅𝑃𝑌) and also the matrix associated with the end-effector 𝑅𝑃𝑌𝑡𝑖𝑝 that defines the transformed matrix between the base frame of reference and the end-effector frame of reference. ➢ Definition of the global matrix 𝑇06, based on the rotation matrix 𝑅06 and the cartesian position vector of the end-effector (𝑃06). Each of the steps is observable in the following excerpt.
16 Figure 12 - First excerpt of the code involved in the inverse kinematics model ➢ Calculation of the wrist position (𝑃05), equivalent to the subtraction between the position specified for the end-effector (𝑃06) and the distance between the end-effector and the wrist (joint 5) multiplied by the 𝑧 orientation of the rotation matrix 𝑅𝑃𝑌 (𝑅𝑃𝑌𝑡𝑖𝑝_𝑧). Figure 13 - Second excerpt of the code involved in the inverse kinematics model Determination of geometric 𝜽𝟏 The previous determination of the wrist coordinates (𝑃05), allows to obtain geometrically the value of 𝜃1, based on the projection of the vector 𝑝𝑤 in the 𝑥𝑦 plane (Figure 14), through the expression (6). In this expression, the importance of using the trigonometric function 𝑎𝑟𝑐𝑡𝑎𝑛2 is highlighted, so that the spatial location of the robot is taken into account when calculating 𝜃1.
17 Figure 14 - Projection of vector 𝑝𝑤 into the 𝑥𝑦 plane 𝜃1= {𝑎𝑟𝑐𝑡𝑎𝑛2(𝑝𝑤,𝑦,𝑝𝑤,𝑥) 𝑠𝑒 𝑝𝑤,𝑦≠0 0 𝑠𝑒 𝑝𝑤,𝑦=0 (6) This is not the only solution for 𝜃1, since this angle is of rotation about 𝑧. Thus, the second solution presents a very simple calculation: 𝜃1′= 𝜃1+180° (7) Calculation of 𝜽𝟏 - Implementation The angles responsible for the positioning of the wrist are 𝜃1, 𝜃2 and 𝜃3. It can be taken into consideration that angle 1 defines the positioning of the wrist along the 𝑥𝑦 plane, while angle 2 and angle 3 define the positioning along the 𝑥𝑧 plane. Angle 1 is defined as the arc-tangent of the position of the wrist along the 𝑥𝑦 plane. If the variation seen along the 𝑦 axis is close to 0, the angle value can be disregarded and assigned an approximation of 0. ➢ Defining the values of the 2 solutions presented for 𝜃1, 𝑡ℎ𝑒𝑡𝑎1_𝐿 (when the left "elbow" is used) and 𝑡ℎ𝑒𝑡𝑎1_𝑅 (when the right "elbow" is used).
18 Figure 15 - Third excerpt of the code involved in the inverse kinematics model Calculation of 𝜽𝟐 and 𝜽𝟑 For the calculation of 𝜃2 and 𝜃3 the problem can be simplified to a 2-link planar robot, where a vector between the shoulder and wrist are defined. Thus, the determination of 𝜃2, similarly to 𝜃1 depends on the previously determined shoulder (ombro) and wrist (pulso) coordinates, and the method of obtaining them is purely geometric. Figure 16 - Simplified problem to a 2-link planar robot Using the schematic shown and the cosine theorem it is possible to extract the angles 𝛽2 and, consequently, 𝜃2. {𝜃2=90𝑜− 𝛼2− 𝛽2 𝛼2=arctan( 𝑝 𝐵𝑤𝑠,𝑧,𝑟) 𝐿𝑐2= 𝐿𝐵 2+ 𝑟′2−2×𝐿𝐵×𝑟′× cos (𝛽2) (8)
19 Being that, 𝛽2=acos (𝐿𝐵 2+ 𝑟′2− 𝐿𝑐2 2×𝐿𝐵×𝑟′ ) (9) Only exists if, −1 ≤ 𝐿𝐵 2+ 𝑟′2− 𝐿𝑐2 2×𝐿𝐵×𝐿𝐶 <1 (10) By the cosine theorem it is also possible to determine 𝛽3. This is assumed to be a considered angle that helps in obtaining 𝜃3. It should also be noted that 𝑟= √𝑝𝑝𝑢𝑙𝑠𝑜,𝑥2+ 𝑝𝑝𝑢𝑙𝑠𝑜,𝑦2. Figure 17 - Simplified problem to a 2-link planar robot (𝛽3 present instead of 𝛽2) 𝛽3=acos (𝐿𝐵 2+𝐿𝑐2− 𝑟′2 2×𝐿𝐵×𝐿𝐶 ) (11) With 𝛽3 defined, and using the geometric properties of the sketch, it is possible to obtain the equation for angle 𝜃3: 𝜃3= 𝛽3−90 (12) Calculation of 𝜽𝟐 and 𝜽𝟑 – Implementation
20 The set of steps performed throughout the implementation and aimed at calculating the angles 𝜃2 and 𝜃3 are presented: ➢ Calculation of the length of the vector between the shoulder and the wrist 𝑟′ (𝑟3 in the script), according to the following formulation 𝑟3=√𝑃25𝑥2+ 𝑃25𝑦2+ 𝑃25𝑧2. Preceded by this calculation is presented the calculation of 𝑃25 by subtraction between the vector between the base and the pulse 𝑃05 and the vector 𝑃02 defined between the base and the second axis of the manipulator, being 𝑃25={𝑃25𝑥,𝑃25𝑦,𝑃25𝑧} . ➢ Calculation of 𝛽3(𝑏𝑒𝑡𝑎3) according to equation 11, preceded by calculation of the argument (𝑎𝑟𝑔3) 𝐿𝐵 2+𝐿𝑐2− 𝑟′2 2×𝐿𝐵×𝐿𝐶 where 𝐿𝐵 and 𝐿𝐶 equal the dimensions 𝑎2 and 𝑑4, respectively. ➢ Calculation of the two solutions of 𝜃3 (𝑡ℎ𝑒𝑡𝑎3_𝐿 e 𝑡ℎ𝑒𝑡𝑎3_𝑅). The solution profiling the left elbow is given by equation 12, while the solution established by the right elbow is calculated using the following formula. 𝜃3= 270−𝛽3 (13) ➢ Calculation of 𝑟′ projected along the 𝑥𝑦 plane (𝑟) ➢ Calculation of 𝛼2 (𝑎𝑙𝑓𝑎2) using the coordinate of vector 𝑃25 (𝑃25_𝑍) and 𝑟 ➢ Calculation of 𝛽2(𝑏𝑒𝑡𝑎2) according to equation 9, preceded by calculation of the argument (𝑎𝑟𝑔2) 𝐿𝐵 2+ 𝑟′2− 𝐿𝑐2 2×𝐿𝐵×𝑟′ . ➢ Calculation of the two solutions of 𝜃2 (𝑡ℎ𝑒𝑡𝑎2_𝐿 e 𝑡ℎ𝑒𝑡𝑎2_𝑅). The solution profiling the left elbow is given by equation 8, while the solution established by the right elbow is calculated using the following formula. 𝜃2=90𝑜− 𝛼2+ 𝛽2 (14)
21 Figure 18 - Fourth excerpt of the code involved in the inverse kinematics model Calculation of 𝜽𝟒 , 𝜽𝟓 and 𝜽𝟔 Using the Denavit - Hartenberg parameters, it is possible to calculate the first 3 individual transformation matrices and from there extract the corresponding rotation matrix 𝑅 03. Considering 𝑅 06, the rotation matrix 𝑅𝑃𝑌 (which is known), it is possible to solve the equation for 𝑅 36. 𝑅 36= 𝑅0 3× 𝑅6 0= 𝑖𝑛𝑣( 𝑅3 0)× 𝑅6 0 (15) Having obtained the final values of the matrix 𝑅 36 and knowing that its elements may be defined in the way illustrated in Figure 19, it’s possible to calculate 𝜃4, 𝜃5 e 𝜃6. Figure 19 - Rotation matrix 𝑅 36
22 Resorting to the element 𝑟23 and knowing that sin(𝜃)= ±√1− (𝑐𝑜𝑠(𝜃))2, the determination of 𝜃5 becomes possible, whose dual solution can be taken from the following equation. 𝜃5= 𝑎𝑟𝑐𝑡𝑎𝑛2 (±√1−(𝑟23)2,𝑟23) (16) Similarly, using the formulations taken from matrix present in Figure 20 allows, based on elements 𝑟33 and 𝑟13, to extract the value of 𝜃4 as well as, using 𝑟22 and 𝑟21, the value of 𝜃6 . {𝜃4=𝑎𝑟𝑐𝑡𝑎𝑛2 (𝑟33,− 𝑟13 ) 𝜃6 =𝑎𝑟𝑐𝑡𝑎𝑛2 (−𝑟22,𝑟21 ) (17) The deductions of these values present, however, the condition that sin(𝜃5)≠0 aimed at avoiding singularities. It is in this sense that the following conditional definition for both angles 𝜃4 and 𝜃6 is further considered. {𝜃4=0 ∧𝜃6=𝑎𝑟𝑐𝑡𝑎𝑛2 (𝑟12,𝑟32) 𝑖𝑓 𝜃5=0 𝜃4=0 ∧𝜃6 =− 𝑎𝑟𝑐𝑡𝑎𝑛2(−𝑟12,− 𝑟32) 𝑖𝑓 𝜃5=𝜋 (18) Calculation of 𝜽𝟒 , 𝜽𝟓 and 𝜽𝟔 – Implementation The set of steps performed throughout the implementation and aimed at calculating the angles 𝜃4 , 𝜃5 and 𝜃6 are presented: ➢ Statement of the Denavit - Hartenberg parameters 𝑎𝑖 , 𝛼𝑖 , 𝑑𝑖 and 𝜃𝑖 for the different frames of reference (𝐷𝐻_𝑎𝑙𝑝ℎ𝑎,𝐷𝐻_𝑎,𝐷𝐻_𝑡ℎ𝑒𝑡𝑎,𝐷𝐻_𝑑). ➢ Calculation of the first 3 individual transformation matrices 𝑇1 0, 𝑇2 1 e 𝑇3 2 (𝑇01 , 𝑇12 e 𝑇23 ). ➢ Calculation of the transformation matrix 𝑇3 0 (𝑇03) and consequent extraction of the rotation matrix 𝑅3 0 (𝑅03) involved in the first 3 frames of reference, proceeded by its inverse 𝑅0 3 (𝑅30). ➢ Calculation of the matrix 𝑅 36 (𝑅36), necessary for the calculation of the 3 angles. Based on the definition of this matrix, each of the constituent elements is subsequently determined (𝑟11,𝑟12,𝑟13, etc).
23 Figure 20 - Fifth excerpt of the code involved in the inverse kinematics model ➢ Compute the two solutions for 𝜃5, using the elements present in equation 16. Figure 21 - Sixth excerpt of the code involved in the inverse kinematics model ➢ Calculation of the generic solutions for 𝜃4 and 𝜃6, as well as the conditional solutions dependent on the value of 𝜃5. ➢ Final definition of the 𝑗𝑜𝑖𝑛𝑡𝑠 vector consisting of the 6 angles, being this vector equivalent to the only output defined for the model. Figure 22 - Seventh excerpt of the code involved in the inverse kinematics model
24 2.1.2. Trajectory Definition After developing the code that dictates obtaining the desired angles, there is the input of these same angles in the model for trajectory calculation or also called "motion planning". In robotic control systems, motion planning is the computational problem responsible for outlining the path to be executed, free of obstacles, through the sequence of a set of valid configurations that move the object from the origin to the profiled destination. For a better explanation of this section, it starts with the first approach taken in the development of this model, in which a Pick&Place with no via point mode is considered. At a later stage, however, the improvement with the via point mode is implemented, thus bringing complementary aspects to the initially conceived model. Figure 23 - On the left, the elaborated model involved in the trajectory definition. On the right, the reference model used. In Figure 23 presented, it is possible to observe on the left the initially designed model of the path planning and, analogously, the model [21] with the same purpose inserted in the reference model present in the Modelica Standard Library. Some aspects introduced can be highlighted, such as the existence (1) of 2 trajectory definition models, or movement profile, contrasting with 1 in the reference model, the existence of a section (2) that collects and sums both movement profiles over time, coming from the 2 previous models, thus defining a single movement profile, and also presenting the specificity of dividing its state in position, velocity, ❶ ❸ ❷ ❹
31 𝒑𝟐=𝟏𝟐×𝒕𝒂× 𝒗𝒎𝒂𝒙 or 𝒑𝟐=𝟏𝟐×𝒕𝒂𝟐× 𝒂𝒎𝒂𝒙 Position Function (2 → 3) 𝒑(𝒕)=𝒑𝟐+𝒗𝒎𝒂𝒙×(𝒕−𝒕𝒂) Position 3 (position at 𝒕𝒂+𝒕𝒄𝒐𝒏𝒔𝒕) 𝒑𝟑=𝒑𝟐+𝒗𝒎𝒂𝒙×𝒕𝒄𝒐𝒏𝒔𝒕 Position Function (3 → 4) 𝒑(𝒕)=𝒑𝟑+𝟏𝟐×(𝒕−𝒕𝒂 −𝒕𝒄𝒐𝒏𝒔𝒕)× 𝒗𝒎𝒂𝒙 or 𝒑(𝒕)=𝒑𝟑+𝟏𝟐×(𝒕−𝒕𝒂−𝒕𝒄𝒐𝒏𝒔𝒕)𝟐 × 𝒂𝒎𝒂𝒙 Position 4 (Final Position 𝒕𝒇) 𝒑𝟒=𝒑𝟑+𝟏𝟐×𝒕𝒅× 𝒗𝒎𝒂𝒙 𝒑𝟒=𝒑𝟑+𝟏𝟐×𝒕𝒅𝟐× 𝒂𝒎𝒂𝒙 Being that 𝒕𝒅= 𝒕𝒂 The calculation formulas presented in table 3 show their significance throughout the development of the code, however the final values obtainable through the calculations can be disregarded, since the calculation formulas are to be aided by a time scale, and this will be explained below. The configuration of the 6 axes of a manipulator as a function of time is called trajectory.
32 Figure 31 - Trajectory and path along a 2-axis system Where 𝑇 is assumed to be the value of the total travel time. However, the interest of the configuration development is not always initially dependent on time, but rather on the configured space. That is, the curve observed in Figure 31 in which can be observed the evolution of the 2-axis angles, instead of evolving according to time 𝑡, evolves according to a function whose parameter 𝑠 varies between 0 (initial configuration) and 1 (final configuration), thus defining the path. A path can be transformed into a trajectory, in turn, by defining 𝑠 as a function over time. In this way, the trajectory can be defined: 𝜃(𝑠(𝑡)),𝑠∶ [0,𝑇]→ [0,1] The definition of a path, through the implementation of a trajectory is thus called time scaling, where the speed with which the path is traveled is established. Thus, the final implementation required will involve the use of the formulas presented in the table 3 in conjunction with the angular displacement delineated between the points of the path, causing the final values of position to vary between 0 and 1, resulting from a relative and not absolute positioning. In equation 21, 𝑡𝑐𝑜𝑛𝑠𝑡 is positive when 𝑡𝑓 is greater than 2𝑡𝑎. This means that 𝑡𝑐𝑜𝑛𝑠𝑡 can be zero if 𝑡𝑓 is equivalent to 2𝑡𝑎. This happens when the displacement ∆𝑥 is relatively small. The constant velocity zone in the profile may not exist, thus giving rise to a triangular velocity profile where only the acceleration and deceleration zones appear, as profiled in Figure 32. For a kinematics algorithm that offers greater consistency, this velocity profile is also defined in the event that the angular displacement of a particular axis is reduced. Trajectory: 𝜃(𝑡),𝑡 ∈ [0,𝑇] Path: 𝜃(𝑠),𝑠 ∈ [0,1]
33 Figure 32 - Triangular speed profile For this profile, the maximum speed is not reached when the maximum acceleration 𝑎𝑚𝑎𝑥, is imposed. It is in this sense that the variables 𝑡𝑎, 𝑡𝑓 and 𝑣𝑚𝑎𝑥 need to be recalculated, giving rise to 𝑡′𝑎, 𝑡′𝑓 e 𝑣′𝑚𝑎𝑥. 𝑡′𝑎=√∆𝑥 𝑎𝑚𝑎𝑥 (22) 𝑣′𝑚𝑎𝑥=𝑎𝑚𝑎𝑥×𝑡′𝑎 (23) 𝑡′𝑓=2𝑡′𝑎 (24) The positions and position functions are again calculated, this time for the triangular profile. Table 4 - Calculating the positions along the triangular velocity profile Position Value/Formula Position 1 (Start) 𝒑𝟏=𝟎 𝒑(𝒕)=𝟏𝟐×𝒕× 𝒗′𝒎𝒂𝒙 Start Time End Time Acceleration Time ❶ ❷ ❸
34 Position Function (1 → 2) 𝒑(𝒕)=𝟏𝟐×𝒕𝟐× 𝒂𝒎𝒂𝒙 Position 2 (position at 𝒕′𝒂) 𝒑𝟐=𝟏𝟐×𝒕′𝒂× 𝒗′𝒎𝒂𝒙 𝒑𝟐=𝟏𝟐×𝒕′𝒂𝟐× 𝒂𝒎𝒂𝒙 Position Function (2 → 3) 𝒑(𝒕)=𝒑𝟐+𝟏𝟐×(𝒕−𝒕𝒂′ )× 𝒗′𝒎𝒂𝒙 𝒑(𝒕)=𝒑𝟐+𝟏𝟐×(𝒕−𝒕𝒂′)𝟐× 𝒂𝒎𝒂𝒙 Position 3 (position at 𝒕′𝒂+𝒕′𝒅) 𝒑𝟑=𝒑𝟏+𝒗𝒎𝒂𝒙×𝒕𝒄𝒐𝒏𝒔𝒕 The detailed implementation of the trapezoidal profile, already present in the reference model, can be seen in appendix 1. 2.1.2.3. 3rd Order Polynomial Kinematic Profile 3rd Order Polynomial Profile - Theory In order to be able to explore different kinematic profiles, a polynomial profile of motion is elaborated along the Pick and Place kinematic models. The equations for calculating the polynomial are inserted into the kinematic models and thus allow the trapezoidal profile to be compared to a 3rd order polynomial. The user is also given, as input parameters in the global system, the option to choose which of the two kinematic profiles he wants for the delineation of the angular trajectories along the robot's axes.
35 Figure 33 - Trapezoidal, 3rd order polynomial and 5th order polynomial velocity profile for the same time interval In Figure 33, comparing the trapezoidal profile with the polynomial one, it can easily be seen that the use of a polynomial profile projects a smoother movement, without radical changes in slope, however this smoothness of movement is contrasted with higher values of speed and maximum acceleration. The study of the polynomial trajectory that allows the manipulator to evolve from one position to another will be, throughout this section, explored, first in mathematical terms and then with its implementation in Modelica. The mathematical deduction of the coefficients of a cubic polynomial equation will be briefly discussed. The choice of a cubic polynomial function is admitted for the following motivations: • A cubic polynomial function is sufficient for the four constraints to be used; • A polynomial function ensures smooth motion, because it is a continuous function and has a first derivative that is also continuous; • If the first and last point are within the joint space, then the points in between will be as well. The deductions expressed are designed for the case in which the initial and final velocity are zero, however they are also valid if one chose to use via points [24], a situation in which specific points of trajectory are usually designed in which the manipulator will pass with nonzero velocity. Equation 25 contains the expression that describes the evolution of the angle of each joint over time. In this expression it is intended to determine 𝑎0, 𝑎1, 𝑎2 e 𝑎3. 𝜃𝑖(𝑡)= 𝑎0+𝑎1𝑡+ 𝑎2𝑡2+ 𝑎3𝑡3 (25)
36 Deriving equation 25 gives equation 26, which allows obtaining the angular velocity at each joint over time. 𝜃𝑖(𝑡)= 𝑎1+2𝑎2𝑡+ 3𝑎3𝑡2 (26) Restrictions The restrictions [25] for the intended trajectory are found in equations 27-30. These are the initial (𝜃𝑖,0) and final (𝜃𝑖,𝑓) angle of the joint and the initial (𝜃𝑖,0) and final (𝜃𝑖,𝑓) velocity of the joint. In equations 28 and 30, 𝑇 is the duration time of the motion, which must be the same for all joints. 𝜃𝑖(0)= 𝜃𝑖,0 𝜃𝑖(𝑇)= 𝜃𝑖,𝑓 𝜃𝑖(0)= 𝜃𝑖,0 𝜃𝑖(𝑇)= 𝜃𝑖,𝑓 (27) (28) (29) (30) Determination of 𝒂𝟎, 𝒂𝟏, 𝒂𝟐 and 𝒂𝟑 From the constraints in equations 25-26 and equations 27-30 the system of equations [25] below can be written. This system of equations shows the constraint that gave rise to each equation. { 𝑎0= 𝜃𝑖,0 𝑎1= 𝜃𝑖,0 𝜃𝑖,𝑓= 𝜃𝑖,0+ 𝜃𝑖,0𝑇+ 𝑇2𝑎2+ 𝑇3𝑎3 𝜃𝑖,𝑓= 𝜃𝑖,0+ 2𝑎2𝑇+ 3𝑎3𝑇2 (31) By solving this system it is possible to obtain the expressions for calculating the coefficients of the cubic polynomial equation that gives the evolution of a joint angle over time. { 𝑎0= 𝜃𝑖,0 𝑎1= 𝜃𝑖,0 𝑎2= −1𝑇𝜃𝑖,𝑓− 2𝑇𝜃𝑖,0+ 3 𝑇2(𝜃𝑖,𝑓− 𝜃𝑖,0) 𝑎3= − 2𝑇(𝜃𝑖,𝑓− 𝜃𝑖,0)+ 1 𝑇2(𝜃𝑖,𝑓+𝜃𝑖,0) (32) 3rd Order Polynomial Profile - Implementation
37 Having presented the theoretical principles of the 3rd order polynomial calculus, its implementation in Modelica will now be shown. In a first instance, the polynomial path coefficients for each of the axes are calculated. The coefficient implied in the constriction of the initial position adopts the value present in the q_begin array, while that of the initial velocity adopts the value 0. An initial velocity of 0, thus implies that 𝑎2=3 𝑇2(𝜃𝑖,𝑓− 𝜃𝑖,0) and also that 𝑎3=− 2𝑇(𝜃𝑖,𝑓− 𝜃𝑖,0), whose angular variation, (𝜃𝑖,𝑓− 𝜃𝑖,0), is determined by the difference between the two vectors of initial and final position defined in the model. Figure 34 – Excerpt from the implementation of a 3rd order polynomial kinematic profile, contained in the code involved in the kinematic profile generation model The fact, that this calculation ends up describing the calculation of coefficients for motion profile models where a direct trajectory is verified, should be emphasized. That is, without Via Point mode activated. In situations where Via Points are used, these define points through which the trajectory of the manipulator's tip must pass, but not necessarily stopping at them in an absolute way. The objective is to observe a slowdown, in order to make sure that the passage through the reference point occurs, without sudden changes in trajectory direction and also without the occurrence of an absolute stop. Thus, the final speed value up to the via point and the initial speed value from the via point should have non-zero values. This change in speed restrictions changes the way the other coefficients (𝑎2 𝑒 𝑎3) are calculated. Coefficients (Axes) 1 2 3 4 5 6
38 Figure 35 - Excerpt from the implementation of a 3rd order polynomial kinematic profile, contained in the code involved in the kinematic profile generation model - Continuation Once the coefficients are calculated, the next step is to write the equation of motion (equation 25), that is, the evolution of the angle over time. The code passage took into account that the evolution of each of the angles, described by the equation, must occur at the proper instant, so its execution only occurs within the established condition. This condition defines the variation of the angular value only when the simulation time interval of the global Pick&Place system is between the instant when the model is activated, being this instant defined by the parallel modeling to this model, and the time instant defined by the initial time when the model is "activated" + the final time of the movement profile. The function is defined for 𝑡 with 0<𝑡<𝑇, being 𝑡 defined as the total simulation time minus the instant of time when this model initializes the motion profile calculation and 𝑇 as the total displacement time of the 6 axes. 2.1.2.4. 5th Order Polynomial Kinematic Profile 5th Order Polynomial Profile – Theory In the event that an even smoother movement is preferred compared to the 3rd order polynomial function, a 5th order polynomial function is developed, in which acceleration constraints can be set, at the beginning and end of the movement, with a value of 0. This way, it is confronted with 2 more coefficients, along the function, which are used to satisfy the acceleration constraints mentioned. Equation 33 contains the expression that allows the description of the evolution of the angle of each joint over time. In this expression it’s intended to determine 𝑎0, 𝑎1, 𝑎2, 𝑎3, 𝑎4 and 𝑎5. 𝜃𝑖(𝑡)= 𝑎0+𝑎1𝑡+ 𝑎2𝑡2+ 𝑎3𝑡3+ 𝑎4𝑡4+ 𝑎5𝑡5 (33)
39 Deriving equation 33 gives equation 34, which gives the angular velocity at each joint over time. 𝜃𝑖(𝑡)= 𝑎1+2𝑎2𝑡+ 3𝑎3𝑡2+ 4𝑎4𝑡3+ 5𝑎5𝑡4 (34) Restrictions The constraints [25] for the intended trajectory are found in equations 35-40. These are the initial (𝜃𝑖,0) and final (𝜃𝑖,𝑓) angle of the joint, the initial (𝜃𝑖,0) and final (𝜃𝑖,𝑓) velocity, and finally the initial (𝜃𝑖,0) and final (𝜃𝑖,𝑓) acceleration of the joint. In the equations, T is the time duration of the motion, which must be the same for all joints. 𝜃𝑖(0)= 𝜃𝑖,0 𝜃𝑖(𝑇)= 𝜃𝑖,𝑓 𝜃𝑖(0)= 𝜃𝑖,0 𝜃𝑖(𝑇)= 𝜃𝑖,𝑓 𝜃𝑖(0)= 𝜃𝑖,0 𝜃𝑖(𝑇)= 𝜃𝑖,𝑓 (35) (36) (37) (38) (39) (40) Determination of 𝒂𝟎, 𝒂𝟏, 𝒂𝟐, 𝒂𝟑, 𝒂𝟒 and 𝒂𝟓 From the constraints present in equations 33-34 and equations 35-40 it is possible to write the system of equations [25]. In this system of equations, the constraint that gave rise to each equation is marked. { 𝑎0= 𝜃𝑖,0 𝑎1= 𝜃𝑖,0 𝑎2= 𝜃𝑖 2 𝑎3= 20𝜃𝑓−20𝜃0−(8𝜃𝑓+12𝜃0)𝑡𝑓−(3𝜃0− 𝜃𝑓)𝑡2𝑓 2𝑡3𝑓 𝑎4= 30𝜃0−30𝜃𝑓+(14𝜃𝑓+16𝜃0)𝑡𝑓+(3𝜃0− 2𝜃𝑓)𝑡2𝑓 2𝑡4𝑓 𝑎5= 12𝜃𝑓−12𝜃0−(6𝜃𝑓+6𝜃0)𝑡𝑓−(𝜃0−𝜃𝑓)𝑡2𝑓 2𝑡5𝑓 (41)
40 5th Order Polynomial Profile - Implementation Similarly to the coefficients calculated for the 3rd order polynomial calculation, the coefficient implied in the constriction of the initial position adopts the value present in the q_begin array, while that of the initial velocity adopts the value of 0 and, similarly, the coefficient 𝑎2 of the initial acceleration, as well. Considering the null values given for the coefficients for the initial constraints, one gets 𝑎3= 20(𝜃𝑖,𝑓− 𝜃𝑖,0) 2𝑡3𝑓, 𝑎4= 30(𝜃𝑖,0− 𝜃𝑖,𝑓) 2𝑡4𝑓 and 𝑎5= 12(𝜃𝑖,𝑓− 𝜃𝑖,0) 2𝑡5𝑓. Figure 36 - Excerpt from the implementation of a 5th order polynomial kinematic profile, contained in the code involved in the kinematic profile generation model Once the coefficients are calculated, the next step is to write the equation of motion (equation 33), similar to what is done for the 3rd order polynomial profile.
47 Figure 43 - Models responsible for collecting the different variables intended for each axis command 2.1.3. Mechanical Structure In order to properly simulate the system, a mechanical structure of the robotic arm performing the Pick and Place task is developed. At the structural level, the initial goal would be to model based on the physical profile of the ABB IRB 140 robot [26], and in a simulation environment, each of the links modeled in Modelica would adopt the actual shape of the different components of the IRB 140, in compatibility with the respective components modeled in CAD software. However, the compatibility process that would allow the transcription of the different components failed, largely due to the limitations offered by the open-source program OpenModelica. Therefore, an effort is made to model each of the robot's links, from scratch, in OpenModelica, based exclusively on the geometric shapes provided by the program (cylinders and parallelepipeds). The result is shown in Figure 44.
48 Figure 44 - Simulation representation of the modeled mechanical structure The total structure is obtained through a model consisting essentially of "bodyshape's" that depict each of the linkages or structural components. In these, the mass, center of mass and shape (height, width and length) are defined, using, fundamentally, vectors. Between each of the links, rotating joints or "revolute's" are modeled, constituting the joints whose axes will be respectively driven by the servomotors. The fixing of the joints at a specific location in the link is done using the "fixedTranslation" or "fixedRotation" components, which host the vector between the end of the link and the beginning of the joint, and vice versa. To complement the physical shape of the model, physical shapes are also added through "fixedShape's". Table 5 - Components used for the design of the mechanical structure Component Illustration BodyShape Revolute FixedTranslation FixedRotation
49 FixedShape Each of the axes, coming from the modeling section intended for axial control, enters the structure model and connects to the revolutes, thereby actuating the respective joints, whenever required. Figure 45 - Model of the mechanical structure of the manipulator 2.1.3.1. Robot – Gripper Connection An attempted robot - Gripper connection was explored with some exhaustion but successively failed, in which a frame connection between the mechanical structure of the robot and the mechanical structure of the 3 constituent fingers of the gripper was modeled. The modeling presented successive errors due to an overloading of the system. Thus, the gripper is simulated independently, from the structural point of view, of the manipulator. However, in order not to compromise the study of the manipulator's performance, a point of mass is added at the end of the manipulator's structure, thus trying to replicate the mass of the gripper's presence along the structure.
50 Figure 46 - Gripper structure modeled independent of the manipulator, from a structural point of view In Figure 47 it can be seen the block corresponding to the additional mass that aims to study, as already mentioned, the replication of the gripper presence at the end of the robot structure. Figure 47 - Attaching the gripper mass to the manipulator frame It can be concluded that, and as becomes clear from a graphical observation, an increase in mass applied at the end of the structure implies an increase in torque applied along each of the robot's axes. Gripper Structure Robot Structure
51 Figure 48 - Torque amplitude over time is increased on each axis. Graph on the left plots torque at 5kg gripper mass. Graph on the right plots torque at 10kg gripper mass 2.1.4. Thermal Flow – Motor Shafts In order to try to replicate possible heat losses throughout the operation of the robot, a heat transfer model between an input port and the exterior is developed. The heat transfer to the outside occurs under convective effect, and can be represented by the following formula. 𝑄=ℎ×𝐴×𝑑𝑇 (43) Where 𝑄 corresponds to the heat transfer [𝑊], ℎ and 𝐴 correspond respectively to the heat transfer coefficient [𝑊/𝑚2℃] and the total area [𝑚2] on which the transfer occurs, and finally the temperature difference between the 2 environments [℃]. The model developed aims to study the heat transfer by convection, from the surface under study, with its own heat capacity, to the outside that admits a constant temperature over time. In the project under study, this model is used to study the thermal losses in the motor(s), as well as the friction losses along the component designed for this purpose, which is located in the transmission section. (N/m)
52 Figure 49 - Thermal flow model associated with each axis The possibility of using a representative transfer component in the form of conduction, before the convection modeling, would possibly replicate a more realistic situation of the process to be modeled here, however, the fact that the conduction transfer component has a standard temperature (20 degrees) different from the initial ambient temperature to be considered for the bearing and motor (15 degrees), implies an initial heat transfer to bridge this temperature difference along the transfer section. The heat transfer as a function of the system operation would be barely noticeable, as there would be another factor for it to occur. In the following table 6 it will be possible to observe how the concepts discussed, convective transfer, as well as heat capacity, are incorporated into the modeling presented in Figure 49. For this purpose a set of components are used and whose respective description will be readily presented. Servomotor Model in Each Axis
53 Table 6 - Components present in the heat flow model Component Description Component that shows the heat capacity 𝐶, that is, the amount of heat supplied so that the temperature rises one unit, considering a constant temperature of the body throughout its volume. The heat capacity is obtained by multiplying the specific heat 𝑐𝑝 by the mass of the body 𝑚. In modeling using this component, the establishment of 𝐶 is a directly defined parameter, so there must be inherent knowledge of the body to be studied, such as the material of which the body is made as well as its mass and/or volume. 𝐶=𝑚×𝑐𝑝 Component that defines the convective state of the transfer, specifically the heat transfer coefficient and the total transfer area, as shown in the equation. For this purpose the parameter 𝐺𝑐 is defined in which it is determined based on the multiplication of the area by the coefficient. 𝐺𝑐=ℎ×𝐴 Component that defines the outside temperature and whose difference to the body generates the thermal potential necessary for the transfer to take place. Component responsible for measuring the heat transferred between the object of study and the outside. It is connected to the model's output. For the situation of the bearing, it can be seen below the temperature difference 𝑑𝑇 between it and the ambient temperature (which adopts the value of 15 degrees). When throughout the process this temperature difference increases, it is possible to observe that this increase is also accompanied by an increase in energy transfer in the form of heat, whose values are obtained by multiplying the heat capacity of the bearing.
54 Figure 50 - Temperature variation and consequent increase in energy transfer In an initial phase, when the bearing is at rest, heat transfer is zero, since the bearing, before being driven, has its temperature equalized to the ambient temperature. When the Pick movement is initiated and thus the movement of the bearing, the heat increase, due to friction, raises the heat transfer until the arm movement ceases and the gripper operating stage is initiated, resulting in a drop in transfer given the stabilization in temperature differences. When the Place motion is initiated, there is an increase in transfer again and the process repeats. Note the fact, that for this particular situation, although the Place movement is of shorter duration than the Pick, this is where the peak of heat transfer is reached. This is explained by the fact, that the increase in transference at the time of the Place is preceded by a state of the bearing in which, although stopped, it still presents a temperature deviation due to the performance in the Pick. There is thus a need for a considerable pause in the operation of the manipulator if the temperature values are to return to ambient values. Figure 51 - Heat transfer (purple) from the motor (axis 1) (K) (W) (W)
55 Regarding the thermal transfer that comes from the motor, it can be observed that it occurs in the moments of acceleration and deceleration of the motor (in orange). During moments of acceleration, the inflow of current and voltage increases. Similarly, during deceleration moments, the current value increases again, this time in the opposite direction. At current peaks, variations in temperature values are naturally observed, which in turn trigger a convective heat transfer. The heat transfer losses in each axis can be seen in the following graph. Figure 52 - Heat transfers (W) involved in the 6 axes The thermal losses are calculated individually in each of the axes, however, in order to make it easier to consult them, a model is designed with the purpose of channeling the different values and presenting them in a single model with dynamic indicators. Figure 53 - Model presenting the thermal losses in all axes (W)
56 2.1.5. Continuation of the Simulations Study – Robot Some results derived from the simulations and arising from the manipulator are presented here. Regarding the variation of the angles associated with each of the manipulator's axes, it is observed in the graph that axes 1, 3 and 5 have an angular variation in Pick and a variation in the opposite direction along the Place. Axis 4 is not driven along Pick&Place since the configurations required for the total path do not require it. Axis 6 presents an exclusive variation in the Place movement and axis 2 has the particularity of being driven twice in the same direction. Figure 54 - Angular variation in all 6 axes, with trapezoidal velocity profile and no Via Point mode - Entry Conveyor 2 and Box 1 transport The trapezoidal velocity profile can be observed (Figure 55). The time required for each trapezoidal profile performed is equal, as noted above, allowing each of the profiles to start and end at the same times. This required trajectory time equals the time from the axis that takes the longest to complete the trapezoidal profile taking into account the angular displacement for that axis and also the axial kinematic constraints involved. Only in this way is it guaranteed that all axes are able to complete the trapezoidal profile in the same time interval. The direct consequence of this imposition is that only one axis reaches the maximum speed (the axis whose ratio between angular displacement and maximum speed defined is greater), and the remaining axes have a peak speed lower than the maximum speed defined
63 end point of the conveyor, where the box must admit the 0 speed, in order to be processed in a further process. In the diagram presented, the modeling of the velocity and position profile, which can be divided into three as mentioned, allows the use of the trapezoidal profile model already developed, subject only to minor changes, specifically the input and output variables that take place in each of the trajectory models. Thus, a sequencing is developed through the transmission of initiation signals through Booleans, and the sending of timing values, i.e., the time instants in which the respective profiles should be calculated. Figure 64 shows the control cycle of the conveyor's movement, thus constituting the final architecture of the model of the different conveyors. Regarding the trajectory generation, and as previously mentioned, the input conveyors and output conveyor 3 generate position and velocity profiles (the presence of a trapezoidal velocity profile in the transport is more easily obtained according to a cascaded position-speed control) and in the output conveyors 1 and 2 velocity profiles are generated exclusively, due to a less judicious control need, as a consequence of the absence of a slowdown at the end of the movement. Figure 64 - Control cycle present in the conveyor models and the options present for generating the movement profile 2.2.2. Control and Motor Similar to the servomotor developed in the manipulator model, the modeling of the conveyor motor has the same format, with the only distinction being how the current is transmitted to the electrical circuit. In this, a SignalVoltage block is used giving input directly into the circuit. The voltage along the developed closed circuit is thus mediated by this block, which transmits Entry Conveyor Belts Exit Conveyor Belt 1/2 Exit Conveyor Belt 3
64 a continuous function of potential difference over time. This voltage, in turn, ends up being the command provided by the P-PI control. Figure 65 - Modeling of the motor used in the conveyor belts P-PI control is directly associated with trajectory generation, with proportional position control and PI speed control (input conveyors). Figure 66 - Motor associated P-PI control on the entry conveyors In the output conveyors, the control modeling is modified. In the first 2 output conveyors, the absence of a proportional control term for position is noteworthy. The absence of a position control on these 2 conveyors determines a unique PI speed control. Finally, for the control of output conveyor 3, a cascade control that attends to the position, speed and current commands (similar to the control profile inserted in the manipulator's motors) is implemented.
65 Figure 67 - Control cycle present in the models of the conveyor belts and the options present for the controller There is, therefore, an increase in the impositions inherent to the control cycles, meeting the needs required by each task performed by each conveyor belt. 2.2.3. Conveyor Belt Structure Starting by analyzing the conveyor model itself, that is, the entire conjuncture inherent to the operability of the mechanical load. The mechanical load represents the force required to move successive packages along the conveyor in an industrial environment. Modeling the transport of the mechanical load involves dividing the conveyor system into different competencies, with the initial approach consisting of the gears, the inertia of the system, damping, the transmission that translates the linearity of the movement, and finally the mass to be transported, being this initial approach based on the schematization present in [27]. For the modeling of the structure and mechanical load, two distinct models are also developed, one more simplified and the other with greater complexity, i.e., with a larger number of parameters and variables involved, thus determining a more rigorous study of the system. The set of different components used will be discussed in more detail below. It is important to realize that for the motor to accelerate or decelerate the conveyor, the motor has to overcome not only the inertia of the mass being transported, but also the conjectural inertia of the entire system. Simplification of the system could lead us to a system consisting of a conveyor geared to two cylinders/pulleys. These pulleys in turn can be classified according to their action in the Entry Conveyor Belts Exit Conveyor Belt 1/2 Exit Conveyor Belt 3
66 system. Motor or drive pulleys are those responsible for transmitting force. On the other hand, the pulley that receives the movement is called the driven or conducting pulley. Figure 68 - Conveyor belt with associated rollers/pulleys The drive pulley, driven by the motor shaft, triggers the movement of the conveyor and, attached between it and the motor shaft, a set of highly efficient gears is introduced, increasing the output torque and decreasing the speed, of the motor output, to be transmitted. Regarding inertia/moment of inertia, this is a measure of the distribution of mass of a body around an axis of rotation, which for the modeled system is the drive shaft. The moment of inertia evaluates the difficulty of the drum/cylinder inherent to the transmission to rotate about its axis, and this same difficulty is directly related to the moments of inertia of the load (belt and packages) as well as to the moments of inertia of the transport drums. The total inertia thus depends on several parameters implicit to the type of conveyor present in the system. The main points of interest already mentioned to be taken into consideration throughout the modeling of a conveyor: gears, system inertia, damping, transmission that translates the linearity of the movement, and the mass to be transported, will serve as a basis for the more simplistic development of the system structure model. Of these, the point that requires the most careful analysis is the total system inertia, involved in the torque required for the movement to occur as desired. Thus, the appropriate formulations will be presented. 2.2.3.1. Calculation of Torque and Total System Inertia Assuming for example a trapezoidal speed profile (verified on exit conveyor 3), the different torques required throughout the process are torque for acceleration, constant speed and
67 deceleration torque, and in most applications, the maximum torque occurs during acceleration. Because the maximum value occurs mostly at the beginning, in processes involved with conveyors, a constant torque, in many applications, is provided to the system by the motor, and its calculation is performed by the square root of all the different torques required throughout the process (the use of constant torque will be disregarded in the modeling). The different torques involved in the different phases will be presented. Torque – Continuous Speed For a system such as a conveyor, the motor torque required during constant speed is simply the total axial force (𝐹𝑎) on the conveyor multiplied by the radius of the pulley (𝑟𝑝). 𝑇𝑐= 𝐹𝑎× 𝑟𝑝 𝜂 (44) Where the efficiency 𝜂 of the system is included in the torque equation. This efficiency relates to the friction losses between the belt and the pulleys/cylinders. It is also important to note that it is assumed that both the drive and driven pulleys have the same diameter, which turns out to be the case for most conveyor belts used in linear motion systems. Conveyor belts are not normally designed to withstand external axial forces, so the total axial force consists exclusively of the force required to move the load, which is the weight (𝑚.𝑔) of the package to be transported as well as the belt, multiplied by the coefficient of friction of the load bearing guide. 𝐹𝑎=𝑚×𝑔×𝜇 (45) Torque – Acceleration The acceleration phase of the motion profile is typically the period when the maximum torque required by the motor is reached, and this torque (𝑇𝑎) is often also considered the intermittent torque. The torque required during belt acceleration includes the torque required at constant speed (𝑇𝑐) plus the torque required for load acceleration (𝑇𝑎𝑐). 𝑇𝑎= 𝑇𝑐+ 𝑇𝑎𝑐 (46)
68 The acceleration torque of the load is obtained by multiplying the total inertia of the system (𝐽𝑡) by the angular acceleration (𝛼). 𝑇𝑎𝑐= 𝐽𝑡×𝛼 (47) The total inertia of the system includes the inertia of the motor, coupling, pulleys/cylinders, and also the load (belt and packing). 𝐽𝑆= 𝐽𝑃1+ 𝐽𝑃2+ 𝐽𝑇+ 𝐽𝐶+ 𝐽𝑀+ 𝐽𝐴𝑐𝑜𝑝 (48) Table 8 - Calculation of the different constituent inertias in the inertia of the overall system Component Inertia Calculation Cylinders Inertia 𝐽𝑃1=18×𝑚𝑃1×𝐷2 ; 𝐽𝑃2=18×𝑚𝑃2×𝐷2 𝑜𝑟 𝐽𝑃1=12×𝑚𝑃1×𝑟2 ; 𝐽𝑃2=12×𝑚𝑃2×𝑟2 Conveyor Belt Inertia 𝐽𝑇=14×𝑚𝑇×𝐷2 𝑜𝑟 𝐽𝑇=𝑚𝑇×𝑟2 Box Inertia 𝐽𝐶= 14×𝑚𝑐×𝐷2 𝑜𝑟 𝐽𝐶=𝑚𝑐×𝑟2 Motor Inertia 𝐽𝑀 Coupling Inertia 𝐽𝐴𝑐𝑜𝑝 Torque – Deceleration 𝑇𝑑= 𝑇𝑐− 𝑇𝑎𝑐𝑐 (49)
69 The torque required during deceleration of the conveyor includes the torque required at constant speed minus the torque required for acceleration of the load. Between the inertia, which represents the resistance of the total load being carried, and the transmission that converts the rotary motion to linear, a damping present in the bearings is modeled. The damping force or torque (𝑇𝑎) is equal to the multiplication of the damping constant (𝑐𝑎) and the relative angular velocity (𝑤𝑟). The energy loss (𝑃) in the bearings is equal to the damping torque multiplied by the relative speed. 𝑇𝑎=𝑐𝑎 × 𝑤𝑟 𝑃 =𝑇𝑎 ×𝑤𝑟 (50) (51) 2.2.3.2. Implementation The motor torque is responsible for the movement of all the mechanical load involved in the belt. In the event of wanting to maintain a constant speed, and disregarding the friction losses between the belt and the pulleys/cylinders, an increase in load drives a "counter-torque" (torque in the opposite direction) on the motor, which triggers the belt speed to decrease, so an increase in motor torque is required so that a counter-balance, between the torque that triggers the movement and the torque that offers resistance to the movement, exists, and thus prevents the speed from decreasing. Thus, when the torque and counter-torque are equal, a stabilization of speed is generated, making the speed constant. When the torque is greater than the counter-torque there is an increase in speed and a consequent acceleration. On the other hand, for a higher counter-torque, a deceleration is verified. Table 9 - Transmission and inertia component used in the modeling Component Description Component involved in the calculation of torque at constant speed, using the axial force required to carry the load. The transmission ratio subject to the transformation from rotational to linear motion is taken into account. 𝑇𝑐=𝐹𝑎×𝑟𝑝
70 Component that defines the total inertia of the system, also calculating the acceleration torque of the load based on the acceleration allowed on the flanges. 𝐽𝑆= 𝐽𝑃1+ 𝐽𝑃2+ 𝐽𝑇+ 𝐽𝐶+ 𝐽𝑀+ 𝐽𝐴𝑐𝑜𝑝 𝑇𝑎𝑐=𝐽𝑡×𝛼 Acceleration torque 𝑇𝑎𝑐, being solely responsible for the speed increase. It corresponds to the motor torque over acceleration 𝑇𝑎 minus the constant speed torque 𝑇𝑐 (corresponding to the counter-torque 𝑇𝑐𝑡) exerted by the mechanical load. 𝑇𝑎=𝑇𝑎𝑐− 𝑇𝑐 ↔ 𝑇𝑎=𝑇𝑎𝑐− 𝑇𝑐𝑡 ↔ 𝑇𝑎𝑐= 𝑇𝑎+ 𝑇𝑐𝑡 , with ‖𝑇𝑎‖ > ‖𝑇𝑐𝑡‖ (52) The acceleration torque is 0 in the constant speed phase, and in this same phase the motor torque throughout acceleration is set by a value equal but symmetrical to the counter torque. 𝑇𝑐𝑡=− 𝑇𝑎 , for 𝑇𝑎𝑐=0 (53) On the other hand, for the deceleration torque 𝑇𝑑𝑒𝑠, it is exclusively responsible for the decrease in speed. The calculation is formulated in the same way as the acceleration torque, with the particularity that: 𝑇𝑑𝑒𝑠= 𝑇𝑎− 𝑇𝑐𝑡 , with ‖𝑇𝑎‖ < ‖𝑇𝑐𝑡‖ (54) One can consider flange b as the flange where the counter torque is defined, flange a as the flange where the constant velocity torque is defined, and finally the total inertia of the system, introduced in the block, which defines the acceleration torque, together with the acceleration. Flange A Flange B
71 Figure 69 - Code excerpt in the inertia component, in which the equation establishing the torque is defined Simplified Model Figure 70 - Simplified modeling of the conveyor structure The 1-dimensional modeling of the transformation from rotation to translation is achieved through a component/object characterized as an ideal gearbox (without mass and inertia considered), in which the transmission ratio is properly defined, along with the blocks defined in table 9, a block intended for rotary damping, allowing to ensure a smooth and controlled rotary motion, and finally the component intended for the mass of the package to be transported. Model with considered losses For the 2nd model, which aimed at a more in-depth study of the development of the mechanical load, it is based on the set of objects already developed, adding some more, thus expanding the total model.
72 Figure 71 - Modeling with associated losses of the conveyor belt structure This model admits not only one, but two gear reductions. The additional components focus on verified energy losses in the form of friction, damping, elasticity, and also backlash. Table 10 - Description of the components associated with energy losses in the conveyor system Component Description Component that characterizes the Columbus friction between the flange along a present support (e.g. a bearing). Here, the existing friction results from contact between the flange and a bearing surface. Component that establishes a series connection between a backlash element and a parallel connection, consisting of a spring and a damper, respectively. In this way, the elasticity, damping, and backlash effects can be extracted for the second gear reduction in the model, thereby being able to model its gearbox more accurately. The block for the rotary-linear transmission initially present in the first model of the belt is ideal, and therefore disregards possible losses right away. This block, however, models elasticity and damping present in that transmission, thus ensuring a transmission definition closer to the real one. ❶ ❷ ❸ ❹ ❺
79 thermal conduction component introduced, whose transfer is defined using the following formula. 𝑄= 𝑄 Δ𝑡= 𝑘×𝐴×Δ𝑇 𝐿 (55) Where the thermal conductance 𝑘 × 𝐴 𝐿 is parameterized in the component for the body's thermal conductivity. As can be seen from the heat dissipation process analyzed, a continuous heat transfer occurs, between the conveyor and the external environment, whenever it starts operating and its overall temperature increases. Thus, it is easy to see that a cooling is always inevitable, when the conveyor operation is interrupted and the convective heat transfer rate, implied by a heat transfer to the surrounding environment, is higher than the heat generation by the conveyor components. The development of a cooling system arises from the need to increase this heat transfer rate whenever desired and thus more consistently control the average conductive surface temperature of the conveyor. Figure 78 - Natural cooling and induced cooling
80 In order to attach the fluid section, and cause additional cooling when needed, a new portion will have to be modeled and associated with the component that portrays the thermal conductivity of the conveyor surface, thus serving as an intermediate component between the total flow coming from inside the conveyor structure and also the flow coming from the pipe through which the fluid circulates. Figure 79 - Modeling of the attached cooling system 2.2.6.2. Thermodynamic Aspects The cooling system model has a number of thermodynamic aspects that will be readily referred to. The different parameters and variables that are relevant in the two main models of the cooling system can be seen in Figure 80. The coolant circulation system is inspired by an example in the Modelica library [28].
81 Figure 80 - Different parameters and variables that have relevance in the 2 main cooling system models Partial TwoPort model in which the fluid properties are defined. These properties serve as a basis for the volumeFlow and cooling models. This partial model consists of 2 flowports in which pressure p (Pa), mass flow m_flow (kg/s), specific enthalpy h and enthalpic flow h_flow (watts) are defined. In these 2 flowports a medium parameter, with properties relative to the fluid, is further established, in which density Rho (kg/m3), specific heat capacity cp (J/(Kg.K)) at constant pressure, specific heat capacity cv (J/(Kg.K)) at constant volume, thermal conductivity lambda (W/(m.K)) and kinematic viscosity nu (m2/s) are stated. The TwoPort partial model calculates the variation between the pressures in the 2 flowports, the volumetric flow rate by dividing the mass flow rate in the first flowport by the density, the temperatures in the 2 flowports by the ratio between the specific enthalpy and the specific heat capacity at constant pressure, and finally the temperature relevant for heat exchange with the environment. Throughout this partial model a mass balance is also defined between the two ports and an energy balance where the enthalpic flow in the two flowports plus the heat exchanged with the outside/environment equals 𝑚 .𝑐𝑣 .𝑑𝑇 where 𝑚 is the mass of the •Dp - Pressure drop between the two ports •V_flow (Volume flow) = Mass Flow (port a) (kg/s) / Density (kg/m3) •T_a = H - Specific Enthalpy (port a ) / Cp – Specific Heat Capacity (J/(kg.K)) – at constant pressure •T_b = H - Specific Enthalpy (porte b ) / Cp - Specific Heat Capacity (J/(kg.K)) – at constant pressure •P - Pressure (Pa) •M_flow – Mass Flow Rate (kg/s) •H - Specific Enthalpy •H_flow – Enthalpy Flow Rate (watts) •Rho - Density (kg/m3) •Cp - Specific Heat Capacity (J/(kg.K)) – at constant pressure •Cv - Specific Heat Capacity (J/(kg.K)) – at constant volume •Lambda - Thermal Conductivity (W/(m.K)) •Nu – Kinematic Viscosity (m2/s)
82 fluid, 𝑐𝑣 is the specific heat capacity at constant volume and finally 𝑑𝑇 is the derivative of the temperature in the second flowport over time. Table 12 - Description of the components present in the cooling system Component Description Inlet and outlet are defined as two components that determine the boundary conditions of the system, where an environment with the properties of pressure and temperature are established. Component that has the ability to directly define the volumetric flow rate (m3/s). In the absence of such definition by the user, the volumetric flow rate taken into account comes from the thermodynamic equations evident in the partial model of the two ports. Allows an ideal heat exchange with the outside. 2.2.6.3. Cooling System Control In modeling the cooling system, there is a concern to optimize the cooling by controlling the volumetric flow rate. A higher value of volumetric flow results in a greater heat exchange arising between the piping and the thermal conduction surface on the conveyor, thus decreasing the temperature.
83 Figure 81 - Schematic of the control system In order to ensure this flow control, the temperature at the outlet of the thermal port (process variable) in the cooling block is continuously measured, and its value is input to a PI controller. This controller in turn manipulates over time the volumetric flow rate in the system, so as to ensure that the difference between the desired temperature at the thermal conduction surface of the conveyor and the instantaneous temperature obtained is close to absolute 0. Figure 82 - Control system modeling An additional condition is inserted throughout the system, which is related to activation of the cooling system, in the event that the respective activation boolean is true the control system Operating Condition Temperature Sensor Controller
84 operates as mentioned above, otherwise the volumetric flow rate admitted into the system is 0 and the occurrence of additional cooling is not verified. The final model of the conveyor 2, with the thermal dissipation and cooling properties of the system, can be seen in the illustration below. Figure 83 - Final model of conveyor 2 with conduction, convection and thermal cooling system 2.2.6.4. Cooling - Results • Without induced cooling It can be seen that an increase in temperature along the conveyor takes place, simultaneously with its movement. When the movement of the conveyor is finished, the peak temperature is reached, and the temperature subsequently goes into decline as a result of heat transfer to the outside.
85 Figure 84 - Temperature variation along the conveyor without cooling system activated • With induced cooling With the active cooling system, the difference in temperature variation is notorious. There is a peak increase in temperature variation of 0.116 as opposed to 1.299 when not subject to supplemental cooling. Figure 85 - Temperature variation along the conveyor without cooling system activated 2.2.7. Continuation of the Simulations Study – Conveyor Belts Some results derived from the simulations and arising from the conveyors are presented here. (°C) (°C)
86 Figure 86 - Entry conveyor belt 1 with (red) and without (blue) damper In this graph (Figure 86) it is possible to observe the input conveyor 1 that is simulated apart from the global system with 2 different configurations, in order to allow observing the effect that the insertion of a damper has on the performance of the different conveyors. It is noticeable that its insertion (function in red) allows a much smoother movement, without disturbances and/or overshooting. Figure 87 – Linear movement (meters) of entry conveyor 2 (red) and exit conveyor 1 (blue) Here it is possible to observe the movement of the package on the entry conveyor 2 and exit conveyor (package 1). With the use of the input conveyor considering losses, accelerations (m) (m)
87 and decelerations are smoother in contrast to the output motion, where losses are not considered. Figure 88 – Command (red) and Position/Movement (blue) of the entry conveyor 1, and command (green, not visible – overlaid by the instant position) and Position/Movement (yellow) of the exit conveyor 3 The differences established between the position commands and the positions actually adopted can be observed in Figure 88, for entry conveyor 1 and exit conveyor 3. While the input conveyor presents a mismatch, the output conveyor presents an almost perfect behavior, with the overlapping of the acquired position with the desired one. The mismatch verified in the input conveyor can be explained by a not very accurate tuning and by the absence of the current control, which is present in the output conveyor control. The fact that the output conveyor requires successive stops at specific operation posts and whose 4-second rest time must be obeyed with very little tolerance, the development of the control on this conveyor is more rigorous. Regarding the torques, it is important to note that acceleration will require an acceleration torque (𝑇𝑎𝑐=𝐽𝑡×𝛼). When acceleration ceases and a constant speed is reached, the torque is equal to counter-torque (difference between the two becomes zero as verified graphically), generating an equilibrium of motion. (m)
88 Figure 89 - Difference between torque and counter-torque When acceleration occurs, the resulting motor torque is greater than the counter-torque (resulting in a positive difference where acceleration is verified), and in a final phase there is a lower motor torque than the counter-torque resulting from the inertia of the system (resulting in a negative difference where deceleration is verified). Figure 90 - The torque involved in the transmission is directly proportional to the axial force required for the transport The axial force, and consequently the torque on the rotation-translation transmission block, will always adopt a value close to 0 between acceleration and deceleration, since, disregarding losses, the load will maintain a uniform rectilinear motion without any axial force acting. Therefore the torque will always tend towards a zero value, in this phase, regardless of the inertia of the total system or the damping constant considered. (N/m) Transmits position and force, the force being generated by the torque in the transmission
95 Regarding the distribution of the pulleys along the 3 interconnected phalanges, 2 divisions in the structure can be considered. In the first one, which is in the upper area of the crosssectional view image, there are only 2 pulleys, which dictate the respective positioning and orientation of the 2nd phalanx. While in the bottom section of the cross-sectional image, 3 pulleys are presented, being responsible for dictating the orientation of the 3rd phalanx. It can thus be considered that in a first phase, the position and orientation of the first two phalanges is achieved, and the orientation of the third phalange is later adjusted, according to the profiles of the preceding phalanges. Table 14 - Pulleys belonging to each of the fingers and their angular variation Section Angular Displacement 1st Pulley 2nd Pulley 3rd Pulley Exit Angle Upper α 2α ---- 3α Description Pulleys that drive the kinematic motion of the first and second phalanx, with the total absolute angular displacement being equivalent to the sum of the motion of the first and second pulleys. Lower α -2α -3α -3α Description Pulleys that determine the final orientation of the third phalanx. The absolute angular displacement of the third phalanx is dictated by the last pulley. In order to maintain the same orientation in space, the angular displacement of the joint at the start of the third flange has to be the inverse value observed for the absolute angular displacement of the second flange. With this in mind, the proportion of angular displacements is established, in accordance with the values entered in the table 14, and from there the dimensional proportions of the different pulleys are taken.
96 Table 15 - Pulleys belonging to each of the fingers and their dimensional proportion Section Diameter 1st Pulley 2nd Pulley 3rd Pulley Upper 2d d ---- Lower 2d d 2/3d 2.3.2. Modeling In order to model the gripper that is attached to the robotic arm wrist, it is necessary to develop not only a control system that includes the movement of the phalange joints, aiming at opening and closing the gripper during the Pick&Place task, but also the force control to be exerted when closing it. All this implies a sequencing of control in different stages: ➢ In an initial stage a control by feedback is elaborated with an angular setpoint as reference, trying to define in this way the closing of the gripper and the approach of the fingers to the package. ➢ In a second stage, there is a feedback control with a force setpoint as reference. Here, contact is established as well as a compression force, allowing gripping the package. Simultaneous to this phase, there is the arm that transports the package between the entry and exit conveyor. ➢ Finally, an angular reference setpoint is again set, trying to replicate the opening of the gripper and the placement of the package.
97 Figure 97 - Gripper model In Figure 97 it's possible to observe the gripper model where several modeling instances can be immediately distinguished, such as the closing, force and opening movement models, which express the signals sent to the control system and that dictate the structure's movement. Regarding the modeling of each finger, a prismatic joint is associated to the 3rd phalanx, with a spring and damper in parallel, with the purpose of simulating the contact arising from the gripper with the package to be transported. Figure 98 - Specific components used in the modeling of the finger structure Closing Movement Generation Model Opening Movement Generation Model Force Motion Generation Model
98 The prismatic joint, where the spring axis is attached, allows the movement of the spring to be perpendicular to the surface of the third phalanx, whose orientation remains constant over time. In this way, the force to be calculated using the spring and damper will also be perpendicular to the contact surface of the finger with the package. The spring and damper are actuated along the 3rd phalanx and are connected to the gripper shaft, whereby only motion in the direction of the shaft is permitted, as expressed through the use of a 2nd prismatic joint. By Newton's 3rd law, the spring applies a force equal and opposite to the force applied by the flange. In the prismatic joint, the displacement x along the axis is the displacement of any point along the 3rd flange and 𝑣=𝑑𝑥/𝑑𝑡 is its velocity. The force acting by the flange on the damped spring along the prismatic joint can be expressed as follows: 𝐹= −𝑘(𝑥−𝑥0)−𝑏𝑣 (56) Where the admitted parameters are the spring constant 𝑘, the natural length of the spring 𝑥0, and also the damping constant 𝑏. The logic expressed in the structure also presents its complexity, arising from the need to modify not only one of the three movement profiles, opening, force or closing, but also the mechanical structure itself, over time, with the assignment of the spring properties when the force profile is initiated. When the movement of the arm to the collection point is finished, a signal of the time instant in which it occurs takes on a value other than 0 and feeds into the higher hierarchy model. This in turn enters the model for generating the motion profile for the closure, with the activation of a trapezoidal profile and sending it to the control model. Figure 99 - Model for generating the motion profile for the closure
99 In the control model, 2 inputs are shown on the left, the top input defines the force profile and the bottom input defines the motion profiles (in the top hierarchy model, the closing or opening motion profiles have their input in this model determined by a switch). Figure 100 - Central gripper control model The profiles are thus generated and sent as commands to the motor, driving the motor according to the operating stage the gripper is in. Finally, the motion is transmitted to the flanges via the output flange of the model illustrated above. In modeling the final gripper structure, the gripper components are modeled as follows. Table 16 - Components used in modeling the final gripper structure Components Illustration Description Phalanx Use of bodyshapes for each of the phalanges, assuming the values of mass, center of mass, total mass, and moments of inertia. Some bodyshapes are also added to the model, for the purpose of its runnability, but without significant interference on its performance. Rotary Joint Represents the rotation axes along the structure. The first one is driven directly by the servomotor and the others by transmission through pulleys and belts. In the second joint, 2 axes are elaborated, one for the angular displacement that constitutes the kinematic movement of the second phalanx, and a second axis/rotating joint that characterizes
100 the angular movement to be transmitted to the lower pulley, and thus the desired transmission rate is ensured. Pulley It constitutes the different pulleys distributed along the structure. The modeled pulleys are considered toothed, where the efficient diameter, the number of teeth, and also the moment of inertia are parameterized. Belt Belt that transmits momentum between the pulleys. Its elasticity can be considered by defining an elastic constant. Prismatic Joint Prismatic joints that define the physical constrictions of the spring movement along the gripper movement, with the intention that the force exerted on it be exclusively vertical. Damping spring Damping spring, involved in the force required for the gripper to grip the box. The modeling of the finger structure can be seen below. For a better understanding of the modeling, it is divided into different parts. In the component highlighted in orange are the joints and phalanges, which can later be seen in the images of the simulated model. The sections highlighted in green are the upper and lower sections of the pulleys and belts responsible for driving the joints and moving the flanges. The yellow section refers to the components that subject the structure to a series of kinematic constrictions, namely prismatic joints and a damping spring that is activated, exclusively, when the force setpoint is admitted in the control, trying to replicate the contact with the packaging. The development of the modeling that targets the structure is partially inspired by a model developed in [29].
101 Figure 101 - Modeling the structure of a finger The damping spring is modeled so that the parameters 𝑘 (spring constant) and 𝑏 (damping constant) vary over time, in accordance with the inputs received in the model of the spring. Figure 102 - Modeling inputs on the springDamper component There are thus 2 inputs on the component, one for each parameter, whose values are determined by a pair of switches. Each of these switches is activated by a boolean, with a value other than 0 being admitted when the compression force is performed to grip the package, in contrast to a value of 0 when the gripper movement is to be free, either to bring the fingers together before the compression force, or to open the fingers, and allow the package to be dropped.
102 Figure 103 - Illustration of the gripper in simulation at the opening and closing moment 2.3.3. Gripper – Control It was discussed the fact that there is a control model with 3 inputs that define the commands to the motor, depending on the operating stage in which the gripper is, and that only one of them appropriates, each time, the control signal sent to the motor. The definition of the instants in which either the closing movement command, the force command or the opening movement command are defined, is guaranteed by a set of associated feedbacks in the gripper structure model and that end up acting as angular change sensors of the first joint, allowing to perceive when the different closing, force and opening movements are completed. Figure 104 - Feedbacks requeridos na modelação de forma a permitir uma correta ordem nos movimentos The different feedbacks present in the gripper structure model are assumed to be Boolean signals that admit the value of true when each of the movements is consummated. These Boolean signals are developed based on a set of logic models, whose state is defined by the angular values of the joints in the case of the closing and opening movements, and also by the force value in the damping spring component in the case of the force movement.
103 Figure 105 - Next to the modeling of the finger structure, a feedback section was developed In Figure 105, regarding the feedback component, it is possible to observe the 4 inputs in blue, which relate to the derivatives of the angular position of the 3 joints along the finger and also the derivative of the force applied when the movement to grab the box is initiated. These 4 values work as inputs to the logic models, which will be analyzed next, and at the output of each of them there are Boolean feedbacks (in pink) that portray the state of the end of each movement. Feedback Component
104 Figure 106 - The 3 models associated to the logic blocks of each movement executed by the gripper In Figure 106, it can be seen the 3 modeling inherent to the programmed logic of the 3 output feedbacks. For this purpose are used blocks referring to the mathematical expressions of “greater than (or equal to)” and “less than (or equal to)”, blocks of the logical condition and for both 2 and 3 expressions (and block for 3 expressions is created from scratch, given its absence in the library) and also a block created from scratch, which expresses a rising edge behavior in which a value of true at the output of the block is adopted when a transition false → true is verified. The state of the output also has the particularity of becoming true indefinitely after a rising edge is realized. The significance of this block is thus expressed by an interest in a single rising edge to be verified, thus presenting a neutral position with respect to later rising edges.
111 Figure 112 - Entry Conveyor 1 - Box 1 - Initial Rest • Carrying the Package along the entire length of the conveyor. Figure 113 - Entry Conveyor 1 - Box 1 - Motion State • End of transportation, with packaging allocation at the collection point. Figure 114 - Entry Conveyor 1 - Box 1 - Final Rest 3.2. Movement of the Manipulator – Pick Presentation of the set of steps for the package pickup by the manipulator, with a movement of the different axes dictated by the inverse kinematics of the pickup/ collection point. • Start of the Pick motion still with the manipulator at the initial instant, defined by a random spatial configuration.
112 Figure 115 - Pick - Conveyor 1 - Box 1 – Initial Rest • Pick motion with variation of the spatial configuration over time, through the angular variation of the different axes. Figure 116 - Pick - Conveyor 1 - Box 1 - Motion • Final configuration for collection achieved. Figure 117 - Pick - Conveyor 1 - Box 1 - Final Rest 3.3. Gripper Movement – Closing
113 Presentation of the set of steps for closing the gripper and the respective collection of the package. • Gripper still in its initial resting state, without the closure having been started yet. Figure 118 – Gripper Movement - Start Position • Closure movement initiated by the gripper Figure 119 – Gripper Movement - Closing • Force component initiated in the gripper allowing the package to be gripped. Figure 120 - Gripper – Power movement
114 3.4. Movement of the Manipulador - Place Presentation of the set of steps for the package delivery by the manipulator, with a movement of the different axes dictated by the inverse kinematics involved between the pickup/collection point and the deposition point. • Start of the Place movement with the package being grabbed and transported. In this phase the package visually disappears in the simulation, avoiding any kind of incompatibility to the understanding of the operation. Figure 121 - Place - Conveyor 1 - Box 1 - Motion • Place movement completed. Figure 122 - Place - Conveyor 1 - Box 1 –Final Rest 3.5. Gripper Movement – Opening Presentation of the set of steps for opening the gripper and the respective deliver the package. • Opening movement initialized.
115 Figure 123 – Gripper Movement - Opening • The opening movement is completed by depositing the package on the output conveyor. Figure 124 - Gripper - Finished opening and deposition of the packaging 3.6. Box Transportation – Exit Conveyor Belt Presentation of the set of steps involved in the operation of the Pick & Place system exit conveyor, responsible for transporting the package to the deposition point. • Start of exit transportation process.
116 Figure 125 – Exit Conveyor 1 - Box 1 - Initial Rest • Carrying the Package along the entire length of the conveyor. Figure 126 – Exit Conveyor 1 - Box 1 – Motion State • End of transportation, with allocation of the package off the conveyor in its entirety, allowing it to be deposited for further processing. At this stage the simulation ends. Figure 127 – Exit Conveyor 1 - Box 1 – Final Deposition With two entry conveyors and three exit conveyors, the combination of possible Pick&Place trajectories amounts to 6 distinct trajectories (which extends to more if the option with Via Points is considered). The illustrations inserted in the following table try to give a synthesized portrait of the characteristic route for each combination.
117 Table 20 - Prints illustrating the routes involved in other options provided Process Simulation Prints Pick&Place Entry Conveyor 1 Box 1 Pick&Place Entry Conveyor 2 Box 1 Pick&Place Entry Conveyor 1 Box 2 Pick&Place Entry Conveyor 2 Box 2
118 Exit Conveyor Box 2 Pick&Place Entry Conveyor 1 Box 3 Pick&Place Entry Conveyor 2 Box 3
119 Exit Conveyor Box 3 It is possible to verify in the graphs below the relative duration for each of the package transport phases. The duration of the entry conveyor phase presents a longer duration in entry conveyor 2, due to the losses considered. The Pick&Place transport duration presents a longer execution duration when both the entry conveyor 1 and the package 1 are used, due to a longer distance involved in the total route. The exit conveyor duration, on the other hand, exhibits a longer time when package 3 is transported and exit conveyor 3 is actuated, due to the stops involved. Stopping Points
120 Figure 128 - Voltages present in the signal lamps associated with each of the conveyor phases. Entry conveyor belt 1 and box 1 Figure 129 - Voltages present in the signal lamps associated with each of the conveyor phases. Entry conveyor belt 1 and box 3 Entry Conveyor Robot Exit Conveyor (V) Entry Conveyor Robot Exit Conveyor (V)
127 [16] E. B. Erlhagen, “Kinematic analysis of Industrial Serial Robots with 6 DoF,” em Case study: Yaskawa Motoman MH5, Guimarães, 2020. [17] A. A. Hayat, R. Chittawadigi, A. D. Udai e S. K. Saha, “Identification of Denavit-Hartenberg Parameters of an Industrial Robot,” em AIR '13: Proceedings of Conference on Advances In Robotics, Pune, India, 2013. [18] R. ABB AB, Product specification - IRB 140 (Revision: H), Västerås, 2004-2017. [19] J. J. Craig, Introduction to Robotics : Mechanics and Control, Pearson Prentice Hall , 2005. [20] B. Siciliano, L. Sciavicco , L. Villani e G. Oriolo , Robotics : Modelling, Planning and Control, Springer Science & Business Media, 2010. [21] “.Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.Utilities.PathPlanning6,” OpenModelica, [Online]. Available: https://build.openmodelica.org/Documentation/Modelica.Mechanics.MultiBody.Examples.Syst ems.RobotR3.Utilities.PathPlanning6.html. [Acedido em 10 April 2023]. [22] M. Otter, “.Modelica.Blocks.Sources.KinematicPTP2,” OpenModelica, [Online]. Available: https://build.openmodelica.org/Documentation/Modelica.Blocks.Sources.KinematicPTP2.html. [Acedido em 10 April 2023]. [23] H. J. Yoon, S. Y. Chung, H. S. Kang e M. J. Hwang, “Trapezoidal Motion Profile to Suppress Residual Vibration of Flexible Object Moved by Robot,” Electronics , vol. 8, 2019. [24] R. Zhao, D. Sidobre e W. He, “Online Via-Points Trajectory Generation for Reactive Manipulations,” em IEEE/ASME International Conference on Advanced Intelligent Mechatronics (AIM), Besançon, 2014. [25] E. B. Erlhagen, “Trajectory Generation in robotic manipulators,” Guimarães, 2020. [26] “IRB 140 - ABB,” ABB, [Online]. Available: https://new.abb.com/products/3HAC020536-001/irb- 140. [Acedido em 10 April 2023]. [27] M. M.Tiller, “Multi-Domain Modeling - Conveyor System,” em Introduction to Physical Modeling with Modelica, Kluwer Academic Publishers, 2001, p. 232. [28] “.Modelica.Electrical.Machines.Examples.DCMachines.DCPM_Cooling,” OpenModelica, [Online]. Available: https://build.openmodelica.org/Documentation/Modelica.Electrical.Machines.Examples.DCMa chines.DCPM_Cooling.html. [Acedido em 10 April 2023]. [29] G. Ferretti, G. Magnani, P. Rocco e L. Viganò, “Modelling and simulation of a gripper with Dymola,” Mathematical and Computer Modelling of Dynamical Systems, vol. 12, 2006.
128 APPENDIX 1 – TRAPEZOIDAL PROFILE IMPLEMENTATION Having studied the theoretical assumptions associated with the generation of trapezoidal kinematic profiles, it’s now explained their practical implementation in the model. Basically, the script regarding the trapezoidal motion profile is the same present in the trajectory model already inserted in the provided global reference model. There is however, a total lack of information regarding the explanation of the code, so throughout this chapter it will be presented. The explanation will be elaborated by presenting, in order, different excerpts or sections of the script. Figure 131 - First excerpt of the code involved in the kinematic profile generation model In an initial phase, 2 vectors are calculated for each element of each axis, one corresponding to the ratio between the angular difference and the maximum speed (thus consisting of the travel time if the maximum speed covered the entire travel time) and another concerning the ratio between the angular difference and the acceleration. From these 2 vectors, only the element with the highest value will be extracted later. Taking into account the required displacement and kinematic constraints for each joint, it is easy to deduce that the displacement times involved vary for each axis, in accordance with the corresponding constraints. However, a smooth motion is desired ensuring an equal travel time for all joints. The selection of the higher value in each of the 2 vectors mentioned, guarantees not only an equal travel time for all joints, but also ensures that this same time is sufficient for the consummation of the trapezoidal motion profile in all axes.
129 The remaining parameters present in the excerpt will be described in the following Table 21. Each of these parameters has a value of 0 if the startTime = 0 condition is verified, that is, if the instant at which it’s wanted the trajectory command to be calculated, has not yet been reached. Table 21 - Description of the parameters present in the model excerpt Variable Description sd_max Inverse of the ratio between angular amplitude and maximum speed, the value of this ratio being the maximum value acquired along the 6 axes sdd_max Inverse of the ratio between angular amplitude and maximum acceleration, the value of this ratio being the maximum value acquired along the 6 axes Ta1 Acceleration time if the maximum speed is not reached, i.e. with a triangular velocity profile Ta2 Acceleration time with maximum speed to be reached, i.e. with trapezoidal velocity profile and not triangular noWphase Boolean that when true portrays the existence of a triangular velocity profile, i.e., without constant phase Tv In the trapezoidal profile it equals the time along the section with constant velocity. In the triangular profile it equals the acceleration time Te Total travel time Ta1s Time instant at which the acceleration time (if maximum speed is not reached) ends, i.e. it is equivalent to acceleration time + startTime. Triangular profile. Ta2s Time instant at which the acceleration time (if maximum speed is reached) ends, i.e. it is equivalent to acceleration time + startTime. Trapezoidal profile. Tvs Time instant when the constant velocity ends (trapezoidal profile) or time instant when the acceleration phase ends (triangular profile, thus equaling Ta1s)
130 Tes Time instant at which the travel time ends, equals travel time + startTime sd_max2 Maximum speed reached when facing a triangular speed profile s1 Percentage of displacement occurred in the acceleration time s2 Percentage of displacement that occurred in the time at which the constant speed is terminated s3 Percentage of displacement occurred in the final time, which basically adopts the entire displacement, thus equivalent to the fixed value of 1 s Percentage of displacement occurring over time and gradually adopting over time the values of de s1, s2 and s3 Thus varies between 0 and 1 In the event that the instant relative to the calculation is reached, the following excerpt shows the calculation developed for the parameters previously described. Figure 132 - Second excerpt of the code involved in the kinematic profile generation model For a better understanding of the calculations replicated in the excerpt above, they can be found in the following table. Table 22 - Calculation of the parameters present in the model excerpt Variable Calculation sd_max 1(∆𝑥 𝑣𝑚𝑎𝑥)𝑚𝑎𝑥 ⁄ sdd_max 1(∆𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 ⁄
131 Ta1 √(∆𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 Ta2 (𝑣𝑚𝑎𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 noWphase True if (𝑣𝑚𝑎𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥> √∆𝑥 𝑎𝑚𝑎𝑥 Tv If noWphase then Tv = Ta1, otherwise Tv = (∆𝑥 𝑣𝑚𝑎𝑥)𝑚𝑎𝑥 Te If noWphase then Te = 2Ta1, otherwise Te = Tv + Ta2 Ta1s Ta2s Tvs Tes Ta1 Ta2 Tv Te sd_max2 √(∆𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 ⁄ s1 Considerations • s1 = 𝑫𝒊𝒔𝒕𝒂𝒏𝒄𝒆 𝒕𝒓𝒂𝒗𝒆𝒍𝒆𝒅 𝒂𝒍𝒐𝒏𝒈 𝒕𝒉𝒆 𝒂𝒄𝒄𝒆𝒍𝒆𝒓𝒂𝒕𝒊𝒐𝒏 𝑻𝒐𝒕𝒂𝒍 𝑫𝒊𝒔𝒕𝒂𝒏𝒄𝒆 • If it’s taken into account the trapezoidal velocity profile, the distance traveled is equivalent to the area of the triangular left half, so 𝑑=12×𝑡𝑎×𝑣𝑚𝑎𝑥 • It’s also known that 𝑣𝑚𝑎𝑥=𝑎𝑚𝑎𝑥×𝑡𝑎, so 𝑑= 12×(𝑡𝑎)2×𝑎𝑚𝑎𝑥 Thus: If noWphase then, 12×(𝑡𝑎)2×(𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥𝑚𝑎𝑥)𝑚𝑎𝑥 = 12×(𝑻𝒂𝟏)2×𝒔𝒅𝒅_𝒎𝒂𝒙 Otherwise, 12×(𝑡𝑎)2×(𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥𝑚𝑎𝑥)𝑚𝑎𝑥 = 12×(𝑻𝒂𝟐)2×𝒔𝒅𝒅_𝒎𝒂𝒙 + startTime
132 s2 • If it’s taken into account the trapezoidal velocity profile, the distance traveled is equivalent to the rectangular area in the center of the trapezoidal section, so 𝑑=𝑡𝑣𝑒𝑙.𝑐𝑜𝑛𝑠𝑡.𝑣𝑚á𝑥 If noWphase then, √(∆𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 - 12 ( 𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (𝑻𝒆−𝑻𝒂𝟏)2 (∆𝑥)𝑚𝑎𝑥 Otherwise, s1 + (𝑻𝒗−𝑻𝒂𝟐 )(𝑣𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥)𝑚𝑎𝑥 s3 Note that for the calculation of s3, this corresponds to a section of the profile that only exists for the trapezoidal profile, and defines the third profile section. s2 + ( 𝑣𝑚𝑎𝑥.(𝑡𝑑)−12 × (𝑡𝑑)2×(𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥)𝑚𝑎𝑥 ) s2 + ((𝑣𝑚𝑎𝑥 ∆𝑥)𝑚𝑎𝑥× (𝑻𝒆− 𝑻𝒗)− 12 ×(𝑻𝒆− 𝑻𝒗)2× (𝑎𝑚𝑎𝑥)𝑚𝑎𝑥 (∆𝑥𝑚𝑎𝑥)𝑚𝑎𝑥 ) s2 + (𝒔𝒅𝒎𝒂𝒙× (𝑻𝒆− 𝑻𝒗)− 12 × (𝑻𝒆− 𝑻𝒗)2× 𝒔𝒅𝒅_𝒎𝒂𝒙 ) s Using the expressions of the functions shown in Table 3 and Table 4 and dividing them by the range of angular variation: Trapezoidal Profile If 𝒕(𝑡𝑖𝑚𝑒)< Ta2s : 12×𝒕𝟐×𝒂𝒎𝒂𝒙 (∆𝑥)𝑚𝑎𝑥 = 𝒔𝒅𝒅_𝒎𝒂𝒙 𝟐×(𝑡𝑖𝑚𝑒−𝑠𝑡𝑎𝑟𝑡𝑇𝑖𝑚𝑒)2 If 𝒕(𝑡𝑖𝑚𝑒)> Ta2s e 𝒕(𝑡𝑖𝑚𝑒)< Tvs : 𝒑𝟐+𝒗𝒎𝒂𝒙×(𝒕−𝒕𝒂) (∆𝑥)𝑚𝑎𝑥 =𝒔𝟏+ 𝒔𝒅_𝒎𝒂𝒙 (𝑡𝑖𝑚𝑒−𝑻𝒂𝟐𝒔) If 𝒕(𝑡𝑖𝑚𝑒)> Tvs e 𝒕(𝑡𝑖𝑚𝑒)< Tes: 𝒑𝟑+𝟏𝟐×(𝒕−𝒕𝒂−𝒕𝒄𝒐𝒏𝒔𝒕)𝟐×𝒂𝒎𝒂𝒙 (∆𝑥)𝑚𝑎𝑥
133 = 𝒑𝟑+𝒗𝒎𝒂𝒙×(𝒕−𝒕𝒂−𝒕𝒄𝒐𝒏𝒔𝒕)−𝟏𝟐×(𝒕−𝒕𝒂−𝒕𝒄𝒐𝒏𝒔𝒕)𝟐×𝒂𝒎𝒂𝒙 (∆𝑥)𝑚𝑎𝑥 =𝒔𝟐+𝒔𝒅_𝒎𝒂𝒙(𝑡𝑖𝑚𝑒−𝑻𝒗𝒔)−𝒔𝒅𝒅_𝒎𝒂𝒙 2×(𝑡𝑖𝑚𝑒−𝑻𝒗𝒔)2 Triangular Profile If 𝒕(𝑡𝑖𝑚𝑒)< Ta1s: 12×𝒕𝟐×𝒂𝒎𝒂𝒙 (∆𝑥)𝑚𝑎𝑥 = 𝒔𝒅𝒅_𝒎𝒂𝒙 𝟐×(𝑡𝑖𝑚𝑒−𝑠𝑡𝑎𝑟𝑡𝑇𝑖𝑚𝑒)2 If 𝒕(𝑡𝑖𝑚𝑒)> Ta1s and 𝒕(𝑡𝑖𝑚𝑒)< Tes: 𝒑𝟐+𝟏𝟐×(𝒕−𝒕𝒂′)𝟐×𝒂𝒎𝒂𝒙 (∆𝑥)𝑚𝑎𝑥 = 𝒑𝟐+𝒗′𝒎𝒂𝒙×(𝒕−𝒕𝒂′ )−𝟏𝟐×(𝒕−𝒕𝒂′)𝟐× 𝒂𝒎𝒂𝒙 (∆𝑥)𝑚𝑎𝑥 =𝒔𝟏+𝒔𝒅_𝒎𝒂𝒙𝟐(𝑡𝑖𝑚𝑒−𝑻𝒂𝟏𝒔)−𝒔𝒅𝒅_𝒎𝒂𝒙 2×(𝑡𝑖𝑚𝑒−𝑻𝒂𝟏𝒔)2 Once each of the reference positions (s1, s2 and s3) of the configured space (between 0 and 1) have been formulated, they are implemented in the model. Reference positions (1,2 and 3) - Trapezoidal and triangular profile. Position functions (configured space) - Triangular profile Position functions (configured space) - Trapezoidal profile
134 Figure 133 - Third excerpt of the code involved in the kinematic profile generation model Once calculated the relative positions s according to the configured space (variation between 0 and 1), it’s now converted the path into a trajectory (definition of s as a function over time) by multiplying the values obtained by the angular variation in each of the axes. Figure 134 - Fourth excerpt of the code involved in the kinematic profile generation model Functions of position, velocity, and acceleration at different time instants
135 APPENDIX 2 – MODELING OF ROBOT CONTROL (STRUCTURE) Once a control technology like IRC5 has been analyzed, it is important to incorporate some of its inherent control principles into the modeling of the robotic arm control system to be designed. It is easy to see that modeling a system with this technology, following each of the sections and components discussed, requires a very detailed global model and a certain multidomain complexity. In order to preserve the multi-domain property that a control arm technology requires, but seeking to explore a more simplified set of models, the Modelica modeling of the robotic arm aimed at a series of modifications and simplifications, of which stand out: ➢ The AC motor will be replaced by a simplified DC motor, and with it, a downgrading of the power section, consisting of the rectifier, DC - Link and also DC-AC inverter. ➢ Current control using the SVPWM (Space Vector Pulse Width Modulation) modulation technique is replaced by a current control using operational amplifiers. ➢ A position control is added, thus allowing a simpler, but compact control. ➢ The resolver as well as the whole position calculation system present in the SMB is replaced by a position and speed sensor present in the Modelica Standard Library. ➢ Introduction of a current sensor. Figure 135 - Simplified control system schematization and easier adaptation to object-oriented language
136 APPENDIX 3 – AXIAL CONTROL AND ACTUATOR To control the motor in accordance with the instructions provided by the robot computer, a servo motor driver is modeled. The driver modeled here could also be called an amplifier in the motion control industry. It accepts a command signal for position, speed or current and adjusts the voltage and current applied to the servo motor. The driver logic includes three types of cycles or loops: current, speed and position. Each of the loops uses feedback signals to adjust the values at the output of the loop and thereby produce the desired results. Figure 136 - Modeling of the axial control, servomotor and transmission PI/PID control is a cornerstone in our automated world. From setting a desired temperature to controlling the pressure of a tool, PI/PID control is one of the most effective control methods. Throughout this chapter are examined in some detail the elements that make up the P - PI control that is built into the control of each axis of the arm. Initially, the general control theory will be covered, and will be proceeded by applying the same principles to operational amplifier circuits, which serve the same purpose, but by means of analog control. A block diagram for a general control system may be seen in Figure 137, where an input signal, 𝑒(𝑡), is sent to the controller block. Then the obtained control signal, 𝑢(𝑡), is transmitted to the plant block or physical system to be controlled. The feedback loop compares the output signal from the plant block, ℎ(𝑡), with the input signal to the control system, 𝑑(𝑡). The difference between the output signal and the input signal gives the error term, 𝑒(𝑡), which feeds back to the controller. Mathematically, the error term may be calculated as:
89 A implementação do modo de operação com via points implicou uma reestruturação na modelação da cinemática inversa assim como no perfil de movimento. No lugar de dois cálculos de cinemática inversa e dois de perfil de movimento, passa-se a ter quatro para cada uma das diferentes fases. As mudanças que este novo conceito introduz na modelação em Modelica serão prontamente explicadas. Figura 69 - Reestruturação na modelação da cinemática inversa. Modelo de Pick e do Place à esquerda, sendo que cada um é constituído, por sua vez, por 2 modelos de cinemática inversa (um de aproximação e outro de finalização do movimento). No lugar de dois modelos de cinemática inversa, em que ocorre de forma direta o cálculo dos valores angulares finais do Pick e do Place e posteriormente associados ao modelo em que o perfil de movimento da trajetória é calculada, tem-se um modelo em que apenas no seu interior um modelo de cálculo é apresentado. Assim, dentro do modelo de cinemática inversa, destinado ao Pick, é apresentado um diagrama constituído por dois modelos de cálculo, um para a cinemática inversa do ponto cartesiano final do Pick, caso o modo Via Point não esteja ativado, e outro para a cinemática inversa do ponto cartesiano de aproximação do Pick caso o modo Via Point esteja ativado. A seleção de um dos dois, surge na sequência de um booleano, cujo parâmetro se encontra diretamente igualado ao parâmetro Via Point definido no sistema global pelo utilizador. Caso o booleano se encontre verdadeiro, tem-se a transmissão do vetor dos ângulos dos seis eixos por parte do modelo que calcula a cinemática inversa do Via Point, através de um modelo switch (Figura 69). O modelo switch foi elaborado
90 de raiz com a particularidade de, face ao switch da Modelica Standard Library, se destinar a um array de 6 dimensões. Estabelecido este rearranjo, de forma a reunir uma modelação de acordo com as pretensões de trajetória, declaradas pelo utilizador, resta um reajuste no perfil de movimento, desta feita um pouco mais complexo, e ainda um modelo de cálculo adicional para a cinemática inversa relativa ao Pick e Place, caso o modo Via Point seja ativado. O modelo do perfil de movimento elaborado será de seguida explicado com atribuição numerada, por ordem de funcionamento, a cada uma das secções do diagrama presente no modelo. Figura 70 - Reestruturação do modelo de perfil de movimento ❶ - Primeiro modelo relativo ao cálculo do perfil de movimento Posição Inicial – Posição de Pick. Caso se esteja perante o modo Via Point ativo, os valores programados que dão entrada neste modelo são os valores angulares das juntas da posição inicial, assim como da posição de aproximação do Pick. Se por outro lado este modo não estiver ativo, os valores das juntas finais correspondem às variações angulares para a posição cartesiana final do Pick. ❷ - Modelo elaborado de raiz, que admite como saída um booleano positivo, de tempo indeterminado, após um falling edge ser verificado. No diagrama, este falling edge acaba por ❶ ❷ ❸ ❹ ❺
91 dizer respeito ao cessamento de movimento por parte do comando dos eixos. No modo via point, o cessamento de movimento diz respeito à aproximação à embalagem, enquanto que na ausência deste modo tem-se o movimento de Pick (do braço) completado na sua plenitude. ❸ - Conjunto constituído por um input real que determina a existência ou não do modo via point, de uma condição and que estabelece a saída de um booleano em função da existência conjunta do modo e do falling edge (ou seja, cálculo do primeiro perfil de movimento finalizado) e ainda de um switch cujo estado de saída é determinado pela condição and. Desta forma, na ausência do modo via point, quando o modelo do perfil de movimento termina o cálculo da variação de posição, velocidade e aceleração das juntas, o tempo de término sai do modelo do perfil e entra no switch no estado de falso, visto que o booleano and não se encontra verdadeiro. Se por outro lado o modo via point estiver ativo, o booleano and adota o estado verdadeiro, transmitindo esse estado para o 2º modelo do perfil de movimento, para que o cálculo no mesmo seja inicializado. Ao longo deste modo, a saída do tempo final apenas tomará lugar após o cálculo no do 2º perfil de movimento. ❹ - Da mesma forma que existe um switch responsável pela transmissão do tempo de término de cálculo de todo o movimento Pick, estabelecido quer para um movimento direto ou para um movimento com aproximação pelo meio do percurso, também existe apresentado na secção mais à direita do modelo, um conjunto de switch’s, desta feita para vetores a 6 dimensões, responsáveis por transmitir às saídas do modelo cada uma das posições, velocidades, acelerações e estados de movimento, definidos ao longo dos modelos de cálculo do perfil ao longo do tempo. O booleano and é, novamente, a condição que define qual dos comandos serão posteriormente enviados através dos switch’s. ❺ - Na eventualidade de se encontrar ativo o modo via point, um segundo perfil terá de ser calculado, representativo do movimento entre o ponto de referência de aproximação e o ponto cartesiano final. Para o efeito, dão entrada no segundo modelo de perfil o valor do instante de tempo em que este se inicia, e corresponde ao instante de término do 1ºmodelo de perfil, e ainda o booleano de inicialização, permitindo não só a ativação dos switch’s como também desencadear o cálculo necessário dentro do modelo do perfil. Para o 2º modelo do perfil de movimento, tem-se ainda os valores angulares iniciais que correspondem aos valores angulares finais do 1º modelo, sendo esta equivalência programada no texto view do programa, e os valores angulares finais são calculados com um modelo de cálculo de cinemática inversa, também este devidamente programado, em que os valores angulares são
92 calculados para o ponto cartesiano em questão, variando este em função dos tapete de entrada escolhido pelo utilizador. 8.1.2.6. Soma de Trajetórias Elaborado o cálculo individual do perfil cinemático Pick e o perfil cinemático Place, procedese a soma dos dois perfis ao longo do tempo, perfazendo um perfil cinemático único que possa ser enviado para o controlo dos diferentes eixos. Figura 71 - Modelos destinados à soma dos perfis de movimento ao longo do tempo (Pick + Place) A conceção desse perfil único é feita com o auxílio de um modelo de cálculo do vetor final, cuja saída do mesmo é o vetor do perfil. Esse modelo pode ser observado na Figura 72. Figura 72 - Modelo que define o vetor final
93 O vetor de saída equivale ao vetor de entrada proveniente do perfil Pick, até uma condição booleana ser verificada, sendo esta variável booleana ativada quando o instante de tempo no cronómetro (cujo valor é iniciado aquando do início da simulação) for superior ao instante de tempo que dá entrada no modelo. O valor do instante de tempo que dá entrada no modelo é equivalente ao tempo de término do perfil cinemático Pick. Depois da condição booleana ser verificada o vetor de saída passa a equivaler ao vetor proveniente do perfil cinemático Place. Há assim uma “troca” de perfis ao longo do tempo, de modo que à saída do bloco o vetor seja constituído pela soma de ambos. Os modelos destinados ao cálculo dos vetores finais de posição, velocidade, aceleração e movimento, apresentam todos eles a mesma estrutura. Há a exceção, no entanto, para o modelo que retrata se o robot está em movimento em cada um dos eixos ou não, em que uma pequena alteração é efetuada com o uso de vetores booleanos e não vetores reais à entrada do modelo auxiliar de cálculo. 8.1.2.7. Distribuição dos perfis finais pelos eixos As variáveis de saída dos modelos de soma dos 2 perfis, a nível de posição, velocidade, aceleração e movimento apresenta a seguinte forma: 𝑞=[𝑞1 ⋮ 𝑞7] ; 𝑞𝑑=[𝑞𝑑1 ⋮ 𝑞𝑑7]; 𝑞𝑑𝑑=[𝑞𝑑𝑑1 ⋮ 𝑞𝑑𝑑7]; 𝑚𝑜𝑣𝑖𝑛𝑔=[𝑇𝑟𝑢𝑒/𝐹𝑎𝑙𝑠𝑒 ⋮ 𝑇𝑟𝑢𝑒/𝐹𝑎𝑙𝑠𝑒] (42) Cada um destes vetores são, por fim, distribuídos em função do eixo em causa, ou seja, cada uma das variáveis 𝑞[𝑖], 𝑞𝑑[𝑖], 𝑞𝑑𝑑[𝑖] e 𝑚𝑜𝑣𝑖𝑛𝑔[𝑖] são conectadas ao bloco do eixo 𝑖 respetivo.
94 Figura 73 - Modelos responsáveis por recolherem as diferentes variáveis destinadas ao comando de cada eixo 8.1.3. Braço Robótico – Controlo Ao longo deste capítulo irá fazer-se uma introdução aos princípios de funcionamento de um braço robótico, dando maior destaque ao método de controlo dos diferentes eixos. A tecnologia IRC5, presente por exemplo nos robots da ABB, servirá assim como uma referência, permitindo uma compreensão generalizada do controlo dos braços robóticos industriais. A pertinência do estudo desta tecnologia advém do facto de ser um modelo base de controlo cujo modo de operação se aproxima com a maioria das técnicas de controlo empregadas em manipuladores industriais. Assimilados esses conceitos, uma transposição para o sistema de modelação a ser efetuado, será elaborada, com os devidos ajustes ou modificações que se acharem adequadas. O objetivo, assim, não se baseia numa replicação digital exata de um robot industrial específico, mas sim obter um entendimento sólido da forma como estes operam, genericamente, e a partir daí partir para meios de modelação que possam ser implementados, auxiliando assim no estudo do sistema. • Alimentação dos motores
95 Em simultaneidade com o controlo dos motores, através de um processo de feedback, os motores, que no caso da ABB são maioritariamente motores trifásicos síncronos, devem ser devidamente alimentados. Para o efeito, uma das topologias mais utilizadas em sistemas industriais é o conversor AC/DC/AC de frequência, também denominado de back-to-back (Babu & V., 2020). Este conversor é empregado no sistema de driver, pois não só admite energia elétrica a ser fornecida ao motor, como também a controla por comandos, numa fase final. O conversor poderá ser dividido em diferentes fases. Figura 74 - Diferentes fases do conversor Este apresenta a particularidade de transformar voltagem de corrente alternada, fornecida pela rede, em voltagem de corrente contínua, com recurso a um retificador. O retificador é assim a principal unidade de alimentação do sistema de driver. Figura 75 - DC-Link do manipulador industrial ABB IRB 140 (ABB, 1995) O DC-Link é a secção de ligação entre o retificador e o inversor, providenciando a este último, voltagem de corrente contínua. Este apresenta um conjunto de condensadores, capazes de providenciar uma voltagem DC mais estável, limitando as flutuações quando picos de corrente são atingidos. A secção inversora, devido ao facto de se possuir seis motores, um para cada eixo, é dividida em seis placas/unidades de driver. Rede Trifásica Retificador/ Conversor DC - Link Inversor
96 Figura 76 - Secção inversora connectada a um motor trifásico Cada uma das unidades driver recolhe a corrente contínua proveniente do DC-Link, fornecendo essa corrente aos transístores. Os transístores são controlados por PWM, atuando como switch, através da comunicação direta que estabelecem com o computador do robot. Dependendo da posição dos ímans no motor, os transístores receberão uma configuração onoff que determinará o movimento do motor. Três fios elétricos ligam o motor à unidade driver, ou seja, um fio para cada fase (ABB, 1995). • Resolvers Os motores associados ao braço usam resolvers (Yu, et al., 2022) de maneira a determinar a posição e velocidade de cada motor. Um resolver é um aparelho analógico que pode ser extremamente preciso na informação recolhida de feedback quanto às respetivas posições dos motores. Esta informação é transmitida sob a forma analógica ou com uma onda senoidal. Um enrolamento no rotor é aplicado ao veio do motor. Este enrolamento é energizado, ou excitado, com uma onda senoidal de 10KHz. Outros dois enrolamentos, de seno e cosseno, são aplicados na carcaça do resolver a uma distância angular exata de 90 graus entre cada um. Uma corrente é induzida nos 2 enrolamentos estáticos pelo enrolamento acoplado no rotor. Esta indução provoca uma forma de onda em cada um dos enrolamentos (ABB, 1995). Relativamente a um Encoder, um Resolver apresenta as vantagens de não necessitar de calibração, ser mais preciso e é mais fácil de trabalhar. O ângulo ou posição do enrolamento do rotor relativamente aos restantes dois enrolamentos, determinará a amplitude e polaridade dos sinais induzidos. Estes sinais por sua vez serão posteriormente transmitidos e processados pelo SMB, permitindo assim a sua interpretação. O SMB calcula, com base nos sinais, a posição exata do veio do motor, o que por sua vez indicará a posição exata do próprio robot através do cálculo por cinemática direta.
97 Figura 77 - Ilustração de motores pertencentes ao manipulador IRB 140 Cada um dos motores do braço, que por sua vez se encontram associados a cada um dos eixos, irão ter um resolver acoplado. Dentro do resolver, a bobina excitada pelo rotor irá criar um campo eletromagnético, que por sua vez excitará as dois enrolamentos restantes, gerando uma função seno e cosseno, respetivamente. Figura 78 - Constituição de um Resolver Os valores de seno e cosseno obtidos determinarão a respetiva posição angular instantânea do rotor. SMB O SMB lê os feedbacks provenientes dos resolvers e converte a voltagem analógica em sinais digitais. Depois o SMB converte os sinais digitais numa comunicação serial. A comunicação da posição em cada eixo é recolhida através dos resolvers e enviada para o computador do robot a cada 5 milissegundos, sensivelmente. Resolver Cabo de Feedback - Resolvers Pinhão de Transmissão Função Seno Função Cosseno
98 Os sinais analógicos provenientes dos resolvers poderão ser verificados através de um osciloscópio ligado ao SMB (ABB, 1995), Figura 79 - Esquema da estrutura do SMB MAIN COMPUTER A “pose” é gerada por este componente, ou seja, o movimento planeado que o robot irá executar. No entanto, no computador outras informações são inseridas, tais como o peso, comprimento e orientação da ferramenta, os efeitos da gravidade e inércia, etc. Estas informações permitem que o sistema drive admita uma performance sólida. A “pose” é gerada pelo programa presente no computador principal ou por um joystick, por exemplo, que se vem acompanhar pelo robot. O software e os parâmetros do utilizador determinarão os cálculos exatos a serem executados de forma a criar a trajetória do movimento. Esta trajetória é enviada do computador principal para o computador do robot, através de comandos de posição. ROBOT COMPUTER O computador do robot compara os comandos de posição provenientes do computador principal com os valores instantâneos calculados através do conjunto resolvers/SMB (ABB, 1995). Se uma diferença entre esses dois valores for admitida, um sinal será enviado para as unidades driver ao longo de cada eixo, segundo a técnica PWM (K. & A. , 2018). Este sistema de controlo é, portanto, um sistema de controlo de ciclo fechado.
105 Figura 88 - Amplificador diferencial implementado e nomenclatura associada Tendo por base as resistências apresentadas na Figura 88, a voltagem de saída define-se da seguinte forma: 𝑉𝑠𝑎í𝑑𝑎= 𝑉𝑠𝑎í𝑑𝑎 ′+ 𝑉𝑠𝑎í𝑑𝑎 ′′ =−𝑅2 𝑅1𝑉1 + 𝑉2𝑅2 𝑅1 = 𝑅2 𝑅1(𝑉2− 𝑉1) (46) Tendo em conta a equação apresentada e os valores atribuídos às resistências, tem-se que a voltagem de saída é igual à diferença entre os dois inputs (o ganho aqui é inexistente uma vez que o valor atribuído às resistências é igual). 8.1.5.3.2. Amplificador Operacional Inversor (proporcional) É possível recorrer ao uso de um amplificador operacional para o desenvolvimento de um controlador proporcional. O amplificador operacional, também denominado de op-amp, segue um conjunto de regras simples: as entradas do amplificador apresentam corrente elétrica praticamente inexistente e a saída é uma voltagem positiva se 𝑉+> 𝑉−, ou uma voltagem negativa caso 𝑉+< 𝑉−. Na Figura 89 é apresentado um op-amp em que uma voltagem de entrada se encontra associada à entrada negativa do amplificador, enquanto que a entrada positiva do amplificador se encontra conectada à terra. O amplificador não permite a admissão de corrente nas entradas, pelo que: 𝐼𝑅1= 𝐼𝑅2 (47)
106 E uma vez que à saída do amplificador irá ser apresentada uma qualquer voltagem necessária para permitir que a corrente das duas voltagens flua através de 𝑅2, as quedas de tensão podem ser escritas como: 0− 𝑉𝑒𝑛𝑡 𝑅2= 𝑉𝑠𝑎í𝑑𝑎−0 𝑅1 (48) Que com um pequeno rearranjo, obtem-se: 𝑉𝑠𝑎í𝑑𝑎=(𝑉𝑒𝑛𝑡)−𝑅2 𝑅1 (49) 𝑉𝑠𝑎í𝑑𝑎 𝑉𝑒𝑛𝑡 =−𝑉2 𝑉1= −𝑅2𝐼 𝑅1𝐼= −𝑅2 𝑅1 (50) Visualizando a equação 50, é percetível a capacidade de desenvolvimento de um controlador proporcional com um op-amp integrado num circuito elétrico, em que 𝑉𝑒𝑛𝑡 poderá ser considerado o erro 𝑒(𝑡), e ainda 𝑅2/ 𝑅1 = 𝐾𝑝. Este amplificador permite assim que o erro, ou diferença entre valor desejado e obtido, seja submetido a um ganho, correspondendo desta forma ao elemento proporcional de um controlador PI. Figura 89- Amplificador inversor proporcional implementado e nomenclatura associada
107 8.1.5.3.3. Amplificador Operacional Integrador Amplificador que constitui o elemento integrador do controlador PI, aqui definido sob a forma de amplificadores operacionais. A maneira como o controlo integrador é implementado é através de um op-amp como o esquematizado na figura 90. A expressão será agora projetada tendo em mente que a corrente em 𝑅 é igual à corrente em 𝐶 : 𝑉𝑒𝑛𝑡 𝑅= −𝐶.𝑑𝑉𝑠𝑎í𝑑𝑎 𝑑𝑡 (51) Isolando 𝑉𝑠𝑎í𝑑𝑎 passa-se a ter 𝑑𝑉𝑠𝑎í𝑑𝑎= −1 𝑅𝐶 .𝑉𝑒𝑛𝑡 𝑑𝑡 (52) E por fim 𝑉𝑠𝑎í𝑑𝑎= −1 𝑅𝐶 ∫𝑉𝑒𝑛𝑡(𝑡)𝑑𝑡 (53) Figura 90 - Amplificador integrador implementado e nomenclatura associada 𝐼= 𝑉1 𝑅= 𝑉𝑒𝑛𝑡 𝑅 (54)
108 8.1.5.3.4. Amplificador Operacional Somador Amplificador que tem o objetivo de “reunir” ambos os elementos do controlador através da sua soma. A soma entre o elemento proporcional e o elemento integrador é assim realizada, sendo que para o efeito, nenhum coeficiente foi adicionado a ambos os termos, ou seja, o valor das resistências associadas é assim igual. Figura 91 - Amplificador somador implementado e nomenclatura associada 𝑉𝑠𝑎í𝑑𝑎= −(𝑅 𝑅1𝑉1+ 𝑅 𝑅2𝑉2+⋯+ 𝑅 𝑅𝑛𝑉𝑛) (55) 8.1.5.3.5. Amplificador Operacional Inversor À saída do driver, surge ainda a preocupação de inverter o sinal, de negativo para positivo, de maneira a ajustar a ordem na diferença de valores realizada à entrada do driver. O presente amplificador, além do ganho que realiza, permite que essa inversão de sinal seja feita.
109 Figura 92 - Amplificador inversor implementado no fim do circuito 8.1.5.4. Atuadores – Servomotores Um motor elétrico pode ser modelado com um circuito elétrico equivalente, como representado esquematicamente na Figura 93. Neste, uma voltagem de alimentação que se mantém constante é inserida no circuito acompanhada por uma resistência, representativa da resistência interna dos fios de cobre utilizados para criar as espiras. Por outro lado, o indutor é representativo da indutância, descrevendo a tendência dos fios em oporem-se a uma mudança na corrente elétrica que flui sobre eles. Por fim, um componente onde a força eletromotriz é descrita, é inserido no circuito. Figura 93 - Modelo do Servomotor
110 Elaborada a componente elétrica, resta a componente mecânica do sistema em questão. Para o efeito, um amortecedor rotativo foi acrescentado, permitindo absorver e abrandar o movimento rotativo gerado pela força eletromotriz do motor, alterando a vibração, ruído e desgaste dos componentes, alicerçando assim um movimento mecânico mais suave. Além disso, um momento de inércia foi acrescentado permitindo representar a necessidade energética a ser fornecida pela força eletromotriz induzida, de maneira que a rotação do eixo seja constatada. Este parâmetro encontra-se diretamente relacionado com o rotor do motor elétrico. 8.1.5.5. Função Transferência – Servomotor Analisada a modelação subjacente ao motor, e percebendo a sua importância no processo envolvido nos ciclos de controlo, foi elaborada a função de transferência representativa do servomotor. Esta permite desde logo abordar a forma como o desenvolvimento do modelo é encarado, pois permite a simplificação do processo de controlo. Assim, o modelo do servomotor poderá ser substituído por um bloco que designa a função de transferência, em que todas as equações e variáveis envolvidas nos componentes do circuito elétrico e mecânico se encontram subjacentes. Para o modelo em questão, a função transferência não foi implementada, uma vez que para esta situação em específico não providenciava qualquer benefício, além de que se incompatibilizaria com o controlador de corrente, uma vez que é analógico. No entanto, o estudo foi explorado, permitindo perceber as principais equações envolvidas na conceção do servomotor e do seu funcionamento. Figura 94 - Circuito elétrico incorporado no servomotor A função transferência obtém-se através da razão entre a variável de saída a ser estudada e a variável manipulada de entrada no sistema. Deste modo, a função poderia ser definida como
111 a razão entre a velocidade à saída do eixo do rotor e a voltagem fornecida ao circuito elétrico incorporado na armadura do servomotor, passível de ser observado na Figura 94. O conjunto de equações e parâmetros, envolvidos em cada um dos subsistemas do motor poderão ser encontrados na tabela. Tabela 9 - Equações envolvidas nos diferentes domínios do servomotor Componente Variável/ Parâmetro Equilíbrio/Equação 𝑬𝒂 Sistema Elétrico 𝑬𝒂− 𝑹𝒂𝑰𝒂− 𝑳𝒂𝑺𝑰𝒂− 𝑽𝒃=𝟎 (56) 𝑬𝒂 – Voltagem fornecida 𝑹𝒂 – Resistência 𝑳𝒂 – Indutância 𝑽𝒃 – Voltagem no motor em si mesmo 𝑹𝒂 𝑳𝒂 𝑽𝒃 𝑽𝒃 Constantes do Motor 𝑻𝒎= 𝑲𝒕𝑰𝒂 → 𝑰𝒂= 𝑻𝒎 𝑲𝒕 𝑽𝒃= 𝑲𝒃𝜽𝒎 → 𝑽𝒃= 𝑲𝒃𝑺𝜽𝒎 𝑬𝒂− 𝑹𝒂(𝑻𝒎 𝑲𝒕)− 𝑳𝒂𝑺(𝑻𝒎 𝑲𝒕)− 𝑲𝒃𝑺𝜽𝒎= 𝟎 (57) 𝑻𝒎 – Torque do Motor 𝑲𝒕 – Constante de Torque 𝑲𝒃 – Constante da força eletromotriz do Motor
112 𝑱 Sistema Rotativo 𝑻𝒎−𝑫𝜽𝒎=𝑱𝜽𝒎 𝑻𝒎= 𝑱𝜽𝒎+ 𝑫𝜽𝒎 𝑻𝒎= 𝑱𝑺𝟐𝜽𝒎+ 𝑫𝑺𝜽𝒎 𝑻𝒎= 𝜽𝒎(𝑱𝑺𝟐+ 𝑫𝑺) (58) Com base nas equações presentes na tabela, mais especificamente a substituição em (56) de (57) e (58), a equação 59 poderá ser escrita. 𝑬𝒂− 𝜽𝒎(𝑱𝑺𝟐+ 𝑫𝑺)(𝑹𝒂+ 𝑳𝒂𝑺 𝑲𝒕)− 𝑲𝒃𝑺𝜽𝒎=𝟎 (59) Sabendo que 𝑺𝜽𝒎= 𝒘𝒎 e que 𝑲𝒕= 𝑲𝒃 , então a formulação final da função transferência dá-se do seguinte modo 𝒘𝒎 𝑬𝒂= 𝑲𝑺 ( 𝑱𝑳𝒂𝑺𝟑+(𝑱𝑹𝒂 + 𝑫𝑳𝒂)𝑺𝟐+(𝑫𝑹𝒂 + 𝑲𝟐)𝑺) (60) O estudo da função transferência obriga assim a um entendimento e análise minuciosa do sistema em causa, despontando uma maior clarividência para as opções de controlo e modelação envolvidas. Quando a “planta” ou objeto de controlo é conhecido com todos os seus parâmetros já bem ressalvados, e o estudo se foca mais nas variáveis de saída e não necessariamente na manipulação das mesmas, a conceção de uma modelação com uma função transferência apresenta-se como vantajosa. 8.1.5.6. Transmissão Compreendido entre o eixo à saída do motor e o eixo de cada uma das juntas, foram modelados os elementos de transmissão. O primeiro elemento caracteriza uma caixa de velocidades que possui um eixo à entrada que aciona e um eixo acionado à saída. As engrenagens envolvidas são ideais, em que a inércia, elasticidade, amortecimento e backlash são desconsiderados.
113 Figura 95 - Componentes de transmissão utilizados 8.1.5.7. Modelos Auxiliares De maneira a manter um correto funcionamento do controlo das diferentes variáveis medidas nos atuadores, é relevante que a discrepância entre a variação angular ao longo do eixo do rotor dos servomotores e a real variação angular verificada ao longo de cada eixo no braço, seja combatida. Falando especificamente da posição e velocidade angular, estas duas propriedades têm que ser devidamente ajustadas com o índice de transmissão presente nas engrenagens de transmissão, e dessa forma gerar uma diferença nos diferentes feedbacks com valores inseridos na mesma escala operacional. Figura 96 - Ajuste no índice de transmissão, proporcionando um correto funcionamento do controlo Na transmissão, os valores das propriedades em estudo, sofrem uma redução e adotam valor negativo, ou seja, o sentido de rotação é invertido à saída das engrenagens. Essa redução e inversão de sentido é equilibrada, com a multiplicação dos valores de referência de posição e velocidade pelo índice de transmissão à entrada do controlador e dos respetivos ciclos de controlo, tendo sido desenvolvido um modelo para o efeito. Associada à flange de saída do modelo de controlo axial encontra-se um componente responsável por atribuir uma posição angular inicial à flange.
114 Figura 97 - Componente initializeFlange responsável por atribuir valores de posição, velocidade e aceleração à flange de saída do eixo Este componente permite assim que a posição inicial (definida) do robô seja garantida. Associado ao eixo, existe ainda um modelo com uma resistência, simulando dessa forma uma pequena lâmpada de sinalização de movimento, que se liga quando o comando de movimento é transmitido. Desta forma, a deteção de uma avaria física do processo sai facilitada, a ausência de movimento por parte do eixo quando a luz se encontra ligada permite assim identificar uma possível anomalia no sistema físico. Figura 98 - Modelo que replica uma lâmpada de sinalização de movimento no eixo 8.1.6. Estrutura Mecânica De forma a simular apropriadamente o sistema, uma estrutura mecânica do braço robótico a executar a tarefa Pick and Place foi elaborada. A nível estrutural, o objetivo inicial seria a modelação tendo por base o perfil físico do robot ABB IRB 140 (IRB 140 - ABB, s.d.), sendo que em ambiente de simulação cada um dos elos modelados em Modelica adotaria a forma real dos diferentes componentes constituintes do IRB 140, em compatibilidade com os respetivos componentes modelados num software CAD. No entanto, o processo de compatibilidade que permitisse a transcrição dos diferentes componentes fracassou, muito por força das
121 Componente responsável pela medição do calor transferido entre o objeto de estudo e o exterior. Este encontra-se ligado à saída do modelo. Para a situação do rolamento, pode-se visualizar em baixo a diferença de temperatura 𝑑𝑇 entre este e a temperatura ambiente (que adota o valor de 15 graus). Quando ao longo do processo essa diferença de temperatura aumenta, é possível observar que esse aumento é acompanhado também pelo aumento da transferência de energia sob a forma de calor, cujos valores são obtidos pela multiplicação da capacidade calorífica do rolamento. Figura 105 - Variação da temperatura e consequente aumento da transferência de energia Numa fase inicial, quando o rolamento se encontra em repouso, a transferência de calor é nula, uma vez que o rolamento, antes de ser acionado, tem a sua temperatura igualada à temperatura ambiente. Quando o movimento de Pick é iniciado, e dessa forma o movimento do rolamento, o aumento de calor devido à fricção eleva a transferência de calor até o movimento do braço cessar e o estágio de funcionamento do gripper ser inicializado, resultando numa queda na transferência, dada a estabilização nas diferenças de temperatura. Quando o movimento Place é iniciado, tem-se um aumento da transferência novamente e o processo repete-se. De salientar o facto, que para esta situação em específico, embora o movimento de Place tenha sido de menor duração relativamente ao Pick, é neste que é atingido o pico de transferência de calor. Isto explica-se pelo facto, de que o aumento da
122 transferência aquando do Place é precedido por um estado do rolamento em que, embora parado, ainda apresenta um desvio de temperatura devido à performance no Pick. Há assim a necessidade de uma pausa considerável no funcionamento do manipulador, caso se pretenda que os valores da temperatura retomem os valores ambiente. Figura 106 - Transferência de calor (roxo) proveniente do motor (eixo 1) Relativamente à transferência térmica que advém do motor, é possível observar que a mesma se regista nos momentos de aceleração e desaceleração do motor ( a laranja). Nos momentos de aceleração o influxo de corrente e voltagem aumenta. Da mesma forma, perante os instantes de desaceleração, o valor de corrente aumente novamente, desta feita em sentido contrário. Aquando dos picos de corrente, observa-se naturalmente variações nos valores da temperatura, que por sua vez desencadeiam uma transferência de calor por convecção. As perdas pelo fenómeno de transferência de calor em cada eixo poderão ser observadas no seguinte gráfico. Figura 107 - Transferêmcias térmicas envolvidas nos 6 eixos
123 As perdas térmicas são calculadas individualmente em cada um dos eixos, no entanto de maneira a facilitar a consulta das mesmas, um modelo foi concebido com o propósito de canalizar os diferentes valores e apresentá-los num só modelo com indicadores dinâmicos. Figura 108 - Modelo que apresenta as perdas térmicas em todos os eixos 8.1.8. Continuação do Estudo de Simulações – Robot Alguns resultados derivados das simulações e decorrentes do manipulador são aqui apresentados. Relativamente à variação dos ângulos associados a cada um dos eixos do manipulador, é observado no gráfico que os eixos 1, 3 e 5 têm uma variação angular em Pick e uma variação em sentido oposto ao longo do Place. O eixo 4 não chega a ser acionado ao longo do transporte Pick&Place uma vez que as configurações requeridas para o percurso total assim não o exigem. O eixo 6 apresenta uma variação exclusiva no movimento Place e o eixo 2 possui a particularidade de ser acionado duas vezes no mesmo sentido.
124 Figura 109 - Variação angular nos 6 eixos, com perfil de velocidades trapezoidal e sem modo Via Point – Tapete de Entrada 2 e Embalagem de Transporte 1 O perfil trapezoidal de velocidades pode ser observado (110). O tempo requerido para cada perfil trapezoidal efetuado é igual, como já anteriormente referido, permitindo que cada um dos perfis se iniciem e acabem nos mesmos instantes. Este tempo de percurso requerido equivale ao tempo proveniente do eixo que demora mais tempo a completar o perfil trapezoidal tendo em consideração o deslocamento angular para esse eixo e ainda as restrições cinemáticas axiais implicadas. Apenas deste modo se garante que todos os eixos sejam capazes de completar o perfil trapezoidal no mesmo intervalo de tempo. A consequência direta desta imposição é que apenas um eixo atinge a velocidade máxima (o eixo cuja razão entre o deslocamento angular e velocidade máxima definida seja maior), sendo que os restantes eixos apresentam um pico de velocidade menor do que a velocidade máxima definida de forma indivual. Para a situação apresentada no gráfico (111) , apenas o eixo 1 adota a sua velocidade máxima definida cujo valor é 3 rad/s.
125 Figura 110 – Perfil de velocidades trapezoidais nos 6 eixos, sem modo Via Point – Tapete de Entrada 2 e Embalagem de Transporte 1 Na Figura 111 é possível observar os 3 perfis de velocidade calculados para o eixo 1 do manipulador. O perfil de velocidade trapezoidal apresentado no gráfico foi extraído dos sensores de posição presentes no eixo (ou seja, foi o perfil implementado) enquanto que os restantes 2 perfis foram calculados sem implementação através do modelo de geração de trajetória. Figura 111 - Perfil de velocidade trapezoidal, polinomial de 3ª ordem e polinomial de 5ª ordem, no eixo 1 Relativamente ao modo Via Point, é possível concluir no gráfico presente da Figura 112, que apenas 3 eixos (eixo 2, 3 e 5) estão envolvidos num movimento angular de aproximação e posteriormente um movimento angular de recolha/ deposição, garantindo um perfil
126 trapezoidal “duplo” tanto no Pick como no Place. Por outro lado, o eixo 1 e 6 têm o seu movimento angular exclusivamente envolvido na aproximação, tanto no Pick como no Place, sem a apresentação de um perfil trapezoidal “duplo”. Figura 112 - Perfil de velocidade trapezoidal nos 6 eixos, com modo Via Point Como na fase entre o ponto de aproximação e recolha/deposição apenas 3 eixos iniciam movimento angular, o eixo que atinge a sua velocidade máxima definida muda (passa-se a ter o eixo 2 em detrimento do eixo 1, atingindo uma velocidade máxima de 1.5 rad/s). Quanto ao impacto do perfil de movimento na performance, a ordem obtida do menor para o maior gasto térmico ao longo do funcionamento é Polinomial de 3ª Ordem -> Trapezoidal -> Polinomial de 5ª Ordem. O facto de o polinomial de 3ª ordem apresentar menos gasto que o trapezoidal explica-se pelo movimento mais suave do motor. Por outro lado, um maior gasto que o trapezoidal, por parte do polinomial de 5ª ordem, advém do facto de apresentar acelerações mais elevadas, o que obrigatoriamente se traduz num maior gasto elétrico e térmico. Assim, aquando da escolha de um perfil de movimento do ponto de vista de gasto térmico, a escolha deve recair sobre um perfil polinomial em que um equilíbrio entre a suavização de movimento e as acelerações seja constatado.
127 Figura 113 - Perdas térmicas (watts) ao longo do 1ºeixo, em função do perfil de movimento escolhido Na Figura 114 é possível observar o resultado obtido através do controlador de corrente, em que a vermelho é possível observar a oscilação da diferença de voltagem, entre o valor de referência e obtido no motor, que dá entrada no controlador. Por outro lado a azul é possível observar a resposta dada, ou seja, o valor de corrente enviado ao motor para que as oscilações observadas sejam colmatadas. Existem duas instâncias com 2 picos de corrente em sentido contrário, isto é explicado pelo aumento (fase de aceleração) e diminuição (fase de desaceleração) de velocidade ao longo do Pick e do Place respetivamente. Trapezoidal Polinomial de 3ª Ordem Polinomial de 5ª Ordem
128 Figura 114 - Controlo de corrente. Diferença de voltagem à entrada e comando de corrente à saída Caso se foque na diferença de valores entre os valores de corrente desejados (comando) e os medidos diretamente no motor, ao longo do controlador PI de corrente, rapidamente se apercebe que a diferença apenas se torna significativa quando a aceleração de movimento requerida varia. Figura 115 - Diferença de voltagem desejada e medida, no controlador de corrente, diretamente relacionada com a aceleração Pode-se assim concluir que, este bloco de controlo de corrente, atua fundamentalmente para controlar o movimento ao longo de estágios de aceleração não nulos. Rapidamente se percebe que isto acontece porque precedido deste bloco existem 2 blocos, cada um deles para controlo de posição e velocidade, mas nenhum deles se destina ao controlo da variação da velocidade ao longo do tempo. As diferenças de voltagem calculadas assim à entrada deste bloco surgem na sequência dessa diferença estabelecida, e um controlo por amplificadores Aceleração
129 operacionais permite que uma resposta, a nível de corrente a ser fornecida ao motor, seja executada. 8.2. Tapetes Transportadores Para os diferentes tapetes transportadores utilizados ao longo do processo, o tipo de transportador escolhido foi o transportador de cintos. Os diferentes tapetes presentes no sistema apresentam, na sua globalidade, uma estrutura de modelação bastante próxima entre si. Figura 116 - Estrutura de modelação base, em cada um dos tapetes transportadores A pertinência do desenvolvimento de modelos relativos a tapetes com tarefas divergentes, permitiu, sem perder foco na estrutura base de modelação, refinar cada uma das fases, de forma individual, sempre que necessário. As diferentes fases integradas na estrutura de modelação dos tapetes serão descritas. 8.2.1. Definição do Percurso É importante salientar que o percurso do movimento dos tapetes, ao longo do tempo, foi projetado de maneira a transportar a caixa apenas ao longo de um ciclo de funcionamento. De uma outra forma, a interpretação e modelação do funcionamento dos tapetes seria muito provavelmente diferente. É ao longo desta fase que a posição/velocidade de referência, referente ao percurso da caixa ao longo do tapete, são definidas, sendo que estas diferenciamse consoante a tarefa específica desempenhada pelo transporte. Assim, duas formas foram consideradas para a geração de trajetória: geração de uma trajetória “trapezoidal”, onde se encontram incorporados os tempos de arranque, de movimento linear uniforme e ainda paragem, condicionados pelas constrições cinemáticas desejadas; e geração de trajetória com arranque e movimento linear uniforme concebida por pulsos ou sinais step. Sendo esta última um manifesto da tentativa de replicar tapetes de deposição à saída do sistema, em que a paragem no movimento de transporte não chega a ser verificada. Definição do Percurso Controlo Motor Estrutura do Conveyor Lógica Booleana
130 Figura 117 - Tapete transportador que visa o depósito da embalagem O facto de se debruçar apenas sobre um ciclo de operação, e a necessidade de colocar a embalagem num local específico do transportador não existir, faz com que um estágio de desaceleração ou paragem seja desprezada na definição do percurso, desencadeando assim um movimento linear uniforme do tapete que se extingue, exclusivamente, aquando da interrupção da simulação. Por outro lado, na exploração dos percursos trapezoidais, dois tipos de percursos foram considerados: percurso com perfil trapezoidal único; e ainda percurso com perfil trapezoidal cíclico. Os tapetes transportadores à entrada, recolhem uma embalagem e transportam-na até ao ponto de recolha efetuado pelo braço robótico, existindo dessa forma um ponto inicial e final em que a velocidade absoluta é zero e um perfil trapezoidal de velocidade definido entre esses 2 pontos, constituído assim um perfil trapezoidal único. Em contrapartida, num dos tapetes de saída, constata-se a existência de diferentes células de operação ao longo do transporte da embalagem, resultando assim num percurso de velocidade trapezoidal cíclico, em que sucessivas paragens da embalagem são verificadas.
137 grande eficiência é introduzida, aumentando o torque de saída e diminuindo a velocidade, de saída do motor, a ser transmitida. Relativamente à inércia/momento de inércia, esta constitui-se como a medida de distribuição de massa de um corpo em torno de um eixo de rotação, que para o sistema modelado, se trata do eixo de transmissão. O momento de inércia avalia a dificuldade do tambor/cilindro inerente à transmissão rodar sobre o seu eixo, sendo que esta mesma dificuldade se relaciona de forma direta com os momentos de inércia da carga (tapete e embalagens) assim como com os momentos de inércia dos tambores de transporte. A inércia total depende assim de vários parâmetros implícitos ao tipo de tapete presente no sistema. Os principais pontos de interesse já referidos a serem tidos em consideração ao longo da modelação de um tapete transportador: engrenagens, inércia do sistema, amortecimento, transmissão que traduz a linearidade do movimento e a massa a ser transportada, servirão de base para o desenvolvimento mais simplista do modelo da estrutura do sistema. Destes, o ponto que requer uma análise mais cuidada é a inércia total do sistema, envolvida no torque requerido para que o movimento ocorra como desejado. Desta forma, as devidas formulações serão apresentadas. 8.2.3.1. Cálculo do Torque e da Inércia total do sistema Partindo por exemplo de um perfil de velocidade trapezoidal (verificado no tapete de saída 3), os diferentes torques requeridos ao longo do processo são o torque para a aceleração, para a velocidade constante e o torque de desaceleração, sendo que na maioria das aplicações, o torque máximo ocorre durante a aceleração. Devido ao facto do valor máximo se verificar maioritariamente no início, nos processos envolvidos com tapetes, um torque constante, em muitas aplicações, é fornecido ao sistema pelo motor, sendo o seu cálculo efetuado através da raiz quadrada de todos os diferentes torques requeridos ao longo do processo (a utilização do torque constante será desconsiderada na modelação). Os diferentes torques envolvidos nas diferentes fases serão apresentados. 8.2.3.1.1. Torque – Velocidade Contínua
138 Para um sistema como um tapete transportador, o torque do motor requerido durante a velocidade constante é simplesmente a força axial (𝐹𝑎) total no tapete multiplicado pelo raio da polia (𝑟𝑝). 𝑇𝑐= 𝐹𝑎. 𝑟𝑝 𝜂 (61) Em que a eficiência 𝜂 do sistema é incluída na equação do torque. Esta eficiência relaciona-se com as perdas de atrito entre o tapete e as polias/cilindros. É importante ainda notificar que foi assumido que ambas as polias, tanto a de acionamento como a acionada apresentam o mesmo diâmetro, o que acaba por ser o caso para a generalidade dos tapetes transportadores usados em sistemas de movimento linear. Os tapetes transportadores por norma não são projetados para suportar forças axiais externas, pelo que a força axial total consiste de forma exclusiva na força necessária para mover a carga, que é o peso (𝑚.𝑔) da embalagem a ser transportada assim como do tapete, multiplicada pelo coeficiente de atrito da guia que suporta a carga. 𝐹𝑎=𝑚.𝑔.𝜇 (62) 8.2.3.1.2. Torque – Aceleração A fase de aceleração do perfil de movimento é tipicamente o período em que o torque máximo requerido pelo motor é atingido, sendo este torque (𝑇𝑎) frequentemente considerado também o torque intermitente. O torque necessário durante a aceleração do tapete inclui o torque necessário a velocidade constante (𝑇𝑐) mais o torque necessário para a aceleração da carga (𝑇𝑎𝑐). 𝑇𝑎= 𝑇𝑐+ 𝑇𝑎𝑐 (63) O torque de aceleração da carga é obtido pela multiplicação da inércia total do sistema (𝐽𝑡) pela aceleração angular (𝛼). 𝑇𝑎𝑐= 𝐽𝑡 .𝛼 (64) A inércia total do sistema inclui a inércia do motor, acoplamento, polias/cilindros e ainda a carga (tapete e embalagem).
139 𝐽𝑆= 𝐽𝑃1+ 𝐽𝑃2+ 𝐽𝑇+ 𝐽𝐶+ 𝐽𝑀+ 𝐽𝐴𝑐𝑜𝑝 (65) Tabela 13 - Cálculo das diferentes inércias constituintes na inércia do sistema global Componente Cálculo da Inércia Inércia Cilindros 𝐽𝑃1= 18 .𝑚𝑃1.𝐷2 𝐽𝑃2= 18 .𝑚𝑃2.𝐷2 𝑜𝑢 𝐽𝑃1= 12 .𝑚𝑃1.𝑟2 𝐽𝑃2= 12 .𝑚𝑃2.𝑟2 Inércia Tapete 𝐽𝑇= 14 .𝑚𝑇.𝐷2 𝑜𝑢 𝐽𝑇= 𝑚𝑇.𝑟2 Inércia Caixa 𝐽𝐶= 14 .𝑚𝑐.𝐷2 𝑜𝑢 𝐽𝐶= 𝑚𝑐.𝑟2 Inércia Motor 𝐽𝑀 Inércia Acoplamento 𝐽𝐴𝑐𝑜𝑝 8.2.3.1.3. Torque – Desaceleração 𝑇𝑑= 𝑇𝑐− 𝑇𝑎𝑐𝑐 (66) O torque necessário durante a desaceleração do tapete inclui o torque necessário a velocidade constante menos o torque necessário para a aceleração da carga. Entre a inércia, que representa a resistência da carga total a ser transportada e a transmissão que converte o movimento rotativo em linear, foi modelado um amortecimento presente nos
140 rolamentos. A força ou torque de amortecimento (𝑇𝑎) é igual à multiplicação da constante de amortecimento (𝑐𝑎) e da velocidade angular relativa (𝑤𝑟). A perda de energia (𝑃) nos rolamentos é igual ao torque de amortecimento multiplicado pela velocidade relativa. 𝑇𝑎=𝑐𝑎 .𝑤𝑟 𝑃 =𝑇𝑎 .𝑤𝑟 (67) (68) 8.2.3.2. Implementação O torque do motor é responsável pelo movimento de toda a carga mecânica envolvida no tapete. Na eventualidade de se querer manter uma velocidade constante, e desprezando as perdas de atrito entre o tapete e as polias/cilindros, um aumento de carga impulsiona um “contra-torque” (torque em sentido oposto) no motor, que desencadeia a diminuição da velocidade do tapete, pelo que um aumento do torque do motor é necessário para que um contrabalanço, entre o torque que desencadeia o movimento e o torque que oferece resistência ao movimento, exista, e dessa forma impeça a diminuição de velocidade. Assim, quando o torque e o contra-torque se igualam, uma estabilização da velocidade é gerada, tornando-a constante. Quando o torque é superior ao contra-torque tem-se um aumento de velocidade e uma consequente aceleração. Por outro lado, para um contra-torque superior, uma desaceleração é verificada. Tabela 14 - Componente de transmissão e inercial usado na modelação Componente Descrição Componente envolvido no cálculo do torque a velocidade constante, com recurso à força axial requerida para o transporte da carga. O índice de transmissão sujeito à transformação de movimento rotacional em linear é tido em consideração. 𝑇𝑐= 𝐹𝑎. 𝑟𝑝
141 Componente que define a inércia total do sistema, calculando ainda o torque de aceleração da carga com base na aceleração admitida nas flanges. 𝐽𝑆= 𝐽𝑃1+ 𝐽𝑃2+ 𝐽𝑇+ 𝐽𝐶+ 𝐽𝑀+ 𝐽𝐴𝑐𝑜𝑝 𝑇𝑎𝑐= 𝐽𝑡 .𝛼 Torque de aceleração 𝑇𝑎𝑐, sendo o mesmo responsável, de forma exclusiva, pelo aumento de velocidade. Corresponde ao torque do motor ao longo da aceleração 𝑇𝑎 menos o torque de velocidade constante 𝑇𝑐 (correspondendo ao contra-torque 𝑇𝑐𝑡) exercido pela carga mecânica. 𝑇𝑎=𝑇𝑎𝑐− 𝑇𝑐 ↔ 𝑇𝑎=𝑇𝑎𝑐− 𝑇𝑐𝑡 ↔ 𝑇𝑎𝑐= 𝑇𝑎+ 𝑇𝑐𝑡 , com ‖𝑇𝑎‖ > ‖𝑇𝑐𝑡‖ (69) O torque de aceleração é 0 na fase de velocidade constante sendo, nessa mesma fase, o torque do motor ao longo da aceleração definido por um valor igual mas simétrico ao contratorque. 𝑇𝑐𝑡=− 𝑇𝑎 , para 𝑇𝑎𝑐=0 (70) Por outro lado, para o torque de desaceleração 𝑇𝑑𝑒𝑠, o mesmo é responsável, de forma exclusiva, pela diminuição de velocidade. Sendo o cálculo formulado da mesma forma que o torque de aceleração, com a particularidade de: 𝑇𝑑𝑒𝑠= 𝑇𝑎− 𝑇𝑐𝑡 , com ‖𝑇𝑎‖ < ‖𝑇𝑐𝑡‖ (71) Pode-se considerar a flange b como a flange em que o contra-torque se encontra definido, a flange a como a flange em que o torque de velocidade constante se define e por fim a inércia total do sistema, introduzida no bloco, que define o torque de aceleração, em conjunto com a aceleração. Flange A Flange B
142 Figura 126 - Excerto de código no componente da inércia, no qual a equação que estabelece o torque é definida 8.2.3.2.1. Modelo Simplificado Figura 127 - Modelação simplificada da estrutura do tapete A modelação a 1 dimensão da transformação da rotação em translação foi conseguida através de um componente/objeto caracterizado como uma caixa de engrenagens ideal (sem massa e inércia considerada), em que o índice de transmissão é devidamente definido, juntamente com os blocos definidos na tabela 14, um bloco destinado a um amortecimento rotativo, permitindo assegurar um movimento rotativo suave e controlado, e por fim o componente destinado à massa da embalagem a ser transportada. 8.2.3.2.2. Modelo com perdas consideradas Relativamente ao 2º modelo elaborado, que visou um estudo do desenvolvimento da carga mecânica mais aprofundado, apoiou-se no conjunto de objetos já desenvolvidos, acrescentando mais alguns, expandindo assim o modelo total.
143 Figura 128 - Modelação com perdas associadas da estrutura do tapete Este modelo não só admite uma, mas sim duas reduções por engrenagens. Os componentes adicionais focam-se em perdas de energia verificadas sob a forma de atrito, amortecimento, elasticidade e ainda backlash. Tabela 15 - Descrição dos componentes associados a perdas de energia no sistema do tapete Componente Descrição Componente que caracteriza a fricção de Colombo entre a flange ao longo de um suporte presente (por exemplo uma chumaceira). Nesta, a fricção existente resulta do contacto entre a flange e uma superfície do rolamento. Componente que estabelece uma ligação em série entre um elemento de backlash e uma ligação paralela, composta respetivamente por uma mola e um amortecedor. Desta forma, os efeitos por elasticidade, amortecimento e backlash conseguem ser extraídos relativamente à segunda redução por engrenagens presente no modelo, conseguindo desta forma modelar com uma exatidão maior a respetiva caixa de velocidades. ❶ ❷ ❸ ❹ ❺
144 O bloco destinado à transmissão rotativalinear inicialmente presente no 1º modelo do tapete, é ideal, pelo que despreza desde logo as eventuais perdas. Este bloco, no entanto, modela elasticidade e amortecimento presente nessa transmissão, garantindo assim uma definição de transmissão mais próxima da real. À semelhança do modelo/componente do atrito no rolamento, também este componente se foca no atrito de Colombo mas desta feita, não dependente do torque de atrito e da velocidade angular absoluta, visto tratarse de um movimento translacional, mas sim entre a força de atrito, atuada entre a superfície e a carga, e a velocidade translacional absoluta. Tem-se assim no 1º modelo, desprezando as perdas, 2 blocos que definem o torque requerido pelo motor. Estes, no entanto, poderão ser complementados com os blocos reproduzidos na tabela 15 e que retratam devidamente as perdas envolvidas. Estes blocos/modelos complementares irão assim definir as equações já abordadas. 1 - Blocos representativos da eficiência final relacionada com as perdas entre as engrenagens e o tapete e as polias/cilindros. 2 – Bloco representativo do coeficiente de atrito da guia que suporta a carga.
145 Figura 129 – Variáveis referentes à eficiência do sistema (vermelho) presentes nas equações envolvidas no torque e força axial requeridas Atendendo às diferentes modelações da estrutura dos tapetes de entrada, as mesmas encontram-se inseridas no ciclo final do modelo do tapete, precedidas pelo modelo do motor e do controlo associado. Figura 130 - Ciclo de controlo presente nos modelos dos tapetes e as opções para a estrutura do tapete transportador 8.2.4. Temporização De maneira a estabelecer o tempo de percurso da caixa ao longo do tapete, uma secção constituída por blocos lógicos é elaborada. 𝐹 𝑎 =𝑚.𝑔.𝜇 𝑇𝑐= 𝐹 𝑎 . 𝑟 𝑝 𝜂 Tapete de Entrada 1 Tapetes de Entrada 2
146 Um sensor de posição é conectado à caixa transportada pelo conveyor e um feedback é responsável pela subtração entre o valor do comprimento do percurso a ser realizado, pela caixa, e a posição da mesma ao longo do percurso, medida pelo sensor. Quando essa diferença for igual a 0, com uma tolerância de 0.01 metros, um timer é ativado. Figura 131 - Modelação da temporização do percurso no tapete O bloco tempo de percurso, recolhe o sinal booleano, que determina se o percurso foi finalizado ou não, e o sinal proveniente do timer, que funciona como um cronómetro que é inicializado quando o booleano adota o valor de 1. Recolhidos os sinais, estes são tratados pela equação presente no bloco, em que caso o booleano seja 1, o valor de saída corresponde à diferença entre o tempo de simulação menos o tempo marcado na saída do timer. O tempo de simulação e o tempo no timer são valores que crescem de forma contínua, marcando a passagem do tempo, pelo que a subtração entre ambos será um valor real, valor esse que corresponde ao instante de tempo em que a caixa atinge a posição onde será posteriormente recolhida. Figura 132 - Modelo de cálculo do tempo de percurso
153 Modelo parcial TwoPort em que propriedades do fluído se encontram definidas. Estas propriedades servem de base por sua vez para a elaboração dos modelos volumeFlow e cooling . Este modelo parcial é constituído por 2 flowports em que pressão p (Pa), vazão mássico m_flow (kg/s), entalpia específica h e fluxo entálpico h_flow (watts) se encontram definidos. Nestes 2 flowports um parâmetro medium, com propriedades relativas ao fluído, é ainda estabelecido, nos quais densidade Rho (kg/m3), capacidade calorífica específica cp (J/(Kg.K)) a pressão constante, capacidade calorífica específica cv (J/(Kg.K)) a volume constante, condutividade térmica lambda (W/(m.K)) e viscosidade cinemática nu (m2/s) são declaradas. O modelo parcial TwoPort calcula a variação entre as pressões nos 2 flowports, o vazão volumétrico através da divisão do vazão mássico no primeiro flowport pela densidade, as temperaturas nos 2 flowports através da razão entre a entalpia específica e a capacidade calorífica específica a pressão constante e por fim a temperatura relevante para a troca de calor com o ambiente. Ao longo deste modelo parcial é definido ainda um equilíbrio mássico entre os 2 ports e um equilíbrio energético em que o fluxo entálpico nos 2 flowports mais o calor trocado com o exterior/ambiente se iguala a 𝑚 .𝑐𝑣 .𝑑𝑇 sendo 𝑚 a massa do fluído, 𝑐𝑣 a capacidade calorífica específica a volume constante e por fim 𝑑𝑇 a derivada da temperatura no segundo flowport ao longo do tempo. No modelo simpleFriction tem-se uma definição do tipo de escoamento presente ao longo do tubo, com base na variação de pressão verificada. Para uma variação de pressão menor que dpLaminar , o escoamento é considerado laminar, pelo que para uma variação de pressão maior que o valor dpLaminar admite-se um escoamento turbulento. Perante um escoamento laminar, a dependência da variação de pressão no vazão volumétrico é linear, enquanto que perante um escoamento turbulento esta dependência assume-se como quadrática.
154 Figura 138 - Componente simpleFriction Há no entanto, por motivos de facilitamento de simulação, uma desconsideração das perdas por atrito, decorrentes de um fator de atrito atribuído, que em conjunto com a queda de pressão e vazão volumétrico permite o seu calculo. Deste modo, o calor trocado com o meio exterior, é exclusivamente determinado pelo balanço energético estabelecido no sistema. Tabela 17 - Descrição dos componentes presentes no sistema de arrefecimento Componente Descrição Inlet e outlet definem-se como dois componentes que determinam as condições fronteira do sistema, em que um ambiente com as propriedades de pressão e temperatura se encontram estabelecidas. Componente que tem a capacidade de definir diretamente o vazão volumétrico (m3/s). Na ausência dessa definição por parte do utilizador, o vazão volumétrico tido em consideração advém das equações termodinâmicas patentes no modelo parcial dos dois portes.
155 Admite uma troca de calor ideal com o exterior. 8.2.6.3. Controlo do Sistema de Arrefecimento Na modelação do sistema de arrefecimento, houve uma preocupação em otimizar o arrefecimento com recurso a um controlo do vazão volumétrico. Um maior valor de vazão volumétrico resulta numa maior troca de calor decorrente entre a tubagem e a superfície de condução térmica no tapete transportador, diminuindo assim a temperatura. Figura 139 - Esquematização do sistema de controlo De modo a garantir este controlo do vazão, a temperatura à saída do port térmico (variável do processo) no bloco cooling é continuamente medida, sendo o respetivo valor um valor que dá entrada num controlador PI. Este controlador por sua vez manipula ao longo do tempo o vazão volumétrico no sistema, de modo a garantir que a diferença entre a temperatura desejada na superfície de condução térmica do tapete e a temperatura instantânea obtida se aproxime do 0 absoluto.
156 Figura 140 - Modelação do sistema de controlo Uma condição adicional é inserida ao longo do sistema, que se prende com ativação do sistema de arrefecimento, na eventualidade de o respetivo booleano de ativação se encontrar verdadeiro o sistema de controlo opera conforme supramencionado, de outra forma, o vazão volumétrico admitido no sistema é 0 e a ocorrência de um arrefecimento suplementar não é verificado. O modelo final do tapete 2, com as propriedades de dissipação térmica e arrefecimento do sistema, podem ser observadas na ilustração embaixo. Condição de Funcionamento Sensor de Temperatura Controlador
157 Figura 141 - Modelo final do tapete 2 com sistema de condução, convecção e arrefecimento térmico 8.2.6.4. Arrefecimento - Resultados • Sem arrefecimento induzido É possível verificar que um aumento de temperatura ao longo do tapete se verifica, em simultaneidade com o movimento de transporte do tapete. Quando o movimento do tapete é finalizado, o pico de temperatura é atingido, sendo que a temperatura entra posteriormente em declínio, resultado da transferência de calor para o exterior. Figura 142 - Variação de temperatura no tapete sem sistema de arrefecimento ativado
158 • Com arrefecimento induzido Com o sistema de arrefecimento ativo, a diferença da variação de temperatura é notória. Registando-se um pico de aumento, de variação da temperatura, de 0.116 em detrimento de 1.299 quando não sujeito ao arrefecimento suplementar. Figura 143 - Variação da temperatura no tapete com o sistema de arrefecimento ativado 8.2.7. Continuação do Estudo de Simulações – Tapetes Alguns resultados derivados das simulações e decorrentes dos tapetes são aqui apresentados. Figura 144 - Tapete de entrada 1 com e sem amortecedor
159 Neste gráfico é possível observar o tapete de entrada 1 que foi simulado à parte do sistema global com 2 configurações distintas, de forma a permitir observar o efeito que a inserção de um amortecedor tem na performance dos diferentes tapetes. É notório que a sua inserção (função a vermelho) permite um movimento muito mais suave, sem perturbações e/ou overshooting. Figura 145 – Movimento linear de tapete de entrada 2 e tapete de saída 1 Aqui é possível observar o movimento da embalagem no tapete de entrada e no tapete de saída (embalagem 1). Com a utilização do tapete de entrada considerando as perdas, as acelerações e desacelerações são mais suaves em contraste com o movimento de saída, em que as perdas não são consideradas.
160 Figura 146 - Comando e Posição/Movimento do tapete de entrada 1, e comando e Posição/Movimento do tapete de saída 3 As diferenças estabelecidas entre os comandos de posição e as posições verdadeiramente adotadas poderão ser observadas no gráfico, para o tapete de entrada 1 e o tapete de saída 3. Enquanto que o tapete de entrada apresenta um desfasamento, o tapete de saída apresenta um comportamento quase perfeito, com a sobreposição da posição adquirida à desejada. O desfasamento verificado no tapete entrada pode ser explicado por um tunning pouco exato e pela ausência do controlo de corrente, que se encontra presente no controlo do tapete de saída. O facto de o tapete de saída obrigar a paragens sucessivas em postos de operação específicos e cujo tempo de repouso de 4 segundos deve ser obedecido com muito pouca tolerância, o desenvolvimento do controlo neste tapete foi mais rigoroso. Relativamente aos torques, é importante referir que a aceleração exigirá um torque de aceleração (𝑇𝑎𝑐= 𝐽𝑡 .𝛼). Quando a aceleração cessa e uma velocidade constante é atingida, tem-se torque igual ao contra-torque (diferença entre ambos torna-se nula como constatado graficamente), gerando um equilíbrio de movimento.
161 Figura 147 - Diferença entre o torque e o contra-torque Quando a aceleração ocorre, o torque resultante do motor é maior que o contra-torque (resultando numa diferença positiva em que aceleração é verificada) e numa fase final tem-se um torque proveniente do motor menor que o contra-torque resultante da inércia do sistema (resultando numa diferença negativa em que desaceleração é verificada). Figura 148 - Torque envolvido na transmissão diretamente proporcional à força axial requerida para o transporte A força axial, e consequentemente o torque no bloco de transmissão rotação - translação, adotará sempre um valor próximo de 0 entre a aceleração e desaceleração, uma vez que , desconsiderando as perdas, a carga manterá um movimento retilíneo uniforme sem a aplicação de qualquer força axial atuada. Portanto o torque tenderá sempre para um valor nulo, nesta fase, independentemente da inércia do sistema total ou da constante de amortecimento considerada. Transmite posição e força, sendo a força gerada pelo torque na transmissão
162 Figura 149 - A castanho o torque requerido pelo motor. A verde o contra-torque de aceleração e desaceleração em função da força axial exigida e por fim a azul o contra-torque fruto do amortecimento No gráfico, é apresentado a castanho o torque proveniente da transmissão associada ao motor. Analisando a fórmula decorrente do torque com velocidade constante, seria expectável que este torque exigido ao motor adota-se um valor próximo de 0, uma vez que não existindo aceleração nesta fase, a força decorrente da variação de velocidade também não existe, resultando num torque próximo de 0. A força axial de movimento existe, no entanto, não pela variação de velocidade mas pelo contra-torque, consequente da utilização de um amortecedor (para evitar overshooting). O contra-torque tem o seu torque diretamente proporcional à velocidade, pelo que assume, à semelhança da velocidade, um perfil próximo do trapezoidal. O torque do motor (linha castanha) adota assim um valor ao longo do tempo, decorrente da soma entre o torque para a aceleração e desaceleração da carga (linha verde) e o contra-torque (linha azul) resultante da força de atrito no amortecedor. Quando o contratorque do amortecedor supera o torque proveniente do motor, a desaceleração é verificada.
169 Tabela 20 - Polias pertencentes a cada um dos dedos e respetiva proporção dimensional Secção Diâmetro 1ª Polia 2ª Polia 3ª Polia Superior 2d d ---- Inferior 2d d 2/3d 8.3.2. Modelação De forma a modelar o gripper que se encontra acoplado ao pulso do braço robótico, foi necessário desenvolver, não só um sistema de controlo que inclua o movimento das juntas das falanges, visando a abertura e fecho do gripper aquando da tarefa de Pick and Place, como também o controlo de força a ser exercido aquando do fecho do mesmo. Tudo isto implica um sequenciamento do controlo por diferentes fases: ➢ Num estágio inicial é elaborado um controlo por feedback com um setpoint angular como referência, procurando definir desta forma o fecho do gripper e a aproximação dos dedos à embalagem. ➢ Numa segunda fase, tem-se um controlo por feedback com um setpoint de força como referência. Aqui, o contacto é estabelecido assim como uma força de compressão, permitindo pegar na embalagem. De forma simultânea a esta fase, tem-se o transporte da embalagem por parte do braço, entre o tapete de admissão e o de saída. ➢ Por fim, um setpoint de referência angular é novamente definido, tentando replicar a abertura do gripper e a colocação da embalagem.
170 Figura 155 - Modelo do gripper Na Figura 155 é possível observar o modelo do gripper onde se pode desde logo distinguir várias instâncias de modelação, como por exemplo os modelos do movimento de fecho, de força e de abertura, que expressam os sinais enviados para o sistema de controlo e que ditam o movimento da estrutura. Relativamente à modelação de cada dedo, associou-se à 3ª falange uma junta prismática, com uma mola e amortecedor em paralelo, com o intuito de simular o contacto decorrente do gripper com a embalagem a ser transportada. Figura 156 - Componentes específicos utilizados na modelação da estrutura do dedo Modelo de Geração do Movimento de Fecho Modelo de Geração do Movimento de Abertura Modelo de Geração do Movimento de Força
171 A junta prismática, onde o eixo da mola se encontra acoplado, permite que o movimento da mola seja perpendicular à superfície da terceira falange, cuja orientação se mantém constante ao longo do tempo. Desta forma, a força a ser calculada com recurso à mola e amortecedor, será também ela perpendicular à superfície de contacto do dedo com a embalagem. A mola e o amortecedor são atuados ao longo da 3ª falange e encontram-se conectados ao eixo do gripper, em que no mesmo apenas movimento no sentido do eixo é permitido, como expresso através da utilização de uma 2ª junta prismática. Pela 3ª lei de Newton, a mola aplica uma força igual e oposta à força aplicada pela falange. Na junta prismática, o deslocamento 𝑥 ao longo do eixo constitui o deslocamento de qualquer ponto ao longo da 3ª falange e 𝑣=𝑑𝑥/𝑑𝑡 é a respetiva velocidade. A força atuada pela falange na mola amortecida ao longo da junta prismática pode ser expressa da seguinte forma: 𝐹= −𝑘(𝑥−𝑥0)−𝑏𝑣 (73) Em que os parâmetros admitidos são a constante elástica da mola 𝑘, o comprimento natural da mola 𝑥0 e ainda a constante de amortecimento 𝑏. Lógica A lógica expressa na estrutura apresenta, ainda, a sua complexidade, decorrente da necessidade de modificar não só um dos três perfis de movimento, abertura, força ou fecho, como também a própria estrutura mecânica, ao logo do tempo, com a atribuição das propriedades da mola quando o perfil de força é iniciado. Quando o deslocamento do braço até ao ponto de recolha é finalizado, um sinal do instante de tempo em que o mesmo ocorre, adota um valor diferente de 0 e dá entrada no modelo de hierarquia superior. Este por sua vez entra no modelo de geração do perfil de movimento para o fecho, com a ativação de um perfil trapezoidal e envio respetivo para o modelo de controlo.
172 Figura 157 - Modelo de geração do perfil de movimento para o fecho No modelo de controlo, são apresentadas 2 entradas à esquerda, a entrada cimeira define o perfil de força e a entrada inferior define os perfis de movimento ( no modelo de hierarquia superior, os perfis de movimento de fecho ou abertura, têm a sua entrada neste modelo determinada por um switch). Figura 158 - Modelo central de controlo do gripper Os perfis são assim gerados e enviados como comandos para o motor, acionando o mesmo de acordo com a etapa de operação em que o gripper se encontra. Por fim, o movimento é transmitido às falanges através da flange de saída do modelo ilustrado em cima. Na modelação da estrutura final do gripper, os respetivos componentes foram modelados da seguinte forma. Tabela 21 - Componentes utilizados na modelação da estrutura final do gripper Componentes Ilustração Descrição
173 Falange Uso de bodyshapes para cada uma das falanges, admitindo os valores de massa, centro de massa, massa total e momentos de inércia. Alguns bodyshapes foram ainda adicionados também ao modelo, para efeitos de executabilidade do mesmo, mas sem interferência significativa na sua performance. Junta Rotativa Representa os eixos de rotação ao longo da estrutura. Sendo o primeiro acionado diretamente pelo servomotor e os restantes por transmissão através das polias e correias. Na segunda articulação, são elaborados 2 eixos, um para o deslocamento angular que constitui o movimento cinemático da segunda falange e um segundo eixo/junta rotativa que caracteriza o movimento angular a ser transmitido à polia inferior e, dessa forma, o índice de transmissão desejado é assegurado. Polia Constitui as diferentes polias distribuídas ao longo da estrutura. As polias modeladas são consideradas dentadas, onde se parametriza o diâmetro eficiente, o número de dentes e ainda o momento de inércia. Correia Correia que transmite momento entre as polias. A elasticidade da mesma poderá ser considerada com a definição de uma constante elástica.
174 Junta prismática Juntas prismáticas que definem as constrições físicas do movimento da mola ao longo do movimento do gripper, com a intenção que a força exercida na mesma seja exclusivamente na vertical. Mola c/ Amortecimento Mola amortecedora, implicada na força necessária para que o gripper agarre na embalagem. A modelação da estrutura do dedo pode ser visualizada em baixo. Para uma melhor perceção da modelação, esta encontra-se dividida em diferentes partes. Na componente realçada a laranja encontram-se as juntas e as falanges, que poderão ser posteriormente visualizadas nas imagens do modelo simulado. As secções realçadas a verde dizem respeito às secções superiores e inferiores das polias e correias responsáveis pelo acionamento juntas e movimento das falanges. A secção amarela diz respeito aos componentes que sujeitam a estrutura a uma série de constrições cinemáticas, nomeadamente juntas prismáticas e uma mola amortecedora que é ativada, exclusivamente, quando o setpoint de força é admitido no controlo, tentando replicar o contacto com a embalagem. O desenvolvimento da modelação que visa a estrutura foi parcialmente inspirada num modelo desenvolvido em (Ferretti, Magnani, Rocco, & Viganò, 2006). Figura 159 - Modelação da estrutura de um dedo
175 A mola amortecedora foi modelada de maneira que os parâmetros 𝑘 (constante elástica) e 𝑏 (constante de amortecimento) variem ao longo do tempo, em conformidade com os inputs recebidos no modelo da mesma. Figura 160 - Modelação de entradas no componente da mola amortecedora Existem assim 2 entradas no componente, uma para cada parâmetro, cujos valores são determinados por um par de switchs. Cada um desses switchs é ativado por um booleano, sendo que um valor diferente de 0 é admitido quando a força de compressão é realizada para pegar na embalagem, em contrapartida com um valor de 0 quando o movimento de gripper se quer livre, quer para aproximar os dedos antes da força de compressão, quer para abertura dos dedos, e permitir que a embalagem seja largada. Figura 161 - Ilustração do gripper em simulação no momento de abertura e no momento de fecho
176 8.3.3. Gripper – Controlo Foi abordado o facto de existir um modelo de controlo com 3 entradas que definem os comandos para o motor, dependendo da etapa de operação em que o gripper se encontra, sendo que apenas um deles se apropria, de cada vez, do sinal de controlo enviado ao motor. A definição dos instantes em que, ou o comando de movimento de fecho, ou o comando de força ou o de movimento de abertura são definidos, é garantido por um conjunto de feedbacks associados no modelo da estrutura do gripper e que acabam por atuar como sensores de variação angular da primeira junta, permitindo perceber quando os diferentes movimentos de fecho, força e abertura são completados. Figura 162 - Feedbacks requeridos na modelação de forma a permitir uma correta ordem nos movimentos Os diferentes feedbacks presentes no modelo da estrutura do gripper assumem-se como sinais booleanos que admitem o valor de verdadeiro quando cada um dos movimentos é consumado. Estes sinais booleanos foram desenvolvidos com base num conjunto de modelos lógicos, cujo estado é definido pelos valores angulares das juntas, no caso dos movimentos de fecho e abertura, e ainda pelo valor de força no componente da mola amortecedora, no caso do movimento de força.
177 Figura 163 - Junto à modelação da estrutura de um dedo, uma secção de feedback foi desenvolvida Na Figura 163, no que diz respeito ao componente de feedback, é possível observar as 4 entradas a azul, que se relacionam com as derivadas da posição angular das 3 juntas ao longo do dedo e ainda a derivada da força aplicada quando o movimento para agarrar a caixa é iniciado. Estes 4 valores funcionam como entradas nos modelos lógicos, que serão analisados de seguida, e à saída de cada um deles tem-se os feedbacks booleanos (a rosa) que retratam o estado do final de curso de cada movimento. Componente de Feedback
178 Figura 164 - As 3 modelações associadas aos blocos lógicos de cada movimento executado pelo gripper Na Figura 164, é possível observar as 3 modelações inerentes à lógica programada dos 3 feedbacks de saída. Para o efeito foram utilizados blocos referentes às expressões matemáticas de maior e menor, blocos da condição lógica “e” quer para 2 como para 3 expressões (bloco “e” para 3 expressões foi elaborado de raiz, dada a sua ausência na biblioteca) e ainda um bloco realizado de raiz, que expressa um comportamento de rising edge em um valor de verdadeiro à saída do bloco é adotado quando uma transição falso → verdadeiro é verificada. O estado da saída apresenta ainda a particularidade de se tornar verdadeiro por tempo indefinido, após um rising edge se concretizar. A significância deste bloco é expressa assim por um interesse num único rising edge a ser verificado, apresentando assim uma posição neutra para com rising edge posteriores.
185 Figura 171 - Modelo de temporização do transporte Pick&Place Além do tempo de execução Pick&Place recorrendo ao braço robótico. Existe um bloco que determina o tempo de transporte caso o modo manual seja adotado. Figura 172 - Modelo que determina o tempo do percurso manual Neste bloco, um input dá entrada no text view assumindo o valor aleatório de transporte calculado no modelo do modo manual, acompanhado por um input, visível em diagrama, correspondente ao valor de término do tapete de entrada. Uma variável y é calculada com base nos 2 valores mencionados adotando, na existência de um booleano verdadeiro para o modo manual, a soma dos 2 valores referidos e adotando o valor de 0 caso o booleano seja falso. Tempo de Percurso Automático Tempo de Percurso Manual
186 Figura 173 - Variável definida no bloco Esta variável, correspondendo ao instante de tempo em o transporte manual finaliza, é admitida, por último, à saída do bloco, apenas quando o tempo de simulação atinge esse mesmo valor. O valor proveniente do modelo de cálculo de término do transporte manual encontra-se ligado a um bloco de soma, dando entrada de forma paralela com o tempo de fim de percurso do movimento do braço (sabendo que, independentemente do modo de transporte, pelo menos um destes valores será sempre 0). O valor proveniente do bloco de soma dá entrada direta ao visualizador dinâmico de término do transporte Pick&Place. Da mesma forma, esse mesmo valor também se connecta a um bloco realizado de raiz, de forma a apresentar o valor de percurso na interface de visualização apenas quando o mesmo termina ao longo da escala de tempo, e dessa forma, tentar simular um cronómetro real, antes de dar entrada no visualizador de tempo de percurso. Neste bloco é realizada ainda a subtração do instante de término ao instante de inicialização, permitindo obter o valor do tempo de percurso. Figura 174 - Bloco de subtração programada e apresentação do valor no instante pretendido • Tapete de Saída Por fim, no mesmo molde estrutural que a temporização realizada para o modelo do manipulador, a temporização para o tapete de saída foi feita. Em que o primeiro valor real a dar entrada no modelo provém do modelo de temporização do robot, constituindo-se como o valor de término do mesmo e início do funcionamento do tapete de saída. A única diferença
187 observável neste modelo relativamente ao prévio, diz respeito ao tempo de percurso, que é calculado através da soma dos tempos de saída em cada um dos tapetes de saída (1, 2 e 3) ), dado que apenas um deles se encontra em funcionamento e o valor de saída dos tapete inativos é 0, garantindo desta forma uma correta apresentação do valor do percurso final no tapete independentemente do tipo de embalagem. Figura 175 - Modelo de temporização do tapete de saída Leds de Sinalização Os diferentes booleanos que dão saída nos 3 modelos anteriormente abordados, respetivos à temporização de cada uma das etapas de funcionamento do sistema global, entram no presente bloco, e desta forma são as variáveis de condição que permitem que, de forma exclusiva, a corrente passe por uma das três resistências presentes no circuito apresentado. O circuito é constituído por um sinal de voltagem constante e uma resistência ligada à terra, sendo que, em função do booleano ativado ao longo do tempo, a resistência sob a qual passará corrente será diferente, simulando assim 3 leds presentes, que emitem luz em instâncias de tempo diferentes dependendo da etapa de funcionamento do sistema global.
188 Figura 176 - Modelo com resistências de sinalização 8.5. Modelos – Tipos de Operação O estudo de um sistema com base na modelação orientada a objetos procura, fundamentalmente, uma análise cuidada de um sistema físico e da sua performance. No entanto, a capacidade em complementar e enquadrar essa performance, nos devidos timings e segundo uma sequência ou tipo de operação específica é, de facto, um aspeto que demonstra a complexidade que poderá ser implementada com Modelica. A capacidade de programar e estabelecer determinados parâmetros que determinam o tipo de operação a ser efetuada, é um atributo que torna o estudo do funcionamento do sistema mais completo. Com isso em mente, um conjunto de modelos foram desenvolvidos com o objetivo de dinamizar um pouco o sistema Pick&Place, introduzindo variáveis como o tipo de tapete de entrada, o tipo de tapete à saída dependente do tipo de embalagem a ser transportada, uma simulação de emergência e ainda uma simulação onde o transporte é efetuado de forma manual e, assim, procurar uma simulação com um estudo exclusivo dos tapetes.
189 Figura 177 - Modos de operação (modelos) Foram elaborados um conjunto de modelos cujos parâmetros são definidos pelo utilizador e determinam a operação a ser efetuada. Estes modelos constituem-se desta forma como modelos sobretudo de interação entre o utilizador e o sistema designado. ❶ - Um modelo alusivo ao tipo de caixa permite escolher uma de três embalagens a ser transportada, sendo que cada uma apresenta uma massa distinta. Este modelo permite determinar ainda o tapete de saída a ser acionado, pois cada um dos tapetes de saída encontra-se destinado a uma embalagem em específico, e, de forma consequente, determinar o percurso a ser efetuado pelo braço robótico, mais especificamente o trajeto Place a ser efetuado. ❷ - Neste modelo o tipo de perfil de movimento do manipulador é determinado. Cada um dos booleanos associados ao perfil requerido (trapezoidal, polinomial de 3ª ordem e polinomial de 5ª ordem) são definidos pelo utilizador. ❸ - No modelo em que a emergência é simulada, um bloco gera um valor aleatório entre 0 e 1, sendo multiplicando esse valor de seguida por um ganho associado ao tempo mínimo de ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾
190 término do sistema total, considerando todas as opções de operação e garantindo desta forma que o instante de tempo atribuído é válido ao longo de qualquer operação efetuada. Figura 178 - Modelo de Emergência ❹ - Modelo que, à semelhança do modelo 2 nas opções, determina o perfil de movimento, mas desta feita para os tapetes. ❺ - Modelo que permite que o utilizador opte, exclusivamente, pela simulação dos tapetes, não ocorrendo movimento do manipulador e projetando um valor aleatório para o tempo de transporte Pick&Place do tapete de entrada para o de saída. Há assim uma tentativa de replicação de um transporte manual, em que o estudo exclusivo dos tapetes permite uma simulação final mais rápida. Figura 179 - Modelo de transporte manual O tempo aleatório estabelecido, do transporte da embalagem do tapete de entrada para o tapete de saída, varia entre os 4 e os 6 segundos. ❻ - Modelo que define o estado adjacente ao modo Via Point, em que um ponto de aproximação é estabelecido ao longo de todo o percurso Pick e do percurso Place, evitando
191 deste modo um percurso direto entre a configuração inicial do manipulador e a configuração destinada à recolha. ❼ - Modelo que permite estabelecer qual dos dois modelos (se tapete de entrada 1 ou tapete de entrada 2) serão simulados, para o transporte da embalagem no sistema. ❽ - Modelo que define se o modo de arrefecimento será ativado, com a existência de um sistema de arrefecimento suplementar, no segundo tapete de entrada. ❾ - Na secção relativa à delineação das opções de operação, existe ainda uma opção que define, não um aspeto relativo à modelação, mas sim ao instante de término da simulação. O mesmo foi definido para o instante de tempo em que o tapete de saída termina o seu curso. Esta definição foi estabelecida tendo em conta um booleano à saída dos 3 tapetes, sendo que o booleano que determinará o fim da simulação, encontra-se diretamente dependente do tipo de caixa a ser transportada. Figura 180 - Bloco que dita o fim da simulação através de uma condição Na Figura 180 pode-se observar que a condição definida é assim a conversão de pelo menos um dos 3 booleanos para o estado de verdadeiro. 8.6. Parâmetros – Modos de Operação Para que as informações provenientes dos parâmetros definidos pelo utilizador, relativos aos modos de operação/funcionamento, sejam transmitidos aos respetivos locais em que uma condição com o respetivo parâmetro seja programada, a utilização de conectores, maioritariamente booleanos, acarretaria uma complexidade elevada a nível de diagrama. Nesse sentido, a programação da transmissão do estado destes parâmetros foi elaborada recorrendo ao Text View.
192 Apresenta-se de seguida, o conjunto de parâmetros cuja transmissão entre modelos foi programada. A programação foi elaborada no modelo do sistema global, ou seja, no modelo de hierarquia superior assim como em cada um dos submodelos envolvidos. Desta forma, o bom funcionamento de cada um dos modelos, posteriormente apresentados, está assim dependente da entrada de cada um destes parâmetros. Tabela 25 - Parâmetros definidos pelo utilizador nos modelos destinados ao Tapete de entrada Modelo Parâmetros/Input’s Tapetes de Entrada Tipo Descrição Real • Valor da massa da embalagem (associado ao tipo de embalagem selecionada) Booleano • Ocorrência de Emergência • Seleção de Tapete 1/2 • Seleção de embalagem tipo 1 • Seleção de embalagem tipo 2 • Seleção de embalagem tipo 3 • Seleção de perfil de movimento polinomial • Seleção de arrefecimento suplementar Uma vez declarados cada um destes parâmetros no modelo do tapete de entrada 1, estes são por sua vez distribuídos pelos componentes/modelos presentes no respetivo modelo. Esta distribuição dos parâmetros será brevemente analisada.
193 Valor Massa da embalagem – Parâmetro que varia em conformidade com o tipo de embalagem selecionada e cujo valor real será igualado ao parâmetro do componente representativo da massa da embalagem, acoplado junto à estrutura do tapete transportador. Figura 181 - Componente destinado ao parâmetro do valor de massa da embalagem Ocorrência de Emergência – Input que procura simular uma paragem abrupta do tapete transportador numa situação de emergência. Caso o utilizador queira simular esta situação, o estado deste Input poderá sofrer uma alteração ao longo do tempo, mais concretamente de falso para verdadeiro. Se essa mudança se verificar, a saída no modelo de emergência, que se verifica na Figura 182, adota o valor verdadeiro e o valor de voltagem fornecida ao motor passa a ser zero. Figura 182 - Modelo de emergência em que a ocorrência de emergência é parametrizada Componente cujo parâmetro massa é definido pelo utilizador Comando do Controlador Valor de voltagem Modelo de Emergência
194 Seleção de Tapete 1 – Parâmetro que define se o tapete 1 é executado ou não. Caso não seja, o estado falso do parâmetro será lido no modelo de geração do perfil de movimento do tapete, com as variáveis de cálculo, envolvidas na obtenção da posição, velocidade e aceleração, a adotarem o valor de 0. Desta forma, as variáveis de posição, velocidade e aceleração, por sua vez, apresentarão também elas o valor de 0, responsáveis assim num comando ao motor “zerado” e a não ocorrência de movimento por parte do tapete. Figura 183 - Parâmetro de seleção do tapete 1 que permite estabelecer uma condição no modelo de geração do perfil de movimento do tapete Seleção de perfil de movimento polinomial – Parâmetro que define o tipo de perfil de movimento a ser implementado no transporte da embalagem. Caso o tipo de perfil polinomial seja definido, o parâmetro adota o estado de verdadeiro e as duas variáveis de saída, correspondentes à posição e velocidade ao longo do tempo, adotarão os valores das mesmas calculadas sob o perfil polinomial. Se o parâmetro apresentar o estado falso, a posição e velocidade adotarão os valores calculados para o perfil trapezoidal. Figura 184 - Parâmetro de seleção de perfil de movimento polinomial que permite estabelecer uma condição no modelo de geração do perfil de movimento do tapete Seleção de embalagem tipo 1/2/3 – Além de acabar por definir a massa da embalagem a ser transportada, o tipo de caixa apresenta o detalhe de definir uma cor de visualização diferente
201 Figura 192 - Booleanos e modelos de cálculo associados ao Modo Via Point 8.7. Sequência – Transmissão de Variável Tempo ao longo da Simulação Para que a simulação dos diferentes modelos ocorra sob a ordem pretendida, avançou-se para a elaboração de lógica programada envolvendo ativação de booleanos e transmissão de valores da variável associada ao tempo de simulação. A explicação da ordem sobre o qual essa mesma variável é transmitida, no modelo de hierarquia superior, será aqui analisada. Figura 193 - Diferentes instâncias em que se verifica uma transmissão de variáveis (tempo) entre os diferentes modelos do sistema global Booleanos que determinam o modo Via Point, e modelos de cálculo ativados ❶ ❷ ❸ ❹
202 A transmissão da variável tempo, poderá ser desdobrada em 3 fases principais. ❶ - Quando a embalagem finaliza o seu percurso, ao longo de um dos dois tapetes, o instante de tempo em que a situação se concretiza é registado sob a forma de valor real e transmitido, através da ligação 1, ao robot. Quando o clock de simulação atinge esse valor, tem-se assim a geração do comando que irá ser transferido para os controladores dos motores de cada um dos eixos, iniciando assim a reprodução do movimento do manipulador. ❷ - Esta etapa relaciona-se com a partilha de valores que dizem respeito à variável tempo, ocorridas entre o início do movimento do robot para efetuar o pick e o final do movimento do robot para efetuar o place. Durante esta fase do processo, o gripper executa um movimento de fecho e abertura, pelo que um sincronismo, entre os movimentos do braço e os movimentos do gripper, tem que ser estabelecido. Dentro desta etapa pode-se dividir assim diferentes instâncias, que podem ser descritas do seguinte modo : • 2.1 – O deslocamento do braço até à embalagem é completado, o registo do instante de tempo é efetuado e por sua vez transmitido ao modelo do gripper para que o mesmo possa iniciar o seu fecho e agarrar na embalagem. • 2.2 – O gripper acaba de executar o seu movimento de fecho e o instante de tempo é registado e enviado ao modelo do manipulador, permitindo assim que o manipulador retome o seu movimento, desta feita para o place. • 2.3 – O movimento do place é completado, o registo do instante de tempo é realizado e, dessa forma, tem-se o início da abertura do gripper e dessa forma a deposição da embalagem no tapete de saída. Figura 194 - Informações partilhadas entre o Manipulador e o Gripper ❸ - Terminada a execução que envolve o manipulador e o gripper , resta a atuação do tapete de saída, que é iniciado no instante em que o gripper termina a sua abertura e a embalagem ❶ ❷ ❸
203 já se encontra no ponto de recolha do tapete. O instante de tempo em que o gripper termina a sua abertura é assim transmitido a um dos três tapetes de saída, permitindo ,assim, o início da execução do mesmo, quer com sinais step, quer com a geração de um perfil no comando transmitido ao motor. Os valores numéricos dos diferentes instantes de tempo analisados, foram transmitidos ao longo de um conector, contendo as variáveis associadas a cada um dos instantes temporais. O uso de um conector permite desde logo uma simplificação a nível de diagrama, evitando uma transmissão esquematizada individual. A descrição das variáveis presentes no conector que associa os diferentes modelos principais, poderão ser observadas na seguinte tabela. Figura 195 - Connector Tabela 28 - Variáveis definidas no interior do Connector Conector (variáveis) Manipulador Instante de Tempo relativo ao fim do movimento Pick Instante de tempo relativo ao fim do movimento Place Gripper Instante de tempo relativo ao fim do fecho do gripper Instante de tempo relativo ao fim da abertura do gripper ❹ - Uma última (dupla) ligação que poderá ser observada na Figura 193 relaciona-se não com a modelação no sentido físico, mas sim visual. Esta ligação permite que o instante de tempo em que o gripper finaliza o seu fecho seja associado a um componente visualizador dentro dos modelos dos tapetes e, dessa forma, interromper a visualização da embalagem no final da linha de um dos tapetes. A simulação e o transporte da embalagem tornam-se assim mais intuitivos, uma vez que a visualização das embalagens tanto no tapete de entrada como no tapete de saída são definidas de acordo uma tarefa pick&place real. A simulação em Openmodelica não apresenta qualquer tipo de engenharia física associada, pelo que a
204 visualização a nível de transporte tem que ser devidamente programada, incluindo a visualização dos componentes. 9. SIMULAÇÃO AMBIENTE FÍSICO Finalizada a modelação do sistema global (cuja arquitetura poderá ser encontra no apêndice 3), o retrato da simulação física para um ciclo de operação será apresentado, fracionado em diferentes etapas. Antes de se partir para um conjunto de passos que permite a compreensão do ambiente de simulação, a descrição com o conjunto de componentes constituintes do sistema será ilustrada. Figura 196 - Componentes modelados "animados". Representação física dos componentes na simulação. Gripper Manipulador Tapete de Entrada 1 Tapete de Entrada 2 Tapete de Saída 1 Tapete de Saída 2 Tapete de Saída 3
205 9.1. Transporte da Embalagem - Tapete de Entrada • Início do processo de transporte. Figura 197 - Tapete de Entrada 1 - Caixa 1 - Repouso Inicial • Transporte da Embalagem ao longo de toda a extensão do tapete. Figura 198 - Tapete de Entrada 1 - Caixa 1 - Estado de Movimento • Término do transporte, com alocação da embalagem no ponto de recolha. Figura 199 - Tapete de Entrada 1 - Caixa 1 - Repouso Final 9.2. Movimento do Manipulador – Pick • Início do movimento Pick ainda com o manipulador no instante inicial, definido por uma configuração espacial aleatória.
206 Figura 200 - Pick - Tapete 1 - Caixa 1 - Repouso Inicial • Movimento Pick com variação da configuração espacial ao longo do tempo, através da variação angular dos diferentes eixos. Figura 201 - Pick - Tapete 1 - Caixa 1 - Movimento • Configuração final para recolha, atingida. Figura 202 - Pick - Tapete 1 - Caixa 1 - Repouso Final 9.3. Movimento do Gripper - Fecho
207 • Gripper ainda no seu estado de repouso inicial, sem que o fecho tenha sido ainda iniciado. Figura 203 – Atuação do Gripper - Posição Inicial • Movimento de fecho iniciado pelo gripper Figura 204 - Atuação do Gripper - Fecho • Componente de força iniciada no gripper permitindo que a embalagem seja agarrada. Figura 205 - Atuação do Gripper – Movimento de Força 9.4. Movimento do Manipulador - Place
208 • Início do movimento Place com a embalagem a ser agarrada e transportada. Nesta fase tem-se, visualmente, o desaparecimento da embalagem na simulação, evitando provocar qualquer tipo de incompatibilidade à compreensão da operação. Figura 206 - Place - Tapete 1 - Caixa 1 - Movimento • Movimento de Place finalizado. Figura 207 - Place - Tapete 1 - Caixa 1 – Repouso Final 9.5. Movimento do Gripper – Abertura • Movimento de abertura inicializado. Figura 208 - Atuação do Gripper - Abertura
209 • Movimento de abertura finalizado com a deposição da embalagem no tapete de saída. Figura 209 - Atuação do Gripper - Abertura finalizada e deposição da embalagem 9.6. Transporte da Embalagem - Tapete de Saída • Início do processo de transporte de saída Figura 210 - Tapete de Saída 1 - Caixa 1 - Repouso Inicial • Transporte da Embalagem ao longo de toda a extensão do tapete Figura 211 - Tapete de Saída 1 - Caixa 1 – Estado de Movimento • Término do transporte, com alocação da embalagem fora do tapete, na sua totalidade, permitindo a sua deposição para processamento posterior. Nesta fase tem-se o fim da simulação.
210 Figura 212 - Tapete de Saída 1 - Caixa 1 – Deposição Final Com dois tapetes de entrada e três tapetes de saída, a combinação de trajetórias possíveis Pick&Place ascende a 6 trajetórias distintas (que se estende a mais se a opção com Via Points for considerada). As ilustrações inseridas na seguinte tabela procuram fazer um retrato sintetizado do percurso característico a cada combinação. Tabela 29 - Prints ilustrativos dos percursos envolvidos nas restantes opções disponibilizadas Processo Prints de Simulação Pick&Place Tapete Entrada 1 Caixa 1 Pick&Place Tapete Entrada 2 Caixa 1
217 Relativamente ao manipulador, as diferenças que saltam em evidência relativamente ao modelo de referência, retirado da biblioteca presente na linguagem, ditam fundamentalmente uma modelação mais refinada do comando do manipulador (replicando uma delineação de movimento própria do computador principal associado), permitindo um estudo mais aproximado dos percursos envolvidos em ambiente industrial, assim como o estudo de todas de variáveis implicadas no movimento. Os torques, e consequentemente o aquecimento dos motores que resultam numa dissipação térmica, apresentam picos para valores de massa da ferramenta (gripper) mais elevados, como seria expectável, e para um perfil de velocidades polinomial de 5ª ordem, explicado por variações de velocidade elevadas. Na modelação dos tapetes, foi importante fazer uma exposição das diferentes opções de modelação para uma arquitetura igual, tendo cada uma das diferenças sido implementadas de acordo com a função específica de cada tapete. A modelação das perdas envolvidas é um fator importante a ter em consideração pelo seu impacto significativo na performance e, em paralelo com as conclusões retiradas com os perfis de movimento implementados no robot, foi possível perceber que a transferência de calor, como consequência do torque total abrangido, vê os seus valores a variarem dependendo do tipo de perfil de movimento implementado, e cujos fatores determinantes envolvidos são as constrições cinemáticas definidas nos perfis assim como a amplitude de movimento total. Na modelação do gripper, os diferentes comandos a serem admitidos, em instâncias diferentes no circuito de controlo, foi sem dúvida o aspeto de maior relevância, comparativamente ao controlo do manipulador e tapetes. A modelação da estrutura mecânica de cada um dos dedos destacou-se ainda pela presença de um conjunto de restrições cinemáticas importantes para assegurar um funcionamento íntegro da recolha e deposição da embalagem. Melhorias a serem implementadas: • Maior foco nos valores envolvidos que são parametrizados ao longo do conjunto de modelos. O centro da atenção ao longo do projeto focou-se mais no desenvolvimento correto de modelos, colocando para plano secundário muitas das vezes os valores dos
218 parâmetros envolvidos. É evidente que nenhum modelo, por mais bem concebido que seja, traduzirá uma replicação aproximada de um processo real, se os parâmetros definidos e que caracterizam o sistema não estiverem bem projetados. Uma revisão assim destes valores, acompanhado por um estudo detalhado que se debruce nas limitações que estes possam oferecer assim como normalizações existentes, deverá ser efetuada. • Conexão manipulador – gripper deverá ser solucionada, permitindo perfazer um estudo mais bem enquadrado entre os dois sistemas e as implicâncias que um apresenta no outro, principalmente o peso do gripper na estrutura do manipulador. • Uma melhoria geral dos subsistemas, tendo por base a arquitetura global delineada.
219 REFERÊNCIAS BIBLIOGRÁFICAS Hayat, A. A., Chittawadigi, R., Udai, A. D., & Saha, S. K. (2013). Identification of Denavit-Hartenberg Parameters of an Industrial Robot. AIR '13: Proceedings of Conference on Advances In Robotics. Pune, India. .Modelica.Blocks.Sources.KinematicPTP2. (s.d.). Obtido de https://build.openmodelica.org/Documentation/Modelica.Blocks.Sources.KinematicPTP2.html .Modelica.Electrical.Machines.Examples.DCMachines.DCPM_Cooling. (s.d.). Obtido de https://build.openmodelica.org/Documentation/Modelica.Electrical.Machines.Examples.DCMachine s.DCPM_Cooling.html .Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.FullRobot. (s.d.). Obtido de OpenModelica Build Server: https://build.openmodelica.org/Documentation/Modelica.Mechanics.MultiBody.Examples.Systems. RobotR3.FullRobot.html .Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.Utilities.PathPlanning6. (s.d.). Obtido de https://build.openmodelica.org/Documentation/Modelica.Mechanics.MultiBody.Examples.Systems. RobotR3.Utilities.PathPlanning6.html ABB. (1995). Electrical Troubleshooting Manual - IRB6400 Industrial Robot & S4 Control System. ABB AB, R. (2004-2017). Product specification - IRB 140 (Revision: H). Västerås. Babu, B. P., & V., I. (2020). Analysis of Back To Back (BTB) Converter Control Strategies in Different Power System Applications. IOP Conference Series: Materials Science and Engineering. IOP Publishing. Banks, J. (1998). Handbook of Simulation: Principles, Methodology, Advances, Applications, and Practice. Craig, J. J. (2005). Introduction to Robotics : Mechanics and Control. Pearson Prentice Hall . Erlhagen, E. B. (2020). Kinematic analysis of Industrial Serial Robots with 6 DoF. Case study: Yaskawa Motoman MH5. Guimarães. Erlhagen, E. B. (2020). Trajectory Generation in robotic manipulators. Guimarães. Ferretti, G., Magnani, G., Rocco, P., & Viganò, L. (2006). Modelling and simulation of a gripper with Dymola. Mathematical and Computer Modelling of Dynamical Systems, 12. Fritzson, P. (2011). Introduction to Modeling and Simulation of Technical and Physical Systems with Modelica. Ibrahim, M. A., Hamoodi, A. N., & Salih , B. M. (2020). PI controller for DC motor speed realized with simulink and practical measurements. International Journal of Power Electronics and Drive System (IJPEDS), 119~126. IRB 140 - ABB. (s.d.). Obtido de https://new.abb.com/products/3HAC020536-001/irb-140
220 K. , P., & A. , M. (2018). DC Motor Speed Control Using PWM. International Journal of Innovative Science and Research Technology, 584-587. M.Tiller, M. (2001). Multi-Domain Modeling - Conveyor System . Em Introduction to Physical Modeling with Modelica (p. 232). M.Tiller, M. (2019). Modelica by Example. Maria, A. (1997). Introduction to modeling and simulation. Proceedings of the 29th conference on Winter simulation, 7-13. ModelicaShortCourse. (s.d.). Obtido de https://openmodelica.org/doc/ModelicaShortCourse/ModelicaTutorial-slides-PeterFritzson-160202- BT.pdf OpenModelica. (s.d.). Obtido de https://openmodelica.org/ Pickering, J. (2014). Analogue to Digital and Digital to Analogue Converters (ADCs and DACs): A Review Update. Proceedings of the CAS-CERN Accelerator School: Power Converters (pp. 363-377). Baden, Switzerland: CERN . Polenghi, A., Fumagalli, L., & Roda, I. (2018). Role of simulation in industrial engineering: focus on manufacturing systems. IFAC PapersOnLine, 496-500. R.K. Boel, B. D. (1999). Approaches to modelling, analysis, and control of hybrid systems. ROBERGE, J. K. (1975). OPERATIONAL AMPLIFIERS: Theory and Practice. John Wiley & Sons (Wiley). Siciliano, B., Sciavicco , L., Villani, L., & Oriolo , G. (2010). Robotics : Modelling, Planning and Control. Springer Science & Business Media. Smith, J. S. (2003). Survey on the use of simulation for manufacturing system design and operation. Journal of Manufacturing Systems, 157-171. Wang, L. (2020). Basics of PID Control. Em L. Wang, PID Control System Design and Automatic Tuning using MATLAB/Simulink (pp. 1-55). Wiley-IEEE Press. Yoon, H. J., Chung, S. Y., Kang, H. S., & Hwang, M. J. (2019). Trapezoidal Motion Profile to Suppress Residual Vibration of Flexible Object Moved by Robot . Electronics , 8. Yu, A., Wang, C., Guo, X., Li, Z., Zhang, C., & Guerrero, J. M. (2022). New Rotor Position Redundancy Decoding Method Based on Resolver Decoder. Micromachines.
221 APÊNDICE 1 - FORMALISMO GRAFCET – SISTEMA O Grafcet é uma metodologia utilizada no controlo de processos sequenciais e que permite uma discretização de um sistema em estruturas de etapas, ações e transições correlacionadas de modo que a evolução do sistema depende sempre da verdade das transições e as ações estão associadas à etapa que as ativa. O Grafcet constitui deste modo um método claro e sintetizado de definir o controlo de um sistema que se pretende automatizar. • Entradas e Saídas do Sistema É importante em qualquer sistema que se pretenda conceber, disponibilizar ao autômato associado quais as entradas e saídas do sistema. As entradas referem-se às variáveis que serão transmitidas ao controlador e mediante as quais o programa do controlador manipulará o sinal das variáveis de saída. Tabela 30 - Entradas do sistema e descrição Entradas Significado START Variável booleana, representa o botão monoestável que inicia o ciclo quando estão garantidas as condições para tal STOP Variável booleana, representa o botão monoestável que interrompe o ciclo de funcionamento quando não estão garantidas as condições para que o mesmo prossiga tp1_0 Deteção de uma caixa no início do Tapete 1 tp1_1 Deteção de uma caixa no fim do Tapete 1 tp2_0 Deteção de uma caixa no início do Tapete 2 tp2_1 Deteção de uma caixa no fim do Tapete 2 pose_0 Configuração espacial do manipulador definida como inicial Tabela 31 - Saídas do sistema e descrição Saídas Significado MT1 Acionamento do Motor associado ao movimento do Tapete 1 MT2 Acionamento do Motor associado ao movimento do Tapete 2
222 Com base na tabela 30 e tabela 31 é possível esquematizar as entradas e saídas do sistema, do modo presente na Figura 216, que permite de uma forma sucinta ter uma ideia global do controlador do funcionamento do sistema. Figura 216 - Controlador com as entradas e saídas representadas De salientar a simplicidade apresentada pelo grafcet elaborado. A sua extensão com a adição de condições adicionais foi desconsiderada, uma vez que os pressupostos em que este se baseou foram os mesmos tomados para a modelação orientada a objetos em que apenas um ciclo de operação é admitido, que ao longo do ciclo o manipulador já se encontra disposto com a uma configuração previamente estabelecida e que nenhuma caixa se encontra previamente num dos 2 tapetes (entrada e saída). Figura 217 - Grafcet do sistema global Pick&Place MT1 MT2 tp1_1 tp2_1 tp2_0 C START STOP tp1_0 pose_0
223 APÊNDICE 2 - SIMULAÇÃO DO AMBIENTE FÍSICO – MATLAB E COPPELIA A modelação e simulação orientada a objetos é precedida por um estudo cuidado do processo físico, nomeadamente o braço robótico, pela complexidade de controlo superior requerida, em comparação com os tapetes transportadores. Com esse propósito, um estudo da cinemática inversa do braço foi realizado, acompanhado pelo desenvolvimento de um script em Matlab, não só da cinemática inversa mas sim de toda a logística responsável pela implementação de trajetória. Cinemática Inversa - Matlab ➢ Definição do comprimento dos elos, com base no vetor 𝐿 e onde se incluem os valores das dimensões 𝑑1,𝑎1,𝑎2,𝑑4 e 𝑑6 implicados nos parâmetros de Denavit – Hartenberg. ➢ Declaração dos parâmetros de Denavit – Hartenberg 𝑎𝑖 , 𝛼𝑖 , 𝑑𝑖 e 𝜃𝑖 para os diferentes referenciais (𝐷𝐻_𝑎𝑙𝑝ℎ𝑎,𝐷𝐻_𝑎,𝐷𝐻_𝑡ℎ𝑒𝑡𝑎,𝐷𝐻_𝑑). Figura 218 - Função de Cinemática Inversa em Matlab - Excerto 1
224 ➢ Definição do vetor 𝑃𝑜𝑠𝑒_𝑡𝑖𝑝, em que se incorpora nos 3 valores iniciais a posição final do end-effector (𝑃06) e nos 3 valores finais os ângulos Roll, Pitch e Yaw (𝑅𝑃𝑌), sendo que os mesmos são arbitrados com valor de 0. ➢ Declaração da matriz rotação 𝑅06, com base nos valores declarados para os 3 ângulos envolvidos na orientação do end-effector (𝑅𝑃𝑌) e ainda a matriz associada ao endeffector 𝑅𝑃𝑌𝑡𝑖𝑝 que define a matriz transformada entre o referencial base e o referencial do end-effector ➢ Definição da matriz global 𝑇06, com base na matriz de rotação 𝑅06 e no vetor de posição cartesiana do end-effector (𝑃06). Figura 219 - Função de Cinemática Inversa em Matlab - Excerto 2 ➢ Cálculo da posição do pulso (𝑃05), equivalente à subtração entre a posição especificada para a ponta do end-effector (𝑃06) e a distância entre o end-effector e o pulso (junta 5) multiplicada pelo eizo 𝑧 da matriz de rotação 𝑅𝑃𝑌 (𝑅𝑃𝑌𝑡𝑖𝑝_𝑧). ➢ Definição dos valores das 2 soluções apresentadas para 𝜃1, 𝑡ℎ𝑒𝑡𝑎1_𝐿 (quando o “cotovelo” esquerdo é utilizado) e 𝑡ℎ𝑒𝑡𝑎1_𝑅 (quando o “cotovelo” direito é utilizado).
225 Figura 220 - Função de Cinemática Inversa em Matlab - Excerto 3 ➢ Cálculo do comprimento do vetor entre o ombro e o pulso 𝑟′ (𝑟3 no script), segundo a seguinte formulação 𝑟3=√𝑃25𝑥2+ 𝑃25𝑦2+ 𝑃25𝑧2. Precedido deste cálculo é apresentado o cálculo de 𝑃25 através da subtração entre o vetor entre a base e o pulso 𝑃05 e o vetor 𝑃02 definido entre a base e o segundo eixo do manipulador, sendo 𝑃25= {𝑃25𝑥,𝑃25𝑦,𝑃25𝑧} . ➢ Cálculo de 𝛽3(𝑏𝑒𝑡𝑎3) segundo a equação, precedido pelo cálculo do argumento (𝑎𝑟𝑔3) 𝐿𝐵 2+𝐿𝑐2− 𝑟′2 2 . 𝐿𝐵 . 𝐿𝐶 em que 𝐿𝐵 e 𝐿𝐶 se igualam às dimensões 𝑎2 e 𝑑4, respetivamente. ➢ Cálculo das duas soluções de 𝜃3 (𝑡ℎ𝑒𝑡𝑎3_𝐿 e 𝑡ℎ𝑒𝑡𝑎3_𝑅). A solução que perfila o cotovelo esquerdo dá-se pela equação, enquanto que a solução estabelecida pelo cotovelo direito é calculada através da seguinte fórmula. 𝜃3= 270−𝛽3
226 Figura 221 - Função de Cinemática Inversa em Matlab - Excerto 4 ➢ Cálculo de 𝑟′ projetado ao longo do plano 𝑥𝑦 (𝑟) ➢ Cálculo de 𝛼2 (𝑎𝑙𝑓𝑎2) recorrendo à cota do vetor 𝑃25 (𝑃25_𝑍) e 𝑟 ➢ Cálculo de 𝛽2(𝑏𝑒𝑡𝑎2) segundo a equação, precedido pelo cálculo do argumento (𝑎𝑟𝑔2) 𝐿𝐵 2+ 𝑟′2− 𝐿𝑐2 2 . 𝐿𝐵 .𝑟′ . ➢ Cálculo das duas soluções de 𝜃2 (𝑡ℎ𝑒𝑡𝑎2_𝐿 e 𝑡ℎ𝑒𝑡𝑎2_𝑅). A solução que perfila o cotovelo esquerdo dá-se pela equação, enquanto que a solução estabelecida pelo cotovelo direito é calculada através da seguinte fórmula. 𝜃2=90𝑜− 𝛼2+ 𝛽2 ➢ Cálculo das 3 primeiras matrizes de transformação individual 𝑇1 0, 𝑇2 1 e 𝑇3 2 (𝑇01 , 𝑇12 e 𝑇23 ). ➢ Cálculo da matriz 𝑅 36 (𝑅36), necessária para o cálculo dos 3 ângulos (𝜃4 , 𝜃5 e 𝜃6).
233 admitimos que a posição do braço já se encontre na posição inicial e a primeira trajetória entre os dois primeiros via points poderá ser iniciada, com a variável test_pegar tomando o valor de 1. Figura 230 - Integração de trajetória em Matlab para simulação em CoppeliaSim - Ciclo associado à trajetória test_pegar ❖ Criação de um ciclo while, cuja condição de entrada no ciclo apresente o valor da variável da trajetória em causa de 1, mas garantido ainda que a variável de saída do ciclo admita um valor de 0 e o stop de simulação não tenha sido premido. As funções de leitura e comunicação são novamente inseridas para que a comunicação seja estabelecida e informação recolhida de todas as vezes que ocorre uma iteração no interior deste ciclo. ❖ No início do ciclo tem-se ainda a apresentação da equação que permite incrementar o tempo, cujo valor de cada time-step de simulação é 50 ms. A variável de tempo inserida é a variável j e como se verá de seguida, as diferentes iterações de tempo ao longo do ciclo permitem a evolução do valor dos ângulos das juntas.
234 Figura 231 - Integração de trajetória em Matlab para simulação em CoppeliaSim - Iteração para a definição das restrições e dos coeficientes da juntas ❖ Na primeira iteração do ciclo, ou seja, quando a variável j admite o valor de 1, um conjunto de diferentes parâmetros, especificamente para a trajetória do ciclo são calculados. Mais concretamente, a velocidade inicial, a velocidade final, as coordenadas da posição final, orientação do manipulador e ainda o arm plane angle. Além destes, um outro parâmetro que é calculado de enorme importância, é o número de incrementos necessários para que a trajetória se complete na totalidade. De forma a estabelecer esse valor, foi definido um valor de 20°/s para a velocidade máxima de rotação das juntas, que em conjunto com um valor de 50 ms de time-steps e o valor relativo ao diferencial máximo na variação do valor das juntas, tornando assim possível o cálculo do número de time-steps requeridos para que o movimento entre as devidas posições se concretize. ❖ É definida uma matriz com o valor das juntas desejadas, de maneira a que a posição final com a orientação e arm plane angle inseridos, seja atingida. O valor das juntas foi calculado recorrendo à função da cinemática inversa. ❖ Uma vez definidos os parâmetros, o cálculo dos diferentes coeficientes relativos à equação polinomial de geração de trajetórias torna-se possível. Os 4 coeficientes para a geração de trajetória de cada junta, foram definidos recorrendo à seguinte função:
235 Figura 232 - Função para o cálculo dos coeficientes Em que, com recurso aos parâmetros de entrada, os diferentes coeficientes são calculados e colocados posteriormente na respetiva matriz. Figura 233 - Integração de trajetória em Matlab para simulação em CoppeliaSim - Cálculo dos novos valores das juntas e envio ao simulador ❖ Por fim, definidos os coeficientes, a equação polinomial de geração de trajetória tornase possível de ser elaborada para cada uma das juntas, sendo que a variável é o tempo, ou seja, a variável j, e novos valores são obtidos sempre que uma nova iteração é efetuada incrementando o valor de j .Para o cálculo dos novos valores das juntas foi utilizada então uma função onde, recorrendo aos coeficientes característicos de cada junta calculados anteriormente, os novos valores das juntas poderão ser obtidos. A função poderá ser visualizada de seguida: Figura 234 - Função definindo a equação polinomial de geração de trajetória
236 ❖ O ciclo acaba com os novos valores de juntas a serem enviados para o Simulador, sendo de seguida iniciado novamente o ciclo com um valor incrementado de j. Quando, por fim, na última iteração, os valores lidos se igualam aos valores previamente calculados para a posição desejada, recorrendo à função da cinemática inversa, um novo valor de 1 é atribuído à variável associada relativa à trajetória seguinte a ser realizada, permitindo assim o avanço do programa para um novo ciclo while, em que todos os aspetos de código abordados até agora ao longo deste ciclo se repetem. É importante mencionar ainda, que devido a incertezas de cálculo, o ciclo acaba de ser finalizado quando a posição desejada é atingida dentro de uma determinada tolerância atribuída. Os ciclos while correspondentes à trajetória Grasp e ainda trajetória Transport and Release utilizados ao longo do código dos diferentes modos de operação, obedecem à mesma formulação de código, modificando apenas as restrições de trajetória utilizadas (posições inicial e final assim como velocidades inicial e final) assim como as designações das matrizes utilizadas. Interface Gráfica de Controlo Recorrendo à ferramenta App Designer do MATLAB, foi possível conceber uma interface a ser disponibilizada ao utilizador, garantido não só a capacidade deste em escolher se pretende que o braço execute o seu funcionamento normal ou não, assim como executar funções complementares. Desta forma, pode-se distinguir 2 áreas distintas ao longo da elaboração da interface gráfica: Cálculo da Cinemática Inversa - O utilizador introduz os valores da pose, obtendo assim as coordenadas das juntas. Tipo de Funcionamento Desejado - Permite ao utilizador aceder à escolha do tipo de funcionamento que deseja. Foram definidas as seguintes opções: • Modo Automático: Equivalente ao comportamento Pick&Place ao longo de um ciclo de operação. As diferentes etapas envolvidas na trajetória são adotadas de forma automática.
237 Figura 235 - Pick&Place - Modo automático • Modo Manual: Equivalente ao comportamento Pick&Place ao longo de um ciclo de operação, no entanto o utilizador dita através da interface os momentos em que as diferentes etapas de trajetórias são calculadas e, de forma consequente, implementadas. Tabela 32 - Ilustração das diferentes etapas presentes no modo manual Modo Manual Centrar Aproximar Agarrar Transporte Como anteriormente mencioado, através da App Designer do MATLAB, um GUI ( Graphical User Interface) foi criado. O mesmo poderá ser visualizado na Figura 236.
238 Figura 236 - Interface de Controlo: ABB IRB 140 ➢ Callbacks De forma a garantir que as funções necessárias para a apresentação dos valores ou simulações desejadas sejam processadas nos momentos requeridos, é necessário “chamá-las” sempre que a condição estabelecida seja atuada. Para o nosso caso, as condições definidas foram os botões de cálculo que permitem calcular os valores da cinemática e ainda o “Discrete Knob” por forma a estabelecer o funcionamento desejado e assim iniciar a reprodução da respetiva simulação e/ou função associada. Figura 237 - Definição de um Callback para a Cinemática Direta
239 De maneira a conseguir estabelecer essa ligação entre os componentes atuados na interface e as funções associadas, é necessário configurar o componente através de um Callback. Quando premido, este redireciona automaticamente para a secção no código onde uma função poderá ser introduzida e assim, obter-se a associação desejada. Exprimindo o exemplo da Cinemática Inversa, a função InvKin é chamada quando o Botão de Cálculo é premido, sendo posteriormente processada e permitindo a apresentação dos resultados na interface. Tabela 33 - Callback e Função associada Callback Função É importante referir que para todas as opções disponíveis ao longo da interface, as funções associadas já estavam parcialmente elaboradas, pelo que o processo ficou bastante simplificado. Foi ainda necessário elaborar alguns ajustes, de forma a que os resultados a serem apresentados na interface fossem devidamente associados aos indicadores gráficos. Figura 238 - Atribuição de valores aos indicadores gráficos Nesse sentido, as variáveis relativas aos valores dos indicadores, como se pode observar no extrato de código em cima dentro dos retângulos azuis, são igualadas aos valores das variáveis calculadas na própria função, dentro dos retângulos vermelhos.
240 Já para o caso das simulações adjacentes ao tipo de funcionamento do robot, basta que o Callback seja definido através da função previamente elaborada e o modo de operação selecionado, e a respetiva simulação correrá paralelamente no Coppelia, caso o ficheiro do programa se encontre aberto, uma vez que as funções que permitem a comunicação com o programa simulador já se encontram incorporadas na função do modo de operação.
241 APÊNDICE 3 – ARQUITETURA DO SISTEMA ❶ ❷ ❺ ❸ ❹
242 ❶