This is one of the coolest and most complicated projects I've ever designed and developed. Using our existing PLC system and automation hardware combined with a bit of Python, the system is capable of detecting whether any overmolded inserts were missed/dropped during our automated loading process using AI/machine learning models.
When the program sees a signal sent by the robot arm, a photo is taken of a part placed on a conveyor. Smaller images of critical locations are extracted from the photo. These smaller images are fed into their specific AI model (there are 3: bushings, outer insert, inner insert) for inference. If all 12 images return "good", the conveyor moves the part forward to release it to the operator. Otherwise, it moves back to a scrap bin. Data is captured throughout the process and stored.
One unexpected downside to this system is that although it reduces total cycle from the old process, the part sits stationary on the conveyor for a much longer period while waiting for the arm to move out of the photo frame. This has caused some operators to become impatient and actually reach inside the safety cage to grab the part during image capturing. It was the main cause of misclassification once the system moved to production. We added light curtains to prevent this.
I'm sure at some point you've heard about the theory where the entire universe, and everything in it, is just a simulation being run on some super-computer? Experiments in ALife attempt to recreate complex biological processes though the use of computer simulations.
I stumbled across the topic of Boids on my lunch break one day while searching for inspiration regarding AI for some enemies in a game I'm working on. Essentially the idea is to attempt to simulate the movement patterns of flocks of birds, swarms of insects, schools of fish, and the like. While this may seem complex on the surface, these behaviors proved rather trivial to replicate. It can be done with the implementation of 3 basic rules:
Separation - Avoid collisions with other objects and boid cells.
Alignment - Align movement direction with that of other nearby boid cells.
Cohesion - Attempt to move towards the collective center of mass of other nearby boid cells.
Below is my simple implementation for this project. The simulation begins by instancing a designated number of boid objects randomly throughout the screen, while randomly assigning a rotation_degree value (0-359) to each boid at instantiation. Boids only have the ability to move forward at a constant speed and rotate according to collision input, average flock vector direction, and average flock position. I only spent about an hour on this after work one day, but still find it rather satisfying to watch this random pile of arrows quickly align themselves with each other. I would love to come back and refine it further.
Code can be reviewed here.
Mandelbrot Set - Taken from Wikipedia
Fractal image created in Chaotica
If you've ever googled the term "fractals" then you've probably seen something similar to the images above. To the left is an image of what's known as the "Mandelbrot Set" and unfortunately, that's about as much context as you'll typically get through a casual encounter. However, I had many questions: What exactly is this geometry we're looking at? Why are these swirling patterns and colors significant? And most importantly, what does this have to do with math and computer science?
Turns out, the answers to those questions aren't nearly as profound as I had thought they'd be. I won't bore you with the tedious details. But as fascinating as this image is (especially when you start zooming in on the edge), it's really just numerous sets of points on a 2D plane. Technically the complex plane, but I said no details. Not too exciting. But we can create some really cool effects if we start applying geometric transformations over time on these plots.
Fractals represent the infinitely complex geometry that can emerge through the iteration of simple rules. You can make some really cool patterns and designs by combining fractal concepts with shader programs (programs that run on the GPU instead of the CPU). I'm going to have to learn a bit more about the shaders, but I've got some ideas floating around for a generative art program...that has already been made (kind of).
Below are some links to fractal animations I've made using a program called Chaotica.