03-31-2022 10:48 AM - edited 03-31-2022 10:52 AM
Hi all,
I'm currently attempting to design a scanning system based on an XY Gantry frame run by two servo motors. The system will scan/gather data from a round object to detect variances in the surface. It will then use this data to create a contour plot of the objects surface. The issue that I'm currently having is that I'm unsure of how to:
I believe that I've found a VI to help design the third feature but I'm unsure about the scanning motion and haven't been able to find any examples. If anyone knows of any examples or could help me with where to start it would be greatly appreciated.
Thank you.
03-31-2022 11:11 AM
It seems you want to scan the circular area, not the circumference? For any point in the plane, you can calculate if it is closer to the center than the radius and thus "inside". Do you have problems with the math or with programming?
What is the "correct order"? What is modeling? Do you scan in a rectangular grid?
Typically you would initialize a 2D array with sufficient size to have one element per scan location, keep it in a shift register, and replace elements corresponding to the current scan location with a reading as data is acquired.
03-31-2022 12:05 PM
@altenbach wrote:
It seems you want to scan the circular area, not the circumference? For any point in the plane, you can calculate if it is closer to the center than the radius and thus "inside". Do you have problems with the math or with programming?
That's correct, I'd like to scan the area inside of the circle - I just meant that I don't want the scanner to venture outside of the circumference of the circle. My initial issue is with the programming of the 'back & forth' motion.
What is the "correct order"?
The correct order would be the data recreated in the same way it was scanned.
What is modeling?
The modeling would be the contour plot that I'm trying to use the data to create (or possibly another kind of plot - the goal is to be able to visualize the height differentiation over the entire area).
Do you scan in a rectangular grid?
My previous iteration of the system used only one single servo motor and only created a line profile (consisting of height vs. time). So... Not currently. I do believe that will be required for this application.
03-31-2022 12:39 PM - edited 03-31-2022 12:45 PM
See if this can give you some ideas....
(Note that you can avoid a lot of trigonometry when using complex datatypes for the xy positions. The absolute value of the difference of two complex numbers is the distance in the complex plane)
03-31-2022 02:57 PM
Of course it might be cleaner to generate the trajectory first, then just play it back in one loop.
(It would be easy to extend flexibility to include e.g. center shift, and non-square canvas, other shapes, etc. etc. Not shown 😄 )
04-01-2022 03:21 PM
Thank you @altenbach! I was trying to figure out how to incorporate the two motors and the sensor into your original program before replying again, but this will definately save me some time! I really appreciate it!
04-12-2022 04:09 PM
Ok, so I'm still a little stuck with how to incorporate dual motor motion into the initialize array funtion. I'm attempting to have four different settings:
Previously, my program only conducted a single line scan down the center and, since there was no movement in the Y-direction, there was no need for an array. A single motor would move in a single direction. Now, I'm at a bit of a loss as to:
I realize that what I've bungled together is probably not the most eloquent or efficient design so any input would be greatly appreciated.