LabVIEW Motion Control VIs - EXAMPLES PDF
LabVIEW Motion Control VIs - EXAMPLES PDF
VI Examples
Software Manual
Revision 1.0
www.ingeniamc.com
Contents
Introduction ........................................................................................................... 3 Opening example VIs .......................................................................................... 5 Running example VIs .......................................................................................... 7 Examples ................................................................................................................. 8 4.1 Basic Examples .............................................................................................. 8 4.1.1 Led value ................................................................................................. 9 4.1.2 Value on DAC ....................................................................................... 11 4.1.3 Torque .................................................................................................... 12 4.1.4 Velocity .................................................................................................. 14 4.1.5 Positioning ............................................................................................ 15 4.1.6 Homing .................................................................................................. 16 4.2 Advanced examples ................................................................................... 17 4.2.1 Digital outputs reacting to ADC value ............................................. 18 4.2.2 Copy switches value to LEDs ............................................................. 20 4.2.3 Control velocity motor by switch ...................................................... 22 4.2.4 Oscillate at different velocities ........................................................... 23
Icons
Icons that the reader may encounter in this manual are shown below, together with their meanings.
Additional information Provides the user with tips, tricks and other useful data.
Warning Provides the user with important information. Ignoring this warning may cause the device not to work properly.
Critical warning Provides the user with critical information. Ignoring this critical warning may cause damage to the device.
Introduction
Ingenia Servo Drives can work with several command reference sources for targeting motor positions/velocities or torques. Typical command sources are 10V analog inputs, Step&Direction digital inputs or network commands (through CAN or RS232 interface). When Ingenia Servo Drives take the references from external input commands they work as slaves. One possible master controller for Ingenia Servo Drives working as slaves is a PC platform running LabVIEW software. LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a system design platform and development environment for a visual programming language from National Instruments. LabVIEW programs are called virtual instruments, or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters.
For this kind of working scenarios Ingenia has developed Ingenia Motion Control Library for LabVIEW. Ingenia Library allows performing LabVIEW motor control through a series of VIs that give the user an easy way to configure and use some of the features of the Ingenia Servo Drives. This will significantly improve the development time for an application and will allow the user to rapidly start performing some movements. Ingenia Motion Control Library for LabVIEW uses the CANopen standards CiA301 and CiA402, working as a network command source. It also includes a complete documentation for each VI and some examples to help users with the start-up. In this guide, user will find information about the examples provided with the Ingenia Motion Control Library for LabVIEW. Each example is fully documented and should be used as a quick startup to learn how to use the different VIs included in the library to achieve LabVIEW motor control. User will find examples classified depending on their complexity as Basic Examples and Advances Examples.
Chapter 1: Introduction 3
Additional information The tested NI platforms with Ingenia Motion Control Library for LabVIEW have been NI PCI-8531, NI PXI-8531 and NI 9881.
Chapter 1: Introduction
Opening VI examples
The VI examples presented in this guide can be opened through LabVIEW (after installing the Ingenia Motion Control Library for LabVIEW) by going to Help->Find Examples, searching for the keyword Ingenia and double clicking on them.
Running VI examples
Any VI example can be run once its opened, via the LabVIEW run button .
Each VI front panel has some common controls and indicators that are described next: Start test: starts the execution of the example. Test finished: indicates when a test has ended. Stop VI: stops the execution of the VI (its only enabled when the test its not being executed).
Examples
This chapter explains the example VIs that show how the Ingenia Motor Control Library for LabVIEW has to be used to to interact with Ingenia CANopen Servo Drives via LabVIEW. There are two kinds of examples, the basic examples, and the advanced examples.
Front panel
This VI front panel, apart from the common controls and indicators that have been explained at section 3, has some LEDs that show the assigned values of the drive digital outputs.
Block diagram
Results
This example will reproduce two sequences of LEDs as the one shown in Figure 6.
Additional notes
Before running this VI, the LEDs circuitery should be properly connected to the CANopen controller at the GPO connectors. This VI assumes that LED1 is connected to GPO1, LED2 is connected to GPO2 and so on.
10
Front panel
This VI front panel only has the common controls and indicators that have been explained at section 3.
Block diagram
Results
After the execution of this example, a voltage of half of output voltage range should be present in the analog output pin.
11
4.1.3 Torque
Description
This VI shows an example of how to set a motor to produce a constant torque during 10 seconds.
Front panel
This VI front panel only has the common controls and indicators that have been explained at section 3.
Block diagram
Results
After starting this example, the motor will produce a constant torque during 10 seconds and then, the motor will be disabled.
Additional notes
Before running this VI, the motor should be connected correctly.
12
Critical warning In this mode the torque is constant, so ensure that the motor have load otherwise velocity will increase suddently.
13
4.1.4 Velocity
Description
This VI shows an example of how to move a motor during 10 seconds at a constant velocity.
Front panel
This VI front panel only has the common controls and indicators that have been explained at section 3.
Block diagram
Results
After starting this example, the motor will move at a constant velocity during 10 seconds and then, the motor will be disabled.
Additional notes
Before running this VI, the motor should be connected correctly.
14
4.1.5 Positioning
Description
This VI shows an example of how to perform an incremental position movement in a generic motor after configuring the trajectory generator.
Front panel
This VI front panel only has the common controls and indicators that have been explained at section 3.
Block diagram
Results
After starting this example, the trajectory generator will be configured and the motor will perform a position increment of 20000 counts.
Additional notes
Before running this example, the motor should be connected correctly.
15
4.1.6 Homing
Description
This VI shows an example where a connexion to a CAN net and device is made, and the homing process is configured and executed.
Front panel
This VI front panel only has the common controls and indicators that have been explained at section 3.
Block diagram
Results
After starting this example, the homing process will be configured and executed.
Additional notes
Some homing methods, as the one used in this example, require to use a limit switch. Limit switches, can be assigned to any drive general purpose input, in this case, the GPI2 is used as the positive limit switch. Before running this macro, switch circuitery should be properly connected to the controller at the GPI2 connector.
Chapter 4: Basic examples 16
17
Front panel
This VI front panel, apart from the common controls and indicators that have been explained at section 3, displays the analog input 1 readed value and has some LEDs that show the assigned values of the drive digital outputs.
Block diagram
Results
The LEDs will blink if the value of the analog input 1 is higher than half of input voltage range. Figure 19, shows the result with two different potentiometer positions.
18
Additional notes
Before running this VI, the LEDs circuitery should be properly connected to the controller at the GPO connector. This example assumes that LED1 is connected to GPO1, LED2 is connected to GPO2 and so on. The analog signal coming from the potentiometer must be connected to AN_IN1 pin.
19
Front panel
This VI front panel, apart from the common controls and indicators that have been explained at section 3, has some LEDs that show the assigned values of the drive digital outputs (in this case, the digital inputs readed values).
Block diagram
Results
Once this example is executed the digital output pins will replicate the content of the digital input pins as shown in See Figure 22.
20
Additional notes
Before running this VI, the switches and LEDs circuitery should be properly connected to the controller digital inputs and outputs. This example assumes that LED1 is connected to GPO1, LED2 is connected to GPO2 and so on.
21
Front panel
This VI front panel, apart from the common controls and indicators that have been explained at section 3, has some LEDs that show the readed values of the drive digital inputs.
Block diagram
Results
After starting the execution of this example, the motor velocity will change depending on the position of the switches. Each one of GPI1, GPI2 and GPI3 adds 15000 to the target veloctiy, GPI4 its used to indicate the direction of the movement. This velocity will be maintained during 10 seconds and then, the motor will be disabled.
Additional notes
Before running this example, the switches circuitery as well as the motor should be properly connected to the controller.
22
Front panel
This VI front panel only has the common controls and indicators that have been explained at section 3.
Block diagram
Results
After starting the execution of this example, the homing process will be done and the motor will perform a serie of oscillating movements at different velocities.
Additional notes
Before running this example, the motor should be properly connected to the controller. Some homing methods, as the one used in this example, require to use a limit switch.
23
Limit switches, can be assigned to any drive general purpose input, in this case, the GPI1 is used as the positive limit switch.
24