Contour mode – Galil DMC-2X00 User Manual

Page 113

Advertising
background image

Figure 6.7 - Velocity Profile with Sinusoidal Acceleration

The DMC-2x00 can compute trigonometric functions. However, the argument must be expressed in
degrees. Using our example, the equation for A is written as:

A = 50T - 955 sin 3T

A complete program to generate the contour movement in this example is given below. To generate an
array, we compute the position value at intervals of 8 ms. This is stored at the array pos. Then, the
difference between the positions is computed and is stored in the array dir. Finally the motors are run
in the contour mode.

Contour Mode

Instruction Interpretation

#POINTS

Program defines A points

DM pos[16]

Allocate memory

DM dir[15]

c=0;d=0 Set

initial

conditions, c is index

d=0
t=0

t is time in ms

#A
v1=50*t
v2=3*t

Argument in degrees

v3=-955*@SIN[v2]+v1 Compute

position

v4=@INT[v3]

Integer value of v3

pos[c]=v4

Store in array pos

t=t+8
c=c+1
JP #A,c<16

#B

Program to find position differences

c=0
#c
d=c+1
dir[c]=pos[d]- pos[c]

Compute the difference and store

c=c+1

DMC-2X00

Chapter 6 Programming Motion

y 103

Advertising