■ EXAMPLE 7
Condition:
Make a line on X-Y Plane
Suppose right now position for three motors are(X0,Y0,Z0) = (0,0,0),
and the End point of straight line is (X1,Y1,Z1) = (100,200,0)
Method:
Always use General ID = 0x7f
The Feedrate = 3, could be from 1~127
Global_Func = (char)Make_LinearLine = 0x02;
Then send four packets to the Drives as:
Send_Package(ID,X1 - X0), i.e. Send_Package(0x7f,100)
Send_Package(ID,Y1 - Y0), i.e. Send_Package(0x7f,200)
Send_Package(ID,Z1 - Z0), i.e. Send_Package(0x7f,0)
Send_Package(ID,FeedRate),i.e. Send_Package(0x7f,3)
After the X-Y-Z three Drives received all four packets, they will start to move until the meet the end point of
(X1,Y1,Z1). Three motors will meet (X1,Y1,Z1) at the same time.
During the linear or circular interpolation motion, the Read_Drive_Status (=0x09) can used to read Drives status
register to check whether b5 = 0 or not, b5 = 0 means the coordinated motion be nished.
Send_Package(ID,Y1 - Y0) is the subroutine in the SAMPLE CODE, it will generate a packet as above exam-
ples.
■ EXAMPLE 8
Condition:
Make a circular arc on X-Y Plane
Suppose right now position for three motors are(X0,Y0) = (0,0), and the End point of arc is (X1,Y1) = (200,0) in
CW direction. It is easy to know the center of arc is (Xc,Yc) = (100,0)
Method:
The Feedrate = 1, could be from 1~127>0, because in CW direction otherwise be negative value.
The planeNumber = 0 because it is in X-Y plane
TwoBytes = (PlaneNumber<<8) | FeedRate = 0*256 + 1 = 1
Use General ID = 0x7f
Global_Func = (char)Make_CircularArc = 0x04;
Then send ve packets to the Drives as:
Send_Package(ID,X0 - Xc), i.e. Send_Package(0x7f,-100)
Send_Package(ID,Y0 - Yc), i.e. Send_Package(0x7f,0)
Send_Package(ID,X1 - Xc), i.e. Send_Package(0x7f,100)
Send_Package(ID,Y1 - Yc), i.e. Send_Package(0x7f,0)
Send_Package(ID,TwoBytes),i.e. Send_Package(0x7f,1)
After the X-Y-Z three Drives received all four packets, Only two of three motors will move and nally will meet
(X1,Y1) at the same time. During the linear or circular interpolation motion, the Read_Drive_Status (=0x09)
can used to read Drives status register to check whether b5 = 0 or not, b5 = 0 means the coordinated motion
be nished.
Two equal half arcs must be made to make a circle.
7.7 Application Examples