As part of OSIE project (Open Source Industrial Edge) we required to have a demonstrator and development system. We decided to implement a small industrial production line using only open source technology. Due to the COVID pandemic and travel and working restrictions, we had no way to visit any of the industrial project partners and thus had to come up with an alternative way so we could implement controls of a production line which we had access to. As one of the project partners and one the Nexedi team leader were located in a region known for cherry production in Bulgaria, we decided to build a cherry picking machine that could sort good from bad cherries and later also fruits in general.
Our long term objectives for this machine are:
Nexedi is a software company first and foremost, so building a mechanical conveyor with all needed electronic components for this was not something we were very familiar with at first. Our initial designs were very naive, our understanding of the problems we faced very limited.
We decided early on to work with ProviewR - an open source process control software used in large scale industrials. During the first months of the project we had a chance to test how ProviewR would connect to a "soft" modbus interface which our machine would provide but without having the physical machine itself. More details can be found in this blog post on using ProviewR with the Godot 3D game engine.
Below you can see a simulated video of the machine we wanted to build and control with ProviewR.
Our critiera to meet from the get go are listed below:
Based on these criteria we knew that we would have to implement our own versions of already existing industrial components like PLC with modbus protocol support. For this we decided to use Olimex's Lime2 open hardware board
We had to be able to control electrical devices (motors, valves, etc), which is usually done by a PLC. We had to build our own but before starting we had to handle a number of prerequisities:
It took some efforts to build a case for Lime2. We did this by starting from an existing FreeCad model which we extended so it could fit an additional component from Olimex called Lime2-shield. The process of printing a box was done using an entry level 3D printer. Luckily for us, Olimex had already developed a library that handles communication over I2c called pyA20Lime2.
As result we had our first first PLC with its own DIN rail mountable box that could be controlled by a Python script. Not fancy but working.
Nexedi hired an external engineer to build a conveyor belt around which we started to construct the fruit selection machine. Our goal was to have the most simple conveyor with loading and offloading units that:
Thanks to industrial standards and existing components this was the easiest part of all. With some good mechanical knowledge we had our first conveyor belt running with START / STOP button within a few weeks.
At this point in project we could use simple Python script to turn conveyor On / Off. To begin, we did not want to handle VFD's modbus communication and thus we had to use a hard-wired configuration and hard-coded linear speed settings which we then developed to controling the electrical relay using remote code. As part of this phase, we added an air valve controlled via a 12V DC circuit which we would use later in project to blow off bad fruits from the line. We added an air compressor which would supply the compressed air for the valve - of course using existing industrial components like relays, air valves, compressors, etc.
And final wiring:
The last part of project was adding Modbus support for our software PLC layer. This would allow a remote application and / or ProviewR setup to control the conveyor. In addition to this we started to experiment with real time camera which uses OpenCV to do shape detection. Since it was a first attempt, the optical inspection we implemented was quite modest and simple: it uses simple masks and countour detection so our conveyor is "trained" to blow away any red items which have more than three countours. This algorithm will of course be improved as the project progresses so it can be used on for real fruits with more complex and realistic models. However for the initial goals we proved that it's possible to have a open source machine within 5 months.