part sorting demo video

WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

part sorting demo video

Post by WayOutWest »

Okay, keep in mind this is still pretty rough... the hardware is stock LitePlacer but I've had less than 3 weeks to write all the code from scratch (except libraries: OpenCV, libUVC, and DirectFB). Most of that time was spent fighting with the stupid TinyG -- I think they should have aimed lower and not tried to offload everything (including GCode parsing, planning, and command-sequence flow control) to the Atmel chip.

Also this can be done much, much faster -- I have put zero effort into speed and in fact deliberately slowed down a lot of things to make accuracy troubleshooting easier. But even at this ultra-slow speed it can sort an entire reel of passives in a 2.5-day-long weekend (i.e. Friday evening to Monday morning).

Yes, the accuracy is not completely perfect. I don't know exactly why the second capacitor is so far off-center, but all the rest are pretty good. The drift you see towards the right end is, I think, because the dropoff needle is actually pushing the ceramic plate a tiny bit with each part it deposits. Also I have the tolerances for the upcam alignment set pretty low; there are still a lot of things I can tune up to improve accuracy. I just wanted to demonstrate that the concept is proven.

All of the vision (except the initial needle-tip alignment) is done using MSER. The needle-tip alignment is the only thing that uses Hough circles.

Actually the LitePlacer shown isn't 100% stock -- the TinyG's firmware is heavily modified and the gantry head has two extra cameras (the needle-view camera that you see used in the video and a plan-view camera you don't see), plus the front headplate is flipped backwards so the downcam is to the LEFT of the needle. This way the upcam and downcam can look at each other... I'm trying to use this to eliminate the silly blue-goo alignment (which needs a human to remove the previous alignment mark) but I don't have that working yet. You can see that the upcam's circular focus knob is painted silver so it makes a really perfect circle when the downcam looks at it. Also I broke my A-axis motor last week so I had to bolt on a badly-fitting replacement from a 3D printer... that's why it looks like it's about to fall off. A replacement is on the way.

The main restriction is that the parts can't be touching. This is partly for vision recognition, but mainly to avoid picking up two parts at once (which leads to catastrophic fail).

The parts below are all 0603s but I'm running it now with 0402s and (aside from requiring a smaller needle) it works... (update: actually for 0402s telecentricity on pickup becomes an issue... I have to move the head until the part is centered in the visual field before deciding what its location is... trying to calculate it for a non-visual-field-centered part using image coordinates and mm-per-pixel results in error large enough to cause tombstoning at least 5% of the time).

Photo before:
before.jpeg
before.jpeg (171.43 KiB) Viewed 8960 times
Photos after:
after1.jpeg
after1.jpeg (92.95 KiB) Viewed 8960 times
after2.jpeg
after2.jpeg (46.86 KiB) Viewed 8960 times
after3.jpeg
after3.jpeg (98.63 KiB) Viewed 8960 times
And yes, it really does pick up every last part (the camera can only hold ~16 minutes of video). Although MSER doesn't recognize every single capacitor in every single frame of the video, it will eventually recognize all of them within a few seconds' worth. So the last few parts take a while longer to find, but they do get found.

Video:

(coming soon, as soon as I finish jumping through the stupid hoops Google makes you go through to upload to youtube)

Well, Google is failing hard right now (what else is new?) so I just used Mega, which... wow just worked without any hassles.

https://mega.nz/#!JMxX3IhR!tuIC_EZS9ic2 ... Fltyz2SaCc

(click the small text that says "download through your browser", not the big huge buttons that advertise junkware)

If you want to listen to the machine, here's a copy with audio included (you have to turn the volume WAY up though)

https://mega.nz/#!9NhgxQ5a!OFdTkCLXXQVS ... 4KBSA6n0ZQ

Vimeo also didn't harass me for all my identifying information like Google does (egads), so here:

https://vimeo.com/141762090
video.png
video.png (374.5 KiB) Viewed 8959 times
Last edited by WayOutWest on Thu Oct 08, 2015 8:59 am, edited 1 time in total.
- Adam
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: part sorting demo video

Post by WayOutWest »

Here are the results with 0402s. The one with the rotation way off was a tombstone (corner-pickup). Still working on that.

Worst case I'll do a second check after dropoff and re-run the process on parts that don't pass the check. The goal here is to maximize reels per weekend without human intervention, not parts per second while being baby-sat.
0402s_too.jpeg
0402s_too.jpeg (149.9 KiB) Viewed 8954 times
Last edited by WayOutWest on Thu Oct 08, 2015 9:02 am, edited 2 times in total.
- Adam
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: part sorting demo video

Post by WayOutWest »

Added Vimeo link: https://vimeo.com/141762090
- Adam
mpbrock
Posts: 9
Joined: Sat Sep 26, 2015 9:58 am

Re: part sorting demo video

Post by mpbrock »

hi

are you doing this just as an exercise to test vision/pick up or is the plan to do this rather than using the tape stuck to the bed idea? i'm not sure why you wouldn't keep the components in the tape rather than emptying them all out and then having to sort them into neat rows when they were already in neatly spaced rows in the tape?

maybe I'm missing something, sorry if i am, its 3am here!

thanks

matt
assasinsareus
Posts: 22
Joined: Mon Nov 02, 2015 12:43 pm

Re: part sorting demo video

Post by assasinsareus »

I like it, I've been building using SMD components for a long time and use the little draws type filing system to keep all my caps and resistors out the way. Each time I get a reel I would empty the reel into the right drawer ready for hand based PnP.

Using this technique with a little modification I can use my existing SMD stock with the LitePlacer.

WayOutWest: How fast do you think you could reliably run this process? Lets say I have 40 drawers each with 100 components in.

Also could you pick components to be placed on a PCB directly from the drawer rather then going via the sticky pad? This would be very interesting as I could then just lay the drawers with the bits I need on the table and let the machine work out where the bits are in the drawers.

I'm a coder so waiting for my kit to be delivered and then I will dive in and get my hands dirty. Are you willing to share your code at all?
assasinsareus
Posts: 22
Joined: Mon Nov 02, 2015 12:43 pm

Re: part sorting demo video

Post by assasinsareus »

I'm also wondering if I could put a raspberry pi or beagleboard in the mix somewhere to use to speed up or simplify the work the PC is having to do. Supposedly Windows 10 runs on a raspberry Pi 2 so maybe even do everything using a Pi. However I imagine this would be slow.
Covert
Posts: 79
Joined: Thu Jun 18, 2015 1:10 am

Re: part sorting demo video

Post by Covert »

This looks great. Awesome work there.
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: part sorting demo video

Post by WayOutWest »

mpbrock wrote:i'm not sure why you wouldn't keep the components in the tape
To eliminate the complicated mechanism ("feeder") to peel back the film on the tape.... which the Liteplacer doesn't have anyways.
- Adam
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: part sorting demo video

Post by WayOutWest »

assasinsareus wrote: WayOutWest: How fast do you think you could reliably run this process? Lets say I have 40 drawers each with 100 components in.
Hrm, speed is not really a major goal for me, so I am not trying to push it. But I think you should expect it to be slow. Feeders are really really really fast which is why the production-scale PCB industry loves them. It's also the only reason people put up with the damn things. :)
assasinsareus wrote: Also could you pick components to be placed on a PCB directly from the drawer rather then going via the sticky pad?
Yes but that is even slower. The reason for the sticky pad is that once the parts are on it they're in a known orientation, so you don't need to bring them back to the upcam for rotation again. The super-slow process of orienting each part is done in one "overnight" run for each part type, then you can go fast while the solderpaste is on the board (i.e. before it dries out).
assasinsareus wrote: Are you willing to share your code at all?
In theory yes, but only so long as supporting it and/or answering questions about it doesn't become an additional drag on my time (I'm already massively overloaded...). Given the current state of the code, and how specific it is to my system (hardcoded machine IP addresses, etc) that's a serious risk. But I do plan on cleaning it up and posting it once it's refactored, as I did (and continue to do) with some of my TinyG firmware modifications here: http://liteplacer.com/phpBB/viewtopic.php?f=10&t=211

Keep in mind, however, that all my code is Java (with a little bit of C/C++). It is not some sort of add-on or patch to the Liteplacer's default software.
- Adam
assasinsareus
Posts: 22
Joined: Mon Nov 02, 2015 12:43 pm

Re: part sorting demo video

Post by assasinsareus »

Hi Adam,

Sounds great I'm into my Java thanks to Android and run a separate embedded forum so I know what you mean about having time and giving support :D I'll keep an eye out.
Post Reply