Forums - Galil: We Move The World
Topic Options
#6633 - 03/23/00 03:55 PM High Speed Position Capture
LarryAhr Offline
Junior Member

Registered: 03/21/00
Posts: 28
Loc: Phoenix, AZ USA
Nothing seems to work like I need it to. Is it me, or do others have this same experience?

Anyway, I have two projects where I am measuring objects using lasers. The lasers being used output an analog signal ranging from 0-10V indicating distance or thickness. The lasers are mounted to an X/Y carriage, and controlled by a Galil 1740.

What I am doing is moving the laser at the highest speed possible to reduce cycle time
while maintaining an acceptable amount of accuracy. The 1740 executes instructions at
375uS each. The problem is capturing the position at which the analog voltage crosses a threshold quick enough to measure the target's diameter accurately. Consider the following code fragment:

NOTE X & Y ARE STATIONARY AT STARTING POINT
UTH=9.1 (RISING THRESHOLD)
LTH=9.0 (FALLING THRESHOLD)
PA ,MAX (MOVE TO MAX OF Y)
SP ,120000 (AND HURRY)
TW6000 (SET TIMEOUT TO 6 SECS)
BGY
#L1
JP#L1,@AN[1]P1=_TPY (CAPTURE FIRST POINT)
#L2
JP#L2,@AN[1]>LTH (WAIT FOR SIGNAL TO CROSS LOWER THRESHOLD)
P2=_TPY (CAPTURE SECOND POINT)
STY
MC
DIA=(P2-P1)/8000 (CALC DIAMETER)
EN

The positions captured could be off by as much as 1125uS. At a rate of 120,000 counts/second with 8000 counts/inch, this becomes .015" and not acceptable.

Suggestion
Expand upon the high speed position capture function to use a selected analog port and
voltage as the trigger. With the reduced latency I could have readings within .000375
inches in this application. The syntax could look something like this:

ALX 1,>9.1 (capture X axis position using analog port 1 when voltage rises above 9.1)
ALY 1,<-1.9 (capture Y axis position using analog port 1 when voltage falls below -1.9)

My code fragment would then look something like this:

TW6000
BGY
ALY 1,>UTH
#L1
JP#L1,_ALY=1 (WAIT FOR EVENT TO HAPPEN)
P1=_RLY (RETRIEVE FIRST POINT)
ALY 1,#L2
JP#L2,_ALY=1 (WAIT FOR EVENT TO HAPPEN)
P2=_RLY (RETRIEVE SECOND POINT)
STY
MC
DIA=(P2-P1)/8000 (CALC DIAMETER)
EN

Dr. J, what do you think?
Larry
_________________________
No matter how bad Windows gets, I still prefer Linux.

Top
#6634 - 04/26/00 04:53 PM Re: High Speed Position Capture
JacobT Offline
Junior Member

Registered: 02/03/00
Posts: 1
Loc: Mountain View, CA, USA
Hi Larry:

Sorry that the controller is not doing the job for you. Howevwer, it is working as expected, doing the loop in one millisec.

Your suggestion makes much sense, and I wish we could implement it, but the position capture is done by a hardware element, that can only read digital encoders.

Maybe in future cards.

Thanks anyway.


Jacob Tal.

Top
#6635 - 08/23/01 12:37 PM Re: High Speed Position Capture
mkooy Offline
Junior Member

Registered: 08/23/01
Posts: 1
Loc: Tempe, AZ 85284
Since the Galil board can use only digital inputs, you might try using an external comparator to trigger the appropriate digital input. If you require the ability to adjust the comparator threshold using the Galil card, then you might use a spare DAC output from the card (controlled directly using the OF command). Then capture the position using the Latch feature.
An external comparator will not introduce significant delays; the only delay present should be the 1-microsecond lagtime Galil specifies.
Hope this helps.

Regards,
Mark Kooy
SigmaTech

Top


Moderator:  KaushalS, RobinR