Correction of a crooked cylinder

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
Last edited on
http://arduino.stackexchange.com/questions/816/c-vs-the-arduino-language

Before I give any further advice, is this really an actual, physical thing you are doing to actual, physical cylinders? Or is this a homework problem to play with an Arduino?

(Because actually straightening a cylinder is a little more complicated than your confusing setup seems to suggest.)

Can you give us much more detail?


At the simplest, if you have the bottom end of the cylinder clamped, you already know where it is. Assuming the cylinder is not significantly deformed on any axis but by bending Z (that is, a cross section is still a circle for any point along the cylinder's Z), all you need are two sensors somewhere at the top.

After that you need to find the angle of the vector (M1, M2).
The black circle, by the way, should already be centered in the pistons; the green one should be the only one that is not centered -- which would mean that (M1, M2) indicates the direction of the bend and points opposite the direction that the pistons need to move to straighten the cylinder.

How do you want to proceed with the piston use? The simplest way would be to find the piston with angle closest to the angle of the vector (M1, M2) and extend it to the proper distance, then repeat until the sensors say that the green circle is centered.

Hope this helps.

Topic archived. No new replies allowed.