University of Jordan School of Engineering Mechatronics Engineering Department 2010 Mechatronics System Design Lab Experim ment no. 1 PRINCIPLES OF SWITCHING Copyrights' are held by : Eng. Ala' Bata & Eng.Rashaa Noufal
Experiments No. 1 PRINCIPLES OF SWITCHING INTRODUCTION A relay is an electrical device that allows the switching of a secondary circuit which can be completely separate from the first by controlling an electromagnetic coil. The passage of current in the electromagnetic coil produce an attractive effect on a metallic armature that moves and consequently moves contacts and changes them between open to closed and vice versa. The most commonly used transistor switch is the NPN. The secret to making a transistor switch work properly is to get the transistor in a saturation state (fully ON) i.e. the voltage V CE across the transistor is almost zero so the transistor cannot pass any more collector current Ic. Figure 3.1: Circuit symbol for a relay Figure 3.2: NPN Transistor OBJECTIVES: In the Experiment you will be expected to achieve the following objectives: Understand the basic principles of switching and switching devices. Introduced to electromechanical switching as well as solid state switching. Understand the advantages and disadvantages of each type. Gain an appreciation of the relative speed of different type of switches. Mechatronics System Design Lab 2
Experiments No. 1 PRINCIPLES OF SWITCHING EQUIPMENT 1. Digital Storage Oscilloscope OX8050 Metrix. 2. Functionn generator. 3. 24 V DC relay (Finder, Type 40.52). 4. Breadboard. 5. Digital multimeter. 6. Transistor BC141 NPN (BJT) 7. Resistors (various) 8. Manual switches. PRE-LAB ASSIGNMENTS: Before you come to the lab you MUST do the following: Read this lab sheet completely, and do all the problems indicated. Read the technical datasheet of the relay Finder type 40.52 and for BC141. Read the manual for the digital storage oscilloscopee OX8050. 1. Relay Switching Examine the relay provided. Q1. How many terminals does it have? Q2. Identify the function of each of the terminals? Figure 3.3: Finder relay 24 V DC. Q3. What is the meaning of N.O. ( normally open) and N.C. (normally closed)? Q4. Based on your examination, draw a schematic diagram of the relay coil and Contacts. Mechatronics System Design Lab 3
Experiments No. 1 PRINCIPLES OF SWITCHING Using the relay provided, connect it to the variable voltage power supply. Turn the power supply voltage down to minimum ensuring that the relay switches off (you can hear it click). Monitor the voltage of the power supply using a multimeter (i.e., independently of the indication on the power supply). 1. Turn the voltage up very slowly until you hear the relay turn on. Record the voltage of the power source. 2. Increase the voltage to 24 V and notice the state of the relay. 3. Turn the voltage down very slowly until you hear the relay switch off. Record the voltage at which the relay drops. 4. Reduce the voltage until it drops to zero volts and notice the state of the relay. 5. Plot these results on the curve below. Figure 3.4: Relationship between coil voltage and relay status. Q5. What is the shape of the resulting curve? Q6. What do we call this phenomenon? Q7. What do we call the voltage at which the relay switched on? Q8. What do we call the voltage at which the relay dropped off? Q9. Unplug the relay and measure the resistance of its coil using the multimeter. Record the value of resistance. Mechatronics System Design Lab 4
Experiments No. 1 PRINCIPLES OF SWITCHING Look at the side of the relay, and you will see the following: Q10. What does this mean? Explain. 2. Transistor Switching In this section we shall use the transistor as a switch instead. Q11. What do you think are the main advantages and disadvantages of using a transistor as a switch compared to a relay? Q12. You are required to use the transistor BC141 as a switch to switch load at 24 V DC from a 5 V input signal. To do this design the circuit needed, finding the value of the required based resistor (Rb). Assume that the transistor will be switching a resistive load of value 820 Ω. Q13. You will need to add a tie down resistor. What is a suitable value for the tie down resistor? Q14. What is the purpose of the tie down resistor? Mechatronics System Design Lab 5
Experiments No. 1 PRINCIPLES OF SWITCHING Q15. Draw the resulting transistor switch circuit below, showing all the values. Figure 3.5: Transistor switching a resistive load. 3. Transistor Switching Speed We now want to identify the switching speed of the transistor as a switch. Q16. Use a function generator to generate a square wave of equal duty cycle at a 5 V peak value. Enter the square wave signal to the input of the transistor switch. Observe the output of the circuit by connecting the oscilloscope (in normal mode not storage) to the collector of the BJT transistor. Keep on increasing the frequency of the function generator until the square wave signal at the output disappears. Record the frequency of the signal at this point. Mechatronics System Design Lab 6
Experiments No. 1 PRINCIPLES OF SWITCHING Q17. Why does the signal disappear the output? Q18. Add an LED in the output circuit of the transistor to show the status of the transistor. Make sure to calculate the suitable value of a series resistor with the LED to allow good lighting. You will need around 20 ma of current passing through the LED to give a clear visible light. 4. Relay switching speed We now want to establish the switching speed of the relay to compare it to the switching speed of the transistor. Remove the load RL and replace it with the relay and connect it as shown in the circuit below. A normally open contact from the relay is used to send a signal to the oscilloscope signifyingg the status of the relay. Figure 3..6: Transistor switching a resistive load. Mechatronics System Design Lab 7
Experiments No. 1 PRINCIPLES OF SWITCHING Q19. Startt from low frequency on the function generator (e.g., 5 Hz) and start increasing the frequency gradually until the signal to the scope disappears. Record the frequency at this happens. Q20. What is the reason that the transistor case? signal disappears in this case. How does this differ from the 5. Use of free-wheeling diode In this section we want to understandd the effectt of switching an inductive load on the switch itself. We are using the transistor as a switch and the relay as a load. Q21. Use a manual switch as shown below to switch the transistor and hence the relay. Whenever you switch the relay off, record the shape of the waveform on VCE on the digital storage scope. What do you notice? Plot the waveform that you see. Figure3.7: VCE signal when switching the relay. Mechatronics System Design Lab 8
Experiments No. 1 PRINCIPLES OF SWITCHING Q22. Now connect a diode (1N4148) across the relay terminal, making sure to connect it in the correct polarity. Repeat the previous step and notice the shape of the new waveform. Comment on the result. Mechatronics System Design Lab 9
University of Jordan Faculty of Engineering and Technology Mechatronics Engineering Department 2010 Mechatronics System Design Lab Experim ment no. 2 DC MOTOR SPEED CONTROL USING PWM Copyrights' are held by : Eng. Ala' Bata & Eng.Rashaa Noufal
Experiments No. 2 DC MOTOR SPEED CONTROL USING PWM DC MOTOR SPEED CONTROL USING PWM 1. Introduction Pulse-width modulation (PWM) or duty-cycle variation methods are commonly used in speed control of DC motors. The duty cycle is defined as the percentage of digital high to digital low plus digital high pulse-width during a PWM period. Fig 2. 1: PWM with different duty cycle PWM stands for the Pulse Width Modulation where the width of a digital waveform is varied to control the power delivered to a load. The underlying principle in the whole process is that the average power delivered is directly proportional to the modulation duty cycle. The term duty cycle describes the proportion of on time to the regular interval or period of time; a low duty cycle corresponds to low power, because the power is off for most of the time. Duty cycle is expressed in percent, 100% being fully on. The average DC voltage value for 0% duty cycle is zero; with 25% duty cycle the average value is 1.25V (25% of 5V). With 50% duty cycle the average value is 2.5V, and if the duty cycle is 75%, the average voltage is 3.75V and so on. The maximum duty cycle can be 100%, which is equivalent to a DC waveform. Thus by varying the pulsewidth, we can vary the average voltage across a DC motor and hence its speed. Mechatronics System Design Lab 2
Experiments No. 2 DC MOTOR SPEED CONTROL USING PWM The average voltage is given by the following equation: Ῡ = D. Ymax + ( 1- D ) Ymin But usually y minimum equals zero so the average voltage will be: Ῡ = D. Ymax A PIC16F877A has an in-built Capture/Com mpare/pwm module. In this experiment we are going to use the CCP as a PWM to control the speed of DC motor. The PWM output is here connected to power a DC motor through a driving circuit motor driving circuit is built in a breadboard, as shown below. The The circuit of a simple speed controller for a mini DC motor, recorders and toys, is shown in Fig 2. 2. such as that used in tape Fig2. 2: DC motor speed control using PWM method Mechatronics System Design Lab 3
Experiments No. 2 DC MOTOR SPEED CONTROL USING PWM 2. Objectives In this experiment, you will The student is expected to build a DC fan drive circuit. The student is expected to control the speed of a DC fan using PWM, in open-loop system. The student is expected to control the direction of a DC fan. The student is expected to control the speed of a DC fan using PWM, in closedloop mode, and to check that the speed stays constant in case of a disturbance such as the increase or decrease of the power supply voltage (e.g., 10 V or 14 V instead of the 12 V originally set). Learn how to use emitter-detector to measure the speed of the motor. 3. Pre lab Before you come to the lab you MUST do the following: 1. Read the PIC16F87X data sheet especially the PWM section, and the A/D Converter. 2. Referring to the lab introduction, design a driving circuit for the PC fan that uses PWM to control its speed, knowing that the fan specification are: (12V,0.16A), you can use any switching technique you want, but you must specify the type and value for each component. 3. Read the extra resources. 4. Apparatus 1. 2-wire PC brushless DC fan. 2. DC power supply 3. Multi-meter. 4. Oscilloscope. 5. Development board. (Bread board, Arduino and any other needed components) Mechatronics System Design Lab 4
Experiments No. 2 DC MOTOR SPEED CONTROL USING PWM 5. Procedure Part I Part one: Design drive circuit Using 2 wire PC brushless DC fan and any other needed components to build drive circuit to speed control in open loop mode. Part II Open Loop System a) Using An Arduino Uno write a program to generate a PWM with a frequency of 1 khz and a duty cycle of 50%, and watch your signal on the oscilloscope. b) Now connect your signal to the fan driver and watch what happens. c) Draw the block diagram for the open loop system. Part III control the speed of a DC fan In this part, we are going to use the potentiometer on the board connected with the supply voltage to produce a variable DC voltage, control the speed of DC fan to move in three different speeds. Part IV Controlling the direction of the DC fan a) Using 2 wire PC brushless DC fan, DC fan drive circuit for part one, and any other needed components to build drive circuit to control the direction in DC motor. b) Using An Arduino Uno write a program to control the direction of rotation (cw & ccw) using two push buttons. Mechatronics System Design Lab 5
University of Jordan Faculty of Engineering and Technology Mechatronics Engineering Department 2010 Mechatronics System Design Lab Experim ment no. 3 STEPPER MOTOR CONTROL Copyrights' are held by : Eng. Ala' Bata & Eng.Rashaa Noufal
Experiments No. 3 STEPPER MOTOR CONTROL STEPPER MOTOR CONTROL 1. Introduction The stepper motor is synchronous motor, driven by a DC power supply. This motor can rotate a specific number of degrees for every electricc pulse received by its control unit, so it can be used to control systems such as CNC machines where the position of the machine can be controlled precisely by the stepperr motor. Moreover, it does not need any form of feedback. There are four types of stepper motors: Unipolar, first two are discussed here in more detail: Bipolar, Bifilar, and multiphase. The 1- Unipolar stepper motor: It consists of four separate electromagnets. To run the motor current has to be passed in each coil in a certain sequence. The current is passed in each coil in only one direction and thus itt is called Unipolar. Fig 3. 1: Circuit symbol for unipolar stepperr motor There are 6 terminal wires available from the motor. Two of them are usually connected to the supply voltage (sometimes they are combinedd into just one wire and hence in that case only 5 terminal will be available rather than 6). The other 4 wires are the terminal of the four electromagn nets. 2- Bipolar stepper motor: In a bipolar motor the current can be passed in each coil in two directions and hencee the name. The bipolar motor is more powerful than the unipolar because it is possible to reversee the magnetization inn each of the electromagnets. We can use an H-bridge (e.g., constructed of 4 transistors) to enable the current to flow in both directions in each coil. Mechatronics System Design Lab 2
Experiments No. 3 STEPPER MOTOR CONTROL Fig3. 2: Circuit symbol for bipolar stepper motor 2. Objectives In this experiment, The studentt is expected to achieve the following objectives: Knowing the different kind of stepper motors. Identify the stepper motor and test it. Controlling the direction, speed, and the position of stepper motor. 3. Pre lab Before you come to the lab you MUST do the following: 1. Understand the working principle of the stepper motor. 2. Read the ULN2003 data sheets. 4. Apparatus 1. 2. Stepper motor kit. Multi-meter. 4. DC power supply. Fig3. 3: Stepper motor kit Mechatronics System Design Lab 3
Experiments No. 3 STEPPER MOTOR CONTROL 5. Procedure Part I : Identification of the stepper motor: 1) Try to rotate the motor s shaft by your hand. What do you notice? What is the difference between it and other motors? 2) Depending on the wires number, what s the type of this motor? 3) Using the multi-meter measure the resistance between the wires and identify the coil wires from the supply wires, and sketch the internal diagram forr this stepper motor. Part II: Driving the stepper motor: Using Arduino Uno, ULN2003, and any other components needed build a stepper motor driving circuit, and write an assembly code to drive the stepper motor with fixed speed and fixed direction. Fig3. 3: Driving the stepper motor Mechatronics System Design Lab 4
Experiments No. 3 STEPPER MOTOR CONTROL Part III : Controlling the direction of the stepper motor: Edit the program you have written in part II to change the direction of rotation (cw & ccw) using one or two push buttons. Part IV : Controlling the speed & direction of the stepper motor: Edit the program you have written in part III to control the speed and direction, it s required to have minimum three speeds (use push buttons to change the speed). Part V: Controlling the position of the stepper motor: 1) Find the resolution of the stepper motor (deg/step) by counting the steps needed to rotate the motor 360 degrees. [Hint: connect LED to one of the phases and count the pulses]. 2) Write an assembly code to rotate the motor to reach 36 degrees then 261 degrees. (You can use push buttons). Mechatronics System Design Lab 5
University of Jordan Faculty of Engineering and Technology Mechatronics Engineering Department 2010 Mechatronics System Design Lab Experim ment no. 4 SIMPLE CALCULATOR Copyrights' are held by : Eng.Rasha Noufal
Experiments No. 4 SIMPLE CALCULATOR SIMPLE CALCULATOR 1. Introduction Arduino based calculator with LCD, The mini calculator is developed using Arduino microcontroller with LCD display. This project will help the students to learn the designing of microcontroller based project, interfacing of keypad with microcontroller, interfacing the LCD with microcontrollers. handling the strings and their conversions to numbers will be discussed in this project. 2. Objectives In this experiment, The student is expected to achieve the following objectives: Identify the LCD. Identify the Keypad. Build simple calculator. 3. Pre lab Before you come to the lab you MUST do the following: 1. Understand the working principle of the LCD. 2. Understand the working principle of the Keypad. 3. Read the Arduino data sheets. 4. Apparatus 1. An Arduino Uno. 2. Breadboard. 3. Jumper Cables 4. A Keypad 5. A PC which has Arduino App Installed 6. A Potentiometer 7. A Resistor. Mechatronics System Design Lab 2
Experiments No. 4 SIMPLE CALCULATOR 5. Procedure Part I : Calculator circuit Using Arduino Uno, LCD, Keypad, and any other components needed build a Calculator circuit. Part II : Build a Simple one digit calculator. Build a simple calculator made using Arduino uno,3x4 keypad and 16x2 lcd. Calculator can perform four functions addition, subtraction, multiplication and division. Mechatronics System Design Lab 3
University of Jordan Faculty of Engineering and Technology Mechatronics Engineering Department 2010 Mechatronics System Design Lab Experim ment no. 5 SEQUENTIAL CONTR ROL OF A 3 DOUBLE ACTING CYLINDER Copyrights' are held by : Eng.Rasha Noufal
Experiments No. 5 SEQUENTIAL CONTROL OF A 3 DOUBLE ACTING CYLINDER SEQUENTIAL CONTROL OF A 3 DOUBLE ACTING CYLINDER 1. Introduction This exercise demonstrates a displacement dependent sequential control with 3 double acting cylinder, signal overlapping and the use of step sequence solution. Signalers are electrical cylinder switches with proximity switching. Electrically controlled 5/2 directional control impulse valves are used as actuators. 2. Objectives In this experiment, The student is expected to achieve the following objectives: Identify the Cylinder. Identify the valve. Identify the relay. Build simple circuit to sequential control of a 3 double acting cylinders. 3. Apparatus 1. An Arduino Uno. 2. Breadboard. 3. Jumper Cables 4. A Valve 5. 3 Cylinders 6. Relay Mechatronics System Design Lab 2
Experiments No. 5 SEQUENTIAL CONTROL OF A 3 DOUBLE ACTING CYLINDER 5. Procedure Part I : Sequential control of a three double acting cylinder 1 Build your design Electro Pneumatic circuit diagram to complete the task description in function diagram in Figure 5.1 ( A, B and C are double acting cylinders ) Figure 5.1: Function diagram (stroke-time diagram) Part II : Sequential control of a Three double acting cylinder 2. Build your design Electro Pneumatic circuit diagram to complete the task description in function diagram in Figure 5.2 ( A, B and C are double acting cylinders ) Figure 5.2: Function diagram (stroke-time diagram) Mechatronics System Design Lab 3