LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3d scanner using 3 linear stages: when X finished, Pause, Y=Y+1, resume X counter; repeat until X counter=X*Y

Hello!

I am trying to make a 3d scanner using 3 linear stages from Standa and a magnetometer. 

say the volume to be scanned is (known) 4x3x2 mm (x,y,z)

Please see this thread:

 

 http://forums.ni.com/t5/LabVIEW/Create-3d-array-from-incoming-1d-succession-of-data-and-arrange/m-p/...

 

2d:  

  0    1   2   3

  7    6   5   4

  8    9  10  11

 

When pressing Start:

-the X linear stage moves +4mm at a speed vx, with acceleration ax, taking time tx.

-a time counter starts to count time units 0,1,2,3

-the magnetometer starts to sample 1 per time unit and store the samples in an array (please see attached program)

 

 

When the counter reaches  3 it stops because X is  maximum(asuming velocity,acceleration and deceleration are respected)

and pauses for tpause;

After the counter has reached 3 and during tpause, Y is incremented by 1.

The pause is needed for moving the Y stage by one step, time during which no sample is taken hence the pause/stop for the counter.

 

After tpause, X movement is resumed by distance -4mm at the same pace

and so is the sampling; so the time counter resumes: 4,5,6,7.

 

At counter=7, sampling stops because X is (presumed to be ) again at minimum; tpause

 y becomes 1+1=2;

 

After tpause, xmovement is resumed by distance +4mm. 

so is the sampling: timer resumes: 8,9,10,11

stops

z becomes z+1, x,y stay the same.

 

 

The problem is inserting that pause at the end of the X cycle, incrementing y/z and restarting the Xcounter/cycle;

I tried to do it using event structures (please see attached tbEventTime.vi) but the structure does not see the boolean indicator and I did not manage to solve its blindness by property node/signalling (I probably did it wrong).

 

How could I insert a pause in the time counter at every n*X-1 time unit (n=1,2... ; X=nr of columns/X distance) ?

 

Would timed loops help and if so, where might I find useful videos?

Thank you!

 

 

Download All
0 Kudos
Message 1 of 6
(3,739 Views)

What is the point of the 500ms global wait? The 500ms timeout value (or infinite, depending on state) seems sufficient.

 

"Pause" is an indicator, and thus the event wil never trigger.Just wire to a "select" node that manipulates the timeout value based on the comparison before it gets wired to the event structure.

 

You should probably initialize the (currently orange) shift register. It also seems to me that everything that is currently orange should be blue (integers). equal comparisons on floating point values are dangerous.

 

It seems to me that all you need is a well defined state machine. Look at the design templates that ship with LabVIEW.

0 Kudos
Message 2 of 6
(3,722 Views)

Thank you for the reply, altenbach!

How do I change the representation of the data in the shift registers?

there is no 'data representation' section in the properties menu.

I am looking into state machines, as you suggested.

 

 

0 Kudos
Message 3 of 6
(3,673 Views)

All your orange controls should be I32. Once you change all the representations, the value in the shift regsiter will turn blue too.

 

(Also don't forget to initialize the shift regsiter)

 

0 Kudos
Message 4 of 6
(3,666 Views)

Thank you again !

I did that and it changed the shift registers' data representation.

0 Kudos
Message 5 of 6
(3,647 Views)

"Just wire to a "select" node that manipulates the timeout value based on the comparison before it gets wired to the event structure."

 

Great idea.

I will try this first.

0 Kudos
Message 6 of 6
(3,638 Views)