Customizing Move Between Taught Points Test
The Select test option on the tuning menu allows you to select tests including Square-Wave and Move between Taught Points (see Servo Tuning Parameters Menu). The standard routine built into SPEC will prompt you to enter two taught points, and specify a DURATION. Then, it will execute a simple sub-routine that makes a MOVE between the two points. Some advanced users may want to customize the motion program, for example to move along a series of points, instead of just between two points.
The following information is provided only for experienced users of SPEC, who are also familiar with V+ programming. Adept recommends that you use the "standard" test move first, and only attempt to customize it if you are sure that you need to.
Procedure to Use Custom Program
The procedure to use a custom test-move program is as follows:
Write a new program that uses the same input and output parameters as the standard program, which is listed below.
Your new program should have the same name as the standard program, sp.tu.mov.test.
Save a copy of your program to disk.
Load your program before you load SPEC. (If you have already loaded SPEC, you will need to delete that program first.)
Load SPEC. (You may see an error message, *Program already exists*. This is normal.)
Execute SPEC. Specify the items for data-collection, and select the "Move between Taught Points" test. Teach the two positions using the SPEC (these will be stored as #sp.tu.pt[0] and #sp.tu.pt[1]).
When you select the "Test and plot" option (or "Test and display"), your program will be called. If there are any errors in your program, you may get some unexpected results.
Program Development Description
- Call sp.tu.config to configure the data buffer to collect the data specified in the data collection menu of SPEC.
- When beginning the test, call sp.buf.enable to enable the data collection buffer in single-sweep or wrap-around mode. If the buffer is configured for up to 10 seconds of data collection, single sweep mode will collect the first 10 seconds of data, and wrap-around mode will collect the last 10 seconds of data. If the buffer is disabled in less than 10 seconds, both modes are the same.
- When the test is complete, call sp.buf.enable with no arguments to stop data collection.
- To plot the resulting data, call sp.gr.plot to plot all the collected data. The top plot will list the first argument to sp.gr.plot as the cycle time if it is non-zero.
Example Program
.PROGRAM sp.tu.mov.test(plot , $err) ; ABSTRACT: Performs programmed motion for taught-point tuning test. ; Assumes motion speeds and accelerations have already been set. ; Assumes points #sp.tu.pt[0] and #sp.tu.pt[1] have been defined. ; ; If the user creates a program with the same name and call ; arguments, and loads it before loading SPEC, that routine ; will be performed instead of this one. If SPEC is aborted ; via a ^Z, and routines similar to this one executed, the ; user can perform and plot any of a variety of tests. The ; data collected will be that configured in the data-collection ; menu before SPEC was aborted. ; ; INPUT PARM : plot Flag indicating whether to plot results ; ; OUTPUT PARM : $err Error string. If non-empty, then an error ; occurred that will be reported to the user. ; ; SIDE EFFECTS: None ; ; Copyright (c) 1994-1995 by Adept Technology, Inc. AUTO time CALL sp.tu.config(10) ;Configure 10 sec of data collection![]()
Custom Data Collection and Plotting
The previous example also shows how custom data collection and plotting can be performed. If you first configure data collection in either square-wave or taught-point tuning mode, you can abort SPEC by typing ^Z and freely perform tests and plot results. SPEC can be restarted by typing RETRY 1 (if it is running as task 1)_ if you want to export the collected data or reconfigure data collection. Use the programs sp.tu.config , sp.buf.enable , and sp.tu.plot as shown in the example to perform data collection and plotting.