MCT4159 Lab 3 Manual

74
KULLIYYAH OF ENGINEERING DEPARTMENT OF MECHATRONICS ENGINEERING SEMESTER I 2011/2012 Laboratory Manual MECHATRONICS ENGINEERING LAB III (MCT 4159) (DSD-Microprocessors- Robotics)

description

MCT4159 Lab 3 Manual

Transcript of MCT4159 Lab 3 Manual

Page 1: MCT4159 Lab 3 Manual

KULLIYYAH OF ENGINEERINGDEPARTMENT OF MECHATRONICS ENGINEERING

SEMESTER I 2011/2012

Laboratory Manual

MECHATRONICS ENGINEERING LAB III

(MCT 4159)

(DSD-Microprocessors-Robotics)

Page 2: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

LABORATORY EXPERIMENTS

All experiments except the laboratory project do not require a final laboratory report.

Data Sheet(1) Original data sheet. This original data sheet should approved by instructor(s) during experiment day. If it is a printed from a system then the original print needs to be approved and signed by the instructor, else please use the format contain in Appendix B for data sheet. Make sure the data sheets are approved and signed BEFORE the end of the laboratory session, marks will be deducted if the data sheets is not approved and signed prior to end of the laboratory session.(2) Calibration curves of instruments which were used in the performance of the experiment. Include manufacturer of the instrument, model and serial numbers. Calibration curves will usually be supplied by the instructor.(3) Bibliography listing all references used.

PROJECT REPORTS: AN OVERVIEW All experiments except the laboratory project do not require a final laboratory report.

The reports MUST BE TYPED and COMPUTER PRINTED and in the following specification:Font Type: Times New RomanFont Size: 12

Any graphs need to be plotted using excel. Please make sure you use scatter graph when appropriate and add trend lines to those graph. Identify the R2 value for the graph to see the best fit line when using as such, discuss on the R2 value during your discussion as well. You are only suppose to use a line graph, when you encounter adding a trend line to the scatter graph as deemed inappropriate for the discussion that you are suppose to make. The suitability of the graph used will be considered in marking as well.

Plagiarism is a major offence. Please adhere to university’s policy for plagiarism. Any student found to commit an offence of plagiarism will be dealt with accordingly.

Please refer to APA basic format in the LMS for citing and referencing guides.

GUIDELINES FOR FINAL REPORT WRITING

Page 2 of 60

Page 3: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

The report should be written in such a way that anyone can duplicate the project and find the same results as the originator. The reports should be simple and clearly written.

The report should communicate several ideas to the reader. 1. The report should be neatly done. A poorly written report might instead lead the reader to think that just as little care went into performing the experiment. 2. The report should be well organized. The reader should be able to easily follow each step discussed in the text. 3. The report should contain accurate results. This will require checking and rechecking the calculations until accuracy can be guaranteed. 4. The report should be free of spelling and grammatical errors. 5. The report should show your analysis of results in your discussion, with all the relevant sample calculation. The analysis could be in the form of summary tables, graphs or other appropriate measure to show your good analysis of the results.

Title pageSpecify the project title. Include names of all group members, matric numbers, group number, date of submission. At top of this page must bear the subtitle: "Final Laboratory Project Report". Refer to Appendix A for the example of this title page.

Table of ContentsList each major section and subsection and their page numbers.

Objectives The objectives are a clear concise statement explaining the purpose of the project. The objectives serve as a guide to the results. This is one of the most important parts of the laboratory report because everything included in the report must somehow relate to the stated objectives. The objectives can be as short as one sentence and it is usually written in the past tense. Do not exceed one page.

Abstract/IntroductionSummarize the important results. The abstract must be self-contained: do not refer to figures and tables located in other sections of the report. Do not include tables, figures, and equations, unless absolutely necessary. Do not assume that the reader will unambiguously identify undefined symbols. Be precise and succinct. Do not exceed one page. The Abstract should be written with great care because it is a most important part of the Final Report and will have a very large impact on the grade assigned to the work.

Procedure

Page 3 of 60

Page 4: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

The procedure section should contain a schematic drawing of the experimental setup including all equipment used in a parts list with manufacturer serial numbers, if any. Show the function of each part when necessary for clarity. Outline exactly step-by-step how the project was performed as there is someone desires to duplicate it. If it cannot be duplicated, the experiment shows nothing.

Results Include all tables and graphs that document your final results. Include all relevant information so that you can later refer to these figures in the discussion section to support your conclusions. If possible, present the results in the same order that you listed the objectives. Do not discuss the significance of the results. Include only final results that satisfy the objectives of the experiment; lengthier tables and intermediate figures should be included in the Appendix. Introduce the reader to each figure and table with a brief paragraph indicating what variables are plotted or tabulated. Each figure and table must have a unique number and a title or caption.

GraphsIn engineering laboratory reports, one of the methods to represent the results is graph. The graph sometimes summarized the results. An acceptable graph has several features. Some of the important features are as following.

Axis labels defined with symbols and units. Each line is identified using a legend. Data points are identified with a symbol: “x” on the Qac line to

denote data points obtained by experiment. Data points are identified with a symbol: “o” on the Qac line to

denote data points obtained by theoretical. Nothing is drawn freehand. Should have number and title; e.g. Fig. E1.1 Volumetric flow

rate, Q vs. head drop, Δh. Title is descriptive, rather than something like Q vs Δh

All graphs must be generated using a computer. (No scanning or drawing using pen and pencil)

Assembly Codes / Screen CaptureSome parts of the project may require you to come out with a program to run certain features such as input from keyboard, output to display, running a motor, LED, LCD etc. All these laboratory session requires a certain coding from your side. If the coding is required from you before/during/after the project, you are required to supply your source codes in the report. At the same time, an appropriate screen/camera capture showing your results would be necessary to show the output of your experiments.

Page 4 of 60

Page 5: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Sample CalculationsIf any of the experiment requires that you come out with a calculation to get to the end results. You are required to give one example of each calculation that leads to a result reported in the document. Include one calculation for each figure or table reported in the Results section. Introduce each calculation with a brief paragraph indicating to the reader which specific point in a figure or entry in a table is being calculated. These calculations are samples only and must be annotated. The rest of the calculation should be done using excel. Please prints out a full table calculation using excel as part of your sample calculations. All excel softcopies data MUST be submitted.

Discussion and Conclusion Discussion and conclusion should be separate. This section should give an interpretation of the results explaining how the object of the project was accomplished. If any analytical expression is to be verified, calculate % error and account for the sources. (% error – An analysis expressing how favorably the empirical data approximate theoretical information. There are many ways to find % error, but one method is introduced here for consistency. Take the difference between the empirical and theoretical results and divide by the theoretical result. Multiplying by 100% gives the % error. You may compose your own error analysis as long as your method is clearly defined). Discuss this project with respect to its faults as well as its strong points. Suggest extensions of the project and improvements. Also recommend any changes necessary to better accomplish the objectives. Use the available theory to explain why the relevant variables behaved in the observed fashion. The discussion questions act as a guide only for you to do your discussion, not as part of a question and answer scheme.

IMPORTANT: IN DISCUSSION YOU MUST DISCUSS AND ANALYSE YOUR RESULTS, AND LINK TO THEORY AS APPROPRIATE. THE USE OF SUMMARY TABLES AND VARIOUS CHARTS AND PLOTS WILL HELP TO MAKE YOU YOUR DISCUSSION AND FINALLY CONCLUSION MUCH CLEARER TO THE AUDIENCE.

The marking scheme for the reports is as follows:Format 2 marksProcedure 4 marksDiscussion 15 marksGraphs / Summary Table 10 marksSummary table – Calculation 5 marksCalculation Sample 10 marksConclusion 2 marks

Page 5 of 60

Page 6: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Grammar 2 marksTotal 50 marks

CERTIFICATION OF ORIGINALITY AND AUTHENTICITY.

All reports need to include the certification of originality and authenticity to be accepted. This certificate will act as a proof that the report have been done by all the group members and not only by an individual of the group. If there is a proof that the report is being done only by an individual within the group, the marks for the reports will only be given to the sole individuals who does the reports.

The certificate of originality and authenticity MUST only be sign when reports have been completed, understood and agreed upon by all members of the groups. EACH group member will need to sign in what is their contribution to the reports and tick (“/”) that they have READ, UNDERSTAND AND AGREE that it is shall be submitted for marking.

The full certificate of originality and authenticity could be seen in Appendix C.

REFERENCE: COMPULSARY READING MATERIAL FOR LAB

68000 Microprocessor Trainer User Manual68000 Microprocessor Application Board / Lab Experiment Workbook

Page 6 of 60

Page 7: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

DSD EXPERIMENT 1:

-INTRODUCTION TO BASIC LOGIC GATES-

Page 7 of 60

Page 8: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Digital System Design

Experiment No. 1: Introduction to Basic Logic Gates.

ObjectiveThis experiment will introduce AND, OR, NAND, NOR and Exclusive OR logic gates. You will learn about:

Electrical characteristics of logic circuits. Operation of basic gates. The concept of a universal gate.

Components needed: 74LS08, 74LS00, 74LS32, 74LS02, 74LS86.

I. PrelabYou must have this information when you ENTER THE LAB.

A. Use the TTL Logic Data Book to locate the following information.

1. Define tPHL and tPLH.

2. Locate the datasheets for the following parts: 74LS08, 74LS00, 74LS32, 74LS02, 74LS86.

a. Create a table that shows the TYPICAL delay values for tPHL and tPLH for each gate.

b. There are more delay values for the 74LS86 than there are for the other gate types. Why is this? EXPLAIN!

3. From the datasheet of the 74LS00:

a. What is the minimum input voltage for a logic ‘1’?

b. What is the minimum input voltage for a logic ‘0’?

c. What is the minimum output voltage for a logic ‘1’?

d. What is the minimum output voltage for a logic ‘0’?.

e. Compute the difference (C – A), (D-B). Why must this be a positive number? Explain what a “noise margin” is and why it is important.

B. Prepare truth tables for each of this experiment's logic diagrams.

C. Label each of the logic diagrams with pin assignments using the TTL Data Book.

II. Procedure

Page 8 of 60

Page 9: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

A. Assemble the circuits in Figure 1 through Figure 5. Verify that each circuit operates as expected. Compare your results with those in your truth tables.

B. A universal gate is a logic gate that can be used to create all the basic logical functions. These two gates are the NAND and the NOR.

1. Connect the circuit in Figure 6 and verify that it operates as an inverter.

2. Connect the circuit in Figure 7 and verify that it operates as an inverter.

3. Connect the circuit in Figure 8 and verify that it operates as an OR gate.

4. Assemble each of the circuits in Figure 9 through Figure 11 and determine the equivalent gate represented by each circuit.

Page 9 of 60

Page 10: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

C. All combinational logic functions can be represented in sum-of-products (AND/OR) form and product-of-sums (OR/AND) form. This implies that all functions can be implemented in two levels of logic provided that at each level gates have enough inputs. In practice, this may not be realizable due to limitations on fan-in (maximum number of inputs a gate may have). It should also be noted that AND/OR and OR/AND forms can be converted to forms that use only the universal gates.

1. Assemble the circuits in Figure 12 and Figure 13 and show that the (AND/OR) form is equivalent to the (NAND/NAND) form.

2. Assemble the circuits in Figure 14 and Figure 15 and show that the (OR/AND) form is equivalent to the (NOR/NOR) form.

D. In logic circuits it is not always obvious that there is a time delay between the time an input changes and the time the output changes. This delay is known as propagation delay and it must be taken into account in many circuit designs.

1. Connect the circuit in Figure 19. Notice that the output appears to always be a logic `1' regardless of the input setting.

2. Connect the 1 Mhz digital clock output on the test box to the input of the circuit. Monitor the input to the circuit on CH1 of the scope and monitor the output of the circuit on CH2. Adjust the CH2 vertical scale in order to clearly see the `glitch' caused by propagation delay. Record all waveforms.

E. Design Problem

Part 1: Universal NAND GateUsing a single 7400 IC, connect a circuit that produces the following:1. A 2-input AND gate2. A 2-input OR gate3. A 2-input NOR gate4. A 2-input XOR gate

Part 2: NAND Circuit

Page 10 of 60

Page 11: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Is it possible to design the following equation?

F = AB’ + C’D

using a single 7400 IC?

Implement the equation using a minimum number of 7400 IC’s and consider alternatives to the suggested IC.

III. Results and Discussion

Results of the experiment shall be noted down in the students’ report. At the same time, students are to demo to the demonstrator that they have completed the experiment.

Discussion should be based on the results that you have obtained from the experiments. Below are some of the questions that supposed to be discussed in your discussion and analysis.

1. Explain why a logic `1' can be used as one input to a NAND gate in order to use the gate as an inverter.

2. Accurate drawings of the waveforms. Explain those results.

Page 11 of 60

Page 12: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

DSD EXPERIMENT 2:

- Combinational Logic Circuit and Basic ALU-

Digital System Design

Page 12 of 60

Page 13: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Experiment No. 2: Combinational Logic Circuit and Basic ALU.

ObjectiveThis experiment will help you get familiar with Combinational circuit design using logic gates. You will learn about:

• Building a combinational circuit using several logic gates• Commonly used combinational circuits• Basic of ALU - Adder and Subtractor

Components needed: 74LS08, 74LS00, 74LS32, 74LS02, 74LS86.

I. PrelabYou must have this information when you ENTER THE LAB.

1. Download and print out all the datasheets which will be used in this experiment.

2. Prepare truth tables for all the combinational logic circuits shown below (Part 1 and 2) and derive their expression. For the circuit in part 2, design the circuit using only basic logic gates (AND, OR and NOT).

Part 1: Basic combinational circuit - 3 input 1 output logic circuit.

Figure 1.

Multiplexer - 4-to-1 multiplexer.

Figure 2

*A sum-of-products implementation of the 4-to-1 multiplexer appears in figure above. It realizes the multiplexer function:

Page 13 of 60

Page 14: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Decoder - 2 to 4 decoder

Figure 3

Part 2: Design Problem

Design an Adder-Subtractor circuit as shown below:

Figure 4 - Adder-subtractor combination: (a) operation table; (b) truth table for yi and c0; (c) circuit (using XOR); (d) logic symbol

II. Procedure Assemble all the circuits in Part 1, and 2. Verify that each circuit operates as expected. Compare your results with those in your truth tables.

Page 14 of 60

Page 15: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

III. Results and Discussion

Results of the experiment shall be noted down in the students’ report. At the same time, students are to demo to the demonstrator that they have completed the experiment.

Discussion should be based on the results that you have obtained from the experiments.

Page 15 of 60

Page 16: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

DSD EXPERIMENT 3:

- Flip Flop and Sequential Logic Circuit-

Digital System Design

Page 16 of 60

Page 17: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Experiment No. 3: Flip Flop and Sequential Logic Circuit.

Objective-To become familiar with the input/output characteristics of several types of standard flip-flop devices and the conversion among them.

Components needed:

1- 555 IC, variable resistance and capacitors.1-74LS00 TTL IC1-74LS74 TTL IC1-74LS76 TTL IC

I. PrelabYou must have this information when you ENTER THE LAB.

1. Download and print out all the datasheets which will be used in this experiment.

2. Prepare truth tables for and familiarize yourself with all the circuits shown below (Part 1 and 2). Solve all the design problems in Part 2.

Part 1:

1) Construct the clocked RS flip flop of Figure 1. Draw a complete truth table for the circuit. Then use clock pulse as an input at E. Use pulse switch as your clock source. Explain how the circuit behaves.

Figure 1

2) Using the 74LS74 dual D flip flop, investigate the operation of the D flip-flop in Figure 2. Pay attention to the change in state of the device as the clock signal is rising or falling. Draw the complete truth table for the circuit.

Page 17 of 60

Page 18: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Figure 2

3) Using the 74LS76 dual JK flip flop, determine its logical operation. The circuit diagram is shown in Figure 3. Pay attention to the change in state of the device as the clock signal is rising or falling. Draw the complete truth table for the circuit.

Figure 3

Part 2: Design Problem

1) Designing a Counter

Using JK flip-flops and any other applicable gates design, implement and verify a counter that displays the following sequence of numbers:

0, 3, 6, 9, 12, 14 and back to 0 to repeat the sequence.

Note that there will be memory states that are not used. The counter must be self-starting, that is if the circuit starts from any of the unused (i.e. undefined) states, the counter must transfer the circuit to one of the defined states to continue the output in the aforementioned sequence.

In the design you must include a function bit controlling whether you are counting up or down. Use the 74LS47 (BCD to seven segment display decoder) to drive the display.

2) Designing a Car Security System

The State diagram; and the next-state / implementation table of a car security system are as shown in Figure 4 below. Please complete the task by using K-map and identify the excitation equation. Finally construct the logic circuit and test the output to verify the answer experimentally. From the state diagram, explain how the car security works.

Page 18 of 60

Page 19: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Figure 4

II. Procedure Assemble all the circuits in Part 1 and 2. Verify that each circuit operates as expected. Compare your experimental results with the PreLab.

III. Results and Discussion

Results of the experiment shall be noted down in the students’ report. At the same time, students are to demo to the demonstrator that they have completed the experiment.

Discussion should be based on the results that you have obtained from the experiments.

Page 19 of 60

Page 20: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

MICROPROCESSOR EXPERIMENT 4:

-INTRODUCTION TO MC68230 PI/T-

- INPUT SWTICHES AND OUTPUT LEDS-

(WARNING NOTICE: PLEASE MAKE SURE YOU HAVE READ THE 68000 MICROPROCESSOR TRAINERS MANUAL AND THE APPLICATION BOARD MANUAL BEFORE STARTING THE

EXPERIMENT. THE MANUAL IS AVAILABLE IN THE DIGITAL/MICROPROCESSOR LAB,)

EXPERIMENT # 4

Page 20 of 60

Page 21: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

1. INTRODUCTION TO MC68230 PI/T 2. INPUT SWITCHES AND OUTPUT LEDS

1.1 PRE-REQUISITE READING Please make sure you have completed a MCT3235 as a prerequisite or read on your own on the M68000 interfacing from the recommended book in MCT3235.

Please make sure as well you have read the 68000 Microprocessor Trainer Manual Model: GOTT-MP-68K and Page 1 to 15 of Application Board Manual EXP-AP Model: GOTT-MP-68K-APPS

These manuals are available in the Digital Systems/Microprocessor Labs.

1.2 BACKGROUNDPI/T is one of the fundamentals understanding required in microprocessor M68000 as this is the basic communication between requirement between M68000 and the external peripherals. In order to control the environment various input and output devices such as switch, sensors, actuators, cylinders and solenoids are being used. In this experiment, 2 basic input output are use to simulate an actual sensor/actuators which are DIP switch and LEDS.

1.2 OBJECTIVESThe objectives of the experiment are:1. To introduce students to the world of microprocessor and its

interfacing2. To introduce students on how to program an assembler and

transfer the program into the microprocessor and memory.3. To demonstrate basic i/o operation and applications, which is

to read input data from 8-bit DIP Switch (SW1) and Output the results to 8 LEDs (L1 – L8)

4.

1.4 EQUIPMENT:Personal ComputerMain Trainer BoardSerial connector (Between Main Trainer Board and PC)Application Board

1.5 PROCEDURE (1):

Page 21 of 60

Page 22: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

1. Make sure that you have read Part 3 (Getting Started) of 68000 Microprocessor Trainer manual. If you have any question in getting started please make sure you ask the demonstrator/instructor NOW.

2. Check that your communication between Main Trainer board and PC is now available. Open to page 12-13 for testing communication link.

3. Open Easy68K assembly. You are supposed to be familiar with the assembly already by now, since the same assembler is being used for your assignment given in module MCT3235 (Microprocessor Based Design). The same assembler should help you to ensure consistency in your programming.

4. FOR PART A: Type in the following instruction into your assembler.

BEGIN ORG $080C00MOVE.B #$80, $10000D Configure port A ctrlMOVE.B #$00, $100005 Configure port A dir inputMOVE.B #$80, $10000F Configure port B ctrlMOVE.B #$FF, $100007 Configure port B dir outputMOVE.B #$00, $100013 clear all o/pEND BEGIN

5. Compile the following codes6. Please read page 14 – 16 of the Part 3 (Getting Started)

Section on how you are to download the machine codes. 7. Download the machines codes to the M68000. 8. FOR PART B: Change the above program to configure Port

A as output and Port B as input. 9. FOR PART C: Change the above program to configure Port

A as output and Port B as output

PROCEDURES (2)

1. Make sure that you have read Part 3 (Getting Started) of 68000 Microprocessor Trainer manual. If you have any question in getting started please make sure you ask the demonstrator/instructor NOW.

2. Check that your communication between Main Trainer board and PC is now available. Open to page 12-13 for testing communication link.

3. Open Easy68K assembly. You are supposed to be familiar with the assembly already by now, since the same assembler is being used for your assignment given in module MCT3235 (Microprocessor Based Design). The same assembler should help you to ensure consistency in your programming.

4. FOR PART D: BASIC INPUT AND OUTPUT

Page 22 of 60

Page 23: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Type in the following instruction into your assembler.

BEGIN ORG $080C00MOVE.B #$80, $10000D Configure port A ctrlMOVE.B #$00, $100005 Configure port A dir inputMOVE.B #$80, $10000F Configure port B ctrlMOVE.B #$FF, $100007 Configure port B dir outputMOVE.B #$00, $100013 clear all o/p

READ MOVE.B $100011, d0 Read dip switchMOVE.B d0, $100013 output to LEDsBRA READ

END BEGIN

5. Compile the following codes6. Please read page 14 – 16 of the Part 3 (Getting Started)

Section on how you are to download the machine codes. 7. Download the machines codes to the M68000. Please

confirm that you have set the JUMPER for the I/O Module Selector According to this experiment. Refer to Part 2 (Setting Up) on Application Board Manual for the module selector list.

8. Execute the program. 9. Adjust on the setting for the 8 bit DIP switch and monitor

the change pattern on the 8 LEDs. 10. FOR PART E: INVERTED INPUT / OUTPUT

Modify the codes in Part D to invert the input data. For example if the switch as set to high, then the LED will be off, and if the switch is set to low then the LED will be on.

11. FOR PART F: RUNNING LIGHTS Modify the codes in PART D, to do the following: the LED light will move from left to right as below

when a left switch is on. (running light) For example: After switch is on the LED will beLED1 LED2 LED3 LED4 LED5 LED6 LED7 LED8

1 0 0 0 0 0 0 0 next 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0

And repeat from left to right until switch is off.12. FOR PART G: RUNNING LIGHTS WITH DELAY

Modify the codes in PART F, to do the following: Include delays when the running light moves from

left to right.

Page 23 of 60

Page 24: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

13. FOR PART H: RUNNING LIGHTS WITH DELAY AND SKIP

Modify the codes in PART G, to do the following: Having the light to move a bit slower, not skip each

LED as follows:LED1 LED2 LED3 LED4 LED5 LED6 LED7 LED8

1 0 0 0 0 0 0 0 next 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0

14. FOR PART I: TRAFFIC LIGHT SIMULATION Modifying the codes in PART D-H, design a traffic light sequence experiment. Ensure that you have enough delays and correct sequence for the traffic light. No accident can occur in your intersection.

1.5 RESULTS:

Results of the experiment shall be given in assembly codes for the report. At the same time, students are to demo to the demonstrator that they have completed the experiment.

CODES PART ACODES PART BCODES PART CCODES PART DCODES PART ECODES PART FCODES PART GCODES PART HCODES PART I

Please get signature from the instructor/demonstrator that you have complete both lab part.

1.6 DISCUSSION:

Discussion should be based on the results that you have obtained from the experiments, below are some of the questions that supposed to be discussed in your discussion and analysis.

Identify what you have done line by line Explain what is happening to the codes

Page 24 of 60

Page 25: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

MICROPROCESSOR EXPERIMENT 5:

-7 SEGMENTS DISPLAY-

Page 25 of 60

Page 26: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Page 26 of 60

Page 27: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

EXPERIMENT # 57-SEGMENTS DISPLAY

1.1 BACKGROUNDOne of the important aspects in microprocessor is its flexibility in change data based on the requirement of the end user. A Human-Machine-Interface (HMI) is also vital in ensuring that programs done are base on real scenario and human interactions.

1.2 OBJECTIVESThe objectives of the experiment are:1. To demonstrate microprocessor controller 7-segment display

interface.2. To demonstrate the flexibility and HMI interactive feature

within the microprocessors.

1.3 EQUIPMENT:Personal ComputerMain Trainer BoardSerial connector (Between Main Trainer Board and PC)Application Board

1.4 PROCEDURE:1. Make sure that you have read Part 3 (Getting Started) of

68000 Microprocessor Trainer manual. If you have any question in getting started please make sure you ask the demonstrator/instructor NOW.

2. Check that your communication between Main Trainer board and PC is now available. Open to page 12-13 for testing communication link.

3. Open Easy68K assembly. You are supposed to be familiar with the assembly already by now, since the same assembler is being used for your assignment given in module MCT3235 (Microprocessor Based Design). The same assembler should help you to ensure consistency in your programming.

4. FOR PART A: ONE DIGIT DECIMAL COUNTER Type in the following instruction into your assembler.

BEGIN ORG $080C00MOVE.B #$80, $10000D Configure port A ctrlMOVE.B #$00, $100005 Configure port A dir inputMOVE.B #$80, $10000F Configure port B ctrlMOVE.B #$FF, $100007 Configure port B dir outputMOVE.B #$FF, $100011

Page 27 of 60

Page 28: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

DDD CLR d0 Clear 1st digit 7-segEEE BSR DISPLAY Branch to display sub

MOVE.L d0,d1 Copy content CMPI #$09,d1 Compare max valueBEQ DDDADDI #$01,d1 Increment counterMOVE.L d1,d0 Copy contentBRA EEE

DISPLAY MOVE.L #$01ff,d5 Store as temp counter

REPEAT MOVE.B #$fe,$100011 Activate LSB digitMOVE.B d0,$100013 Display d0 to port BBSR DELAYSUBQ.L #$1,d5 Decrement counterBNE REPEAT Loop if d5<>0RTS

DELAY MOVE.L #$03ff,d6DEL1 SUBQ.L #1, d6

BNE DEL1RTS

END BEGIN

5. Compile the following codes6. Please read page 14 – 16 of the Part 3 (Getting Started)

Section on how you are to download the machine codes. 7. Download the machines codes to the M68000. Please

confirm that you have set the JUMPER for the I/O Module Selector According to this experiment. Refer to Part 2 (Setting Up) on Application Board Manual for the module selector list.

8. Execute the program. 9. Observed what happent o the 7-Segment Display10. FOR PART B: DECIMAL COUNTER FROM 00-99

Modify the codes in Part A to form a decimal counter from 00-99.

11. FOR PART C: DECIMAL COUNTER FROM 000-999 Modify the codes in Part A to form a decimal counter from 00-99.

12. FOR PART D: DECIMAL COUNTER FROM 0000-9999 Modify the codes in Part A to form a decimal counter from 00-99.

13. FOR PART E: LAST 4 DIGIT MATRIC NUMBER Modify the codes in Part D to form a decimal display of your last 4 digit matric number.

14. FOR PART F: ROTATING LAST 4 DIGIT MATRIC NUMBER WITH 5/10 SECOND COUNTER.

Page 28 of 60

Page 29: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Modify the codes in part D above and do the following:

i. Display the last 4 digit of your matric numberii. Put a 5 second delay by having a counter to

show on the 7-Segment 0-5iii. Display the last 4 digit of your next friends

matric numberiv. Put a 10 second delay by having a counter to

show on the 7-segment 0-10v. Continue steps 1 until all your team members

last 4 digit numbers are displayed.

1.5 RESULTS:

Results of the experiment shall be given in assembly codes for the report. At the same time, students are to demo to the demonstrator that they have completed the experiment.

CODES PART ACODES PART BCODES PART CCODES PART DCODES PART ECODES PART F

Please get signature from the instructor/demonstrator that you have complete both lab part.

1.6 DISCUSSION:

Discussion should be based on the results that you have obtained from the experiments, below are some of the questions that supposed to be discussed in your discussion and analysis.

Identify what you have done line by line Explain what is happening to the codes

MICROPROCESSOR EXPERIMENT 6:

Page 29 of 60

Page 30: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

-MOTOR CONTROL-

Page 30 of 60

Page 31: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

EXPERIMENT # 6MOTOR CONTROL

1.1 BACKGROUNDThere are many types of application that microprocessor have been used both in the industry as well as service sectors. Among others were motors to control movement of certain parameters within the environment. This experiment will help to demonstrate the use of microprocessors and its interfacing with a motor.

1.2 OBJECTIVESThe objectives of the experiment are:1. To demonstrate microprocessor interfacing and control of a

DC motor.2. To demonstrate microprocessor interfacing and control of a

stepper motor.3. To demonstrate HMI control in microprocessor.

1.3 EQUIPMENT:Personal ComputerMain Trainer BoardSerial connector (Between Main Trainer Board and PC)Application Board

1.4 PROCEDURE:1. Make sure that you have read Part 3 (Getting Started) of

68000 Microprocessor Trainer manual. If you have any question in getting started please make sure you ask the demonstrator/instructor NOW.

2. Check that your communication between Main Trainer board and PC is now available. Open to page 12-13 for testing communication link.

3. Open Easy68K assembly. You are supposed to be familiar with the assembly already by now, since the same assembler is being used for your assignment given in module MCT3235 (Microprocessor Based Design). The same assembler should help you to ensure consistency in your programming.

FOR PART A: DC motor controlled MOTOR CONTROL1. A DC motor operation is controlled by simply turning it on or

off, whereby it will either stop or run. The DC motor is controlled by bits 0 & 1 of port B. The motor stops when both bits are 11 or 00. The motor moves forward (clockwise) when the bit pattern if 01 (bit 0 = 1; bit 1 = 1). The motor moves in reverse direction (anti clockwise) when the bit pattern is 10 (bit 0 = 0 and bit 1 = 1)

Page 31 of 60

Page 32: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

2. Type in the following instruction into your assembler.

BEGIN ORG $080C00MOVE.B #$80, $10000D Configure port A ctrlMOVE.B #$00, $100005 Configure port A dir inputMOVE.B #$80, $10000F Configure port B ctrlMOVE.B #$FF, $100007 Configure port B dir output

ON MOVE.B #$01, $100013 ForwardBSR DELAY DelayBSR DELAYMOVE.B #$00, $100013 StopBSR DELAYMOVE.B #$02, $100013 ReverseBSR DELAYBSR DELAYBRA ON Repeat

DELAY MOVE.L #551800, d6 Delay counterDEL1 SUBQ.L #1, d6

BNE DEL1RTS

END BEGIN

4. Compile the following codes5. Please read page 14 – 16 of the Part 3 (Getting Started)

Section on how you are to download the machine codes. 6. Download the machines codes to the M68000. Please

confirm that you have set the JUMPER for the I/O Module Selector According to this experiment. Refer to Part 2 (Setting Up) on Application Board Manual for the module selector list.

7. Execute the program. 8. Observed what happen on the motor movement.9. FOR PART B: FWD, REV & STOP FOR A WHILE

Modify the codes in Part A to drive the motor forward, then reverse, and then motor stop for a short period

10. FOR PART C: COUNTING PROGRAM Modify the codes in Part A, to develop a counting program to count the number of motor rotation using the pair of infra-red sensor (detector and transmitter) located on the board. Output the result to PC screen.

FOR PART D: DRIVING A STEPPER MOTOR1. Type in the following instruction into your assembler.

BEGIN ORG $080C00

Page 32 of 60

Page 33: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

MOVE.B #$80, $10000D Configure port A ctrlMOVE.B #$00, $100005 Configure port A dir inputMOVE.B #$80, $10000F Configure port B ctrlMOVE.B #$FF, $100007 Configure port B dir output

S_ON MOVE.B #$10, $100013 Motor in CW DirBSR DELAY DelayMOVE.B #$40, $100013 Single Step CW DirBSR DELAYBRA S_ON Repeat

DELAY MOVE.L #551800, d6 Delay counterDEL1 SUBQ.L #1, d6

BNE DEL1RTS

END BEGIN

2. Compile the following codes3. Please read page 14 – 16 of the Part 3 (Getting Started)

Section on how you are to download the machine codes. 4. Download the machines codes to the M68000. Please

confirm that you have set the JUMPER for the I/O Module Selector According to this experiment. Refer to Part 2 (Setting Up) on Application Board Manual for the module selector list.

5. Execute the program. 6. Observed what happen on the motor movement.7. FOR PART E: CCW

Modify the codes in Part D, and single step the stepper motor to counter clockwise (CCW)

8. FOR PART F: CW and CCW Modify the codes in Part D, and drive the stepper motor step in full circle on clockwise (CW) and then step in full circle to counter clockwise direction (CCW). Repeat the cycle 20 times and increase the delay in every cycle.

1.5 RESULTS:

Results of the experiment shall be given in assembly codes for the report. At the same time, students are to demo to the demonstrator that they have completed the experiment.

CODES PART ACODES PART BCODES PART CCODES PART DCODES PART E

Page 33 of 60

Page 34: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

CODES PART F

Please get signature from the instructor/demonstrator that you have complete both lab part.

1.6 DISCUSSION:

Discussion should be based on the results that you have obtained from the experiments, below are some of the questions that supposed to be discussed in your discussion and analysis.

Identify what you have done line by line Explain what is happening to the codes

ROBOTICS EXPERIMENT 7:

Page 34 of 60

Page 35: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

-UNDERSTANDING MANUAL AND AUTOMATIC OPERATIONS OF

INDUSTRIAL ROBOTS-

EXPERIMENT #7UNDESTANDING MANUAL AND AUTOMATIC OPERATIONS OF INDUSTRIAL ROBOTS

OBJECTIVES

To be familiar with the robot component.

To manually operate DENSO Robot for certain task using teaching pendant.

To manually operate FANUC Robot for certain task using teaching pendant.

Page 35 of 60

Page 36: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

To manually operate YASKAWA MOTOMAN Robot for certain task teaching pendant.

INTRODUCTION

Manual operation refers to direct operation of the robot from operating panel or teaching

pendent. In manual operation mode, there are three types of operation modes available:

a) Joint Mode: used to specify movement of each individual joint of the robots

b) X-Y Mode: the joint of the robot moves simultaneously as to create a motion along the 3

major axis X, Y and Z-axis.

c) Tool Mode: is which specifying movement of the robot’s hand relative to a frame attached

to the hand

PROCEDURE

The "Manual Operation" and "Valve Operation" was used to transfer three balls from left to

right with DENSO Robot. The operation was done in different modes which are, Joint Mode and X-Y

Mode. Then, the differences in movement are noted in the data sheet.

In the robotics lab, there are nine robots equipped for this course. Students have to practice the

movement of various robot based on different modes. The modes available are Joint mode and X-Y

mode.

Figure 7.1: Components of robots

Page 36 of 60

Page 37: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Upon switching ‘ON’ the controller, the robot moves to all axes in small amount to confirm

their current positions. Then, the calibration is normally done before using the robot just after the

switch of the robot is turned on.

There are five different robot configurations in general. They are Cartesian, Cylindrical,

Spherical, Articulated and SCARA. In this experiment, we are focusing on SCARA configuration.

SCARA robot has two revolute joints that are parallel and allows the robot to move in a horizontal

plane, plus an additional prismatic joint that moves vertically. SCARA robots are very common

assembly operations. Their specific characteristic is that they are more compliant in the x-y-plane, but

are very stiff along the z-axis, and thus have selective compliance. Another configuration available is

the articulated configuration. Articulated robot's joints are all able to revolute, similar to a human's arm.

They are most common configuration used for industrial robots.

Before proceeding with the lab task, we need to switch ‘ON’ the machine. To switch ‘ON’ the

machine, we have to follow steps as mentioned in figure 2 below. After the motor was switched ‘ON’,

press the ‘CAL’ button and then ‘START’ button for calibration. Calibration is needed in order to

reformat the position to default positioning. This is to prevent inaccuracy in the input coordinate given

before operating the robot.

Figure 7.2: Sequence to operate machine

Page 37 of 60

Page 38: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Two modes are available for manual operation in the machine. While, the differences are as

stated in the table 1 below;

Joint Mode X-Y Mode

The movement is constrained to each joint in a

single operation

The movement is simultaneously for all joints in

single operation

The motion is not linear (circular or curve) The motion is always on a straight line.

Interference between two axis will cause damage

to the motorInterference are impossible

Table 7.1: Differences between Joint mode and X-Y mode

OPERATION OF FANUC ROBOT

OBJECTIVES

To familiarize different kind of teaching pendant due to different robot given a set manual for

the students to read, in industry this is also called On Job Training. (OJT).

To manually operate Fanuc robot for certain task in Joint or X-Y mode using teaching pendant

and to get familiarize with the robot components.

To move the robot end effectors/gripper from one end in manual mode. (The main reasons

here are to identify similarity/differences between DENSO and Fanuc)

PROCEDURE

1. The "Manual Operation" is used to move the robot gripper/welder and effectors from right to

left, and then left to right. First in Joint Axis, and then in Rectangular.

2. We searched from the "Fanuc Manual" in appendix C on how to identify the coordinate of the

current position that we are in. The position is then written down. The robot was moved again

in about L and inverted L shape and the coordinate of the new position is noted.

RESULTS

Coordinates Identified From Different Positions:-

Current Position L Shape Inverted L Shape

J1 = -57.322

J2 = -2.523

J3 = 93.791

J4 = 178.682

J5 = 1.360

J6 = -0.974

J1 = -55.239

J2 = -3.161

J3 = 176.3

J4 = 178.682

J5 = 1.36

J6 = -0.973

J1 = -55.239

J2 = -2.607

J3 = 0.202

J4 = 178.082

J5 = 1.36

J6 = -0.973

Page 38 of 60

Page 39: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

DISCUSSION & CONCLUSION

Figure 7.3 : Robot System

The handling robot (basic stand-alone system) usually consists of a robot control unit, robot

mechanical unit, and hand (tool).

Figure 7.4 : The Configuration of the Handling Robot System

Each part performs different functions as follows:-

Parts Functions

Remote Control Unit Controls the line. This unit starts the robot control unit by calling a program.

Robot Control UnitExecutes the called program.This unit moves the robot arm according to a move statement.This unit opens or closes the hand according to a hand statement.

Robot Mechanical Unit Moves the torch to a specified position according to a move statement.

Hand The hand picks up and places objects as commanded.

Page 39 of 60

Page 40: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Fanuc robot also needs calibration every time it starts operating. As we know, calibration is

done by machine by moving its entire axis in small amount to confirm their current positions. It is

performed right after turning ON the controller before using the robot. The Fanuc robot used is of

Articulated type of configuration coordinate frame because all the joints revolute without any prismatic

motion.

Figure 7.5 : Robot Workspaces

Upon operating the Fanuc Robot, the sequences of key operations are as follows:-

Operation Tasks

Power-on Procedure

1. Turn on the circuit breaker of the control unit.

2. Press the power-on button on the operator's panel. The lamp on the

power-on button goes on.

Selecting a Program

1. Create a program on the program directory screen. Select "SELECT"

from the screen menu, or press the select key to display the program

directory screen.

2. Select a target program, then press the ENTER key.

Setting the Jog Mode and Robot Speed

1. Select a jog mode (which is X-Y Mode). Press the COORD key to

switch the jog mode.

2. Set the robot speed. Set an appropriate cursor speed override sing the

override keys.

Jogging 1. Hold the teach pendant, and press the deadman's switch. Set the teach

pendant enable switch ON.

2. Start the robot by Jogging. Press a jog key while holding down the

SHIFT key. The robot stops jogging when either the SHIFT key or jog

Page 40 of 60

Page 41: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

key is released.

Teaching Move Statements

1. Teach a program on the program edit screen. Select EDIT from the

screen menu or press the EDIT key to display the program edit screen.

2. Jog the robot to a position to be recorded.

3. Press F1 "POINT" to display the standard move statement list in a

submenu.

4. Select a move statement with the arrow keys, then press the enter key.

In this experiment, we have also seen both Joint-axis and Rectangular mode for Fanuc. The

motions of both configurations are of similar to the Denso robot. The joint axis mode directs the robot

axes (joint axes) by manipulating corresponding keys on the teach pendant. While the rectangular mode

moves the robot rectilinearly along the axes of a Cartesian coordinate system.

Figure 5.4 : Different Jogging Modes for Fanuc Robot

Safety configurations are installed for the Fanuc robot during the manual mode session. This

is in order to prevent unwanted cases such as injury, etc from happening while operating the robot.

For installation and layout's safety precautions, signals such as warning lamps are used to

indicate that the robot is in operation. Safety fence installed with a safety door which will stop the robot

when it is opened by a worker coming in. Emergency button is also installed in places that allow the

operator to press it immediately.

While for the system design, a safety joint between the robot joints forming a tool so that if an

abnormal external force is applied to the robot, the safety joints breaks and the robot stops. A lock is

also installed so that only authorized workers can turn on the power.

The most important safety precautions to be observed are during the operation. All Fanuc

robot system users should be trained to acquire sufficient knowledge especially on the safety

precautions and robot functions. Before operating, the robot should be checked first whether or not it is

working properly and no dangerous conditions are present. One should also place a partner as a guard

to observe the situation and act quick in case on any accident occurs.

Page 41 of 60

Page 42: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

ROBOTICS EXPERIMENT 8:

-OFF-LINE AND ON-LINE PROGRAMMING OF

INDUSTRIAL ROBOT-

Page 42 of 60

Page 43: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

EXPERIMENT #8OFF-LINE AND ON-LINE PROGRAMMING OF INDUSTRIAL ROBOT.

OBJECTIVES

To operate the DENSO robot for certain task with on-line programming using teaching

pendant.

To edit a pre-created program in DENSO

To change the end effectors movement coordinates and operations speeds

Edit the written program with off-line programming using computer.

INTRODUCTION

Programming aims to express the operation procedure with language (command). A program

is defined as a chain of flow between beginning of operation and the end of operation. It’s possible to

create a maximum of 100 programs and name them PROGRAM 1 to 100. Program is created through

teaching pendent and it is saved in robot controller. There are two types of programming to operate

DENSO robot:

a) Online programming : Using teach pendent

b) Offline programming : Using WINCAPS software

PROCEDURE

As shown in the figure, an online programming is used to program the robot using the un-

operational and operational command to move the ball from location A to B:

FOR PICK AND PLACE ROBOT

Page 43 of 60

Page 44: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Figure 2.1: Location of the ball

FOR DRILLING ROBOT

Figure 2.2: Location of the Drill

Manual Mode1. The robot controller is turned ON. Manual mode is set. The teaching pendant is then used to

start the motors. The robot is calibrated. The speed is set to 30% and the working mode is

chosen (either Joint mode or X-Y mode).

2. Any subroutine in the controller memory location 1 and 2 is deleted if there is any.

Page 44 of 60

Page 45: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

3. Subroutine 1 is created for chuck close, Subroutine 2 for chuck open (refer to supplementary

manual), or the available subroutine is used if any.

4. Any program in the controller memory location 1 is deleted if there is any.

5. The main Program 1 is then created.

6. The un-operational and operational command is used to drive the desired motion (refer to

supplementary manual)

7. The mode is changed to TEACH CHECK mode and the movement of Program 1 is checked.

The speed is set to 20% during this check. All three types of check is then checked; those are

FWD CHECK, BACK CHECK and CYCLE CHECK.

Auto Mode

3. The Auto mode is set, the motor is started, the robot is calibrated and finally, the desired speed

is determined.

4. The program which has been created: Program 1 is Re-Called.

5. The program is run first in step mode, then in cycle mode. A note of the differences between

the two modes is made.

6. The robot's speed is increased to a safe speed and the pick is repeated and placed for 20 times.

The differences are noticed. The datum for the object to be pick and place are made sure to be

the same for this observation. The observation is written down in the data sheet.

SAMPLE PROGRAM

Page 45 of 60

Page 46: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

The robot repeatability problem can be solved while programming by putting small amount on

the internal speed and make the time for the robot motion become longer. The difference between the

step and the cycle mode are explained in the diagram below.

VS

Page 46 of 60

Page 47: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

EDITING THE PROGRAM

INTRODUCTION

In a manufacturing environment, the manufacturing processing time or cycle time is very important. As

such, the robots sequences operating in the production line can be easily modified to perform any new

assigned process or optimization. This could be done by editing the existing program instead of

rewriting the whole program.

It is only possible to edit commands in a program, which has been already created. A program can not

be edited while we are creating the program. After writing the “END” command and completing

creating mode, we can edit any command such as inserting, deleting, copying and changing commands.

Page 47 of 60

Page 48: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

Editing Operation:

1. Create a new program

2. Insert: Insert a command to create program [INSERT]

3. Deletion: Delete a command from created program [DEL]

4. Display: Display the command of created program [FWD, BACK]

Display the current coordinate of robot [DISP]

5. Copying: Copying the program to another program [COPY]

6. Changing: Changing the numerical value of a command [CHG]

Change the position of a motion command.

PROCEDURE

7. The created PROGRAM 1 (from Experiment 2) is selected by using manual mode.

8. The step is displayed so that the previous command can be edited using forward or backward

check. The given manual given manual is referred.

9. The point B is changed to point C. The subroutine will not be included because it is a drilling

robot. The needed position is set and the desired location is edited for drilling.

10. The speed is set to 1000rpm before drilling, and then reset to 500rpm.

11. After the command is changed, the movement is checked by using teach mode and auto mode.

12. The speed is set to 500rpm after moving to another location.

13. The entire program is copied into PROGRAM 2. The manual is referred on how this step

could be achieved.

14. The programs 1 and 2 are edited so that it could run in loops.

15. 20 loops of both program 1 and 2 are run. The difference in timing is noted. All results are

recorded in data sheet.

Page 48 of 60

Page 49: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

RESULTS

DISCUSSION & CONCLUSION

This experiment shows the significance of understanding on how to edit and change the

program sequence upon different cases according to variety of situations. This is important because

different type of product's design requires different type of motions for the machine to perform their

operation. At the same time, we do not want to waste more money and time to change the machines

when different parts are on the production line after a period of time. Therefore, the program should

always be flexible and easily edited in order to suite the variety of products and increase the efficiency

of the process executed by the program.

Below is the process flow of the edited program:-

Changing the speed in term of cycle time will allow the process to avoid unnecessary time

consumption and waste more money for the waste of time while we know that the quality is not

affected due to the increase of speed. But still, a few things need to be considered under these

circumstances. Because when the speed is higher, it might lead to unwanted movement by the robots

because of the extra momentum which is the result for the increase of speed. The positions of parts

might not be precise at the point indicated inside the programming. Besides, it might lead to hazardous

Page 49 of 60

ISP 100 : Set ISP to 100

APR E 50 : Move the chuck above the point A

MV E 50 : Move to point A

DEP P 50 : 50mm up

MV P : Move from above point A to above point C

APR E 50 : Move above the point C

MV E : Move to the point C

ISP 50 : Set ISP to 50

DEP E 50 : 50mm up

ISP 100 : Set ISP to 100

END : End the program

The changed location

Page 50: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

situations if it get in contact with any human because of the extra speed differing to low safety risk

when the speed is slower.

This process of editing is very crucial in the industry. For example, in the manufacturing

industry, while performing assembly of parts. Those different parts require different type of motions

path for them to be fastened or inserted to the right position. Therefore, at different times, the machine

needs to be informed by editing the program with a slight different path command in order to handle

the process effectively.

As a conclusion, the experiment went well and we have basically achieved the main

objectives. We have understood on how to do editing on the programming as required and how does

this application come in handy in the industry itself.

Page 50 of 60

Page 51: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

ROBOTICS EXPERIMENT 9:

-DEVELOPING AN AUTOMATION SYSTEM AND

TESTING THE SYSTEM-

Page 51 of 60

Page 52: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

EXPERIMENT #9DEVELOPING AN AUTOMATION SYSTEM AND TESTING THE SYSTEM

OBJECTIVES

To branch the program run order to optional step depending on the interfaced signal with the

robot controller input slow using branch instruction JUMP.

PROCEDURE

16. The robot has been fixed with a sensor on its gripper. The gripper will be detected by the

sensor whether it is in closed condition or in open condition. Each sensor is used to identify an

individual condition of closed and open.

17. The ports being used by the sensor are input port number 1 and input port number 2. Short

program identifies is used in order to detect whether port 1 or port 2 is for open or close

condition. The codes are written in the data sheet.

18. Upon identification of the ports for open or close. A program is created to move the parts as

follows using online programming to program the robot so that the ball is moved from

location A to B as shown in the figure below:

19. Include a JI / JZ command in the program to make sure that when a gripper is open, an open

gripper sensor status is checked before it is moved to the next sequence and when a gripper is

closed, the close gripper sensor status is checked before it is move to the next sequence.

20. Through the process that has been programmed earlier, typical cross check mechanism is

created. In next sequence, assuming that the gripper is closed, but the close gripper sensor did

not detect. The program is inserted/edited to include in such a way that the robot would in

sequence:

a) open the gripper

b) check the open gripper status

c) move up

d) move down

e) close the gripper

f) check the close gripper status

g) move the part to another position and so forth

21. The program should run in a loop when the sensor is not triggered. This could be observed

using a teach check mode and moving forward through the programs. Checking the looping

issues within the programs.

RESULTS

Program 110010 LABL 70020 APR E 50

Page 52 of 60

Page 53: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

0030 JI 1-100040 SUB 50050 LABL 80060 MV E JI=5.380070 SUB 100080 DEP E 500090 APR P0100 MV E JI=19.480110 SUB 50120 DEP E 500130 JMP 50140 END

DISCUSSION & CONCLUSION

This experiment shows the significance of JUMP command instruction while operating a

robot. For the robot system, the inputs are from the switches, proximity, pressure, photoelectric. While

the output accessories are the solenoids, relays and indicator lamps.

The proximity sensors are the input device used to ensure the availability of the pen. They are

able to detect the presence of nearby objects without any physical contact. A proximity sensor often

emits an electromagnetic or electrostatic field, or a beam of electromagnetic radiation (infrared, for

instance), and find for changes in the field or the return signal. The sensor or input should be identified

by the program because the robot will only operates when there are interactions between hardware and

software, space complexity in terms of the memory limitations of the robot's controller, and time

complexity in terms of the speed of the robot's action decisions. Without all these systems, the robot

cannot operate accurately.

It is observed that the robot in the lab has been equipped with optical proximity sensor. It can

detect the presence of nearby objects without any physical contact. This robot can detect the existence

of the part/product to-be-pick during pick and place programming when its receiver receives the signal

from the transmitter. The receiver and transmitter are usually placed at the hand of the robot arm or at

the end effectors. Input Voltage: 20 to 132 Vac.

The two sensors -one for open and one for close- is rather important to the system, because

when the close sensor detects an object; it will close within the certain time according to programming.

Then, the close sensor will detect the thing that it is holding until the thing being released. That means

close sensor cannot be used to detect other signal. Therefore, one more sensor should be put to detect

the place where to put the thing. When 2 sensors detect an object in the close range it will send the

signal to the close sensor to open the gripper. The process is vice-verse.

MANDATORY QUESTIONS

1. There are 3 sensor going to be use to construct the line:

a) Infrared Sensor – this sensor react to the intensity of light projected on them by

changing their electrical resistance. The port for this sensor is on the conveyor. When

the infrared sensor detects the pear on the conveyor, the robot will automatically

activated and pick up the pear which is place between the transmitter and receiver.

Page 53 of 60

Page 54: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

b) Tactile Sensor – This is a touch sensor device that sends a signal when physical

contact has been made. The sensor will detect the hardness of the pear. This sensor

will be put at the gripper of the robot, the gripper will give a small pressure during

picking process, if the pear does not follow the specification hardness which has been

set it will consider as old or spoil. Then the pear will be put into the reject basket

meanwhile if the pear meets the hardness specification it will go to further inspection.

c) Camera sensor – This sensor will detect the color of the pear. If the color is green it

will be put into the GREEN basket and if the pear is yellow in color, it will be put

into the YELLOW basket. The sensor also being put nearer to the gripper.

Page 54 of 60

Page 55: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

2.

3. Program

0010 LABL 10

Page 55 of 60

Start

WHITE basket

Reject

Cube on conveyor

Upper conveyor

The point of chucking the cube

Close chuck

Acceptable?Tactile sensorHardness test

Differentiate Color sensor

(Camera)

BLACK basket

End

N=24

Y=0

Y=0

N=24

N=24

Y=0

Page 56: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

0020 JZ 24-10 (wait for workpiece-infrared sensor)

0030 APR E50 (upper conveyor)

0040 MV E (moving to chucking point)

0050 SUB 1 (close chuck)

0060 JI 24-11 (Detect OK or NG signal-tactile sensor)

0070 MV E (moving to camera sensor )

0080 JZ 24-12 (detect color yellow or green-camera sensor)

0090 MV E (moving to GREEN basket)

0100 SUB 21 (Discharging)

0110 JMP 13

0120 LABL 11

0130 MV E (moving to REJECT basket)

0140 SUB 20 (Discharging)

0150 JMP 13

0160 LABL 12

0170 MV E (moving to YELLOW basket)

0180 SUB 20 (Discharging)

0190 LABL 13

0200 END

4. The important of input and output in the robotic system are:

a) Easy for human to communicate with the robot.

b) Input of the robot is sensor and switches. They will collect information about the internal

state of the robot or to communicate with outside environment.

c) Output of the robot is solenoids, relays and indicator lamps. They will do the process that

has been process in the robot system and follow the command from the input.

5. Types of signal from the PLC:

Input signals are typically generated by binary sensors, such as limit switches or photo sensors

that are interfaced with the process.

Output signals are generated by the controller to operate the process in response to the input

signals.

These output signals turn on and off switches, motors, valves, and other binary actuators

related to the process.

A list of binary sensors and actuators, along with the interpretation of their 0 and 1 values are

shown in Table 8.1.

Page 56 of 60

Page 57: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

The purpose of the controller is to coordinate the various actions of the physical system, such

as transferring parts into the workholder, feeding the machining workhead, and so on.

SensorOne/Zero

InterpretationProcess Control Actuator

One/Zero

Interpretation

Limit switch Contact/no contact Motor On/off

Photo-detector On/off Control relay Contact/no contact

Push-button

switchOn/off Light On/off

Timer On/off Valve Closed/open

Control relay Contact/no contact Clutch Engaged/not engaged

Circuit breaker Contact/no contact SolenoidEnergized/not

energized

Table 8.1: Binary Sensors and Actuators Used in Discrete Control

Discrete process control can be divided into two categories:

logic control, which is concerned with event-driven changes in the system; and

Sequencing, which is concerned with time-driven changes in the system?

Both are referred to as switching systems.

6. The robot knows when a jig is at its place, completed its task such as drilling, identifying bad units

or welding by using the sensor which is located at certain check point in the PLC line system.

There are a lot of sensor being used in PLC system such as light and infrared sensor, touch and

tactile sensor, proximity sensor, range finder, sniff sensor, vision system and many more.

Appendix A:

Page 57 of 60

Page 58: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

FINAL LABORATORY PROJECT REPORTReports Title Page

ROBOTICS CONTROL USING MC68230

GROUP NUMBER : 1A

GROUP MEMBERS: MATRIC NO:1. RAHISHAM ABD RAHMAN, 40804842. MUHAMMAD FAHMI ISMAIL 42712763. WAN MUHAMMAD IMRAN 41206784. FAZRI IDRIS 4090974

DATE OF SUBMISSIONTuesday, 7th May 2012

Page 58 of 60

Page 59: MCT4159 Lab 3 Manual

Appendix B: Data sheet report forms

DATA SHEET FOR EXPERIMENT#:

LIST THE CODES USED:

PART B

PART C

(Note Please add the 'PART' accordingly)

DEMO PART A COMPLETE DEMO PART B COMPLETE DEMO PART C COMPLETE……Data approved and verified by :

Signature and date :Appendix C: Certificate of Originality and Authenticity

Page 60: MCT4159 Lab 3 Manual

Mechatronics Engineering Lab III Manual Rev 1.0 04/08/11

This is to certify that we are responsible for the work submitted in this report, that the original work is our own except as specified in the references and acknowledgement, and that the original work contained herein have not been untaken or done by unspecified sources or person.

We hereby certify that this report has not been done by only one individual and all of us have contributed to the report. The length of contribution to the reports by each individual is noted within this certificate.

We also hereby certify that we have read and understand the content of the total report and no further improvement on the reports is needed from any of the individual’s contributor to the report.

We therefore, agreed unanimously that this report shall be submitted for marking and this final printed report have been verified by us.

Signature: ReadName: UnderstandMatric Number: AgreeContribution: Introduction and calculation

Signature: ReadName: UnderstandMatric Number: AgreeContribution: Graphs and procedures

Signature: ReadName: UnderstandMatric Number: AgreeContribution: Conclusion and discussion part A

Page 2 of 60