Programming in motion
Case study: Automated Industrial Machinery (AIM Inc.) moved from an analog interface to servo amplifiers to a digital motion control network to reduce wiring and simplify programming. It used IEC 61131-3 compliant software and industry-standard PLCOpen function blocks. See examples.
Machines now use less wiring and easier motion control programming with code that can be reused. What's not to like? Automated Industrial Machinery (AIM Inc.) of Addison, Ill., is a leading producer of automated CNC wire-bending machinery. For as long as the company has been making machinery, AIM motion control solutions have relied on traditional motion controllers with an analog interface to the servo amplifiers. To drive down costs, AIM decided to investigate using a motion control network to reduce wiring.
AIM's machine uses servos to pull wire through a straightening mechanism and into a bending head, which is also servo-powered. The bending head can also be rotated about the wire to provide bends in three dimensions. Other optional functionality is also servo-driven. The motion control requirements were handled by a stand-alone non-networked controller programmed in a text-based language. The user would create a part program using AIM's SmartEditor software, which then generates the text program required by the controller. The controller controlled the servo with an analog torque signal, relying on encoder feedback for speed and position data.
IEC 61131-3 programming, standard function blocks
AIM has used the same servo motors and amplifiers for many years and is very satisfied with the performance and dependability of the products. AIM wanted a networked control system, and the servo motor supplier developed a solution using a multi-axis controller that is programmed with IEC 61131-3 compliant software from the servo motor supplier. Industry-standard PLCOpen function blocks are used for motion control functions, along with programming toolboxes to add functionality.
The first challenge was figuring out how to get data from the AIM SmartEditor to the servo controller, which isn't programmed in the same way as in the previous controller. The part program, with instructions to make the part, had to be transferred. The AIM SmartEditor also needs to be able to command the controller directly. This is used to do things like jog an axis, turn on an output, or start the part program.
Servo motor supplier engineers created a special set of IEC function blocks to accomplish these tasks and bundled them into a custom software library toolbox.
To make the part program (the list of instructions needed to make a part), a custom program language was created for AIM's needs. After the user enters the data to define the part, SmartEditor generates a program similar to before, but in the new customer language. It is based on two-letter commands, such as MV to make a move, CT to cut the wire, or SV to set a variable to a particular value. A series of operands specific to the command follows the command code, each separated by a comma as a delimiter to make the command parsing simple. These commands were streamed over an Ethernet socket from SmartEditor to the controller, which parsed each line and stored the command and operands in an array. This custom language allows for great flexibility as complex sequences in the controller can be launched with one command.
When the user commands the controller to make a part, the array of commands is executed line by line to make the part. To do this, the Sequential Function Chart (SFC) language of the IEC 61131-3 standard is used. To call SFC a language is a bit of a misnomer; it's a sequence of actions and transitions that looks and acts much like a flowchart. Each action and each transition can be programmed in a different "standard" language like LD (ladder diagram), FBD (function block diagram), or ST (structured text), mixing and matching as the circumstance dictates.
To execute the part program, an idle action waits for the start signal and then reads the first command in the program. Simple commands such as toggling an output can be done immediately within the idle action, but complex tasks like moves require more in-depth programming. In these cases, an internal variable is set that executes the particular branch of the SFC that performs the function. After the command is executed, the step number is incremented and the next line is executed. This repeats until the end of the program.
Direct commands work in much the same way, but are sent over a different Ethernet socket. Using two sockets makes it easy for the controller to determine which commands are for the program and which should be executed immediately. Monitoring information is sent back over these same two sockets: One provides continuous monitoring of machine status and performance, while the other provides on-demand monitoring of variable values.
Reusable toolbox of code
Since the creation of the custom software library toolbox, other customers have express needs for similar control requirements. This application-specific reusable code can address these needs by providing the ability to interface with a previously existing PC program to provide the controller with the data it needs to operate the machine more effectively.
The result for AIM has been positive: "The increased product reliability and simplified wiring that the... controller offers translates to cost reduction," said Constantine Graspas, president of AIM. "Product quality, performance, and dependability, along with the quality engineering support for product development, have helped AIM to be ranked for the third year in the INC 5000 list of the highest growth companies in the USA," said Graspas.
- Mark Wilder is regional motion engineer, Yaskawa America Inc., drives and motion division. Edited by Mark T. Hoske, content manager, CFE Media, Control Engineering, firstname.lastname@example.org.
In June archives this article has links to other relevant information.
- Machine builders can reduce complexity by using digital networking.
- Programming is easier, more modular and reusable by using standards such as IEC 61131-3 and PLCOpen function blocks.
- Sequential Function Chart (SFC) language (part of IEC 61131-3) incorporates other languages as needed.
How could standard programming and easier networking help your machine design or use?
This online posting of this June article contains other relevant machine control information below.