Background
ASTOR is a technological partner in the transformation of factories, responsibly leading the way for the industry of the future. They are leaders in promoting the “Industry 4.0” concept in Poland, offering products such as industrial software, controllers, industrial and mobile robots, drives and industrial communication equipment. They represent different global brands in Poland, including Emerson, Kawasaki Robotics, AVEVA, Epson, MiR, CyberX, Satel, and Horner. They offer assistance in selecting proven solutions for various industries and helping the smooth navigation through the process of change to achieve different business goals. They also have for many years collaborated with leading Polish technical universities and secondary schools.
The project they approached us with was specifically aimed at educating future engineers and improving the transfer knowledge . Astor wanted pupils and university students to gain access to professional equipment from the very beginning, without huge financial investments, but they were having difficulties in finding a suitable solution on the market. Here Marek Niewiadomski was able to design a special robotic construction.
ASTORINO is an innovative educational robot based on six axes, based on 3D printing technology. The user receives 3D designs for all the components, enabling them to print parts independently in case of damage. The programming for the robot is done using the AS language, similar to industrial robots by Kawasaki Robotics. It has external equipment that can be attached using a pick & place mechanism, identical to industrial machines. All of this allows the robot to perfectly reflect the industrial environment, making it an ideal tool for learning robotic techniques and preparing for vocational exams. The robot’s presentation and operating course can be found on ASTOR’s YouTube channel.
Challenge
Astor tasked us with creating an interpreter for the AS language, the original language for controlling Kawasaki Robotics robots, transforming it into C language code.
The programme written in the AS language is uploaded to the robot’s microcontroller, using an SD card. The microcontroller must translate this programme into C and then compile it with the appropriate libraries to create a ready-to-run programme. The resulting programme is executed and controls the robot’s movements. This approach required the creation of an interpreter that minimises the use of RAM and maximises the use of FLASH memory.
Solution
The most important element of this process was the creation of a pair of cooperating generators – lexer and parser, which run the AS-language function skeletons. The lexer – Flex analyses the entered AS-language code, checking each character and creating tokens, which are lexical symbols, that then go to the parser. Based on these tokens, the Bison parser combines them into appropriate rules (which can be compared to grammatical rules, certain sentences) and triggers the dedicated actions assigned to these rules. In this way, the AS-language, which is incomprehensible to the robot, is transformed into specific commands that go to the microcontroller and control the robot. This would not be possible without all these mechanisms.
The microcontroller significantly affected the complexity of the project. Its small amount of RAM forced us to use constant and FLASH memory. Due to performance reasons, actions such as defining variables had to take place in RAM, so this required us to operate on variable pointers wherever possible to minimise the creation of variable copies. Despite this solution, in many cases we also had to resort to manual use of static memory, such as when storing programme functions in FLASH memory.
We introduced our own memory management system, a ‘garbage collector’, which can also release memory in cases of a sudden programme termination.
To make using Astorino even easier and more user-friendly for those who are just learning, we included a system for reporting errors in the interpreter using the entered AS-language code. Lines of code containing syntax and grammatical errors are identified and displayed.
Result
The solution has been delivered to the client. Astor has already introduced Astorino robots using our software for sale. However, the project remains in continuous development, and we are working together with Astor to improve the interpreter’s performance and facilitate its use. Users of previous versions of Astorino software also gain the opportunity to update it. The first universities and schools to use this educational robot praise its management process and overall performance highly.
The ImpiCode team, as part of our team, significantly contributed to the development of the innovative solution that is the Astorino educational robot. ImpiCode programmers helped us to develop software that enables the programming of our educational robot in the AS language. As a result of our work, future engineers can easily learn to operate professional industrial robots.
Technologies
Using Flex lexer and the GNU Bison parser generator, we created an interpreter from the AS language to the C language.