You are on page 1of 37

MODEL 1.

MULTI-AXIS SERVO SYSTEM


USING STEP MOTORS AND MOTION CONTROL

1. CONTENTS
 Step motors and drivers
 NI motion control card
 Labview programming
 Linear and circular interpolation

2. INTRODUCTION TO THE MODEL


2.1 CAD and the real model
The model is a 3-axis servo system as follow:

Fig 1.1: The real experiment model

1
Fig 1.2: The complete 3D model
X, Y axes:

Items Description
6 1 9 4
1 Moving part

2 Ball screw (Y)

3,4 Limit switches (Y)


5 Ball Screw (X)
5
1 6 Guiding shaft(X)
8 7 Encoders

8 Step Motors
7
9 Guiding shaft(Y)
2 3
1 10, 11 Limit switches (X)

Fig 1.3: Components of X, Y axes

2
Z axis

Items Description
1
1 Pulley
5 3
2 Belt
2
3 Step Motor
4
8 4 Encoder

7 5 Ball screw (Z)


9
6, 7 Limit switches

8 Guiding shaft
6
9 Tool

Fig 1.4. Components of the Z axis

2.2 Hardware configuration


2.2.1. General diagram

3
P7S2-232-9D cable

SHC-88 cable
PCI 7344

UMI 7774

DB-15M cable

Driver
P70530

PS 24VDC

DB-25M cable

Fig 1.5. The general diagram of the system


4
2.2.2 Components
NI PS-15 Supply Power
NI PS-15 (National Instruments Power Supply):

 Input: 1-phase, 115/230 VAC


 Output: 24 to 28 VDC, 5A
 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
Fig 1.6 Power supply
continuously up to 45 °C

PCI 7344 Card

Fig 1.7. PCI 7344 Card

This part presents an overview of the motion control algorithms and capabilities of the
7344/7334 controller.
 Dual Processor Architecture
 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.

5
 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.
 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.
 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 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 chip—two per axis.
 Each generator calculates an instantaneous position each PID update period. While
simple point-to-point moves require only one trajectory generator, two
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.

6
 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.
 Flash Memory
 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.
 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 following figures:

Fig 1.8. The interface of closed loop control systems

7
UMI 7774

Fig 1.9 UMI 7774 connection diagram


 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.
 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.

8
Step motors and encoders
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 (ppr)
 Angular accuracy ±3%
 Phases: 2

Fig 1.10 Step motor NEMA 23

Fig 1.11 The characteristic specifications of the given motor

9
Specifications:
Resolution: 1000 (cpr)
Input voltage: 5V
Input current: 100 mA max (60 mA
typical)
Maximum frequency: 200 kHz
Max shaft speed: 8000 RPM
Fig 1.12. Encoder

Driver P70530

Fig 1.13. Driver P70530 and its specifications

10
Fig 1.14. The pin-out of P70530

11
3. DRIVER SETTINGS
Step 1: Hardware Configuration
 Motor Configuration by P70530 driver

Fig 1.15 ON/OFF status of switches on P70530

 DIP Switch Position for Getting Started

12
 Driver Setting for Getting Started

 Motor Selection: NI NEMA 23 (T21NRLH).

13
 Step Resolution

14
 Load Inertia: 0-1

15
 Dynamic Smoothing: Minimal

 Current Reduction: Enabled

 Multi-stepping: Disabled

16
 Encoderless Stall Detection: Enabled

Step 2: Manual control testing


 Configuring the P-7000 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

17
Step 3: 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.16: Axis configuration.


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

18
2. Stepper Settings Tab

Fig 1.17. 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

19
 Motion I/O Settings:

Fig 1.18. 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

20
 Trajectory Settings:
1. Trajectory Settings Tab:

Fig 1.19 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 (Labview)

3. Save to All Axes and Initialize

21
 Find Reference Settings:

Fig 1.20 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.

22
 Gearing Settings:

Fig 1.21 Gearing Settings Configuration


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

Fig 1.22. Control loop settings

23
 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.23: 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.

24
 PWM Settings.

Fig 1.24: PWM settings configuration


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

25
4. LABVIEW PROGRAMMING
4.1 Single axis control

Fig 1.25: The user interface of single axis control


 Step resolution: 200; 400; 5000; 10000; 18000; 25000; 25400; 50000 (it must be
the same with the resolution in the hardware setting step)
 Displacement (mm): 10
 The initial velocity: 0.4 rev/s.
 The initial acceleration: 2 rev/s2.
 Position mode: absolute or relative
Exercise 1: Run and monitor the operation, record data (errors) for each step resolution.
Fill the errors in the following table. Using any software (Excel, Matlab…) to plot these
errors according to step resolutions.

26
Resolution 200 5000 10000 25000 50000
(steps/rev)
1
2
3
4
5
6
7
8
9
10

Exercise 2: Run an axis with the predefined displacement, initial velocity and
acceleration. Let observe the velocity and position graph and estimate the time of
acceleration and deceleration. Compare to the theory of point to point movement by
calculations?
4.2 Multi-axis control

Fig 1.26: The user interface of multi-axis control


27
 Vector Space Configuration: Choosing the controlled axis and Board ID, its
address have to be identical with the one configured in NI MAX
 Trajectory Parameters: parameters setting for motion control.
 Straight Line zone: linear movement
 ON/OFF: turn on/off linear mode
 Position X: 1-D array to input the position targets on X axis
 Position Y: 1-D array to input the position targets on Y axis
 Position Z: 1-D array to input the position targets on Z axis
 Arc zone: circular movement
 ON/OFF: turn on/off circular mode
 Radius: radius of the arc.
 Travel Angle: the positive direction is CCW (counter-clockwise)
⃗ at a starting point (it
 Start Angle: the angle between two vectors x⃗ and R
is always positive).
 Graph zone:
 XY Graph: the position of X/Y axis
 Velocity Graph:
- White line: current velocity
- Red line: desired velocity of the motion
- Green line: reference velocity

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

Fig 1.27: The drawing of experiment 1

Doing these following steps:


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.

29
Experiment 2: Drawing arc according to the following figure

Fig 1.28: The drawing of experiment 2


Doing these following steps:
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.

30
Experiment 3: Blended movement

Fig 1.29: The drawing of experiment 3

Doing these following steps:


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.

31
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
- Setting up the target position
- Create an interface control
- RUN and evaluate the results

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.

Load Target Position


1 2 3 4 5 6 7
4

Fig 1.30: Block diagram of linear movement

32
1 2 3 4 5 6
4

Fig 1.31: Block diagram of circular movement

33
APPENDIX

The library of NI 73xx functions (NI Motion) in Labview:

 Target Position: -231 ÷ (231-1).


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

 Velocity: long signed integer.


Load Acceleration/Deceleration.

34
 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)

35
 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

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

 Z Position
 X Position
 Y Position

37

You might also like