Quick viewing(Text Mode)

The Robot Programming Language Interpreter Written in the Logo Language, Journal of Achievements in Materials and Manufacturing Engineering 45/2 (2011) 194-203

The Robot Programming Language Interpreter Written in the Logo Language, Journal of Achievements in Materials and Manufacturing Engineering 45/2 (2011) 194-203

VOLUME 45 ISSUE 2 April program, carried with the validation of trajectory points. In some procedures, words and lists, so it does not differ too much from of Achievements in Materials cases, an operator can use an application that will export each other high-level languages. The main advantage is the simplicity and Manufacturing Engineering 2011 point of the trajectory to the CAD program and will present the of the program, while the disadvantages include the fact, that in path in an intelligible form [3,5]. However this method fails if the most cases Logo language is available as interpreter. This means path is created in a dynamic way, based on the result of that during each procedure call, the program code is every time conditional statements in the program. In this case, you can try to re-translated line by line. This affects the speed of program examine all the alternative trajectories, but this would require execution. For this reason, some dialects of the Logo offer sophisticated tool for source code analysis and developing the compilation to the intermediate code ("p-code") or a standalone The robot form of path presentation in the CAD application. Another way of . solving this problem may be the translation of the robot program There are also implementations of the Logo language in to a description similar to the pseudo code, which could be which commands have been translated into the user national interpreter written in the Logo language interpreted in a certain graphical environment. In this case, it was language. Examples include Komeniusz/Comenius Logo, ACLogo decided to adapt the Logo language for the presentation of and Imagine. Translation of commands into the foreign languages manipulator’s trajectory. Compared to the other programming K. Foit* is a non-standard approach when compared to the other languages, the Logo is a convenient tool for use in the field of programming languages. On the one hand, it can help to Institute of Engineering Processes Automation and Integrated Manufacturing robotics, due to: understand the code, but on the other, the source code is not as Systems, Faculty of Mechanical Engineering, Silesian University of Technology, x simple syntax, derived from LISP, universal as in the case of other programming language. In the ul. Konarskiego 18a, 44-100 Gliwice, Poland x direct support for mapping the path on the computer graphics Fig. 1 the sample program written in Logo is shown. On the left device (), * Corresponding author: E-mail address: [email protected] side is the original Logo code and on the right side the Polish x original application of turtle graphics is an interface for translation is shown. Received 14.02.2011; published in revised form 01.04.2011 mobile robot control. In the next part of this work the concept of a simple system 2.2. Turtle graphics used to visualize the trajectory of the robot manipulator, using the

Logo interpreter, will be presented. Manufacturing and processing The turtle graphics is a part of the Logo language [11-15].

This graphics subsystem is very different from that used in the

other high-level programming languages. In the classic case, we Abstract 2. The overall description of the have a screen with a specific resolution. The points and lines Purpose: of this paper is to elaborate a simple system used to visualize the trajectory of the robot manipulator, approach defined in the absolute coordinates. The Logo language uses a using the interpreter written in the Logo programming language. The interpreter should be able to run on the virtual screen (sometimes called canvas), whose resolution is not directly linked with the capabilities of the graphics device. In older PC class hardware with limited RAM and CPU computing power. Design/methodology/approach: Compared to the other programming languages, the Logo is a convenient addition, it uses a component called the "turtle", which is tool for use in the field of robotics, due to simple syntax, derived from LISP, direct support for mapping the 2.1. The history of the Logo language characteristic for the turtle graphics. This little icon in the shape manipulator path on the computer graphics device (turtle graphics), and because the original application of turtle of a triangle or a turtle-like image (Fig. 2), is a kind of cursor, graphics was an interface for mobile robot control. The first Logo interpreter was created in 1967 at BBN which is controlled by the appropriate commands. Generally, the Findings: As the subject of further consideration, the Mitsubishi RV-M1 robot has been selected. Its laboratory, driven by three scientists: Bolt, Beranek and Newman, turtle moves in the relative coordinates, where the reference is the programming language, called Movemaster Commands, is very simply and in some aspects very similar to located in Cambridge, Massachusetts. The creators were Wally local coordinate system associated with the turtle. It is also regular BASIC programming language. This makes it useful for processing by the interpreter due to imperative Feurzeig and . Two years later, at Massachusetts possible to move the turtle, giving the coordinates in relation to programming model. Institute of Technology, a turtle robot was created, as a Papert’s the global coordinate system (Fig. 3). The user decides which Research limitations/implications: The current, experimental version of the interpreter lacks some functions initiative. Original idea of turtle robot was designed under method should be used, but in most programming tasks, the first (for example workspace limits checking). Another disadvantage is that the application is dedicated to the auspices of Wiliam Grey Walter in the late forties of XX century. one is used more frequently. In later years Apple and Texas Instruments began a broad particular type of robot. Some problems may also occur during the design, because this part is not well implemented in the Logo. campaign to promote Logo as a programming language for beginners, especially useful for kids in primary schools. In this a) b) Practical implications: The result of the experiment is the computer application. The program is written in the way, this language has gained a reputation as trivial software for FMSLogo programming language. The developed application shares the interface with the FMSLogo. This is children. This opinion seemed to be confirmed by the presence of mainly due the fact, that the Logo is the interpreted language. turtle graphics. Originality/value: The program allows performing a simple check of the trajectory, and complements the

typical program editor. There is no need to use dedicated, high-price simulators. a) b) Keywords: Robotics; Simulation; Logo )

Reference to this paper should be given in the following way: K. Foit, The robot programming language interpreter written in the Logo language, Journal of Achievements in Materials and Manufacturing Engineering 45/2 (2011) 194-203.

1. Introduction which allow testing the program - again for a specific type of 1. Introduction robot or a group of robots [1-10]. There are also complex Fig. 1. The example code in standard Logo (a) and its Polish Fig. 2. Some types of standard turtle shapes: a) default shape, simulation systems, such as RobCAD, which have a large base of localization (b) which could be found in almost all Logo implementation; b) the Robot programming is often done in high-level programming robots possible to handle in a virtual environment, but their main turtle from KTurle application - the part of KDE desktop language designed specifically for a particular type of robot. For disadvantage is the high price and fairy complex usage. However, Logo is derived from LISP and retains all the characteristics environment; c) the turtle from Curly Logo - a web implemen- the same reason dedicated simulation applications are created, in most cases, it is required to perform a simple check of the of that language. Programming in this language is based on tation of Logo

194 Research paper © Copyright by International OCSCO World Press. All rights reserved. 2011

Manufacturing and processing

program, carried with the validation of trajectory points. In some procedures, words and lists, so it does not differ too much from cases, an operator can use an application that will export each other high-level languages. The main advantage is the simplicity point of the trajectory to the CAD program and will present the of the program, while the disadvantages include the fact, that in path in an intelligible form [3,5]. However this method fails if the most cases Logo language is available as interpreter. This means path is created in a dynamic way, based on the result of that during each procedure call, the program code is every time conditional statements in the program. In this case, you can try to re-translated line by line. This affects the speed of program examine all the alternative trajectories, but this would require execution. For this reason, some dialects of the Logo offer sophisticated tool for source code analysis and developing the compilation to the intermediate code ("p-code") or a standalone form of path presentation in the CAD application. Another way of compiler. solving this problem may be the translation of the robot program There are also implementations of the Logo language in to a description similar to the pseudo code, which could be which commands have been translated into the user national interpreted in a certain graphical environment. In this case, it was language. Examples include Komeniusz/Comenius Logo, ACLogo decided to adapt the Logo language for the presentation of and Imagine. Translation of commands into the foreign languages manipulator’s trajectory. Compared to the other programming is a non-standard approach when compared to the other languages, the Logo is a convenient tool for use in the field of programming languages. On the one hand, it can help to robotics, due to: understand the code, but on the other, the source code is not as x simple syntax, derived from LISP, universal as in the case of other programming language. In the x direct support for mapping the path on the computer graphics Fig. 1 the sample program written in Logo is shown. On the left device (turtle graphics), side is the original Logo code and on the right side the Polish x original application of turtle graphics is an interface for translation is shown. mobile robot control. In the next part of this work the concept of a simple system 2.2. Turtle Turtle graphics graphics used to visualize the trajectory of the robot manipulator, using the

Logo interpreter, will be presented. The turtle graphics is a part of the Logo language [11-15].

This graphics subsystem is very different from that used in the

other high-level programming languages. In the classic case, we 2. The The overall overall description description of the of have a screen with a specific resolution. The points and lines the approach defined in the absolute coordinates. The Logo language uses a approach virtual screen (sometimes called canvas), whose resolution is not directly linked with the capabilities of the graphics device. In 2.1. The history of the Logo addition, it uses a component called the "turtle", which is 2.1. Thelanguage history of the Logo language characteristic for the turtle graphics. This little icon in the shape of a triangle or a turtle-like image (Fig. 2), is a kind of cursor, The first Logo interpreter was created in 1967 at BBN which is controlled by the appropriate commands. Generally, the laboratory, driven by three scientists: Bolt, Beranek and Newman, turtle moves in the relative coordinates, where the reference is the located in Cambridge, Massachusetts. The creators were Wally local coordinate system associated with the turtle. It is also Feurzeig and Seymour Papert. Two years later, at Massachusetts possible to move the turtle, giving the coordinates in relation to Institute of Technology, a turtle robot was created, as a Papert’s the global coordinate system (Fig. 3). The user decides which initiative. Original idea of turtle robot was designed under method should be used, but in most programming tasks, the first auspices of Wiliam Grey Walter in the late forties of XX century. one is used more frequently. In later years Apple and Texas Instruments began a broad campaign to promote Logo as a programming language for beginners, especially useful for kids in primary schools. In this a) b) way, this language has gained a reputation as trivial software for children. This opinion seemed to be confirmed by the presence of turtle graphics.

a) b) c)

which allow testing the program - again for a specific type of 1. Introduction robot or a group of robots [1-10]. There are also complex Fig. 1. The example code in standard Logo (a) and its Polish Fig. 2. Some types of standard turtle shapes: a) default shape, simulation systems, such as RobCAD, which have a large base of localization (b) which could be found in almost all Logo implementation; b) the Robot programming is often done in high-level programming robots possible to handle in a virtual environment, but their main turtle from KTurle application - the part of KDE desktop language designed specifically for a particular type of robot. For disadvantage is the high price and fairy complex usage. However, Logo is derived from LISP and retains all the characteristics environment; c) the turtle from Curly Logo - a web implemen- the same reason dedicated simulation applications are created, in most cases, it is required to perform a simple check of the of that language. Programming in this language is based on tation of Logo

READING DIRECT: www.journalamme.org 195

Journal of Achievements in Materials and Manufacturing Engineering Volume 45 Issue 2 April 2011

only a turtle graphics has remained. For many years, not much object in more realistic manner, but there is no advanced display. Therefore, it is possible to display advanced 3D attention was paid to the Logo, which was seen primarily as a techniques available like shadows or reflections. An example of animation and change the position of the observer without Y fd programming language in the early teaching of informatics. use of such features is shown in Figure 5. interrupting drawing of the image. In this way a high-quality 2D rt A few years back, new implementations of Logo began to and 3D graphics, comparable with Flash/Shockwave standard, can appear, and it was often enhanced with new capabilities, which be presented [13]. An example of the Elica Logo graphics is were not implemented in the language standard. Among them, a y shown in Figure 6. downpitch support for dialogs, sound and graphics files and new input/output devices has been added. uppitch l One of the interesting extension, offered by several dialects Turtle nose logo is a support for the third dimension in turtle graphics. bk Currently, three systems allow the direct use of the third dimension. They are: FMSLogo, Elica and Logo3D. leftroll rightroll marker The FMSLogo is derived from the MSWLogo dialect and refers to the Berkley UCBLogo standard. Compared to the standard, FMSLogo includes the following extensions [14]: X x support for TCP / IP, x up to 1024 independent turtles, Fig. 3. Global coordinate system versus turtle coordinates system; x support for serial and parallel port, the turtle can be moved by FD/BK commands and rotated by x x event handling (mouse, timer, keyboard), z LT/RT commands x support for DLL handling,

x support for dialogs, Fig. 4. The standard view of the turtle in the PERSPECTIVE x support for 3D drawing. The turtle visibility is controlled by the two commands: Three-dimensional mode in FMSLogo is activated using the mode and meaning of the 3D control commands x HT - hide turtle, PERSPECTIVE command. In fact, the 3D mode is an extension x ST - show turtle. of 2D mode. The turtle is properly oriented in space, using the

Some implementations of the Logo allow to use more than LEFTROLL, RIGHTROLL, UPPITCH and DOWNPITCH The Elica Logo is an advanced 3D graphics system based on Fig. 5. The result of FMS Logo program that using one turtle at a time [14,15], so there could be introduced some commands. They determine the location of the turtle, and define Logo programming language. It has little in common with typical PERSPECTIVE and POLYGON modes along with the special additional commands for creating a turtle, selecting active turtle the plane where the turtle moves. In this way, in the Logo, being rather oriented on 3D graphics and animation. The turtles; Source: FMS Logo examples etc. Moreover, the turtle can have different shape, which is PERSPECTIVE mode still can be used the commands word Elica is the acronym for “Educational Logo Interface for

selected by the user. These two features could be useful for FORWARD, BACK, LEFT, RIGHT, etc. To point out that the Creative Activities”. Author claims that Elica is object oriented The Elica Logo also uses some special kind of turtles [15], creating animations. program is in PERSPECTIVE mode, a marker is added to the dialect of Logo [12]. Elica uses so called Easy Object which are organized in a manner of objects and inheritance. The The turtle has a pen, which can be "raised" or "lowered". default turtle icon. The marker also allows to identify the Declaration. It means that there is no any special syntax for object root is the generalturtle object, which defines the methods used Picking up the pen with the command PU allows the free orientation of turtle in space. The Figure 4 shows the standard - the object is distinguished from functions or procedures by by other, lower-hierarchy turtles. The children objects are the movement of the turtle on the canvas without leaving a trace, on view after activating PERSPECTIVE mode and the manner in interpreter. There is no difference between procedure, function spaceturtle and cameraturtle. The spaceturtle divides into the other hand, lowering the pen (using PD command) causes that which turtle is controlled by roll and pitch commands. and object by mean of declaration, so interpreter must analyze the traditionalturtle and sphericalturtle objects. The first one defines every movement of the turtle leaves a trail. This approach Referring to the absolute coordinates, the position of the turtle way in which the piece of code is used. Besides the use of objects, the normal, 2D oriented turtle, the second one is slightly different accurately reproduces the control of a real mobile robot equipped can be set using SETX, SETY, SETZ or SETXYZ command to Elica Logo has extended presentation abilities in comparison with because it act on sphere, not on the plane. The parent-child with a pen, which was one of the aims of the Logo language. In set the appropriate turtle coordinates. In addition, the FMS Logo. The Elica Logo is able to use the potential of the dependence of the objects is shown in Fig. 7. contrast to the real robot after reaching the borders of the canvas, SETHEADING, SETPITCH and SETROLL keywords set the graphics device installed in the computer to accelerate image the behaviour of the turtle is defined using one of three proper orientation of the turtle in space, referring to the absolute commands: angles. This raises the interesting possibility of using the language a) b) c) x FENCE - prevents the turtle crossing the edge of the canvas, specific to define not only the position of the characteristic point then an error is signalled, of the robot, but also to determine the spatial orientation of the x WINDOW - going beyond the area of the canvas is permitted, tool (e.g. gripper or welding tip). the turtle responds to commands, you can restore a lost turtle Using the PERSPECTIVE mode, there are three special on the canvas command HOME, turtles, which control the 3D scene [14]: x WRAP - after reaching the edge of the canvas, the turtle x the turtle #-1 - this turtle controls the point of view position, appears on the opposite side, in this case, the upper edge of i.e. the point, where observer is located; the orientation of the the canvas is "glued" with the bottom one and the right edge turtle does not matter in this case, with the left one. x the turtle #-2 - defines the focus point, i.e. the point which is observed from the position defined by turtle #-1; the 2.3. Turtle Turtle graphics graphics and third and dimension third orientation of this turtle also defines the direction of Y axis in dimension reference to the user screen; x the turtle #-3 - defines the position of the light, but its orientation does not matter; it can be used only in the Most of the older Logo interpreters have a turtle graphics, which uses only two dimensions - so the turtle can act only on the POLYGON mode. plane. This approach was quite natural at the time when the Logo Using these special turtles together with ordinary ones, gives has been used to control a real mobile robot. Later, the fully equipped environment for 3D drawing. Also there is Fig. 6. Some examples of Elica Logo graphics: a) simple 3D obects, b) 3D graphics with lights, shadows and color background, programming language has been isolated from the turtle robot and possibility to use simple rendering - this allows to present 3D c) advanced 3D graphics with textures and the fog (source: Elica Logo examples)

196 Research paper K. Foit

Manufacturing and processing

only a turtle graphics has remained. For many years, not much object in more realistic manner, but there is no advanced display. Therefore, it is possible to display advanced 3D attention was paid to the Logo, which was seen primarily as a techniques available like shadows or reflections. An example of animation and change the position of the observer without Y fd programming language in the early teaching of informatics. use of such features is shown in Figure 5. interrupting drawing of the image. In this way a high-quality 2D rt A few years back, new implementations of Logo began to and 3D graphics, comparable with Flash/Shockwave standard, can appear, and it was often enhanced with new capabilities, which be presented [13]. An example of the Elica Logo graphics is were not implemented in the language standard. Among them, a y shown in Figure 6. downpitch support for dialogs, sound and graphics files and new input/output t devices has been added. uppitch l One of the interesting extension, offered by several dialects Turtle nose logo is a support for the third dimension in turtle graphics. bk Currently, three systems allow the direct use of the third dimension. They are: FMSLogo, Elica and Logo3D. leftroll rightroll marker The FMSLogo is derived from the MSWLogo dialect and refers to the Berkley UCBLogo standard. Compared to the standard, FMSLogo includes the following extensions [14]: X x support for TCP / IP, x up to 1024 independent turtles, Fig. 3. Global coordinate system versus turtle coordinates system; x support for serial and parallel port, the turtle can be moved by FD/BK commands and rotated by x x event handling (mouse, timer, keyboard), z LT/RT commands x support for DLL handling,

x support for dialogs, Fig. 4. The standard view of the turtle in the PERSPECTIVE x support for 3D drawing. The turtle visibility is controlled by the two commands: Three-dimensional mode in FMSLogo is activated using the mode and meaning of the 3D control commands x HT - hide turtle, PERSPECTIVE command. In fact, the 3D mode is an extension x ST - show turtle. of 2D mode. The turtle is properly oriented in space, using the

Some implementations of the Logo allow to use more than LEFTROLL, RIGHTROLL, UPPITCH and DOWNPITCH The Elica Logo is an advanced 3D graphics system based on Fig. 5. The result of FMS Logo program that using one turtle at a time [14,15], so there could be introduced some commands. They determine the location of the turtle, and define Logo programming language. It has little in common with typical PERSPECTIVE and POLYGON modes along with the special additional commands for creating a turtle, selecting active turtle the plane where the turtle moves. In this way, in the Logo, being rather oriented on 3D graphics and animation. The turtles; Source: FMS Logo examples etc. Moreover, the turtle can have different shape, which is PERSPECTIVE mode still can be used the commands word Elica is the acronym for “Educational Logo Interface for selected by the user. These two features could be useful for FORWARD, BACK, LEFT, RIGHT, etc. To point out that the Creative Activities”. Author claims that Elica is object oriented The Elica Logo also uses some special kind of turtles [15], creating animations. program is in PERSPECTIVE mode, a marker is added to the dialect of Logo [12]. Elica uses so called Easy Object which are organized in a manner of objects and inheritance. The The turtle has a pen, which can be "raised" or "lowered". default turtle icon. The marker also allows to identify the Declaration. It means that there is no any special syntax for object root is the generalturtle object, which defines the methods used Picking up the pen with the command PU allows the free orientation of turtle in space. The Figure 4 shows the standard - the object is distinguished from functions or procedures by by other, lower-hierarchy turtles. The children objects are the movement of the turtle on the canvas without leaving a trace, on view after activating PERSPECTIVE mode and the manner in interpreter. There is no difference between procedure, function spaceturtle and cameraturtle. The spaceturtle divides into the other hand, lowering the pen (using PD command) causes that which turtle is controlled by roll and pitch commands. and object by mean of declaration, so interpreter must analyze the traditionalturtle and sphericalturtle objects. The first one defines every movement of the turtle leaves a trail. This approach Referring to the absolute coordinates, the position of the turtle way in which the piece of code is used. Besides the use of objects, the normal, 2D oriented turtle, the second one is slightly different accurately reproduces the control of a real mobile robot equipped can be set using SETX, SETY, SETZ or SETXYZ command to Elica Logo has extended presentation abilities in comparison with because it act on sphere, not on the plane. The parent-child with a pen, which was one of the aims of the Logo language. In set the appropriate turtle coordinates. In addition, the FMS Logo. The Elica Logo is able to use the potential of the dependence of the objects is shown in Fig. 7. contrast to the real robot after reaching the borders of the canvas, SETHEADING, SETPITCH and SETROLL keywords set the graphics device installed in the computer to accelerate image the behaviour of the turtle is defined using one of three proper orientation of the turtle in space, referring to the absolute commands: angles. This raises the interesting possibility of using the language a) b) c) x FENCE - prevents the turtle crossing the edge of the canvas, specific to define not only the position of the characteristic point then an error is signalled, of the robot, but also to determine the spatial orientation of the x WINDOW - going beyond the area of the canvas is permitted, tool (e.g. gripper or welding tip). the turtle responds to commands, you can restore a lost turtle Using the PERSPECTIVE mode, there are three special on the canvas command HOME, turtles, which control the 3D scene [14]: x WRAP - after reaching the edge of the canvas, the turtle x the turtle #-1 - this turtle controls the point of view position, appears on the opposite side, in this case, the upper edge of i.e. the point, where observer is located; the orientation of the the canvas is "glued" with the bottom one and the right edge turtle does not matter in this case, with the left one. x the turtle #-2 - defines the focus point, i.e. the point which is observed from the position defined by turtle #-1; the 2.3. Turtle graphics and third dimension orientation of this turtle also defines the direction of Y axis in reference to the user screen; x the turtle #-3 - defines the position of the light, but its orientation does not matter; it can be used only in the Most of the older Logo interpreters have a turtle graphics, which uses only two dimensions - so the turtle can act only on the POLYGON mode. plane. This approach was quite natural at the time when the Logo Using these special turtles together with ordinary ones, gives has been used to control a real mobile robot. Later, the fully equipped environment for 3D drawing. Also there is Fig. 6. Some examples of Elica Logo graphics: a) simple 3D obects, b) 3D graphics with lights, shadows and color background, programming language has been isolated from the turtle robot and possibility to use simple rendering - this allows to present 3D c) advanced 3D graphics with textures and the fog (source: Elica Logo examples)

The robot programming language interpreter written in the Logo language 197

Journal of Achievements in Materials and Manufacturing Engineering Volume 45 Issue 2 April 2011

The Elica Logo is quite fast interpreter, so there is no functions with parameters. On the other hand, many programming is invoked many times, compiling the program piece by piece 2.5. Using the Logo as the robot programming perceptible slowdown during use the graphics interface elements. languages have changed over time, tending to the object-oriented [11]. Generally, the most consist of four components Of course, some operation may last longer, but generally, the programming (OOP) model. The object oriented and structural (Fig. 9): language interpreter

graphics display and animation are very smooth. The only programming are hard for interpreting, because of existing x the input stream handler, lexical analysis, token generator problem that the Elica Logo introduces is some lack of stability - structures like functions, procedures or objects, which should be or the “reader”, which handles the strings entered by the user there are some situations, when interpreter could cause errors or treated as a whole, but they consist of individual lines of code. using the keyboard or the other input devices and divides it Most of the modern robots’ controllers use the programming exceptions. Besides the intermediate code creation, which is very useful in into smaller parts: semantic units (tokens); at this stage it does languages, which are compliant with structural programming this case, there exists one more possibility - so called incremental not matter what is entered, but how to handle the entered model. As it was mentioned earlier, these languages are difficult compiler. The incremental compiler has some advantages of both: characters - in the simple words it divides strings into to process by the interpreter. The flat (imperative) model of interpreter and traditional compiler. The user is working in the meaningful substrings; this step is often presented as a part of programming is more common for older constructions and in this same way like with standard interpreter, but has a possibility to parsing in general and not shown as a separate process, case building the interpreter for these languages is less error- prone process. As the subject of further consideration, the use structural or object-oriented programming model. The x the parser is a part of compiler, where substrings given by the Mitsubishi RV-M1 robot has been selected. Its programming principle of incremental compiler is the fact, that it treats function, previous step were analyzed and compared to the syntactic language, called Movemaster Commands, is very simply and in procedures and objects as a complete structure. It means that these rules of the language; also the semantic analysis is done, some aspects very similar to regular BASIC programming structures are compiled on the fly, right after entering them. The x the code generator does the translation work; the parsed code language [16]. The syntax of sample line of code is shown in user can change some part of code, and there is no need to is replaced with appropriate instructions of the target Figure 10. recompile the entire program, but only the changed part of it. This language,

gives the answer for question, how Logo - as the high-level x the runtime libraries contain a part of code, which is needed programming language, containing structures like procedures, to execute the generated code (error and input/output functions and even object - could be interpreted. After opening by handling, cooperation with the etc.) - they 10 DW 10,20,30 the user the function or procedure definition, using keyword to, are not required at the compilation phase. Optional line the Logo interpreter opens an editor window (see Fig. 8), where Parameters Fig. 7. Turtle objects hierarchy in Elica Logo number the structure can be defined. Closing the editor window makes the Command structure (procedure, function or object) to be compiled, and after The last of the mentioned Logo system, which have support successful compilation, it will be available from the command DataData streamstream for three-dimensional graphics is the Logo3D. This software is line. The problem concerning this method is that incremental Fig. 10. The syntax of the example program line in Movemaster written in Java, so it requires Java Runtime Environment to run. compiler cannot check if keywords used in the procedure/function Commands robot programming language All the necessary files are included in the installer. This system is definition really exist. In fact, this cannot be done in simple rather experimental than for everyday use, mainly because there is manner, because the user can enter the appropriate definitions LexicalLexical analysisanalysis The line of program in the Movemaster Command language no documentation and due to some installation problem on the later. Due to structural model of Logo language, there is no can be preceded by an optional line number. Presence of the line newer operating systems. limited set of keywords, which can be used in the program code, number is interpreted by the control system as “check and store so any errors can be captured only at the program execution stage. the line for later use”. In this manner, a program is written. When ParsingParsing there is no line number, then the command is executed 2.4. T Thehe Logo Logo and and other other high-level high-level immediately. The program code is separated from the positions programmingprogramming languages languages memory, which is stored in the similar manner - every definition of the position has its own number and parameters. A position can Compiled code RTM libraries There are some examples of high-level language interpreters Compiled code RTM libraries be defined using teachbox or programming (see Fig. 11). written in Logo [11-15], because this language has quite simple Main window syntax allowing some syntactic construction, which are hard or impossible to code in other high-level programming languages. Due to “double interpreting” routine (an interpreter is written in + Logo, which is also interpreted language), they are relatively + slow, when compared to the machine-written (compiled) interpreters - so they have more demonstrational character than are aimed for everyday use. Editor window The programming language interpreter acts in the special manner, which allows checking the program correctness on the fly this button closes the window and - that means after every line confirmed by Enter/Return key. This stores the procedure/function in the memory allows executing the command immediately or storing it in a CodeCode executionexecution memory “container“. If the user runs a program, the interpreter translates it line by line into the machine code - then the code is executed. Almost all interpreters are working in this manner, but Fig. 9. The simplified operating principle of the compiler some are different. Some uses an intermediate code, which is a Fig. 11. The two, equivalent methods of positions defining form between high-level and compiled machine code (for example QBasic from Microsoft works in this manner). This is Fig. 8. The FMSLogo and the procedure or function editor The implementation of the incremental compiler in the Logo First method is the easiest one. Everything is done by moving very useful, when the language uses structural or object oriented window language depends on the complexity of the project. Usually the the robot’s manipulator, using jog keys, to the desired position, programming mode. In fact, the flat (imperative) model of programming languages using flat (imperative) model of and then storing it by pressing P.S key, entering position number programming is the best solution for real-time interpreting: The incremental compiler works in the same way as the programming are the easiest one for implementation as the and accepting it by the ENT key. The second method requires variables are defined globally and there are no procedures or traditional compiler - the difference is that incremental compiler interpreter or incremental compiler. entering Movemaster Commands instructions using a terminal.

198 Research paper K. Foit

Manufacturing and processing

The Elica Logo is quite fast interpreter, so there is no functions with parameters. On the other hand, many programming is invoked many times, compiling the program piece by piece 2.5. Using Using the theLogo Logo as the asrobot the programming robot perceptible slowdown during use the graphics interface elements. languages have changed over time, tending to the object-oriented [11]. Generally, the most compilers consist of four components programming language Of course, some operation may last longer, but generally, the programming (OOP) model. The object oriented and structural (Fig. 9): language interpreter interpreter graphics display and animation are very smooth. The only programming are hard for interpreting, because of existing x the input stream handler, lexical analysis, token generator problem that the Elica Logo introduces is some lack of stability - structures like functions, procedures or objects, which should be or the “reader”, which handles the strings entered by the user there are some situations, when interpreter could cause errors or treated as a whole, but they consist of individual lines of code. using the keyboard or the other input devices and divides it Most of the modern robots’ controllers use the programming exceptions. Besides the intermediate code creation, which is very useful in into smaller parts: semantic units (tokens); at this stage it does languages, which are compliant with structural programming this case, there exists one more possibility - so called incremental not matter what is entered, but how to handle the entered model. As it was mentioned earlier, these languages are difficult compiler. The incremental compiler has some advantages of both: characters - in the simple words it divides strings into to process by the interpreter. The flat (imperative) model of interpreter and traditional compiler. The user is working in the meaningful substrings; this step is often presented as a part of programming is more common for older constructions and in this same way like with standard interpreter, but has a possibility to parsing in general and not shown as a separate process, case building the interpreter for these languages is less error- prone process. As the subject of further consideration, the use structural or object-oriented programming model. The x the parser is a part of compiler, where substrings given by the Mitsubishi RV-M1 robot has been selected. Its programming principle of incremental compiler is the fact, that it treats function, previous step were analyzed and compared to the syntactic language, called Movemaster Commands, is very simply and in procedures and objects as a complete structure. It means that these rules of the language; also the semantic analysis is done, some aspects very similar to regular BASIC programming structures are compiled on the fly, right after entering them. The x the code generator does the translation work; the parsed code language [16]. The syntax of sample line of code is shown in user can change some part of code, and there is no need to is replaced with appropriate instructions of the target Figure 10. recompile the entire program, but only the changed part of it. This language, gives the answer for question, how Logo - as the high-level x the runtime libraries contain a part of code, which is needed programming language, containing structures like procedures, to execute the generated code (error and input/output functions and even object - could be interpreted. After opening by handling, cooperation with the operating system etc.) - they 10 DW 10,20,30 the user the function or procedure definition, using keyword to, are not required at the compilation phase. Optional line the Logo interpreter opens an editor window (see Fig. 8), where Parameters Fig. 7. Turtle objects hierarchy in Elica Logo number the structure can be defined. Closing the editor window makes the Command structure (procedure, function or object) to be compiled, and after The last of the mentioned Logo system, which have support successful compilation, it will be available from the command DataData streamstream for three-dimensional graphics is the Logo3D. This software is line. The problem concerning this method is that incremental Fig. 10. The syntax of the example program line in Movemaster written in Java, so it requires Java Runtime Environment to run. compiler cannot check if keywords used in the procedure/function Commands robot programming language All the necessary files are included in the installer. This system is definition really exist. In fact, this cannot be done in simple rather experimental than for everyday use, mainly because there is manner, because the user can enter the appropriate definitions LexicalLexical analysisanalysis The line of program in the Movemaster Command language no documentation and due to some installation problem on the later. Due to structural model of Logo language, there is no can be preceded by an optional line number. Presence of the line newer operating systems. limited set of keywords, which can be used in the program code, number is interpreted by the control system as “check and store so any errors can be captured only at the program execution stage. the line for later use”. In this manner, a program is written. When ParsingParsing there is no line number, then the command is executed 2.4. The Logo and other high-level immediately. The program code is separated from the positions programming languages memory, which is stored in the similar manner - every definition of the position has its own number and parameters. A position can Compiled code RTM libraries There are some examples of high-level language interpreters Compiled code RTM libraries be defined using teachbox or programming (see Fig. 11). written in Logo [11-15], because this language has quite simple Main window syntax allowing some syntactic construction, which are hard or impossible to code in other high-level programming languages. Due to “double interpreting” routine (an interpreter is written in + Logo, which is also interpreted language), they are relatively + slow, when compared to the machine-written (compiled) interpreters - so they have more demonstrational character than are aimed for everyday use. Editor window The programming language interpreter acts in the special manner, which allows checking the program correctness on the fly this button closes the window and - that means after every line confirmed by Enter/Return key. This stores the procedure/function in the memory allows executing the command immediately or storing it in a CodeCode executionexecution memory “container“. If the user runs a program, the interpreter translates it line by line into the machine code - then the code is executed. Almost all interpreters are working in this manner, but Fig. 9. The simplified operating principle of the compiler some are different. Some uses an intermediate code, which is a Fig. 11. The two, equivalent methods of positions defining form between high-level and compiled machine code (for example QBasic from Microsoft works in this manner). This is Fig. 8. The FMSLogo and the procedure or function editor The implementation of the incremental compiler in the Logo First method is the easiest one. Everything is done by moving very useful, when the language uses structural or object oriented window language depends on the complexity of the project. Usually the the robot’s manipulator, using jog keys, to the desired position, programming mode. In fact, the flat (imperative) model of programming languages using flat (imperative) model of and then storing it by pressing P.S key, entering position number programming is the best solution for real-time interpreting: The incremental compiler works in the same way as the programming are the easiest one for implementation as the and accepting it by the ENT key. The second method requires variables are defined globally and there are no procedures or traditional compiler - the difference is that incremental compiler interpreter or incremental compiler. entering Movemaster Commands instructions using a terminal.

The robot programming language interpreter written in the Logo language 199

Journal of Achievements in Materials and Manufacturing Engineering Volume 45 Issue 2 April 2011

A position is defined by entering the string: The differences between dialects of Logo may interfere with 3.2. General description of the interface and PD writing portable applications. This limitation could be omitted by 3. Description of developed application

or using as much as possible from the Berkley Logo standard, which commands

HE is the base of majority of the present-day Logo dialects. Because of the experiment a computer application has been The developed application shares the interface with the Simulation of the results of the robot language commands in developed. The program is written in the Logo programming Of course the PD command can be a part of a program - then any high level programming language environment is radically FMSLogo. This is mainly due the fact, that the FMSLogo is the language (the FMSLogo dialect) and is based on some techniques interpreter and has not a compiler. On the other hand, there is no it should be preceded by the line number - or can be entered different from writing a programming language interpreter for the presented in the “Computer Science Logo Style” [11] and the graphical user interface, due to the limitations of the program. The without line number and stored immediately in positions memory. robot. In the first case it is not necessary to replace keywords and Elica Logo examples [15]. In order to run the program, the user developed application uses mainly the command line interface, The HE command stores the actual position of manipulator under syntax of one language with another, but only the interpretation of should enter robosim from the command line of the Logo where the Movemaster Command language instruction could be the specified number in the positions memory. the instruction arguments are required. The interpreter analyzes interpreter. The Logo should display the header: entered. Besides the robot’s programming language keywords, a The partition of the memory for separate storage for positions the code more widely, leading ultimately to a completely new few more commands have been added. They are not used in and program data is very characteristic in robot programming program in a particular programming language. Taking into RoboSim Logo interpreter for regular programming activities, but they are employed for model. There is no problem, when we have a special application, consideration the technical differences, the following options Movemaster Commands maintenance tasks. The special commands are: which “understand” this model of programming, but there is could be used during writing the Movemaster Commands x LOADPROG - opens the file selection window, where the nothing similar in high-level programming languages, where program code interpreter in the Logo environment: READY variables are used as “storage” for data. Only the BASIC user can indicate the file containing robot’s program code and x simulation of the various commands on the basis of their programming language has something comparable: it is the DATA load it into memory, arguments, and then the following window is displayed (Fig. 12): instruction, which is used to store any type of data that could be x LOADPOS - the similar action to the LOADPROG command, x later substituted into any variable of the given type. On the other translation of the entire robot’s program into the Logo but it is used for retrieving positions definitions from the file, language, hand, it is not the same like PD instruction in Movemaster x SAVEPROG - opposite to LOADPROG, opens the window, Commands, because the elements from the DATA lines are read x interpretation/incremental compilation of a program written in where the user can select the destination folder and type the sequentially, while the PD data can be accessed randomly, by Movemaster Command, carries in the Logo environment. filename to save robot’s program on the disk, In terms of the possibility of improving the program, the least giving the number. Considering the high-level languages, the x SAVEPOS - similar to SAVEPROG, but it concerns the most similar structure to the positions memory storage is the preferred method is the second one, because each change requires defined positions, re-translation of the entire program. The most effective is the third array. The arrays are fully supported in many programming x RCONNECT - this command establishes the connection with languages, but not always in the Logo. As it was mentioned method (interpreter), as in the case of creating a program off-line Fig. 12. The input window of the RobSim program the robot’s controller using serial port, it allows quick and reliable capture of errors at the stage of earlier, the Logo has strong connection with LISP, so its main x RDISCONNECT - closes the serial port opened by structure is the list. Arrays can be built using lists, but processing entering commands. Every line of program and any special command must be RCONNECT command and breaks the connection with the them in this form is more complicated - especially when coping Currently, due to technical limitations, the proposed entered into this window. This is the standard modal window robot’s controller, with multidimensional arrays. On the other hand the Logo is in interpreter does not allow simulating the input and output ports of generated by the FMSLogo interpreter, thus there is no extra x PRGDOWN - downloads the program from the robot’s the robot. Its main task is to show the trajectory of the robot tool, general interpreted language and the method of accessing the information about the process of entering the program. After controller to the computer memory, array element using ITEM command is slower in relation to direct without going into details associated with the exchange of data successful parsing of the command or special instruction, the x POSDOWN - downloads the positions from the robot’s access offered by other programming languages. Another problem between the robot and external devices. Currently, most of the “READY” prompt is displayed in the output box. controller memory to the computer memory, is that different dialects of Logo support arrays in different ways. supported commands are related to the positioning of the x PRGUP - uploads the program from the computer to the For example, in the FMSLogo the declaration of the three- manipulator and control of the program course (absolute jumps, robot’s controller, element, one-dimensional array can be done in the simple way loops, subroutines). 3.1. Organization of the program’s memory x POSUP - uploads the positions from the computer to the [14]: Basic assumptions concerning the establishment of an robot’s controller, interpreter were: x LISTPOS - displays all of the defined positions in the MAKE “a {12 34 56} x the maximum use of the UCBLogo (Berkeley Logo) standard, There are two memory blocks reserved for the Movemaster Notepad editor, in order to achieve high compatibility with other dialects and Command code. The first one is the positions memory declared in x LISTPRG - displays all of the entered program lines in the where a is the array name consisting the numbers 12, 34, 56. thus also high portability of the interpreter, the following manner: Notepad editor. The same array should be declared in Elica Logo in this way: x the illustration of the location and the gripper state will be MAKE “posarray (ARRAY 629). The PRGDOWN, PRGUP, POSDOWN and POSUP done using the appropriate icons for the turtle, MAKE “a [12 34 56] commands are working only when the robot is connected by using x the command interpreter will be limited to the actions The program memory is defined as below: the RCONNECT command. For this reason it has been decided, associated with moving of the manipulator, As it can be seen, the Elica Logo do not distinguish an one- that these commands invoke the RCONNECT automatically. It x the FMSLogo environment will be used for implementing the MAKE “progarray (ARRAY 2048). dimensional array from a list. The problem is that the first could be misleading, why there are separate commands for interpreter, because it is very stable and covers most of the declaration, made in the FMSLogo does not work in the Elica connecting to and disconnecting from the robot’s controller, but Berkley standard, After entering the position definition or the program line into Logo and the code is not portable between them. In fact, the Elica this is for very simple reason. As it was mentioned earlier, x the input window (see Fig. 12), accepting it by the ENTER key or recognizes the text between the {} chars as a comment [15]. The less emphasis on user interface - most of the commands will entering the instruction from Movemaster Commands set without be entered directly from the command line, OK button, the string is processed by the incremental compiler FMSLogo has also the possibility to declare a multi-dimensional and then copied into the proper array. The earlier processing is the line number causes the immediate execution of the command x the ability to read the program and the positions from the array in this manner: necessary, because a position can be defined by directly entering [16]. The specific commands are RN, which starts the program robot controller and send the revised code from your the PD command with parameters, or can be a part of the execution, NW that clears the program memory and PC, which computer to the robot. MAKE "a (MDARRAY [2 3] 0) program, when the line number precedes the PD command. The deletes position from the memory. In case of these commands, it MDSETITEM [0 0] :a 1 There is no standard graphical user interface planned due the compiler should make the proper decision and properly classify should be indicated to which device instruction should be sent. fact that the FMSLogo has relatively poor support for handling the string. The simplest way is to add the parameter to the command, but this The above sample of code declares the two-dimensional array windows. The application can display dialog boxes, but there is Keeping in the memory both the source code and its is connected with the modification of original syntax. The second named a, where the indexes start at 0 and end respectively at 2 no possibility to create full windowed application - in short, there processed version requires very careful synchronization between simple method is to point out which device should be used by and 3. The second line of the code sets the value of the array can be only auxiliary dialog windows, like for example in Excel them, but keeping the source code is necessary for correct data connecting to it. This convention is used by the interpreter, by element (0,0) to 1. when macros have been used. exchange between the computer and the robot controller. using the RCONNECT command. In this way, when the robot is

200 Research paper K. Foit

Manufacturing and processing

A position is defined by entering the string: The differences between dialects of Logo may interfere with 3. Description of developed 3.2. General General description description of the of interface the and PD writing portable applications. This limitation could be omitted by 3. Description of developed application application interface and commands or using as much as possible from the Berkley Logo standard, which commands

HE is the base of majority of the present-day Logo dialects. Because of the experiment a computer application has been The developed application shares the interface with the Simulation of the results of the robot language commands in developed. The program is written in the Logo programming Of course the PD command can be a part of a program - then any high level programming language environment is radically FMSLogo. This is mainly due the fact, that the FMSLogo is the language (the FMSLogo dialect) and is based on some techniques interpreter and has not a compiler. On the other hand, there is no it should be preceded by the line number - or can be entered different from writing a programming language interpreter for the presented in the “Computer Science Logo Style” [11] and the graphical user interface, due to the limitations of the program. The without line number and stored immediately in positions memory. robot. In the first case it is not necessary to replace keywords and Elica Logo examples [15]. In order to run the program, the user developed application uses mainly the command line interface, The HE command stores the actual position of manipulator under syntax of one language with another, but only the interpretation of should enter robosim from the command line of the Logo where the Movemaster Command language instruction could be the specified number in the positions memory. the instruction arguments are required. The interpreter analyzes interpreter. The Logo should display the header: entered. Besides the robot’s programming language keywords, a The partition of the memory for separate storage for positions the code more widely, leading ultimately to a completely new few more commands have been added. They are not used in and program data is very characteristic in robot programming program in a particular programming language. Taking into RoboSim Logo interpreter for regular programming activities, but they are employed for model. There is no problem, when we have a special application, consideration the technical differences, the following options Movemaster Commands maintenance tasks. The special commands are: which “understand” this model of programming, but there is could be used during writing the Movemaster Commands x LOADPROG - opens the file selection window, where the nothing similar in high-level programming languages, where program code interpreter in the Logo environment: READY variables are used as “storage” for data. Only the BASIC user can indicate the file containing robot’s program code and x simulation of the various commands on the basis of their programming language has something comparable: it is the DATA load it into memory, arguments, and then the following window is displayed (Fig. 12): instruction, which is used to store any type of data that could be x LOADPOS - the similar action to the LOADPROG command, x later substituted into any variable of the given type. On the other translation of the entire robot’s program into the Logo but it is used for retrieving positions definitions from the file, language, hand, it is not the same like PD instruction in Movemaster x SAVEPROG - opposite to LOADPROG, opens the window, Commands, because the elements from the DATA lines are read x interpretation/incremental compilation of a program written in where the user can select the destination folder and type the sequentially, while the PD data can be accessed randomly, by Movemaster Command, carries in the Logo environment. filename to save robot’s program on the disk, In terms of the possibility of improving the program, the least giving the number. Considering the high-level languages, the x SAVEPOS - similar to SAVEPROG, but it concerns the most similar structure to the positions memory storage is the preferred method is the second one, because each change requires defined positions, re-translation of the entire program. The most effective is the third array. The arrays are fully supported in many programming x RCONNECT - this command establishes the connection with languages, but not always in the Logo. As it was mentioned method (interpreter), as in the case of creating a program off-line Fig. 12. The input window of the RobSim program the robot’s controller using serial port, it allows quick and reliable capture of errors at the stage of earlier, the Logo has strong connection with LISP, so its main x RDISCONNECT - closes the serial port opened by structure is the list. Arrays can be built using lists, but processing entering commands. Every line of program and any special command must be RCONNECT command and breaks the connection with the them in this form is more complicated - especially when coping Currently, due to technical limitations, the proposed entered into this window. This is the standard modal window robot’s controller, with multidimensional arrays. On the other hand the Logo is in interpreter does not allow simulating the input and output ports of generated by the FMSLogo interpreter, thus there is no extra x PRGDOWN - downloads the program from the robot’s the robot. Its main task is to show the trajectory of the robot tool, general interpreted language and the method of accessing the information about the process of entering the program. After controller to the computer memory, array element using ITEM command is slower in relation to direct without going into details associated with the exchange of data successful parsing of the command or special instruction, the x POSDOWN - downloads the positions from the robot’s access offered by other programming languages. Another problem between the robot and external devices. Currently, most of the “READY” prompt is displayed in the output box. controller memory to the computer memory, is that different dialects of Logo support arrays in different ways. supported commands are related to the positioning of the x PRGUP - uploads the program from the computer to the For example, in the FMSLogo the declaration of the three- manipulator and control of the program course (absolute jumps, 3.1. Organization of the program’s robot’s controller, element, one-dimensional array can be done in the simple way loops, subroutines). 3.1. Organization of the program’s memory memory x POSUP - uploads the positions from the computer to the [14]: Basic assumptions concerning the establishment of an robot’s controller, interpreter were: x LISTPOS - displays all of the defined positions in the MAKE “a {12 34 56} x the maximum use of the UCBLogo (Berkeley Logo) standard, There are two memory blocks reserved for the Movemaster Notepad editor, in order to achieve high compatibility with other dialects and Command code. The first one is the positions memory declared in x LISTPRG - displays all of the entered program lines in the where a is the array name consisting the numbers 12, 34, 56. thus also high portability of the interpreter, the following manner: Notepad editor. The same array should be declared in Elica Logo in this way: x the illustration of the location and the gripper state will be MAKE “posarray (ARRAY 629). The PRGDOWN, PRGUP, POSDOWN and POSUP done using the appropriate icons for the turtle, MAKE “a [12 34 56] commands are working only when the robot is connected by using x the command interpreter will be limited to the actions The program memory is defined as below: the RCONNECT command. For this reason it has been decided, associated with moving of the manipulator, As it can be seen, the Elica Logo do not distinguish an one- that these commands invoke the RCONNECT automatically. It x the FMSLogo environment will be used for implementing the MAKE “progarray (ARRAY 2048). dimensional array from a list. The problem is that the first could be misleading, why there are separate commands for interpreter, because it is very stable and covers most of the declaration, made in the FMSLogo does not work in the Elica connecting to and disconnecting from the robot’s controller, but Berkley standard, After entering the position definition or the program line into Logo and the code is not portable between them. In fact, the Elica this is for very simple reason. As it was mentioned earlier, x the input window (see Fig. 12), accepting it by the ENTER key or recognizes the text between the {} chars as a comment [15]. The less emphasis on user interface - most of the commands will entering the instruction from Movemaster Commands set without be entered directly from the command line, OK button, the string is processed by the incremental compiler FMSLogo has also the possibility to declare a multi-dimensional and then copied into the proper array. The earlier processing is the line number causes the immediate execution of the command x the ability to read the program and the positions from the array in this manner: necessary, because a position can be defined by directly entering [16]. The specific commands are RN, which starts the program robot controller and send the revised code from your the PD command with parameters, or can be a part of the execution, NW that clears the program memory and PC, which computer to the robot. MAKE "a (MDARRAY [2 3] 0) program, when the line number precedes the PD command. The deletes position from the memory. In case of these commands, it MDSETITEM [0 0] :a 1 There is no standard graphical user interface planned due the compiler should make the proper decision and properly classify should be indicated to which device instruction should be sent. fact that the FMSLogo has relatively poor support for handling the string. The simplest way is to add the parameter to the command, but this The above sample of code declares the two-dimensional array windows. The application can display dialog boxes, but there is Keeping in the memory both the source code and its is connected with the modification of original syntax. The second named a, where the indexes start at 0 and end respectively at 2 no possibility to create full windowed application - in short, there processed version requires very careful synchronization between simple method is to point out which device should be used by and 3. The second line of the code sets the value of the array can be only auxiliary dialog windows, like for example in Excel them, but keeping the source code is necessary for correct data connecting to it. This convention is used by the interpreter, by element (0,0) to 1. when macros have been used. exchange between the computer and the robot controller. using the RCONNECT command. In this way, when the robot is

The robot programming language interpreter written in the Logo language 201

Journal of Achievements in Materials and Manufacturing Engineering Volume 45 Issue 2 April 2011

connected, then every command is redirected to the robot’s the Mitsubishi Movemaster RV-M1 robot, mounted on the [2] D. Reclik, G. Kost, The comparison of elastic band and B-Spline controller. Respectively, when the robot is disconnected, then laboratory stand (Fig. 15). 4. Conclusions polynomials methods in smoothing process of collision-free robot commands operate on the local program memory. For example, During the tests, the following aspects are checked: trajectory, Journal of Achievements in Materials and This paper presents a simple example of a simulator, used to giving the RN instruction cause the execution of the program by x opening and closing the connection to the robot, Manufacturing Engineering 29/2 (2008) 187-190. represent the trajectory of the robot manipulator. The Logo the robot, in case the robot is connected, or by the turtle, in case x procedures of positions/program download and upload, [3] J. ĝwider, K. Foit, G. Wszoáek, D. Mastrowski, The system language used in the experiment is quite useful tool to represent the robot is disconnected. On the other hand, the PRGUP, x for simulation and offline, remote programming of the automatic switching between the targets (the robot or the the robot moves, since one of purposes of its creation was to PRGDOWN, POSUP, POSDOWN instruction cannot work Mitsubishi Movemaster RV-M1 robot, Journal of simulator) during execution of the control the robot. without physical connection to the real robot, so their work is Achievements in Materials and Manufacturing Engineering RCONNECT/RDISCONNECT commands, The presented program is based on FMSLogo interpreter and divided into three stages: 25/1 (2007) 7-14. x compliance between simulated and the real trajectory, has been created as a tool to support the process of programming x connection to the robot, [4] K. Foit, The web-based programming interface for the x the results of the compilation of particular commands. a robot. One of the main goals is to run it on older computer x operation on the program or the positions (upload or Mitsubishi Movemaster robot, Journal of Achievements in hardware platforms. The form of the user interface and way of download), Materials and Manufacturing Engineering 27/2 (2008) 183-186. presenting the results of the robot program arises directly from the x disconnection from the robot, [5] J. ĝwider, K. Foit, G. Wszoáek, D. Mastrowski, The off-line properties of the used Logo interpreter. On the other hand x programming and simulation software for the Mitsubishi in the case of download operation, the program is compiled simplifying the graphical representation and the abandonment of Movemaster RV-M1 robot, Journal of Achievements in and the proper procedures are generated. the 3D model of the manipulator derive from the aim to shorten There is one exception, when the robot is connected before Materials and Manufacturing Engineering 20 (2007) 499-502. the process of writing the program - in this case, the focus has issuing these commands: In this case, the command, after the [6] G. Kost, R. Zdanowicz, Modeling of manufacturing systems been on the possibility of a direct Movemaster Command th operation, does not close the communication port. and robot motions, Proceedings of the 13 International language interpretation and generation on this basis of the The LISTPOS and LISTPRG commands use the Notepad Scientific Conference “Achievements in Mechanical and relevant procedures in Logo. The use of the graphics capabilities editor to display the code. The Logo interpreter uses the modal Materials Engineering” AMME'2005, Gliwice-Wisáa, 2005, of the Elica Logo dialect require prior establishment of the input window, so during listing the long program in the output [7] K. Foit, An introduction to the hybrid simulation - the relevant libraries, which contain needed descriptions of graphic box, there is no possibility to use scrollbars. Using the Notepad conception of the simulation system, Journal of elements of the virtual world. The Elica Logo does not provide for displaying the code is effective and simple method. Achievements in Materials and Manufacturing Engineering direct import of 3D graphics to the program code, while creating The program uses two turtles in parallel: one for displaying 39/2 (2010) 347-350. the appropriate converter would take considerable time. In this the tool position and orientation and the second for the tool status [8] G. Kost, D. Reclik, The 2 1/2D algorithm in robot case, the creation of a virtual world based on VRML/X3D is (Fig. 13). This is because FMSLogo does not support bitmap workspace analysis, Acta Mechanica et Automatica faster because a lot of 3D modelling software supports writing to transformations imposed on the turtle. In this way, one of the 2/3 (2008) 65-70. that format. turtles have a standard shape and reflects the orientation of the [9] M. Rohrmeier, Interactive simulation using virtual systems: The current, experimental version of the program lacks some tool, while the second one is associated with an icon that shows web based robot simulation using VRML, WSC'00 functions concerning simulation errors. There is no manipulator nd whether the robot gripper is open or closed. Fig. 14. The example trajectory drawn in the RoboSim program Proceedings of the 32 Conference on Winter Simulation, workspace limits checking, so it is on the user to remember about using the Logo platform San Diego, 2000, 1525-1528. them. Another disadvantage is that the application is dedicated to a) b) [10] S. Carpin, M. Lewis, J. Wang, S. Balakirsky, C. Scrapper, the particular type of robot (in this case the Movemaster RV-M1). USARSim: a robot simulator for research and education, To sum up, the use of the Logo programming language as the Proceedings of the 2007 IEEE International Conference on interpreter of robotic programming language is relatively easy in Robotics and Automation ICRE’2007, Roma, 2007, 1400-1405. comparison with the other high-level programming languages. [11] B. Harvey, Computer Science Logo Style, I-III, MIT Press, Some problems may occur during the graphical user interface http://www.cs.berkeley.edu/~bh/. design, because this part is not well implemented in the Logo th [12] P. Boychev, Elica Logo and Objects, Proceedings of the 7 language. This should be the reason for finding other solution, European Logo Conference EuroLogo 1999, Sofia, which could connect the power of Logo language with the smarter http://www.elica.net/site/papers/papers.html. user interface. [13] P. Boychev, Using Logo To Model And Animate, th Proceedings of the 10 European Logo Conference Fig. 13. The main turtle with the companion turtle, which shows the closed gripper (a) and the opened gripper (b) icon EuroLogo 2005, Warsaw, http://www.elica.net/ site/papers- References /papers.html. The example trajectory, which is a result of a simple program, [14] FMSLogo Manual, http://fmslogo.sourceforge.net/manual- is shown in Fig. 14. The turtle nose shows orientation of the tool [1] J. Li, S.H. Masood, Modelling robotic palletising process /index.html. (gripper). It should be mentioned, that in the prototype version of with two robots using queuing theory, Journal of [15] Elica Logo User’s Manual and Demos (a part of Elica Logo the program, there is no option to change the style or the colour of Achievements in Materials and Manufacturing Engineering system). the line. The application has been designed to be as simple as 31/2 (2008) 526-530. [16] Mitsubishi Movemaster RV-M1 User’s Manual. possible in order to run on almost all software platforms, including the old computer systems.

3.3. The tests of the application 3.3. The  tests of the application using the real robot using the real robot Fig. 15. The Mitsubishi Movemaster RV-M1 laboratory stand The correctness of the results of the commands related to the real robot control has been verified in the Intitute’s Laboratory of The RoboSim application successfully passed all of the Automation and Robotization of Technological Processes, using mentioned tests, concerning the of implemented functions.

202 Research paper K. Foit

Manufacturing and processing

connected, then every command is redirected to the robot’s the Mitsubishi Movemaster RV-M1 robot, mounted on the 4. Conclusions [2] D. Reclik, G. Kost, The comparison of elastic band and B-Spline controller. Respectively, when the robot is disconnected, then laboratory stand (Fig. 15). 4. Conclusions polynomials methods in smoothing process of collision-free robot commands operate on the local program memory. For example, During the tests, the following aspects are checked: trajectory, Journal of Achievements in Materials and This paper presents a simple example of a simulator, used to giving the RN instruction cause the execution of the program by x opening and closing the connection to the robot, Manufacturing Engineering 29/2 (2008) 187-190. represent the trajectory of the robot manipulator. The Logo the robot, in case the robot is connected, or by the turtle, in case x procedures of positions/program download and upload, [3] J. ĝwider, K. Foit, G. Wszoáek, D. Mastrowski, The system language used in the experiment is quite useful tool to represent the robot is disconnected. On the other hand, the PRGUP, x for simulation and offline, remote programming of the automatic switching between the targets (the robot or the the robot moves, since one of purposes of its creation was to PRGDOWN, POSUP, POSDOWN instruction cannot work Mitsubishi Movemaster RV-M1 robot, Journal of simulator) during execution of the control the robot. without physical connection to the real robot, so their work is Achievements in Materials and Manufacturing Engineering RCONNECT/RDISCONNECT commands, The presented program is based on FMSLogo interpreter and divided into three stages: 25/1 (2007) 7-14. x compliance between simulated and the real trajectory, has been created as a tool to support the process of programming x connection to the robot, [4] K. Foit, The web-based programming interface for the x the results of the compilation of particular commands. a robot. One of the main goals is to run it on older computer x operation on the program or the positions (upload or Mitsubishi Movemaster robot, Journal of Achievements in hardware platforms. The form of the user interface and way of download), Materials and Manufacturing Engineering 27/2 (2008) 183-186. presenting the results of the robot program arises directly from the x disconnection from the robot, [5] J. ĝwider, K. Foit, G. Wszoáek, D. Mastrowski, The off-line properties of the used Logo interpreter. On the other hand x programming and simulation software for the Mitsubishi in the case of download operation, the program is compiled simplifying the graphical representation and the abandonment of Movemaster RV-M1 robot, Journal of Achievements in and the proper procedures are generated. the 3D model of the manipulator derive from the aim to shorten There is one exception, when the robot is connected before Materials and Manufacturing Engineering 20 (2007) 499-502. the process of writing the program - in this case, the focus has issuing these commands: In this case, the command, after the [6] G. Kost, R. Zdanowicz, Modeling of manufacturing systems been on the possibility of a direct Movemaster Command th operation, does not close the communication port. and robot motions, Proceedings of the 13 International language interpretation and generation on this basis of the The LISTPOS and LISTPRG commands use the Notepad Scientific Conference “Achievements in Mechanical and relevant procedures in Logo. The use of the graphics capabilities editor to display the code. The Logo interpreter uses the modal Materials Engineering” AMME'2005, Gliwice-Wisáa, 2005, of the Elica Logo dialect require prior establishment of the input window, so during listing the long program in the output [7] K. Foit, An introduction to the hybrid simulation - the relevant libraries, which contain needed descriptions of graphic box, there is no possibility to use scrollbars. Using the Notepad conception of the simulation system, Journal of elements of the virtual world. The Elica Logo does not provide for displaying the code is effective and simple method. Achievements in Materials and Manufacturing Engineering direct import of 3D graphics to the program code, while creating The program uses two turtles in parallel: one for displaying 39/2 (2010) 347-350. the appropriate converter would take considerable time. In this the tool position and orientation and the second for the tool status [8] G. Kost, D. Reclik, The 2 1/2D algorithm in robot case, the creation of a virtual world based on VRML/X3D is (Fig. 13). This is because FMSLogo does not support bitmap workspace analysis, Acta Mechanica et Automatica faster because a lot of 3D modelling software supports writing to transformations imposed on the turtle. In this way, one of the 2/3 (2008) 65-70. that format. turtles have a standard shape and reflects the orientation of the [9] M. Rohrmeier, Interactive simulation using virtual systems: The current, experimental version of the program lacks some tool, while the second one is associated with an icon that shows web based robot simulation using VRML, WSC'00 functions concerning simulation errors. There is no manipulator nd whether the robot gripper is open or closed. Fig. 14. The example trajectory drawn in the RoboSim program Proceedings of the 32 Conference on Winter Simulation, workspace limits checking, so it is on the user to remember about using the Logo platform San Diego, 2000, 1525-1528. them. Another disadvantage is that the application is dedicated to a) b) [10] S. Carpin, M. Lewis, J. Wang, S. Balakirsky, C. Scrapper, the particular type of robot (in this case the Movemaster RV-M1). USARSim: a robot simulator for research and education, To sum up, the use of the Logo programming language as the Proceedings of the 2007 IEEE International Conference on interpreter of robotic programming language is relatively easy in Robotics and Automation ICRE’2007, Roma, 2007, 1400-1405. comparison with the other high-level programming languages. [11] B. Harvey, Computer Science Logo Style, I-III, MIT Press, Some problems may occur during the graphical user interface http://www.cs.berkeley.edu/~bh/. design, because this part is not well implemented in the Logo th [12] P. Boychev, Elica Logo and Objects, Proceedings of the 7 language. This should be the reason for finding other solution, European Logo Conference EuroLogo 1999, Sofia, which could connect the power of Logo language with the smarter http://www.elica.net/site/papers/papers.html. user interface. [13] P. Boychev, Using Logo To Model And Animate, th Proceedings of the 10 European Logo Conference Fig. 13. The main turtle with the companion turtle, which shows the closed gripper (a) and the opened gripper (b) icon EuroLogo 2005, Warsaw, http://www.elica.net/ site/papers- RReferenceseferences /papers.html. The example trajectory, which is a result of a simple program, [14] FMSLogo Manual, http://fmslogo.sourceforge.net/manual- is shown in Fig. 14. The turtle nose shows orientation of the tool [1] J. Li, S.H. Masood, Modelling robotic palletising process /index.html. (gripper). It should be mentioned, that in the prototype version of with two robots using queuing theory, Journal of [15] Elica Logo User’s Manual and Demos (a part of Elica Logo the program, there is no option to change the style or the colour of Achievements in Materials and Manufacturing Engineering system). the line. The application has been designed to be as simple as 31/2 (2008) 526-530. [16] Mitsubishi Movemaster RV-M1 User’s Manual. possible in order to run on almost all software platforms, including the old computer systems.

3.3. The tests of the application using the real robot Fig. 15. The Mitsubishi Movemaster RV-M1 laboratory stand The correctness of the results of the commands related to the real robot control has been verified in the Intitute’s Laboratory of The RoboSim application successfully passed all of the Automation and Robotization of Technological Processes, using mentioned tests, concerning the scope of implemented functions.

The robot programming language interpreter written in the Logo language 203