Hi folks!
I got to work on a cool project. My programming skills are pretty basic. I would like to start off with a math problem and figure out if it is solvable the way I am planning to do it.
I am building a machine to straighten a crooked cylinder. That means the side and the middle line of the cylinder are not rectangular to the footprint.
To fix that, the cylinder will be clamped in a machine with 6 hydraulic pushers in a circle around it. Proximity sensors inside the cylinder will measure the distance between the sensor and the cylinder wall. Because these sensors are very expensive, I need to figure out, how many I actually need.
I made a quick sketch:
http://s13.postimg.org/59q3xdpd3/pic.png
So that is waht I thought:
-the origin of the sensors is my general origin
-four sensors, two on the upper and two on the lower side of the cylinder give me two circles, radius is known
-I calculate the origin of each circle, assuming they are on the same plane
-I calculate a vector out of these two pairs of values
-with the vector I need to figure out, which cylinder to activate, e.g. with an angle or so (C1 activated for angles 0-60deg, C2 for 61-120deg ...)
-dedicated cylinder pushes and bends cylinder in right direction
-start over till cylinder is in spec
For the prototype, I want to start off with an Arduino, my question is:
-Is it possible to easily translate that into C++?
-Is there a better way?
Thanks a lot for your feedback, I appreciate that!
Ben