Motf CenterOfRotation

Sets the center of rotation for rotary MOTF operation. Coordinates in the global address space with the lens field origin being 0,0.  The diagram below shows how to interpret the geometry associated with rotary MOTF operation.

Syntax

CenterOfRotation(float x, float y)

 

Parameters

x float X coordinate of the center of rotation
y float Y coordinate of the center of rotation

 

 

Copy
Example
-- This sample marks a square on a rotating platen where the center
-- of rotation is displaced from the scan head origin.

-- Define the encoder resolution.  Note that this will be converted
-- to micro-radians which will represent the incremental adjustment
-- capability of the galvos.
-- Note that 1 micro-radian is 1 micron of displacement at 1 meter

EncoderResolutionCountsPerRev = 40000
EncoderResolutionMicroRadPerCount = ((2 * 3.14159)
                            / EncoderResolutionCountsPerRev) * 1000000
Report("EncoderResInMicroRadPerCount = " .. EncoderResolutionMicroRadPerCount)
-- In Rotary mode, the encoder counts are scaled to Micro-radians
MOTF.CalFactor = EncoderResolutionMicroRadPerCount

-- The encoder should be attached to port MOTF 0
MOTF.Mode = Encoder.ExternalRotary
-- Increasing counts track this rotation as viewed from above.
-- Clock-Wise (CW) is also available.
MOTF.Direction = Direction.RotaryCCWDirection
-- Define the center of rotation relative to the optical origin of the scan head
MOTF.CenterOfRotation(200, 200)
MOTF.Initialize()

-- Initialize laser/scan-head settings
Laser.MarkSpeed = 2000
Laser.MarkDelay = 200
Laser.JumpSpeed = 3000
Laser.JumpDelay = 200
Laser.Frequency = 20
Laser.DutyCycle1 = 50
Laser.Power = 50
Laser.LaserOnDelay = 75
Laser.LaserOffDelay = 125
Laser.PolyDelay = 50
Laser.VariPolyDelayFlag = true

-- Space the marks around the rotating work-surface
AngleToWaitBetweenMarksInDegrees = 90
AngleToWaitBetweenMarksInMicroRads = ((AngleToWaitBetweenMarksInDegrees / 180)
                                    * 3.14159) * 1000000
Report("AngleToWaitBetweenMarksInMicroRads = " .. AngleToWaitBetweenMarksInMicroRads)

-- Wait for the start signal
IO.WaitForIo(Pin.Din.UserIn1,Trigger.Edge.Rising, 0, 0, true)

-- Initialize to wait the initial distance
MOTF.ResetTracking()
System.Flush()
-- Repeat until aborted via external signal
while IO.ReadPin(Pin.Din.UserIn4) == false do
    MOTF.WaitForCount(AngleToWaitBetweenMarksInMicroRads)
    -- Counters are automatically reset when WaitForCount() releases
    MOTF.StartTracking(Tracking.WhileMarking)
    Image.Box(-10, -10, 20, 20)
    MOTF.StopTrackingAndJump(0, 0, 0, 200)
    Laser.WaitForEnd()
    -- Counters are still counting and distance being measured
end

Report ("Job Finished")