15 chapter-12 ea

12
 12-1 Chapter 12 8255 application in stepping motor Overview In this chapter we want to learn how to control the stepping motor. The application of stepping motor in the industry-control field is very wide. For example, the Robert –arm and bearing control …etc.. There’re many kinds of application. But how to use LabVIEW to control the clockwise (CW) and counter clockwise (CCW) motion of stepping motor is exactly the purpose of this chapter. Objective  To understand the control principle of 8255.  To understand the principle of stepping motor and motion theory.  To study how to use 8255 to control the stepping motor with CW and CCW motion. Keyword  Stepping Motor  Transistor  Brief Why there’re divided into A AB B  four phases? It’s because the general small stepping motors are with four phases, and there’re four opposite coils on stator. That is A AB B , each one provides 90 degree phase shift. Generally, each step of stepping motor is 1.8 degree and 360 degrees in one cycle. Therefore 200 step pulses are required to complete one revolution. Our stepping motor is 7.5 degree, therefore 48 step pulses are required to complete one revolution

Upload: ajayikayode

Post on 02-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 1/12

 

12-1

Chapter 12 8255 application in stepping motor

Overview

In this chapter we want to learn how to control the stepping motor. The application of

stepping motor in the industry-control field is very wide. For example, the Robert –arm and

bearing control …etc.. There’re many kinds of application. But how to use LabVIEW to control

the clockwise (CW) and counter clockwise (CCW) motion of stepping motor is exactly the

purpose of this chapter.

Objective

 To understand the control principle of 8255.

 To understand the principle of stepping motor and motion theory.

 To study how to use 8255 to control the stepping motor with CW and CCW motion.

Keyword

 Stepping Motor

 Transistor  

Brief

Why there’re divided into A、A、B、B   four phases? It’s because the general small stepping

motors are with four phases, and there’re four opposite coils on stator. That is A、A、B、B , each

one provides 90 degree phase shift. Generally, each step of stepping motor is 1.8 degree and

360 degrees in one cycle. Therefore 200 step pulses are required to complete one revolution.

Our stepping motor is 7.5 degree, therefore 48 step pulses are required to complete one

revolution

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 2/12

 

12-2

   There are three kinds of wave drive of stepping Motor

 1 phase on

STEP A B A   B  

1 1 0 0 0

2 0 1 0 0

3 0 0 1 0

4 0 0 0 1

5 1 0 0 0

6 0 1 0 0

7 0 0 1 0

8 0 0 0 1

 2 phase on

STEP A B A   B  

1 1 1 0 0

2 0 1 1 0

3 0 0 1 1

4 1 0 0 1

5 1 1 0 0

6 0 1 1 0

7 0 0 1 1

8 1 0 0 1

 1-2 phase on

STEP A B A   B  

1 1 0 0 0

2 1 1 0 0

3 0 1 0 0

4 0 1 1 0

5 0 0 1 0

6 0 0 1 1

7 0 0 0 1

8 1 0 0 1

Note:The above data is the information of turning clockwise direction. If you want to turn in

counter clockwise direction, just read the data from bottom to top.

Therefore we only need to choose these three kinds of wave drive, and then the motor

can run. Here we will use 1-2 phase on to run the stepping motor.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 3/12

 

12-3

Practice 12-1 Control of stepping motor

We will use 8255 to control stepping motor. When LabVIEW prescribe to run, we’ll use the

icon interface to do the switch between CW and CCW motion of stepping motor.

1、The hardware circuits is as follows.

2、Open new LabVIEW program. In the Front Panel, choose All Controls Array &

Cluster  Array, which name is “1-2 phase ON data", and select

Controls 

Numeric 

Numeric Control. Add it into Array, and input eight values as

following. This is 1-2 phase on signal. You could refer to the prior table.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 4/12

 

12-4

3、Choose Controls 

All Controls Boolean 

OK Button, the name is called as "CW /

CCW”.

4、Choose Controls All Controls Numeric Horizontal Pointer Slide, which name is

“Rotation Speed  ". Set the range from 0 to 10, this is for adjusting the speed of

motor. When you set it to the fastest, the speed is 10 milliseconds per step.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 5/12

 

12-5

5、In the Block Diagram, choose “Functions 

All  Functions 

Structures 

Stacked

Sequence Structured”. Pull up the block, and add 3 new page frames. In the first

page frame, please connect the diagram as following. This is to set the parallel port

data bus as an output.

6、In the second page frame, please enter the data as following. This is to define the

PORT B of 8255 to be output.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 6/12

 

12-6

7、In the 3rd page frame, choose Functions 

All Functions 

Structures 

Case

Structured, pull up the block, and connect the diagram as following.

8、In the Block Diagram of “ True”. Choose Functions 

Functions 

Structures 

For

Loop, pull up a block, and set the count of loop to be 8. This is to read 8 records of

data.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 7/12

 

12-7

9、Please select “Function 

All Functions 

Array 

Index Array”, and select what we

have done SubVI from“8255_OUTPUT.vi”. The connecting diagram is shown as

follows. This means that each loop the register will read the next data from “1-2

phase on” table and output to PORT B of 8255. In this case the stepping motor will

turn in clockwise direction.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 8/12

 

12-8

10、Please connect the “Rotation Speed” as follows, this means we change the delay

time before excite each phase in turn. Therefore it is become to control the stepping

motor speed.

11、Try to create each Local Variable from “1-2 phase on” and “Rotation Speed”. The

method is to click the “1-2 phase on  “with right hand button of mouse, then the

selection is shown as follows. At last a local variable will be create On the “Rotation

Speed” do the same steps to create another Local Variable.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 9/12

 

12-9

12、Please repeat the ninth step, and it will be create as follows.

13、Please select “Functions 

All Functions 

Array 

Reverse 1D Array”, then

connect the end of “Array” with “1-2 phase on”. This step means to reverse the

data in the array of “1-2 phase on”. The data will be arranged from button to top in

order to reverse the motion of stepping motor.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 10/12

 

12-10

14、Now please repeat the steps 10 and 11. To complete those steps you may find some

false as follows.

15、Please click the right hand button of mouse on the “Rotation Speed", and select the

item “Change to Read” as follows.

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 11/12

 

12-11

16、Now you can press the continuous execution  key , the stepping motor will

rotate CCW immediately. Next you can adjust the speed of rotation by press the key

of “Rotation Speed” in the Front Panel.

The end of practice 12-1

continuousexecution key 

8/10/2019 15 Chapter-12 EA

http://slidepdf.com/reader/full/15-chapter-12-ea 12/12

 

12-12

Exercise and discussion

1、In the practice 12-1, if we want to change the driving of stepping motor from “1-2

phase on” into “1 phase on” or “2 phase on”, do you know how to modify the

program of LabVIEW?.

2、Please connect an exterior keypad, and use it to set the motor speed by the

keypad control.

3、Please compare the advantage and defect of three kinds of wave drive of

stepping Motor 。 

4、On the real world application, the motor often need to be proceeded to

immediately start, or perhaps immediately stop its motion. If we want to use

the program of LabVIEW to accomplish this task, how to complete the

program?