Help getting started - R_PI / machine -or- computer vision with input / output

Hello and thanks in advance (for reading and for helping).

I have an issue at work that I think can be resolved with OpenCV. I have no experience with it but from what I can see on the interweb this should be something that someone should have either thought up or has thought up and I just can’t find it.

We one of our automated cells has an operation where studs are placed in brake drums. These studs need to go in straight or they mess up the operation where they get pressed in.

What I would like to be able to do is trigger a camera to take a picture, compare this picture with a base image “good” picture, and if there is something wrong send an output signal to a PLC to notify the operator there is something wrong and they need to fix it.

If this could all be done with a Raspberry Pi setup (camera, pictures, trigger system, operator notification, operator reset, etc.) it would be awesome.

I have pictures I can post as “good” vs “bad”…but I guess I am too new to figure out how to post them right now.

Again, thanks in advance for reading and your help.

Conparing images can be tricky. I guess you could just detect the studs in a photograph and figure out from the shapes (in OpenCV: Contour) whether they are ok or not.

I watched a YouTube video from “tech with Tim” last night about masking. He was doing it with video but I think I could apply it to what I want with pictures. Here is a link showing what I need to do (use your imagination because if this gets setup the brake drums “should be” in the same place in the photo)

every pressfit assembly step has this same problem. I’m no mechanical engineer but this seems to be a solved problem. it is solved with mechanics, not with vision/inspection.

a physical approach is more robust. this calls for an alignment tool, which could be as simple as a cone.

at least give the pressfit machine sensors that measure forces.

I’d also recommend that you find consulting for your mechanical engineering and industrial automation needs. vision is often a terrible solution. it complicates things, is error-prone (if done ad-hoc), … you need to discard the vision approach and consider proven industry-standard alternatives.

Thanks for your comments. I am not looking for a vision system to correct the issue. 95% of the time the corrective actions I have taken have fixed the problem. There is a few times a day when the gravitational pull of Neptune causes the studs to not get placed properly and it isn’t caught by the operator because they are attending to something somewhere else on the cell.

Prior to what has been implemented in the video below, they were using the outside of the cast product to index off of. I came up with the 80/20 fixture and plungers to index off of the machined holes

The system that was made from the “turn key” up-fitter has been what several of us call a “swiss watch”. If one thing goes wrong the whole system shuts down. I believe the KISS principle was never explained to them.

I am in need of a “simple” system that can notify the operator (audibly or flashing light) of an incorrect placement so it can be remedied before it goes to the next step and could potentially cause a system failure…and down time. I am trying to make a “budget” conscious vision system for notification only until I can implement a more substantial fix. I am hoping to do it all with a PI or a combination of a PI and inexpensive PLC. If money wasn’t an issue, I wouldn’t even bother and just contract a Keyence system