Recommended Posts

In addition to my highbay warehouse XL, I now have a new "Technic XL" build "finished" (it never really is finished). Link to the instructions on Rebrickable

51810276355_47fc7f1549_b.jpg

This time I wanted to create a pin sorter that can sort all kinds of lengths and colors (not shapes!).

51789695833_9067cd8ce7_b.jpg

Objectives:

  1. Sorting the different colors; Black, Tan, LBG, DBG, Red, Blue.
  2. Sorting the different lengths: 1.25 (Blue/LBG), 1.5(Tan, DBG), 2(Black, Tan, LBG, Blue), 3(Black, Tan, DBG, LBG, Red, Blue)
  3. Pins should go in bulk in a hopper, and be transported to the scanning belt.
  4. Pins should arrive on the scanning belt 1 by 1, if there are to much arriving they should be brought back to the hopper.
  5. Having the options to throw back the pins on the scanning belt.
    • If for some reason a pin is not recognized, I do not want it to continue to the sorting arm.
    • If 2 pins do get to close to eachother on the scanning belt it can not be scanned good, as the sensors take it as 1 big pin.
    • If some other kind of brick/thing gets on the belt and can not be sorted.
  6. The pins from "5." should go back to the feeding hopper so they can be scanned again later.
  7. Each kind of pin needs to be sorted into easy to come by bins (format).
  8. If pins come fast after each other and the swingarm needs to go far in between, hold them so they don't go flying midair.
  9. If there are many pins in the hopper or nearly empty the feeding system should adjust the speed.

Solution:

  1. A double RBG (Red-Blue-Green) sensor setup. First one on a white background, second one on black background. This makes it possible to find the color of each pin more accurate.
  2. The same sensors measure the length of the pin, all the Data collected is then controlled by a list of possible results.
  3. The main problem with pin sorters is that the little tabs on the pins get stuck everywhere, even 0.1mm sticking out stacked-liftarms can launch them in the air. So I decided to go with a belt system to bring all the pins up.
    • The first belt is a large 3wide small chain conveyor angled near 40°, this is to get them high enough already and this type of chain gives a lot of grip on pins.
    • The second belt is a faster 3wide small chain conveyor lying flat to get the pins to the next upgoing belt, sliding plates did not work, pins get stuck on anything and that's not good with the high output of the first belt.
    • The third belt is a double speed 4wide small track + small chain. This is to get all the pins in the correct direction on 1 single belt at the end.
  4. If there are to much pins to get on 1 single belt, or stacked on eachother they should return to the same hopper, that's why the small conveyor was needed to turn 180° and end up with the overflow right at the hopper.
  5. Pins that can not be scanned good are reversed on the scanning belt back to the first sensor up to 3 times. Meanwhile the feeding system can just continue as it does not get stuck.
  6. The scanning belt is open at the rearside, so pins from "5." are thrown back in the hopper.
  7. The swingarm has a long length and angled up so any kind of plastic bins can be put under, not just tiny ones. A big bearing makes that fast swing are possible and do not skip gears.
  8. The position of the scanned pins are constantly calculated to send the next pin only if it's possible to make the swing to the correct bin. If there is not enough time, the scanning belt will stop and the feeding aswell to prevent buildup before the sensors.
  9. in normal operation with still enough pins in the system the feeding conveyors run at nominal speed. If the first sensor does not detect pins for a longer time it speeds up the feeding by 20% every 5 seconds up to 300% speed, after detection it is slowed down again.

Now the 1 video tells more then 1000 words;

All is run with 4 motors and 3sensors (touch sensor could be left away and use run_until_stalled). So it should be possible with Robot Inventor I think, but I don't have yet such a set.

The onscreen view during the program;

51790316195_b559fc0ecc_b.jpg

New video with calibration included

 

Edited by Mr Jos
Added a clean white background render

Share this post


Link to post
Share on other sites

Cool! It works supersmooth. Interesting that the friction/texture of the small chains is already enough to carry the pins on a fairly steep slope. I hadn't expected that.

Share this post


Link to post
Share on other sites

Very nice! I love these kind of machines!

Could it also sort pins with bush? Though I imagine they might be problematic, as they come in enormous variety of colours, so they'd end up in every bin...

Share this post


Link to post
Share on other sites

I would guess that pins with the bush might be too tight on the sections of conveyer which are only a single link wide.  I would say that maintaining a consistent flow of pins is the biggest challenge, as the large wave of pins (most of which are rejected) results in the momentary loss of flow to the sensors.  This is a really good project and it is great to see the speed of rotation of the delivery conveyer.  Well done!

Edited by trekman

Share this post


Link to post
Share on other sites

Thanks for sharing, very cool. I wonder how you code everything? Because there’s a lot of logic involved…

Share this post


Link to post
Share on other sites

Again, you have created a wonderful machine. A nice inspiration for some of us, including me.

Share this post


Link to post
Share on other sites
On 12/31/2021 at 2:36 PM, Jeroen Ottens said:

Cool! It works supersmooth. Interesting that the friction/texture of the small chains is already enough to carry the pins on a fairly steep slope. I hadn't expected that.

Same thought here, I made many versions trying to get the pins from a large tank/hopper up. First models all had brickbuild/liftarm build steps going up/down, but the edge of the pins get stuck on every 0.01mm sticking out where 2 liftarms/bricks are connected to eachother, putting a big tension in the system, and then shoot all pins flying up in the air. The pro with the chains is that the pins don't get stuck as often anymore. There is 1 place where they sometimes do, and it's the slope 1x2 brick that is sideways at the 4->1 belt. It has a flat part where pins can push on, and when it grips on the small chain firmly it can go flying. But I didn't find a piece without any flat surface (it would be like a knife then). But it doesn't happen often, mostly it's the 1.25L (studded pins). They are the hardest to transport.

On 12/31/2021 at 2:56 PM, howitzer said:

Very nice! I love these kind of machines!

Could it also sort pins with bush? Though I imagine they might be problematic, as they come in enormous variety of colours, so they'd end up in every bin...

I just tried one and it does go through the system perfectly, I might add some of them, but I think I can't add the most common (LBG / Red) as they are 3L and both have a normal pin at 3L aswell, allthough the 3L LBG is discontinued I think, I only have 5 of them.

On 12/31/2021 at 7:32 PM, trekman said:

I would guess that pins with the bush might be too tight on the sections of conveyer which are only a single link wide.  I would say that maintaining a consistent flow of pins is the biggest challenge, as the large wave of pins (most of which are rejected) results in the momentary loss of flow to the sensors.  This is a really good project and it is great to see the speed of rotation of the delivery conveyer.  Well done!

  1. The pins with bushes do fit as said above, will try it when I fix my scanning belt.
  2. I already made the 3 belts bringing the pins up adjustable in speed. When no pin is detected for 5seconds it speeds up 20% every interval. I could lower this threshold to have more pins on the scanning belt.
  3. For this video I reduced the speed of the scanning belt to 400°/second because 3L pins that needed a rescan sometimes would fall of the edge and go in the wrong bin. If I place the sensor back 1stud, or make the conveyor longer by 1 stud I should be able to speed it back up to 800 or even 900°/second as that's the max speed of that motor.
  4. The amount of pins rejected on the belt (running backwards), I hope I will be able to reduce that, but the danger is that there will come a overlap in RBG and pins go to wrong bins.

 

On 12/31/2021 at 7:42 PM, GerritvdG said:

Thanks for sharing, very cool. I wonder how you code everything? Because there’s a lot of logic involved…

A lot of logic indeed. I just start at some point and test it. Sometimes I need to write some code just for calibration, like the background color of the sensors, but it's not needed in normal operation, just start small step by step. I do like to work with blocks and let it perform one task, sometimes I make several 'defenitions' and later on add them to 1 like here; This is a complete operation for the white sensor, and then another block for the black sensor.

51794005536_9fe91937fd_b.jpg

I do like to add the explanation text to know what happens at each part, or what a variable value means, like here the complete data set for a pin at the end of a pin detection.

51793058867_daf127627c_b.jpg

 

16 hours ago, Jonas said:

Again, you have created a wonderful machine. A nice inspiration for some of us, including me.

Thanks!

Share this post


Link to post
Share on other sites
52 minutes ago, Mr Jos said:

I just tried one and it does go through the system perfectly, I might add some of them, but I think I can't add the most common (LBG / Red) as they are 3L and both have a normal pin at 3L aswell, allthough the 3L LBG is discontinued I think, I only have 5 of them.

Yeah, I don't think the LBG 3L frictionless pin has been around since 2007 or something. On the other hand, they just recently released the 77765 pin which is also LBG and 3L so that's going to confuse your sorting system unless you avoid those.

As for the 3L pin with bush, I guess your machine could be used to colour sort them too, just have to account for the large number of different colours.

Share this post


Link to post
Share on other sites
19 hours ago, kieran said:

That’s fantastic, do you share your source code?

All my MOC's that are with advanced programs come with code on Rebrickable, if they could be useable for other people to try.

- Like my Warehouse is to big, I do have a Studio file from v1 and some instructions (not XL version yet), but they are for my own to rebuild them if I need to later. So I didn't post it.

- But my 6DoF arm and V1/2 Pin Sorter instructions are for sale with programs included, where the programming is actually the biggest part. I remade the robotic arm for my warehouse with my instructions and it only took me 1 evening to build it, programming took way over 300hours.

- This V3 Pin Sorter I will start to model in Studio soon, and it's much better then the V1/2 as I learned better ways to code MicroPython now from self learning by reading https://www.w3schools.com/python/ (I am a mechanical industrial machine installer, not a programmer, so will it be written the best possible? No, but it works fine). On this sorter the scanning belt can run backwards for rescanning/rejecting instead of using a bin for "unknown", but it comes at a price of more parts used (loads of small chain).

Do I charge money? Yes, but it's just a little in my opinion, I already heard of a handfull people who bought my 6DoF instruction that they only did it for the program, so they can adapt it to their own robotic arm. One of them even changed it completely to be used with Robot Inventor instead of 2x EV3. I helped him by Messenger for few hours to explain some of the code he needed to change just to get it working on an other sytem, and in the end he managed to. I have no problem in helping people out, the cost is just to be sure people understand what they get as they are interested in it, and not because it's free and have no idea what they are trying to recreate.

The builds I make are always on the edge of what is possible with plastic bricks, I always try to find that edge (and max working speed), and many times I went over it and it seems impossible to do, but those do not get a post here.

So yeah, it will be available in a few weeks I think. Maybe I will even make a manual version that has only the scanning belt with 1motor and 2sensors and manual pin feeding, just so more people can try and learn from it so they don't need loads of parts, but the code for scanning will remain the same.

Share this post


Link to post
Share on other sites

After a few evenings modelling in Stud.Io, and a 50minute render from my old laptop,

51808257156_4ded5e2518_b.jpg

Now just the swingarm is left to design and then full instructions. 743 small chain links counted in the real complete model, and 86 small thread links. I think it will be over 30% of the piece count.

Share this post


Link to post
Share on other sites

And the complete 3D is finished. I've learned a few techniques to be able to model it faster, certainly with all the angles in this build. 2093parts total including the 829 chain pieces (39%)

Without starting to make the instructions (just the steps I designed it in), it's at 365 steps/pages, but I will heavily reduce that now.

Edit: After day one, at instruction page 93 now, total pages reduced to 251 and 339 steps leftover (callouts reduce them). A few more evenings needed to finish the PDF. /End Edit

51809653868_7a33364c66_b.jpg

A few upgrades have been made in the model that gave little problems in the original that is on the video, like the catching walls on the swingarm, with this design they don't keep hanging anymore once in a while.

51810276355_47fc7f1549_b.jpg

Edited by Mr Jos

Share this post


Link to post
Share on other sites

Finally finished the instructions for this model, had a lot of work adding the explanation for everything in the program and I added a easy to use calibration function to find the background RGB colors for both sensors when no pin is on the belt.

Pin sorter instructions on Rebrickable

A new video has been added alongside to show the new functions.

 

Few pages from the instruction and included program;

51823323705_efaef2a52e_b.jpg

51822604151_24ac81a769_b.jpg

51822604191_b1202c0502_b.jpg

51823323745_b834093b62_b.jpg

51822604301_81744dfe92_b.jpg

Guess it will be a breakdown now, maybe I will have to design my XL highbay warehouse in Stud.IO now aswell.. I didn't plan to as I would go to events with it, but corona decided they are cancelled.. So might break down all and start to design new models. The warehouse will just be for myselve to rebuild when events are allowed again, planning to bring both of these machines then, just need an extra EV3 battery.

Share this post


Link to post
Share on other sites

Absolutely amazing piece of engineering and coding! Very creative solution with two black background/white background sensors.

On the photo, it looks like a giant artillery piece XD

Share this post


Link to post
Share on other sites

I once made a pin sorter, but when I built it there was no pins left to sort 🙃🙃🙃🙃🙃

Share this post


Link to post
Share on other sites

I tried to make a more budget version, but then hit the wall again, that it's impossible with just 1 color sensor.

51833025782_2ecf925d51_b.jpg

Tried to get the sensor as close as possible to the pins, and with the dark coloured pins I identify them pretty good on length+color. But Tan pins are so damn hard, really need a dual sensor setup to find the anomalies, the overlap in length for 1,5L and 2L is so big it's impossible to do with this simple setup. I wanted to make just a little belt that could then show on screen or say what pin it scanned, or be used as a counter if you wanted like only 2L blacks and 200 of them, and it reverses all others.

Time to put this project aside now, and go back to a new version 6DoF, or something else..

Share this post


Link to post
Share on other sites
18 hours ago, Mr Jos said:

I tried to make a more budget version, but then hit the wall again, that it's impossible with just 1 color sensor.

 

Tried to get the sensor as close as possible to the pins, and with the dark coloured pins I identify them pretty good on length+color. But Tan pins are so damn hard, really need a dual sensor setup to find the anomalies, the overlap in length for 1,5L and 2L is so big it's impossible to do with this simple setup. I wanted to make just a little belt that could then show on screen or say what pin it scanned, or be used as a counter if you wanted like only 2L blacks and 200 of them, and it reverses all others.

Time to put this project aside now, and go back to a new version 6DoF, or something else..

It'll slow the things considerably, but maybe the process could be made more accurate with single sensor by having the pin run by the scanner multiple times?

Another thing that popped into my mind, would it help if the background was made of some colour that is not used for the pins (or is rare) like green or orange?

Share this post


Link to post
Share on other sites
38 minutes ago, howitzer said:

It'll slow the things considerably, but maybe the process could be made more accurate with single sensor by having the pin run by the scanner multiple times?

Another thing that popped into my mind, would it help if the background was made of some colour that is not used for the pins (or is rare) like green or orange?

Well, the sensor identifies by using RGB values. For each, Red Green and Blue, a value from 0 to 100 is given. The problem is that each pin is a mix of that, like tan has a lot of red, LBG has a lot of blue, DBG is near black (all 0's). And the pins are not big! This is one of the major issues, as the sensor's point of view is larger than a pin, it keeps seeing a part around the scanned pin. Also the chain I only have it in black, and it's always in the viewing range, it is available only in black and reddish brown, and now gold in the BMW bike, so not many choices.

The thing is that for our view a tan, LBG and blue pin do look different, but for the RBG they are pretty close, and certainly when taking 100 samples, there will be some pins with anomalies, that will overlap with another color. My large sorter was able to detect these anomalies because the chance that both sensor get an anomaly at the same time was very small. And I could rescan results that overlapped and could be 2 kinds of pins.

It also depends how the pin is on the belt, they have holes, short side, long side, round, axle. So it's not an easy result saying tan = 40/10/5 RBG for example. it will be a range.

Edited by Mr Jos

Share this post


Link to post
Share on other sites
Just now, Mr Jos said:

Well, the sensor identifies by using RGB values. For each, Red Green and Blue, a value from 0 to 100 is given. The problem is that each pin is a mix of that, like tan has a lot of red, LBG has a lot of blue, DBG is near black (all 0's). And the pins are not big! This is one of the major issues, as the sensor's point of view is larger than a pin, it keeps seeing a part around the scanned pin. Also the chain I only have in black, and it's always in the viewing range, it is available only in black and reddish brown, and now gold in the BMW bike, so not many choices.

The thing is that for our view a tan, LBG and blue pin do look different, but for the RBG they are pretty close, and certainly when taking 100 samples, there will be some pins with anomalies, that will overlap with another color. My large sorter was able to detect these anomalies because the chance that both sensor get an anomaly at the same time was very small. And I could rescan results that overlapped and could be 2 kinds of pins.

It also depends how the pin is on the belt, they have holes, short side, long side, round, axle. So it's not an easy result saying tan = 40/10/5 RBG for example. it will be a range.

Yes, the limited sensing ability of the sensor is a significant problem. I'm not sure how it would work, but eliminating the chain would probably help a lot too, maybe some sort of chute with a pusher that moved out of the way for detection and then back to forward the pin to the next belt?

Share this post


Link to post
Share on other sites
1 minute ago, howitzer said:

Yes, the limited sensing ability of the sensor is a significant problem. I'm not sure how it would work, but eliminating the chain would probably help a lot too, maybe some sort of chute with a pusher that moved out of the way for detection and then back to forward the pin to the next belt?

I tried many feeding systems, chain belt was the only reliable option. Pins have such a varying length (1,25 to 3 long) that it's not easy to get only 1 pin in front of the sensor. 2 small pins would also fill a 'loader' that uses a pusher, as it needs to be big enough to have a 3 long inside. And wherever many pins are together, all the hooks and edge do catch up in eachother and get stuck literally everywhere. if you stack 2 liftarms on eachother, just have a feel, there will be a small ridge. The 1.25L pins are the easiest to get stuck on places like this, and block a whole mechanism. As they move along with the chain it was the only option to transport them.

Share this post


Link to post
Share on other sites
12 minutes ago, Mr Jos said:

I tried many feeding systems, chain belt was the only reliable option. Pins have such a varying length (1,25 to 3 long) that it's not easy to get only 1 pin in front of the sensor. 2 small pins would also fill a 'loader' that uses a pusher, as it needs to be big enough to have a 3 long inside. And wherever many pins are together, all the hooks and edge do catch up in eachother and get stuck literally everywhere. if you stack 2 liftarms on eachother, just have a feel, there will be a small ridge. The 1.25L pins are the easiest to get stuck on places like this, and block a whole mechanism. As they move along with the chain it was the only option to transport them.

Yeah, sounds like there's not getting around of the 2 sensors if you want reliable readings...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.