Fast and Precise Laser Engraving With CompactRIO

Christopher Farmer, Wired-in Software Pty Ltd

"By adopting an NI software and hardware solution, we designed and built a high-speed control subsystem using LabVIEW Real-Time and LabVIEW FPGA within a tight timeline. The PROFINET controller gave us a sophisticated interface to the factory’s distributed control system."

- Christopher Farmer, Wired-in Software Pty Ltd

The Challenge:

Develop a reliable, embedded, high-speed laser engraving control and positioning subsystem within eight weeks.

The Solution:

Develop, integrate, and test the application using CompactRIO hardware and the LabVIEW Real-Time and LabVIEW FPGA modules to control the output signals with transition times between 100 ns and 10 us.

Author(s):

Christopher Farmer - Wired-in Software Pty Ltd
Renu Mohandas - Wired-in Software Pty Ltd

 

Background

Manufacturing processes include critical components to be tightly synchronized within 100 ns to 10 us. In the case of laser engravers, timing and positioning is controlled within the manufacturing system and is a critical part of the process. The customer in question has had a previous solution based on custom hardware; however, this has become outdated and can no longer be serviced and maintained. Being a crucial part, system failure will lead to great risk to production.

 

Wired-in Software is an NI Partner that addresses test and measurement challenges by developing reliable and intuitive purpose-built LabVIEW solutions such as automated test equipment, machine vision systems, process monitoring applications, and embedded products.


At Wired-in, we work closely with industries including automotive, manufacturing, academic, food and beverage, renewables, and telecommunications to provide a full design service that consists of requirements gathering, system and software design specifications, system wiring diagrams, and validation procedures and results.

 

We designed and developed the high-speed laser engraver control subsystem based on CompactRIO technology. It produces patterns of analogue and digital output signals, all within tight transition times (of 100 ns and 10 us). We rapidly developed this reliable and expandable solution in eight weeks. Because we used the CompactRIO platform, the solution was a purely software development effort—no custom hardware was required. This resulted in a much faster solution than if a custom electronic solution had been developed.

 

 

Application Overview

This embedded system application consists of a single controller running in a headless configuration. We designed it to run 24/7 without any user interaction. The PROFINET slave receives commands from a PROFINET master. The controller transmits its status back to the master and returns a fault if the received parameters are invalid, or if an issue is present (such as an input is missing or nonresponsive). On receiving a trigger signal (via a digital input), the encoder counter (via digital inputs) is reset. A sequence of control events is derived from the PROFINET parameters. It is used to position both the motor (via an analogue output) and enable the laser (via a digital output) at specific encoder counts, and must carry out each change within less than 0.1 ms. The sequence is restarted upon every trigger received.

 

Software Design

 

The software involves both the LabVIEW Real-Time and LabVIEW FPGA modules, which ensure deterministic code for this application with strict timing requirements. The control algorithm, written with LabVIEW FPGA, runs on the FPGA inside the CompactRIO system. The FPGA code has a state machine architecture within a Single Cycle Timed Loop. The control system has two modes of operation: auto and manual. During auto mode, the FPGA controls the motor position and laser signals based on the combination of encoder counts, trigger signal, and PROFINET parameters. The PROFINET parameters sent by the master can be changed dynamically, which the FPGA code can read at the start of each trigger. In manual mode, the received PROFINET parameters can change only the position of the motor.

 

The real-time code is used for setting up simulation, and provides remote panel access for diagnostic purposes only. The real-time panel can be easily viewed through a web browser (see Figure 2).

 

 

Simulation

During development (with the system offline and disconnected from the PROFINET master, encoder, and trigger), the PROFINET parameters were simulated in the real-time front panel. This allowed us to test the conversion of 128 byte numeric arrays into meaningful parameters.


The FPGA code has some simulation functions that can be turned on/off from the real-time panel. With the existing I/O available, we connected wires in a loopback type configuration (that is, wire some digital outputs straight back into digital inputs for the encoder and trigger signals). Then, within the FPGA software, we can generate encoder and trigger pulses to stimulate the system inputs.


We developed an independent LabVIEW application to take readings from a Tektronix 1 GS/s oscilloscope to verify the system operation (that is, check timing of the trigger, encoder, motion, and laser). By using the Tektronix device drivers downloadable from ni.com, it was simple to put together an application for test data acquisition that didn’t disrupt the core application development. We saved the files in TDM Streaming file format, allowing for post-analysis in another independent LabVIEW application.

 

Hardware

 

We based the system on cRIO-9035 to meet the following requirements:
• 6 C Series slots (PROFINET slave requires an empty slot beside it)
• Ample FPGA resources
• High-speed timing requirements—need to act within 0.1 ms or less
• Configurable I/O simplifies hardware design

 

We used the modules listed in the table below in this application.

 Modules

 Description

 CompactRIO-9035

 CompactRIO Controller and Chassis

 CompactRIO PROFINET Slave Module 

 Receives commands from the PROFINET master 

 NI-9401 DIO

 Reads the encoder pulses

 NI-9263 AO

 Controls the motor

 NI-9423 DI

 Receives the trigger signal

 NI-9474 DO Enables the laser

 

Benefits

The LabVIEW graphical dataflow programming environment makes the development process easier and faster. With the add-on toolkits and modules, such as LabVIEW FPGA and LabVIEW Real-Time, we can use LabVIEW for domain-specific industrial applications.


The client’s system to be replaced was a custom-designed embedded PC-based solution that is no longer supported. After an extensive search, CompactRIO was the only off-the-shelf solution that did not require custom hardware to meet the system requirements. LabVIEW FPGA is easy to develop and abundant resources are available to fast track development (such as the CompactRIO Developer’s Guide, and online real-time and FPGA training for valid subscriptions), and thus enabling us to meet the timeline.


The CompactRIO modules are easily replaceable, and this solution could work with different motor types if required - something the old system could not do.


We designed and built this subsystem whilst the existing system continued to run. The existing system is in the process of being decommissioned, and the changeover will sustain a small planned production downtime.


The project will allow the client to guarantee production uptime. Replacement units can be readily sourced from NI if required. This was a successful CompactRIO/LabVIEW project delivered by Wired-in Software.

 

Conclusion

By adopting an NI software and hardware solution, we designed and built a high-speed control subsystem using LabVIEW Real-Time and LabVIEW FPGA within a tight timeline. The PROFINET controller gave us a sophisticated interface to the factory’s distributed control system. The spare I/O were leveraged to be used as simulation outputs. The FPGA code runs at a very high speed thus ensuring that every encoder pulse change was captured. CompactRIO is a reliable and robust solution for the application, which is required to run continuously for extended periods of time.

 

Author Information:

Christopher Farmer
Wired-in Software Pty Ltd
Australia
Tel: +61 414 626 214

Figure 1. CompactRIO System Block Diagram
Figure 2. Remote Panel Access to RT_Main.vi
Figure 3. Trace From a Tektronix Oscilloscope
Figure 4. CompactRIO During Development