Sei sulla pagina 1di 47

EXP.

1: 3-AXIS SERVO SYSTEM USING LABVIEW AND


NI MOTION CONTROL CARD

1. Introduction to Experiment Model


The model is a 3-axis servo system including:

Fig 1.1: The real experiment model

Fig 1.2: Solidwork model

- X, Y axes:

1
6 1 9 4

5
10
1
8

2 3
11

Fig 1.3: Components of X, Y axes


Table 1.1: Components of X, Y axes

Items Description
1 Moving part

2 Ball screw (Y)


3, 4 Limit switches (Y)
5 Ball Screw (X)

6, 9 Guiding rods (X, Y)

7 Encoders

8 Step Motors
10, 11 Limit switches (X)

- Z axis

2
1

5 3
2

4
8

7
9

Fig 1.4: Components of the Z axis


Table 1.2: Components of the Z axis
Items Description

1 Pulley

2 Belt

3 Step Motor
4 Encoder

5 Ball screw (Z)


6, 7 Limit switches
8 Guiding rod

9 End effector

1.1 Hardware
1.1.1 NI PS-15 Supply Power

3
NI PS-15 (National Instruments Power Supply):

1-phase, 115/230 VAC input; 24 to 28 VDC, 5 A output


Full 120 W output power between -25 and +60 C, (de-rated 3
W/C from 60 to 70 C)
20 percent power reserve for dynamic loads can be used
continuously up to 45 C
Tool-less spring-clamp terminals for easy field connectivity
DIN-rail mounting included and panel/side mount accessories available

1.1.2 PCI7344 Card

Fig 1.5: PCI 7344 Card


This part presents an overview of the motion control algorithms and capabilities of the
7344/7334 controller.
Dual Processor Architecture
You can perform up to four axes of simultaneous, coordinated motion control in a
preemptive, multitasking, real-time environment with the 7344/7334 controller. The high-
performance capabilities of the 7344/7334 controller result from an advanced dual-
processor architecture using a Motorola MC68331 real-time 32-bit CPU combined with
an Analog Devices ADSP 2185 DSP and custom FPGAs. Its FIFO bus interface and

4
powerful function set provide high-speed communications while off-loading complex
motion functions from the host PC for optimized system performance.
The 7344/7334 controller uses the digital signal processor (DSP) for all closed-loop
control including position tracking, PID control closed-loop computation, and motion
trajectory generation. The DSP chip is supported by custom FPGAs that perform the
high-speed encoder interfacing, position capture and breakpoint functions, motion I/O
processing, and stepper pulse generation for hard real-time functionality. The embedded,
multitasking real-time CPU handles host communications, command processing, multi-
axis interpolation, onboard program execution, error handling, general-purpose digital
I/O, and overall motion system integration functions.
Embedded Real-Time Operating System (RTOS)
The embedded firmware is based upon an embedded RTOS kernel for optimum system
performance in varying motion applications. Motion tasks are prioritized. Task execution
order depends on the priority of each task, the state of the entire motion system, I/O or
other system events, and the real-time clock.
The DSP chip is a separate processor that operates independently from the CPU but is
closely synchronized by an internal packet-based command, data, and messaging event
structure. The 7344/7334 controllers are true multiprocessing and multitasking embedded
controllers. The advanced architecture of the 7344/7334 controller enables advanced
motion features, such as enhanced PID functions.
Trajectory Generators
The 7344/7334 controller trajectory generators calculate the instantaneous position
command that controls acceleration and velocity while it moves the axis to its target
position. This command is then sent to the PID servo loop or stepper pulse generator,
depending on how you configure the axis. To implement infinite trajectory control, the
7344/7334 controller has eight trajectory generators implemented in the DSP chiptwo
per axis. Each generator calculates an instantaneous position each PID update period.
While simple point-to-point moves require only one trajectory generator, two

5
simultaneous generators are required for blended moves and infinite trajectory control
processing.
Analog Feedback
The 7344/7334 controller has an 8-channel multiplexed, 12-bit ADC. The converted
analog values are broadcast to both the DSP and CPU via a dedicated internal high-speed
serial bus. The multiplexer scan rate is approximately 50 s per enabled ADC channel.
This provides the high sampling rates required for feedback loop closure, joystick inputs,
or monitoring analog sensors. Four of these channels are intended for calibration, leaving
the other four available for analog feedback.
Flash Memory
Nonvolatile memory on the 7344/7334 controller is implemented with flash ROM. This
means that the 7344/7334 controller can electrically erase and reprogram its own ROM.
Since all the embedded firmware, including the RTOS and DSP code, of the 7344/7334 is
stored in flash memory; you can upgrade the onboard firmware contents in the field for
support and new feature enhancement.
Axes and Motion Resources
The 7344/7334 controller can control up to four axes of motion. The axes can be
completely independent, simultaneously coordinated, or mapped in multidimensional
groups called vector spaces. You can also synchronize vector spaces for multi-vector
space coordinated motion control.
Axes
At a minimum, an axis consists of a trajectory generator, a PID (for servo axes) or stepper
control block, and at least one output resource, either a DAC output (for servo axes) or a
stepper pulse generator output. Servo axes must have either an encoder or ADC channel
feedback resource.
Closed-loop stepper axes also require a feedback resource, open-loop stepper axes do not.
These axis configurations are shown in the figure 1.6. With the 7344/7334 controller, you
can map one or two feedback resources and one or two output resources to the axis. An
axis with its primary output resource mapped to a stepper output is by definition a stepper

6
axis. An axis with its primary output resource mapped to a DAC is by definition a servo
axis.

Fig 1.6: The axis configurations

1.1.3 UMI 7774

Fig 1.7: UMI 7774 connection diagram

7
Introduction
The UMI-7774 and UMI-7772 (UMI-7774/72) are standalone connectivity accessories
designed to be used with National Instruments 73xx series motion controllers for up to
four axes of simultaneous or independent control. Ideally suited to industrial and
laboratory applications, the UMI-7774/72 connects third-party stepper and servo drives
(amplifiers) and/or feedback and digital I/O to National Instruments motion controllers.
You can use the UMI-7774/72 with a wide variety of drives designed for many types of
motors or actuators and power ranges. This flexibility allows you to use the UMI-7774/72
in systems where you must use a third-party drive. To work correctly with the UMI-
7774/72, drives must have industry standard interfaces. For stepper systems, the industry
standard command signals are step and direction, or clockwise (CW) and counter-
clockwise (CCW), pulse inputs. For servo systems, the industry standard command signal
is a 10 V analog input.
Features
The UMI-7774/72 simplifies field wiring by supplying a separate feedback and control
D-SUB connector for each axis. The UMI-7774/72 connects the motion input and output
to the motion controller through a single interface cable.
You can connect the UMI-7774/72 digital inputs and outputs to the controller with a
separate interface cable to provide access to up to eight digital inputs and eight digital
outputs on the controller. Also, the UMI-7774/72 features a host bus monitor power
interlock that automatically disables the drive if the host computer is shut down or the
motion input/output interface cable is disconnected.
1.1.4 Driver P70530

Fig 1.8: Driver P70530


8
9
10
11
12
13
1.1.5 Step motors and encoders
National Instruments offers a complete stepper motion control solution including
stepper motors, drives, controllers, and software that is easy to set up, configure, and
program. Stepper motors available from NI offer high torque, precision, and easy
connectivity to stepper motor drives. Due to their ease of use, simplified control needs,
and freedom from expensive feedback requirements, stepper motors are an excellent
solution for applications such as machine control, manufacturing test, semiconductor
positioning, biomedical machines, and lab automation.
Stepper motors provide very precise, extremely cost-effective motion control. The 2
phase motors inherently move in small, precise, 1.8 degree increments at 200 steps per
revolution and are brushless and maintenance free. Stepping action is simple to control
and does not require complicated, expensive feedback devices. National Instruments also
offers encoders matched to the motors for applications where position verification is
required. Stepper motors are available from NI in three different National Electrical
Manufacturers Association (NEMA) frame sizes and with either a single or a dual shaft.
The motors provide optimum performance and easy connectivity when matched with the
P7000 series stepper drives available from NI.
Specifications
NEMA 23 Motor
Step angle 1.8 deg
Steps per revolution 200
Angular accuracy 3%
Phases 2

Fig 1.9: Step motor NEMA 23

14
Encoder

Fig1.10: Encoder
Specifications:
Resolution: 1000 counts per revolution
Input voltage: 5V
Input current: 100 mA max (60 mA typical)
Channel Configuration: Quadrature A, B and Index
Operating Temperature: -2085 0C
Maximum frequency: 200Khz
Max shaft speed: 8000 RPM

15
1.2 Introduction to the control software
1.2.1 LabVIEW
LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a programming
environment in which you create programs using a graphical notation (connecting
functional nodes via wires through which data flows); in this regard, it differs from
traditional programming languages like C, C++, or Java, in which you program with text.
The LabVIEW development environment works on computers running Windows, Mac
OS X, or Linux. LabVIEW can create programs that run on those platforms, as well as
Microsoft Pocket PC, Microsoft Windows CE, Palm OS, and a variety of embedded
platforms, including Field Programmable Gate Arrays (FPGAs), Digital Signal
Processors (DSPs), and microprocessors.
Using the very powerful graphical programming language that many LabVIEW users
affectionately call "G" (for graphical). And because LabVIEW has such a versatile
graphical user interface and is so easy to program with, it is also ideal for simulations,
presentation of ideas, general programming, or even teaching basic programming
concepts.
LabVIEW offers more flexibility than standard laboratory instruments because it is
software-based. It has extensive libraries of functions and subroutines to help you with
most programming tasks, without the fuss of pointers, memory allocation, and other
arcane programming problems found in conventional programming languages. LabVIEW
also contains application-specific libraries of code for data acquisition (DAQ), General
Purpose Interface Bus (GPIB), and serial instrument control, data analysis, data
presentation, data storage, and communication over the Internet. The Analysis Library
contains a multitude of useful functions, including signal generation, signal processing,
filters, windows, statistics, regression, linear algebra, and array arithmetic.

16
Single Axis Control Interface.

Fig1.11: Single Axis Control Interface


Multi Axes Control Interface

Fig 1.12: Multi Axes Control Interface

17
1.2.2 Single Axis Control
Hardware connections
General Diagram

Fig 1.13: General Diagram

Fig 1.14: Hardware Connection Diagram

18
PS-15 Power Supply Connection

1: Output Voltage 24VDC-5A


2: Input Voltage 200-240VAC

Fig 1.15: PS-15 Terminal

PCI 7344 Connection


Right click on My Computer > Manage > Device Manager > National Instruments
Motion Controllers in order to check the status of PCI card

Fig 1.16: The PCI card is ready to use

19
Using the cable (SHC88-C88-S) to connect PCI 7344 card with UMI7774

Fig 1.17: PCI card and UMI 7774 connection


UMI 7774 Connection

Fig 1.18: UMI 7774 terminal connection


1. UMI 7774 connected to PCI 7344 card by using SHC88-C88-S cable
2. Connected to PS-15 power supply
3. Connected to Encoder, Limit Switches by using DB25M cable

20
4. Connected to Driver 70530 by using DB15M cable
Driver 70530 Connection

Fig 1.19: Driver 70530 Terminal

J5 Serial: Connected to PC by P7S2-232-9D cable in order to detect motor


specifications using P7000 software
J4 Command I/O: Connected to UMI 7774 by DB15M cable.
J6 Motor: Connected to Step motor (4 leads: bipolar 2 phases).
J7 DC Power: Connected to power supply
Step motor connection
Bipolar, 2 phases motor with 4 leads connected to
the driver as the figure

Fig 1.20: Motor Connection

System Configurations

21
Step 1: Hardware Configurations

Motor Configuration by driver P70530

Fig 1.21: ON/OFF Status of switches on driver P70530


DIP Switch Position for Getting Started

Driver Setting for Getting Started

22
Motor Selection: NI NEMA 23 (T21NRLH).

Step Resolution

23
Load Inertia: 0-1

24
25
Dynamic Smoothing: Minimal

Current Reduction: Enabled

Multistepping: Disabled

26
Encoderless Stall Detection: Enabled

Configuring the P7000 Drive with the Serial Port


Connect the RS-232 serial communication cable between the drive and computer COM1
port. You must set the COM1 port to the following settings:
Baud Rate: 19,200
Data Bits: 8
Parity: Even
Stop Bits: 1
Flow Control: None

Testing Motor with P7000 Tools

27
Step 2: Configuring NI Motion Controller
Using NI MAX software, on the MAX interface, we choose:
My System > Devices and Interfaces > NI Motion Devices > PCI-7340 (1) > Default
7340 Settings > Axis 1
Axis Configuration:
1. Axis Configuration Tab

Fig 1.22: Axis Configuration.


Type: Stepper
Enabled: Enabled
Feedback: Type of Feedback: Encoder

28
2. Stepper Settings Tab

Fig 1.23 Stepper Settings Tab


Stepper steps per revolution: 50000.
Stepper Loop Mode: Closed-Loop
Stepper Output Mode: Step & Direction.
Stepper Pull-in Moves:
Pull-in Window: 3
Pull-in tries: 3
3. Save to All Axes and Initialize

29
Motion I/O Settings:

Fig 1.24: Motion I/O Settings Configuration


Home & Limit Switch Settings: Enabled
Forward Limit Switch: Enabled, Active High Polarity
Reverse Limit Switch: Enabled, Active High Polarity
Home Switch: Disabled.
Software Limit Settings:
Forward Software Limit: Enabled, Software Limit Position: 4950000
Reverse Soft Limit: Enabled, Software Limit Position: -4950000.
Inhibit Output Setting: Disabled.

Save to All Axes and Initialize

30
Trajectory Settings:
1. Trajectory Settings Tab:

Fig 1.25: Trajectory Settings Tab


Unit: Steps
Move Status Settings:
Following Error: 0 (counts).
Velocity Threshold: 100000 (step/s).
Run/Stop Threshold: 1.
Move Complete Criteria: Run/Stop.
2. Move Constraints Tab: (ignore this step)
Velocity, Acceleration, Deceleration and S-Curve Time will be determined
directly in the program

3. Save to All Axes and Initialize

31
Find Reference Settings:

Fig 1.26: Find Reference Settings Configuration


1. Forward Limit:
Approach Velocity %: 100 %.
Offset Move, Reset Position, and Final Approach Direction: ignore
Smart Enable: do not use
2. Tab Reverse Limit and Center: similar to Tab Forward Limit.
3. Save to All Axes and Initialize.

32
Gearing Settings:

Fig 1.27: Gearing Settings Configuration


Gearing Enabled: Disabled
Save to All Axes and Initialize.
Control Loop Settings:

Fig 1.28: Control Loop Settings

33
Control Loop Update Period: Update Period: 5.0 Miliseconds.
Save to All Axes and Initialize.
ADC Settings
Channel: Disabled.
Save to All Axes and Initialize.
Encoder Settings:

Fig 1.29: Encoder Settings Configuration


Encoder counts per revolution: 4000.
Filter Frequency: 50KHz.
Polarities Line State: A: Active Low; B and Index: Active High.
Index Reference Criteria Line State: A and B: Active
Save to All Axes and Initialize.

34
PWM Settings.

Fig 1.30: PWM Settings Configuration


PWM: Disabled
Save to All Axes and Initialize.
After completing these steps, we choose: Multiaxes \ Save \ Initialize .

Step 3: Initiate some necessary parameters


- Step resolution: 200; 400; 5000; 10000; 18000; 25000; 25400; 50000 (it should be
the same with the resolution on NI MAX software; reset the power to update)
- Displacement (mm): 5
- The initial velocity: 0.4 rev/s.
- The initial acceleration: 2 rev/s2.
- Operation mode: relative
- Samples: 20 times

35
Step 4: Run and monitor the machine, recording data (error) for each step
resolution
Report: Data recording and calculating the error.
- Step resolution: 200 steps/rev
Iteration Error Iteration Error Iteration Error

1 8 15
2 9 16

3 10 17

4 11 18
5 12 19

6 13 20
7 14

- Step resolution: 400 steps/rev.

Iteration Error Iteration Error Iteration Error


1 8 15

2 9 16
3 10 17

4 11 18
5 12 19

6 13 20

7 14

- Step resolution: 5000 steps/rev.


-

36
Iteration Error Iteration Error Iteration Error

1 8 15
2 9 16
3 10 17

4 11 18
5 12 19
6 13 20

7 14

- Step resolution: 10000 steps/rev


Iteration Error Iteration Error Iteration Error

1 8 15

2 9 16

3 10 17
4 11 18

5 12 19

6 13 20

7 14

- Step resolution: 18000 steps/rev


Iteration Error Iteration Error Iteration Error
1 8 15

2 9 16
3 10 17

37
4 11 18

5 12 19
6 13 20
7 14

- Step resolution: 25000 steps/rev


Iteration Error Iteration Error Iteration Error

1 8 15

2 9 16
3 10 17

4 11 18

5 12 19

6 13 20

7 14

- Step resolution: 50000 steps/rev


Iteration Error Iteration Error Iteration Error

1 8 15
2 9 16
3 10 17

4 11 18
5 12 19

6 13 20
7 14

38
1.2.3 Multi-axis control
Preparation
Students must prepare these things at home:
- Study on the hardware of the system: components, functions, drivers
specifications, controllers (Similarly to the single axis case).
- Study on the hardware connections. (Similarly to the single axis case).
- Study on the configuration for controller by using NI MAX and P70530 driver
- Understand the multi-axis control interface
- Study on the functional block of NI Motion.
Multi-axis control interface

Fig 1.31: Multi-axis control interface

The function blocks for the movements of NI Motion.


To control the motors by PCI7344 Card, NI Motion uses the function blocks including
specific control blocks such as: position, velocity, acceleration
Block Diagram \ Vision and Motion \ NI 73xx.

39
Fig 1.32: Functional block of NI Motion

Load Target Position

Target Position: -231 (231-1).


Board ID: byte unsigned integer (0-255).
Load Velocity

40
Velocity: long signed integer.
Load Acceleration/Deceleration.

Acceleration: long unsigned integer (U32)


Reset Position

Primary Reset Position: long signed integer.


Secondary Reset Position: long signed integer.
Read Position

Position: output
Read Velocity in RPM

Filtered Velocity: output


Read Velocity (step/s)

41
Filtered Velocity: output (step/s).
Check Move Completed Status

Axis/VS Map
Move Complete: output (True/False)
Find Reference

Search Type: limit switches, center, home or index


Aixs/VS Map (Disabled):
Start Motion

Stop Motion

Stop Type: Decelerate, Halt or Kill


Load Circular Arc

42
Radius: long unsigned integer (U32)
Travel Angle
Start Angle
Load Vector Space Position

Z Position
X Position
Y Position

43
Experiment 1: Drawing lines according to the sample figure.

Step 1: Hardware and software configuration of NI MAX (review the single axis
experiment)
Step 2: Set up the movement parameters
- Home position: (0, 0)
- Starting position: (35, 35)
Step 3: Run and monitor the movement.
- Find the reference position
- Reset position of motor
- Enter the coordinate of the points.
- Set ON of Straight Line to activate the linear movement
- Press Start to start.

44
Experiment 2: Drawing arc according to the following figure

Step 1: Hardware and software configuration of NI MAX (review the single axis
experiment)
Step 2: Set up the movement parameters
- Home position: (0, 0)
- Starting position: (5, 25)
Step 3: Run and monitor the movement.
- Find the reference position
- Reset position of motor
- Enter the coordinate of the points.
- Set ON of Arc to activate the circular movement
- Press Start to start.

Experiment 3: Blended movement

45
Step 1: Hardware and software configuration of NI MAX (review the single axis
experiment)
Step 2: Set up the movement parameters
- Home position: (0, 0)
- Starting position: (5, 25)
Step 3: Run and monitor the movement.
- Find the reference position
- Reset position of motor
- Enter the coordinate of the points.
- Set ON of Straight Line and Arc to activate the linear and circular movement
- Press Start to start.

Experiment 4: Linear and arc movement


- Students complete the control program by adopting the most appropriate function
blocks to replace the blank blocks
- Choose the Board ID: must be the same with NI MAX settings
- Choose the movement axes: X,Y.
- Setting up the velocity, acceleration and vibration parameters
- Setting up the target position
- Create an interface control

46
- Check the program again and RUN
- Supervise and evaluate the results
2-Axis Linear Movement

1 2 3 4 5 6 7

Fig 1.32: Block Diagram of Linear Movement.


2-Axis Circular Movement

1 2 3 4 5 6

Fig 1.33: Block Diagram of Circular Movement

47

Potrebbero piacerti anche