I’m working on this project that has the goal of getting a machine to self-align to a VERY specific point. Without getting too far into specifics, I’m able to easily determine how close the alignment is on a 0 to 1 scale, and I’m able to move my machine on an x- and y-axis and immediately see how this “alignment ratio” increases or decreases. It seems simple in theory, but there are a few hang-ups that have left me lost trying to proceed with getting the machine to align.
My first thought was trying to brute force it The machine will never start at 0 alignment, so I was thinking I could have it arbitrarily move in one direction on a given axis and see if the alignment metric increases or decreases. It will always see some increase or decrease given it starts at a non-zero value. If it increases, move again in that direction, if it decreases, go back and try the other direction, and if it decreases in both directions, then stop. I’d repeat this on the other axis and it would be golden.
However, due to the specifics of the alignment, I’ve been informed that this is incredibly vulnerable to falling into a local maxima. So then my next thought was gradient descent. I’d set the alignment parameter to be negative and try to find the minima. But I’ve never worked with gradient descent before, and from the python examples I’ve seen online, every use case of a gradient descent requires knowledges of the function’s gradient to use. I don’t know this, so I don’t know if gradient descent is what I’m looking for either.
I suppose I’m just asking if anyone has any optimization recommendations for this sort of situation to recommend that could work solely on a continually building database, rather than a pre-established formula or database of information. I’m starting off only knowing the current (x, y) orientation and the current alignment ratio from 0 to 1, and I have to get to as close to 1 as possible by making small adjustments and seeing how that impacts the system, but I also have to avoid falling into a local maxima and not reaching an optimal state. Maybe the best bet would be to implement something like the brute force but to force it to jump a number of steps and repeat if the “optimal” ratio is less than a given number like 0.9 or something? I don’t know. Any help would be appreciated, even if its just a list of other optimization strategies for me to look up on my own time. I don’t even know the formal terms for most of them, so research has been painful.
Thank you 🙂
Sarah Grace LeBaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.