Colour based sorting station with Matlab simulation

. The paper presents the design process and manufacturing elements of a colour-based sorting station. The system is comprised of a gravitational storage, which also contains the colour sensor. Parts are extracted using a linear pneumatic motor and are fed onto an electrically driven conveyor belt. Extraction of the parts is done at 4 points, using two pneumatic motors and a geared DC motor, while the 4th position is at the end of the belt. The mechanical parts of the system are manufactured using 3D printer technology, allowing for easy modification and adaption to the geometry of different parts. The paper shows all of the stages needed to design, optimize, test and implement the proposed solution. System optimization was performed using a graphical Matlab interface which also allows for sorting algorithm optimization.


Introduction
Automatic sorting is one of the most common tasks needed in automated systems [1]. The advantages of such a system are high working speed, high precision, low costs as well as the possibility of sorting through a vast number of objects. Current solutions to this problem are based on several principles, mostly adapted according to what the sorting is done: colour, volume, weight, material type -based on this the measured parameter can be optical, geometric, and magnetic [2].
Such systems can be based on electric, pneumatic or hydraulic actuators according to the particularities of the objects being sorted: weight, volume, rigidity, risk of explosion, working in clean environments, etc. For example, electric systems are preferred for angular displacements while fluid-based actuators are widely used for linear movement [3,4]. There is a growing need for training in the use of such systems, as almost all sorting is now done automatically [5].
The paper shows the methods employed by the authors for the design and of a colourbased sorting station.
The basic schematic of the system is shown in figure 1. It is comprised of a gravitational storage for cylindrical parts, which also contains the colour sensor, HDJD-S822-QR999, alongside a supplemental LED light source.
The parts are taken out of the gravitational storage one at a time by means of a linear pneumatic motor and pushed onto a constant speed conveyor belt, actuated by a servo DC motor. The sorting station has 4 pre-set sorting positions where the parts are stopped depending on their colour, which has been previously determined in the gravitational storage. Removal of the parts from the conveyor is done by means of two pneumatic motors, a servo dc motor as well as the conveyor itself (end of the conveyor). This was done to exemplify different means of performing this operation.

Design of the sorting station
Design of the components of the system was done using Solidworks 3D software, used to obtain STL models of the parts needed to 3D print each component. Using this method allows for easy modifications to be made if the sorting pieces are changed.
The gravitational storage (figure 3a-STL model and 3b-printed model) is comprised of three parts. The first one is cylindrical and is used for actual storage of the parts. Pieces 2 and 3 are attached to the storage and are necessary for the colour sensor, including isolating it from exterior light sources. Colour of the parts represents of the early versions of the system.
Design of the gravitational storage allows for easy modification to be made to the system if for example, the shape of the sorted parts is changed.    Conveyor 9 is connected to servo dc motor 7 by coupling 8. The system is also equipped with a tensioner mechanism 10. Parts are removed from the conveyor using linear motors 12, equipped with cams 11 or by means of a electric motor 13. The electronic system used to control the system is housed in box 14.
The 3D model of the system is presented in figure 5a and the physical model in figure 5b.

The control system
The pneumatic control system of the sorting station is presented in figure 6. It is comprised of a single acting cylinder A, needed to remove the parts from the gravitational storage, as well as single acting cylinders B and C (12 in figure 5), needed to remove the parts from the conveyor belt. All pneumatic motors are controlled by 3/2 pneumatic way valves, electrically actuated. The electronic control system is structured around two Atmel microcontrollers, one responsible for control of the servo dc motor needed for the conveyor and one used to read and send control signals to all other parts of the system. A separate microcontroller is used for the conveyor motor to ensure constant speed and also be able to implement a accelaration/deceleration interrupt-driven algorithm. This is neded since removal of the parts from the conveyor is done in a time-sensitive loop, rather than implementing a proximity sensor algorithm. This was done to ensure low cost and low maintenance of the system. The second microcontroller is used to read analog voltage values from the colour sensor -between 0 and 5V for red, green and blue respectively. The power level of the control system is interfaced using transistor relays. General schematic for the electronic circuit is presented in figure 7.   Fig. 7. Electronic circuit.

Simulation
In order to study the working principle of the sorting station, the authors have developed a graphic interface using Matlab programming environment (figure 8).
The interface recreates the system and allows for different conveyor speeds to be selected, as well as the distance between the sorting positions. In order to start the simulation the user must first select the overall length of the station, by using the "Maximum Length L[mm]" pop-up selector. The speed of the system is also selected by using the "Transport belt speed v [mm/s]" selector. Simulation is started by using the appropriate button and in the new window a random generated part will appear in the storage position. The part is transported using the conveyor to the appropriate position, according to its colour. The application returns travel time to sorting position as well as the speed of the conveyor.  Figures 9a through 9f show the result for different colours. As can be seen in figure 9a depicting the sorting of a red part, time elapsed (1.73s) from the storage PM to the sorting position PM1 is shown in red under the appropriate station. Figures 9c and 9b show sorting of a black part, which is not removed from the conveyor by one of the motors but is stored in a box at the end. Figures 9e and 9f show the sorting process and time for a blue and orange part.

Conclusions
The proposed system has been designed, simulated and tested by the authors. During these stages different modifications were made to the initial design to ensure that it will function within desired parameters but also to ensure that the system could be easily replicated or adapted if needed. Simulations done in Matlab programming environment have confirmed results obtained by testing the installation.