Download ManualV3 - Electromate
Transcript
Control Variables Many motion applications include variable parameters. For example, a cut-to-length application often requires that the cut length be variable. The motion process is the same, but the length is changing. To accommodate these applications, advanced controllers provide symbolic variables. A program can be written in which certain parameters, such as position or speed, are defined as variables. The variables can later be assigned by the operator or determined by program calculations. Variables allow the motion controller to perform certain mathematical functions and to make decisions accordingly. This capability increases the performance of the motion controller and allows it to perform some (background PLC) supervisory functions in addition to the simple motion control. A variable can be defined as a constant or can be equated to a controller parameter. For example, the instruction: V=3 sets the value of the variable V to 3. The instruction: P = _TPX reads the position of the X motor and equates the variable P to that value. Variables can be defined in a variety of ways. For example, the instruction: YERROR = _TEY equates the variable YERROR to the position error of the Y motor. Once the variable is defined, it can be used in mathematical operations. The controller can perform mathematical functions which typically include algebraic, trigonometric, and logical operations. When the operation is completed, the controller can use the computation result to adjust the system parameters. For example, the results can be used to change the speed, set the distance, or change the filter gain. The use of variables is best illustrated by the following example. The following program shows an example where the X motor follows the position of the Y motor. This is done by driving the X motor at a speed proportional to the position difference. 69 ELECTROMATE INDUSTRIAL SALES LTD. TOLL FREE PHONE (877) SERVO98 • TOLL FREE FAX (877) SERVO99 [email protected] • WWW.ELECTROMATE.COM