stepper motor control using labviewtm in a computer numerically

advertisement
Session G-19
STEPPER MOTOR CONTROL USING LABVIEWTM IN A COMPUTER
NUMERICALLY CONTROLLED DESKTOP MILL
Usha L Manepalli, Dr. M. Elsayed
Department of Mechanical Engineering
University of Louisiana at Lafayette
Lafayette, LA, USA
manepalli.usha@gmail.com
melsayed@louisiana.edu
Dr. Cherif Aissi
Department of Industrial Technology
University of Louisiana at Lafayette
Lafayette, LA, USA
aissi@louisiana.edu
Abstract
The advantage of stepper motor motion control system in a computer numerically controlled
(CNC) desktop mill is the high holding torque at low speeds. The aim of this paper is to utilize
stepper motors, build their control circuit and write a LabVIEWTM program that reads and
implements a CNC code, in the form of a text file, for engraving operations on a desktop mill.
The program also controls the basic functions of the desktop CNC mill, such as turning the
spindle on and off and controlling travel limits of the worktable. The basic CNC code included
linear and circular interpolations, which provide the foundation necessary for the implementation
of any future design expansion of the program.
LabVIEWTM is a graphical programming language produced by National Instruments of Austin,
TX, USA.
1. Background
In 1995, Eric Stutes et al.1 successfully designed and manufactured a fully operational desktop
CNC milling machine under the guidance of Dr. M. Elsayed. In this CNC project, DC brush
servo motors were used as a conventional motor technology to produce rotary motion in response
to an applied voltage. So basically, a close-loop feedback system was used to drive the ballscrew
slides for X and Y axis movements using several subroutines and the software library provided
by Technology 80 for a Model 5650 controller card1.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
1
In this work, the servo motors used in the CNC miniature mill are replaced by stepper motors
mainly due to their high holding torque at low speeds, their excellent precise positioning
mechanism, their simple open-loop feedback system applications and their lower cost.
The work is covered mainly in two steps:
1. Test setup I: Build a stepper motor driver interface and control a small 2-phase, bipolar
stepper motor using LabVIEW through digital output of a DAQ (Data Acquisition) card
for full, half and micro-stepping in both clockwise and counter-clockwise directions.
Figure 1-A Small Stepper Motor Purchased from Danaher Motion2
2. Test setup II: To apply the knowledge of LabVIEW and stepping sequence in operating
the X and Y axes motion of CNC miniature mill for the engraving operation using
ballscrew slides and appropriate stepper motors.
Figure 2-Motor and Lead screw Arrangement3
2. Objectives
The main objectives of this research are:
1. To replace the existing servo motors with stepper motors control system for the desktop
CNC milling machine.
2. To develop a driver and an interface circuit between the CNC machine and a PC.
3. To develop a LabVIEW program that can generate machine command from basic CNCcode.
3. Scope of the Research
•
•
•
The controller will be built using LabVIEWTM, a graphical programming language produced
by National Instruments of Austin, TX, USA.
The LabVIEW Program is built based on the basic G-codes, which are G0, G1, G2 and G3.
The new controller will be applied to an existing milling machine, which is the CNC milling
machine by replacing the existing servo-motor controller with the new controller.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
2
•
•
An interfacing circuit board will be built based on the stepper motor in order to interface
between the controllers (PC) and the CNC milling machine.
Actual machining will be done by executing a subroutine for,
a) Linear interpolations (G0, G1)
b) Circular interpolations (G2, G3)
c) Engraving operations (A-Z and 0-9) which utilize (a) and (b)
4. Test Setup-I
Stepping Sequence for Full/ Half/ Micro-Steps mode:
For a four-coil motor, a four-bit code sequence is needed to energize the appropriate poles at any
one time. The sequence needed to make the rotor turn can be done in either “full step” or “half
step” increments. The difference between these two modes is that the application of some of the
codes is omitted. This can be seen in the Tables 1 and 2. Both the speed and direction may be
changed at any instant by applying the appropriate codes at the stepper motor’s signal line.
CW direction
32
Step
1
2
3
4
1
7B
0
1
0
1
0
16
9B
0
1
0
1
0
8
8B
1
0
0
1
1
4
2
1
8A
1
1
0
0
1
7A
1
0
1
0
1
9A
1
0
1
0
1
Nos
15
52
3
56
15
θs (deg)
0
7.5
15
22.5
30
Table 1-Full-Step Sequence for a Stepper Motor with 7.50 Step Angle
where:
7B, 9B & 7A, 9A are I1B, I0B & I1A, I0A respectively (control current levels)
8B & 8A are Phase B & Phase A respectively (control direction)
A and B are two IC chips (NJM3770AD3) used in stepper driver circuit in Test Setup-I.
Half-step mode:
Similarly, the stepping sequence for half and micro-step is given in Table 2 and Table 3
respectively.
For Half Step, θs = 3.750 (half of full step angle)
So, Rs = 3600÷ 3.750 = 96 steps/ rev
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
3
CCW direction
Full-step mode:
The phase switching for the small bipolar stepper motor (Test Setup-I) with full-step, i.e., 7.50
step angle is shown in Table 1. This gives a full step rotation in both clockwise and counter
clockwise directions.
Step angle, θs (degrees/ step) = 3600/ Rs (steps/ rev) [4]
Where ‘Rs’ is Stepping rate
For Full Step, θs = 7.50
So, Rs = 3600÷ 7.50 = 48 steps/ rev
CCW direction
CW direction
32
16
8
4
2
1
Step
7B 9B 8B 8A 7A 9A
Nos
θs(deg)
1
0
0
1
1
1
1
15
0
2
0
0
1
1
0
0
12
3.75
3
1
1
0
1
0
0
52
7.5
4
0
0
0
1
0
0
4
11.25
5
0
0
0
0
1
1
3
15
6
0
0
0
0
0
0
0
18.75
7
1
1
1
0
0
0
56
22.5
8
0
0
1
0
0
0
8
26.25
1
0
0
1
1
1
1
15
30
Table 2-Half-Step Sequence for a Stepper Motor with 3.750 Step Angle
where:
7B, 9B & 7A, 9A are I1B, I0B & I1A, I0A respectively (control current levels)
8B & 8A are Phase B & Phase A respectively (control direction)
LabVIEW and Data Acquisition
LabVIEW is a program development application developed by National Instruments. It uses a
graphical programming language to create programs in block diagram form. It is called a virtual
instrument (VI) because its appearance and operation can replicate an actual instrument. A VI
consists of a front panel and a block diagram.
The front panel is an interactive user interface that simulates a panel of physical instruments
like knobs, push buttons, other controls and indicators. Whereas, the block diagram acts as back
end, where the actual programming is written using different functions and codes5.
Figure 3-Front Panel of Stepper Motor (Half/Full-Step).vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
4
Figure 4-Block Diagram of Stepper Motor (Half/Full-Step).vi
Fig. 3 and Fig. 4 show the front panel and block diagram of full-step mode with step angle 7.5
deg.
Micro-step mode:
For Micro-Step, θs = 0.750 (1/10th of full step angle)
So, Rs = 3600÷ 0.750 = 480 steps/ rev
Compared to full and half-steps, where the stepper motor tends to be slightly jerky in its
operation as the motor moves step by step, in micro-step it runs at a smoother rate.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
5
16
8
4
2
1
7B
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
9B
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
8B
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
8A
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
7A
1
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
1
1
9A
1
0
1
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
1
0
1
Nos θs (deg)
15
0
14
0.75
13
2.25
12
3.75
28
5.25
44
6.75
52
7.5
36
8.25
20
9.75
4
11.25
5
12.75
6
14.25
3
15
2
15.75
1
17.25
0
18.75
16
20.25
32
21.75
56
22.5
40
23.25
24
24.75
8
26.25
9
27.75
10
29.25
15
30
CCW direction
CW direction
Step
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
1
32
Table 3-Micro-Step Sequence for a Stepper Motor with 0.750 Step Angle
where:
7B, 9B & 7A, 9A are I1B, I0B & I1A, I0A respectively (control current levels)
8B & 8A are Phase B & Phase A respectively (control direction)
Working Principle of Test Setup-I
The Test setup-I as shown in Fig. 5 includes a stepper motor, driver interface, DAQ board
(device 3), 5V DC Power supply and a PC with LabVIEW software installed.
Depending upon the size of the stepper motor, its windings require a substantial drive current. In
this case, it ranges between 100mA- 700mA. This drive current is essential for our specified
motor to run. Stepper motor driver with two of NJM3770AD36 IC chips, shown in Fig. 6,
provides the current switching to each of the four lead wires (1-Black, 2-Yellow, 3-Grey, 4-Red)
or the two windings.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
6
LabVIEW
Software
PC
DAQ Extender
Board
P0.0 P0.1 P0.2 P0.3 P0.4 P0.5
(Digital I/O)
7B
5V DC
9B 8B 7A 9A 8A
Stepper Motor Driver
Interface
1
2
3
4
Stepper
Motor
Figure 5-Schematic representation of Test Setup-I7
The input step signals generated from digital I/O (P0.0 to P0.5) transfer to stepper driver pins 7B,
9B, 8B, 8A, 7A, 9A respectively. These input signals or the pulses from the switches or the ports
energize the phase windings consecutively, causing the stepper motor to run.
Motor leads to
pins 1 & 15
Pins 7, 9 are I1,
I0 respectively
and Pin 8 is
Phase.
Figure 6-Pin Configurations of NJM3770AD3 Chip6
Fig. 6 shows the pin configurations of NJM3770AD3 and the inputs (7, 8 and 9) and outputs (1
and 15) of IC chip are used in for the signals to flow through the driver circuit from DAQ board
to the stepper motor leads.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
7
Table
DIP
Symbol
Description
1
MB
2
T
3,14
VMM
4,5
GND
Motor output B, Motor current flows from MA to MB when
phase is high.
Clocking oscillator. Timing pin connect a 56KΩ resistor and a
820pF in parallel between T and Ground.
Motor supply voltage, 10 to 40 V. Pins 3 and 14 should be wired
together.
Ground and negative supply. Note these pins are used for heat
sinking.
12,13
6
7
VCC
I1
8
Phase
9
I0
10
C
11
VR
15
MA
16
E
Logic voltage supply normally +5V.
Logic input. It controls, together with the I0 input, the current
level in the output stage
The controllable levels are fixed to 100, 60, 20, and 0 %.
Controls the direction of the motor current of MA and MB
outputs.
Logic input. It controls, together with the I1 input, the current
level in the output stage
The controllable levels are fixed to 100, 60, 20, and 0 %.
Comparator input. This input senses the instantaneous voltage
across the sensing resistor, filtered through a RC Network.
Reference voltage. Controls the threshold voltage of the
comparator and hence the output current. Input resistance:
typically 6.8KΩ± 20%
Motor output A, Motor current flows from MA to MB when
phase is high.
Common emitter. Connect the sense resistor between this pin
and ground.
Description of NJM3770AD3 Chip6
4-Pin
Figure 7-Stepper Motor Driver Interface6
Fig. 7 is the schematic of the NJM3770A IC chip and its pin configuration is shown in Table 4.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
8
B
7B
Black
8B
Yellow
Grey
9B
Red
8A
7A
9A
A
Figure 8-Typical stepper motor driver application with NJM3770A6
where:
7B, 9B & 7A, 9A are I1B, I0B & I1A, I0A respectively (control current levels)
8B & 8A are Phase B & Phase A respectively (control direction)
A and B are two IC chips (NJM3770AD3) used in stepper driver circuit in Test Setup-I.
PC
LabVIEW
Software
Stepper Driver
Control Circuit
5V DC
NI DAQ USB Board
Digital I/O
Stepper Motor
Figure 9-Digital Control of Stepper Motor Experiment I
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
9
Fig. 9 shows a photo of the Test Setup-I, where a PC with LabVIEW program gives the stepping
input signals to stepper driver through a digital NI-DAQ USB board. The output signals from the
stepper driver control circuit, which is described in Fig. 8, are used for rotary motion of the
stepper motor through the motor leads.
5. Test Setup-II
Stepper Control Circuit in Test Setup-II
Figure 10-Typical Wiring Diagram [8]
In Fig. 10, the microstepping drive receives digital input signals from DAQ-board and the output
signals are sent to stepper motor through an extension cable. A 35V DC power supply is given to
the drive.
0
V2
15 V
XMM1
4
5
Vo
2
Vi
7
8
10 V
50%
V4
+
2
3
1
R2
1k Ω
Key=A
741
U4
DC 10M Ω
U6
4
+
0
-
5.000
DC10M Ω
5.000
V
0
V
0 0
Figure 11-Schematic Diagram of Voltage Follower in *NI Multisim
A special case of the non-inverting amplifier is that of the Voltage Follower. The voltage
follower has the output signal connected to the inverting input terminal of the op amp as shown
in Fig. 11. The analysis of this device shows that Vout= Vin. Also the output is in phase with the
input. The common use for a voltage follower is to create a buffer in a digital circuit9. It acts as
isolation between the input (DAQ board) and the output (Microstepping Drive).
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
10
*National Instruments Multisim is an easy-to-use schematic capture and simulation software.
Stepper Motors
120V AC Power
Supply
Stepper
Drivers
Voltage Follower
Circuit
NI- DAQ
Digital I/O
Figure 12-Stepper Motor Controller Circuit with Voltage Follower in Test Setup-II
Fig. 12 shows that the voltage follower circuit acting as an isolator between the circuits, i.e.,
stepper driver circuit (X and Y drive) along with relay circuit (spindle drive), and the NI- DAQ
digital I/O USB boards.
The DC power supply for the Voltage follower, i.e., Vcc ≈10V. In the test setup-II for CNC
desktop mill, a total of 10 voltage followers are used. So, instead three LM 324 ICs (Integrated
Chips) are utilized for this.
Working Principle of Stepper Motor in Axis Drive:
The movement along the different axis is required either to move the cutting tool to the work
table to the desired positions. In order to accomplish accurate control of position and velocity,
stepper motors are used for axis drive. In the test setup-II, X and Y axes of the work table are
controlled by stepper motors and Z-axis or the cutting tool (spindle) is controlled by pneumatic
actuator, which is activated by a relay circuit10.
Controlling Resonance in the Mechanism:
If a rigidly mounted stepping motor is rigidly coupled to a frictionless load and then stepped at a
frequency near the resonant frequency, energy will be pumped into the resonant system, and the
result of this is that the motor will literally lose control. There are two basic ways to deal with
this problem:
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
11
Use of elastomeric motor mounts or elastomeric couplings (Appendix A shows the drawings
of the motor mounts and couplings) between motor and load can drain energy out of the
resonant system, preventing energy from accumulating to the extent that it allows the motor
rotor to escape from control.
2. Viscous damping can be used. Here, the damping will not only draw energy out of the
resonant modes of the system, but it will also subtract from the total torque available at
higher speeds. The end bearing for the lead screw offers an opportunity for viscous damping,
as do the ways on which the load slides. Even the friction found in sealed ballbearings or
Teflon on steel ways can provide enough damping to prevent resonance problems11.
1.
Spindle Drive
The spindle drive is controlled by a pneumatic/ air cylinder activated by solenoid air valve (Fig.
14) using two solid state I/O relays and DAQ board (device 2). The device shown in the Fig. 13
is the solenoid air valve used for spindle UP/ DOWN actions. A close circuit supplies 5V DC to
the relay and thereby spindle is either extended or retracted from the work piece. Another device
is the spindle motor, which is again controlled by a third relay and same DAQ board for spindle
ON/ OFF positions. Fig. 15 shows the photo of all the connections for spindle drive.
AC Power
Supply
120VAC
Device
Switch
DCVoltage
5V
1
2
AC O/P
3+ 4DC I/P
RELAY
Figure 13-Wiring Diagram of Solid State Digital I/O Relay
These Solid state I/O switching modules deliver an electrically clean, photo-isolated, noise-free
"output" interface from logic level control systems (NI-DAQ board) to external loads such as
motors, valves, solenoids, etc.
Solenoid
Air Cylinder
Figure 14-Working of Solenoid Air Valve12
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
12
An air compressor (Fig. 15) is used to supply a pressurized air of about 75-85 PSI or 6 bar to the
pressure center of the solenoid air valve. When the solenoid is activated and displaces downward,
then the pressurized air is sent to the air cylinder. Here when pressure P1> P2, the piston in the
air cylinder is forced down, moving the spindle downward. Similarly, when P2>P1, the piston is
forced up, moving the load (spindle) upward.
Desktop
Mill
Relay
Circuit
PC with
LabVIEW
Program
Stepper
Driver
NI-DAQ
USB
Air
Compressor
Figure 15-Experimental Test Setup-II
Solenoid
Air Valve
Spindle
Ball End Mill
Clamping
Work Table
Limit
Switches
for Y-axis
Work Piece
Stepper
Motor
Slides
Figure 16-CNC Desktop Mill
Fig. 16 shows a closer view of the CNC desktop mill, where a spindle is operated by a solenoid
air valve. A ball end mill is used as a cutting tool. Clamping is used to fix the work piece to the
work table. Two stepper motors are used to control the X and Y slides movement. Limit switches
are used at each end of the X and Y axes.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
13
Limit Switches in Motion Control
A limit switch is a device that produces a signal used to stop the motor. Limit switches are
usually used to indicate an end of travel, or to prevent a motor from travelling too far in one
direction or crossing the work space limits. In this experiment, the stepper motors cannot move
any more than a specified distance (5.5in. each direction) without doing damage to the motor or
the surroundings. When a limit switch (Fig. 17) is activated in the direction of travel, a controller
needs to stop motion in that direction as soon as possible. To accomplish this, ReadDigPort_2.vi
as shown in Appendix C is used in a while loop in the main program to stop immediately at the
press of the roller. This acts like an emergency stop and the whole program and machine comes
to a stand still. To get any movement, the limit must be disabled.
Figure 17-Limit Switch and its connections for longitudinal slide of the desktop mill
When the XY table has moved to the farthest position it can move to, the motor must stop trying
to push it any further. If there were no limit switches on the XY table, the motor would reach the
end of travel, but still continue to turn, causing damage to either the motor or the XY table13.
6. Results and Discussions
This section includes the description of LabVIEW programming (Fig. 19-36) to read CNC-code
text file and to be able to complete the engraving operation14 on desktop CNC miniature mill.
The program is written to execute sub-routine of any 3 letters (A-Z) or 3 numbers (0-9).The
CNC code for letters A to Z and numbers 0 to 9 are explained in Appendix B.
A flow chart is illustrated in Fig. 18 for the LabVIEW program used to read a CNC-code text file.
The Main VI (Subroutine_Main.vi) is having a SubVI called Sub Code VI which contains all the
different CNC codes (G0, G1, G2, G3, Home, M5 and L9201) used in the program. A SubVI for
each of the CNC code is written.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
14
Main VI
Sub Code VI
G0
G1
Linear
Interpolation
SubVI
G2
Circular
Interpolation
SubVI
G3
Home
Limit
Switch
SubVI
M5
Spindle
SubVI
L9201
Engrave
SubVI
Figure 18-Flow Chart for the LabVIEW Program to read a CNC-Code text file
Main VI Program:
Figure 19-Front Panel of Subroutine_Main.vi
Figure 20-Block Diagram of Subroutine_Main.vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
15
Sub Code VI Program:
Figure 21-Front panel of Sub_Code.vi
Fig. 21 shows front panel of the Sub Code VI. Here a menu ring that has different CNC-codes
and another ring that contains the characters, i.e., letters (A-Z) and numbers (0-9) are used.
Linear Interpolation Sub VI: G0, G1
Figure 22-Front Panel of Feed Rate All_with Limit Switch.vi
Figure 23-Block Diagram of Feed Rate All_with Limit Switch.vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
16
Ring Properties
Table 5-Test Menu Ring Properties
The Table 5 shows the different cases used in Linear Interpolation SubVI.
Figure 24-Front Panel of SubVI Feed Rate _with Limit Switch.vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
17
Figure 25-Block Diagram of SubVI Feed Rate_with Limit Switch.vi
Circular Interpolation SubVI: G2, CW
Figure 26-Front Panel of CW Circular Interpolation (G2) SubVI.vi
Figure 27-Block Diagram of CW Circular Interpolation (G2) SubVI.vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
18
Circular Interpolation SubVI: G3, CCW
Figure 28-Front Panel of CCW Circular Interpolation (G3) SubVI.vi
Figure 29-Block Diagram of CCW Circular Interpolation (G3) SubVI.vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
19
Figure 30-Front Panel of CW/CCW Circular Interpolation SubVI.vi
Figure 31-Block Diagram of CW/CCW Circular Interpolation SubVI.vi
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
20
Figure 32-Description of algorithm in CW/CCW Circular Interpolation SubVI.vi
Spindle SubVI: M5
Figure 33-Front Panel of Spindle Motion (UP/ DOWN/ ON/ OFF).vi
Figure 34-Block Diagram of Spindle Motion (UP/ DOWN/ ON/ OFF).vi
Engrave SubVI: L9201
The L word, L920114 is used for Engraving operations. Before running the Main VI, make sure
that all the G-code text files for the characters (A-Z and 0-9) are in the same folder as that of
Engrave SubVI. All the text files are tab delimited.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
21
Figure 35-Front Panel of LUS.vi (Reads Text file of English Alphabet (A-Z) and Numbers (0-9))
Figure 36-Block Diagram of LUS.vi
Character Box
G-code for each English Alphabet, i.e., from A to Z and Numbers, i.e., from 0 to 9 is written.
Here the character box (Fig. 37) height is taken as 1.4 in. and its width ranges from 0.8 to 1.2 in.
depending upon the character or the letter width. In other words, the Start and End points for
each letter box is (0, 0) and (0.8, 1.4) or (1.2, 1.4) respectively.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
22
Height
EP
S
Width
Figure 37-Character/Letter Box
Engraving (ULL)
An example of engraving, i.e., letters ‘ULL’ on the CNC desktop mill is achieved by using Gcode from tables 6 and 7 and the corresponding tool path is shown in the Fig. 38 and Fig. 39.
Letter U
1.6
X
0
0
0.2
0.6
0.8
0.8
Y
1.4
0.4
0.2
0.2
0.4
1.4
I
0
0
0.2
0
0.6
0
J
0
0
0.4
0
0.4
0
1.4
0.8, 1.4
0, 1.4
1.2
G1
G0
G3
X,Y
I, J
1
Y-axis
Code
G0
G1
G3
G1
G3
G1
0.8
0.6
0.4
0.6, 0.4
0, 0.4 0.2, 0.4
0.8, 0.4
0.2
0.2, 0.2
0.6, 0.2
0
Table 6-G-code for Letter ‘U’
0
0.2
0.4
0.6
0.8
1
X-axis
Figure 38-Character Box for Letter ‘U’
Letter L
J
0
0
0.3
0
0
1.6
0.8, 1.4
0, 1.4
1.4
1.2
Y-axis
Code
X
Y
I
G0
0
1.4
0
G1
0
0.3
0
G3
0.1
0.2
0.1
G1
0.8
0.2
0
G0
0.8
1.4
0
Table 7-G-code for Letter ‘L’
G1
G0
G3
X,Y
I, J
1
0.8
0.6
0.4
0, 0.3
0.2
0
0
0.1, 0.3
0.8, 0.2
0.1, 0.2
0.2
0.4
0.6
0.8
1
1.2
X-axis
Figure 39-Character Box for Letter ‘L’
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
23
Figure 40-Engraving on CNC Desktop Mill
Fig. 40 shows a photo taken after the engraving operation on the CNC desktop mill used in Test
setup-II.
7. Conclusions
In this paper stepper motors, which have high holding torque at low speeds, are utilized to build
their control circuit and write a LabVIEW program that reads and implements a CNC code, in the
form of a text file, for engraving operations on a desktop mill. The program also controls the
basic functions of the desktop CNC mill, such as turning the spindle on and off and controlling
travel limits of the worktable. The basic CNC code included linear and circular interpolations,
which provide the foundation necessary for the implementation of any future design expansion
of the program.
The paper also took one step beyond the set goals, namely engraving operation subroutines for
English Alphabet (A to Z) and numbers (0 to 9) were written and executed on the desktop mill.
Limitations
The limitations of the open-loop approach include:
1. It is not good for applications with varying loads, it is possible for a stepper motor to lose
steps, and its energy efficiency level is low.
2. It has resonance areas which must be avoided15.
8. Scope of Future Work
1. Apart from milling, this experiment can be used for drilling, turning, boring, & grinding
operations. It can be further applied on machines like pipe bending coil winding, flame
cutting, welding, etc.
2. The CNC codes used in this paper are G0, G1, G2, G3, M5 and L9201. In addition to this,
there are several CNC codes which can be programmed and implemented.
3. Instead of reading the code from a text file (.txt) which is written manually, it can be
generated readily by using a CAM package like GibbsCAM, MasterCAM, etc.
4. To improve the function of CNC mill, a 4-axis or 5-axis can be added. This can be used
to machine complex parts like turbine blades.
5. There is a scope to increase the machine operational envelope, i.e., the worktable size,
which is too small for machining.
6. In this paper, X and Y axes are controlled by stepper motors and Z-axis is controlled by a
pneumatic cylinder operated by a solenoid valve using LabVIEW. A study can be made
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
24
by using a stepper motor for Z-axis as well. The rotational bipolar stepper motors can be
replaced by linear stepper motors and studied further.
7. A simulation that allows user to see a preview of the cutter’s tool path either in 2D (XY
Graph) or in 3D view can be developed using a LabVIEW VI program16.
References
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
Stutes, E., Potier, B., Jr. and Thibodeaux, C., 1995, “Computer Numerically Controlled Desktop Milling
Machine,” Report, Mechanical Engineering Department, The University of Southwestern Louisiana, Lafayette,
LA, pp. 1-49.
Portescap, 42M048C Series Stepper Motor Manual, 2005, Danaher Motion, West Chester, Pennsylvania,
42M048C StepperCS 134 v6.09.pdf
Groover, M.P., 2007, Automation, production systems, and computer-integrated manufacturing, Prentice Hall,
Upper Saddle River, New Jersey, pp. 139-178.
Sokoloff, L., 2004, Applications in LabVIEW, Prentice Hall, Upper Saddle River, New Jersey, pp. 386-401.
National Instruments Corporation, 2006, Getting Started with LabVIEW, Manual, Austin, Texas, pp. 1-1.
New Japan Radio Co, Ltd., 2005, NJM3770A Datasheet,
http://semicon.njr.co.jp/njr/hp/productDetail.do?_isTopPage=false&_productId=401&_moveKbn=PRODUCT_
DETAIL_MOVE_SPEC
Sokoloff, L., 2004, Applications in LabVIEW, Prentice Hall, Upper Saddle River, New Jersey, pp. 386-401.
Sure Step Manual, First Edition, Revision A, 2004, Manual Number: STP-SYS-M,
http://www.automationdirect.com/static/manuals/surestepmanual/history.pdf
Michigan Tech., 2005, Operational Amplifiers, Lab Report, pp. 1-2,
http://www.ece.mtu.edu/labs/EElabs/EE3305/OpAmp_Lab_I.pdf
Pabla, B.S., Adithan, M., 1994, CNC Machines, New Age International, Daryaganj, New Delhi, India, pp. 2472.
Jones, D. W., 1995, “Control of stepping motors, a tutorial,” The University of Iowa Department of Computer
Science, Iowa City, Iowa, http://www.cs.uiowa.edu/~jones/step/
Dorf, R. C. and Bishop, R. H., 2008, Modern Control Systems, Prentice Hall, Upper Saddle River, New Jersey,
pp. 69.
National Instruments, 2006, “Limit Switches in Motion control Tutorial,”
http://zone.ni.com/devzone/cda/tut/p/id/4465
Fadal User Manual, 2003, Fixed Subroutines, Section 6, Compumachine Inc., Danvers MA, pp.111-116,
http://www.compumachine.com/Support/Downloads/Fadal/User%20Manual/0060__Sect_6_
_Fixed_Subroutines.pdf
Baldor Electric Company, 2000, Servo Control Facts, A Handbook Explaining the Basics of Motion, Fort Smith,
Arkansas, pp.10-16, http://www.baldor.com/support/literature_load.asp?ManNumber=MN1205
Feng, Y. N., 2007, “LabVIEW Controlled Desktop Computer Numerical Control (CNC) Mill,” National
Instruments ASEAN Virtual Instrumentation Applications Contest, Singapore.
Proceedings of the 2010 ASEE Gulf-Southwest Annual Conference, McNeese State University
Copyright © 2010, American Society for Engineering Education
25
Download