LAB Manuals FINAL

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 35

LAB MANUALS OF MECHATRONICS SYSTEM DESIGN

Group Members:
ROHAN ALI KHAN (180867)

ZAIN UL ABIDEEN (180915)

HASSAN BAIG (180930)

BE MECHATRONICS (Session 2018-2022)

SUBMITTED TO
SYED ALI USAMA

DEPARTMENT OF MECHATRONICS BIOMEDICAL

ENGINEERING
LAB# 01
Introduction to Mechatronics System
Objectives:

1. To understand the design process and its various parts.


2. To understand and implement various steps of the design process.
3. To understand the difference between mechanical, electrical and Mechatronics
design.
4. To be able to design a Mechatronics system given a problem statement.

Pre-Lab

To read the material provided and familiarize with the terminology used in the
document for better understanding of the task during the lab.

Modules of Mechatronics System

o Sensing
o Control

o Action

Engineering Design

Engineering is the discipline, art, skill and profession of acquiring and applying
scientific, mathematical, economic, social, and practical knowledge, in order to design
and build structures, machines, devices, systems, materials and processes.
Engineering can be defined as following a methodical process using available
resources and experien ce to solve complex problem.

Figure.0.1
Case Study:

Identify the Problem

To design a coin separating machine which separate different coins count the number
of coins calculates its total amount and display it on a screen

Identify the Criteria and Constraint

Following are the criteria and the constraint to build the model.

1. Time: 6 weeks
2. Currency
3. Sizes
4. Weight of Coins
5. Material of coin

Brainstorm possible solutions

Possible solutions are:

1. Inclined Cone Coin Counter


2. Blower Based Coin Counter
3. Water jet Coin Counter
4. Centrifugal Force Based Coin Counter

Generate Ideas

1. Weight Based Coin Sorter in weight based coin sorter, load cells are used the
coins are aligned or sorted by the weight of the coin and are placed in the
irrespective coin’s portions.
2. Size based Coin Sorter in size based coin sorter, by knowing the various sizes
of the coins, the coins are placed in their respective coin’s portions.

Explore Possibilities

All of the above mentioned ideas are the possible ways to implement and solve the
given problem but on the basis of given criteria and constraints the idea choose must
be confined to the constraints and criteria’s. On the basis of given criteria’s and
constraints the best idea is to implement the Inclined Slotted Sheet Coin Sorter.
Select an approach

1. Coin Slotted Sheet (The Sorting Portion Take a wooden or any slippery material
sheet and make slots (holes) of various coins having different sizes in order of
increasing sizes. Each hole will be connected with the respective coin chambers.
When a coin is slide on the sheet, then depending upon its size, it will go in the hole
of its respective size and will be drop in the respective coin chamber. This is the
easiest way to place or sort the coins in the chambers.
2. The Monitoring System: The number of coins can be monitored by using 7
segments display modules on the respective chamber. Once we calculate the
number of coins in each chamber, it can be display using a Microcontroller.
Selecting approach of one disc and a straight belt having 3 different sized holes
according to the sizes of coins I ‘ll design my system.

Conclusion:

In this lab we learnt about:

1. The core principles of designing a Mechatronics System.


2. That how to solve a complex engineering problem by exploring different
possibilities and generating ideas.
LAB# 02
To understand the construction and operation of a
DC motor using MATLAB

Objectives

• To get understanding of Simulink.


• To get introduction to mathematical modeling and to model a DC motor
in Simulink.

Introduction:

Mathematical Model

A mathematical model is a description of a system using mathematical concepts and


language. The process of developing a mathematical model is termed mathematical
modeling. Mathematical models are used in the natural sciences (such as physics,
biology, earth science, chemistry) and engineering disciplines (such as computer
science, electrical engineering), as well as in the social sciences (such as economics,
psychology, sociology, political science).

Building the model with Simulink

To build the simulation model, open Simulink and open a new model window. Then
follow the steps listed below:

1. Insert an Integrator block from the Simulink/Continuous library and draw


lines to and from its input and output terminals.
2. Insert another Integrator block above the previous one and draw lines to and
from its input and output terminals.
3. Insert two Gain blocks from the Simulink/Math Operations library, one attached
to each of the integrators.
4. Insert two Add blocks from the Simulink/Math Operations library, one attached
by a line to each of the Gain blocks. ‘

Figur2 simulink

5. Insert a Gain block below the “Inertia” block.


6. Tap a line oR the rotational Integrator’s output and connect it to the input of the
“Damping” block.
7. Draw a line from the”Damping” block output to the negative input of the
rotational Add block.
8. Insert a Gain block attached to the positive input of the rotational Add block
with a line. Continue drawing the line leading from the current Integrator and
connect it to the ”Kt” block.
9. Insert a Gain block above the “Inductance” block. Tap a line oR the current
Integrator’s output and connect it to the input of the “Resistance” block. Draw a
line from the “Resistance” block’s output to the upper negative input of the
current equation Add block.

Figure3 simulink block


10. Insert a Gain block attached to the other negative input of the current Add block
with a line.

Figure 4 simulink model

11. Add In1 and Out1 blocks from the Simulink/Ports Subsystems library and
respectively label them”Voltage” and ”Speed”.
12. In order to save all of these components as a single subsystem block, first
select all of the blocks, then select Create Subsystem from Selection.
Figure 5 subsystem

Building the model with Simscape:

1. Open a new Simulink model and insert the following blocks. Resistor, Inductor,
Rotational Damper, Inertia, Rotational Damper, Electromechanical converter and four
Connection Port.

2. Select the components and click CTR+R to rotate components and place them like this.

Figure 6 model of simulink

Parameters:
3. Electromechanical Converter blocks and enter the following parameters and
associated units: Resistance = R [Ohm] Inductance = L [H] Inertia = J [kg*m2] Constant
of Proportionality = K [V/(rad/s)] Damping coefficient = b [N*m/(rad/s)]

4. Enter the following commands at the MATLAB prompt. J = 0.01; b = 0.1; K = 0.01; R
= 1; L = 0.5;

5. Select all of the blocks and right click and select Create Subsystem from selection.

6. Now place the following components on the new window. Current sensor block,
Controlled Voltage Source, Three PS-Simulink blocks, one Simulink PS block, one
solver configuration, Electrical Reference, Ideal Rotational Motion sensor, Mechanical
Rotational Reference block, three Out1 blocks and one In1 block.

7. Now join the all these blocks as shown.

Figure 7 simulink-connection

8. Now select all these blocks and press CTRL + G to create a subsystem.

Conclusion:

In this lab we learnt

• How to make a Simulink model.


• How to make Simscape model of a dc motor.
• How to integrate Simscape and Simulink models.
• How to apply PID control and observe the results.
LAB# 03
To understand operation and construction of DC
motor drive circuit using BJTs
Objectives:

• In this lab we implement diRerent H-Bridge on proteus using Bjts, Mosfet and
Relay.
• Develop an under standing of Motor driver
• Learn about Bjts and Mosfet

Equipment:

• Arduino uno (328p)


• AVR/Atmel Studio
• Proteus

Introduction:

BJTs:

BJT is a semiconductor device that can both conduct and insulate. A transistor can act as
a switch and an amplifier. It converts audio waves into electronic waves and resistor,
controlling electronic current. Transistors have very long life, smaller in size, can
operate on lower voltage supplies for greater safety and required no filament current.
The first transistor was fabricated with germanium. A transistor performs the same
function as a vacuum tube triode, but using semiconductor junctions instead of heated
electrodes in a vacuum chamber. It is the fundamental building block of modern
electronic devices and found everywhere in modern electronic systems.

Figure 8 Bipolar Junction Transistor


Opto-isolator H bridge:

An Opto-isolator (also called an optocoupler, photocoupler, or optical isolator) is an


electronic component that transfers electrical signals between two isolated circuits by
using light. Opto-isolators prevent high voltages from affecting the system receiving the
signal. Opto-isolators can also be used to switch MOSFET ON and OFF. In this case
two Opto-isolators are used to change the direction of the motor.

Figure 9 opto-coupler
Conclusion:
In this lab we have learnt:

1. The working of Transistor, Relay , Mosfet and opto-isolator and how to connect them
to work as an H bridge to drive a motor.
2. What function they can perform with connecting motors.
3. To control motor using Transistor, Relay and Mosfet.

Question And Answers:

 Circuit works according to given table.


 2V biasing voltage used.
 We consider the components used and map out a range of possible currents and
voltages in which the devices can function properly and use that data to find the load
capacity of the H-Bridge.
 PWM frequency determines the duty cycle and the time for which voltage is given to the
terminal. This controls the speed of the motor.
 PWM variation varies the speed of the motor.
 Yes optoisolator output depends on the given PWM input.
 The circuit limits the output speed.
 This can be overcome by using better motor and components.
LAB# 04
To understand operation and construction of DC
motor drive circuit using Mosfets

Objectives:

 The objective of this lab is to familiarize the students MOSFETs’ operation and

 Build a DC motor drive circuit using MOSFET as switchin devices.

Introduction:

It uses electromagnetism from small voltage to provide higher voltages. It has two basic
contacts i.e. NO (Normally Open) and NC (Normally Closed). When input voltage is
applied across its coil, NC changes to NO and NO changes to NC. When input voltage is
supplied, we say that the relay is energized. It has several features e.g. it can be used for
switching smaller voltage to higher. But it can not be used in power consuming devices.
It has a wide range of applications.

It can be used in home appliances, electronic circuits where there is a need of protection,
robotics for controlling its motors fro the proper motion and many more. As the schematic
shows, terminal1 of motor is connected to Relay1 while terminal2 is connected to Relay2.
Normally the relays are connected so that Relay1 is connected to Power while Relay2 is
connected to the drain of the MOSFET. So, in saturation region of MOSFET Relay2 will
be grounded. Therefore, terminal 1 will be at higher potential than terminal 2 and the
motor will rotate in one direction. But if both relays are activated Relay2 will be connected
to Power while Relay1 will be grounded inverting the potential across the motor so the
motor will start rotating in the other direction.

Brakes can be applied to a DC Motor by shorting both of its terminals. Or brakes are
applied when no voltage is being supplied to the motor.
Figure 10 relay operation

MOSFET H Bridge:

MOSFET is a Voltage controlled device which has a Drain Source and Gate. When
voltage is applied to the gate the MOSFET terminates voltage flow. Similar to
transistor four MOSFETS are connected in an H Bridge to control the direction of the
motor. The four MOSFET are turned ON to determine the direction of the motor.

Figure10.1 proteus design


Figure 12 proteus

Conclusion:

In this lab we concluded that a relay can be used as a switch to control the motion of the
motor. Basically from this lab the experienced of operating the relay with motor was
gained and how to reverse the motion of the motor using relay.
LAB# 05
To understand the procedure of interfacing
MATLAB/Simulink with Arduino using
MATLAB/Simulink

Objectives:

• To understand the procedure of interfacing MATLAB/Simulink with Arduino


using MATLAB/Simulink Hardware support packages and to control the
direction and speed of DC servo motor using Simulink model.

Introduction

With MATLAB® Support Package for Arduino® Hardware, you can use MATLAB to
interactively communicate with an Arduino board, as MATLAB is a high level
interpreted language, you can see results from I/O instructions immediately, without
compiling. MATLAB includes thousands of built-in math, engineering, and plotting
functions that you can use to quickly analyze and visualize data collected from your
Arduino. The Arduino Hardware Package enable us to perform:

1. Acquire analog and digital sensor data from your Arduino board.
2. Control other devices with digital and PWM outputs.
3. Drive DC, servo, and stepper motors (also supports Adafruit Motor Shield).
4. Communicate with an Arduino board over a USB cable or wirelessly over WiFi.
5. Build custom add-ons to interface with additional hardware and software libraries.

Methodology:

Matlab interfacing with arduino includes the following steps:

 First, start MATLAB and click the Add-Ons drop down menu. In the drop-down menu
click Get Hardware Support Packages. It will start the package installer window.

 Select Install from internet and then Next.


Figure 13 installation part

 In the next window you will see all the available packages for MATLAB and Simulink.
Select the Arduino package, then check all the packages displayed and click Next to
continue installation. Note that this picture is showing that I am reinstalling the
Arduino packages because I had previously installed them.

 Next, the installer will ask you to log in to your MathWorks account. If you don’t have an
account, you can create one during installation. Accept the license agreement on the next
screen and continue to download the packages. Now you have to wait for MATLAB to
download and install all the required packages.

Interface Check:

Figure 14 interfacing matlab


Conclusion:

At the end of this lab we were able to connect the MATLAB environment with arduino using the
ADD-IN explorer and downloading the necessary files, after which MATLAB can be used to
code and run any and all arduino devices physically.
Lab#6
Vrep introduction and task performance

Objectives:

 The objective of this lab is to familiarize the students with V-rep simulation environment.

 Simulating a simple robot in V-rep and understanding its code.

Introduction:
V-REP - the Virtual Robot Experimentation Platform - is a 3D robot simulation software, with
integrated development environment, that allows you to model, edit, program and simulate any robot
or robotic system (e.g. sensors, mechanisms, etc.).

Figu50.1 vrep introductory environment

It offers a multitude of functionality that can be easily integrated and combined through an
exhaustive API and script functionality. V-REP supports 2 different physics engines (Bullet and
ODE), handling of the inverse/forward kinematics of any type of mechanism, proximity sensor
simulation, camera sensor simulation with many built-in image processing filters, path planning,
minimum mesh-mesh distance calculation, surface cutting simulation, graphing, etc.

V-REP is used for remote monitoring, hardware control, fast prototyping and verification, fast
algorithm development / parameter adjustment, safety double-checking, robotics-related education
or factory automation simulations.
Installation Procedure:

 Go to coppelia Sim website and select the EDU version.


 Download the free version of the software and install in C:\ directory.
 Make sure that “Pro” version is not downloaded as it contains many forbidden functionalities and is
for commercial purposes.
 Create a desktop shortcut by checking box during installation and then run the software.
 You will be taken to the working environment.

Screenshots:

Figure16 task 1

Figure 17 task 2
Conclusion:

At the end of this lab we were able to simulate different mobile and non-mobile robots in the
Copellia sim V-rep environment. We became familiar with its tools and uses that will help us
better simulate robots in the future.
LAB# 07
Introduction to the sensors
Objectives:
1. To understand different types of sensors and their specifications.

2. To select sensor according to our end semester project

3. To model and simulate sensor of integrated system on Simulink

Component Used:
➢ MATLAB Simulink

Introduction:
Sensors are devices that perform input function in a system as they 'sense' the changes
in a quantity. The best example of a sensor is mercury thermometer. A sensor converts
a physical event into an electrical signal, We live in a World of Sensors. You can find
different types of Sensors in our homes, offices, cars etc. working to make our lives
easier by turning on the lights by detecting our presence, adjusting the room
temperature, detect smoke or fire, make us delicious coffee, open garage doors as soon
as our car is near the door and many other tasks.

Figure 18 types of sensors


Sensors Selection:

Our end semester project is Laser Engraver drawing purposes. A low power laser is
going to be mounted on an XY gantry system. The system will include two X axis guide
rails and one Y axis’s. The laser will be mounted on Y axis. Three stepper motors are
going to be used. Two to move across the X axis and one across the y axis using timing
belts

The Only Sensor required for the project were boundary switches to enable the
microcontroller to detect when the plotter has reached the boundaries. So we’re using
simple push switches as boundary sensors

Push/ Limit Switches:

Limit switch is a switch operated by the motion of a machine part or presence of an


object .They are used for controlling machinery as part of a control system, as a
safety interlocks, or to count objects passing a point. [1] A limit switch is an
electromechanical device that consists of an actuator mechanically linked to a set of
contacts. When an object meets the actuator, the device operates the contacts to
make or break an electrical connection.

They can determine the presence or absence, passing, positioning, and end of travel of
an object. They were first used to define the limit of travel of an object; hence the name
"Limit Switch

Figure 19 push switxh


Simulink Model:

Figure 20 simulink model

Conclusion:

In this lab, we learnt

• About sensors, its uses and types.


• After going through some research we selected sensors which were most suitable for
our project and we perform simulation of limit sensor on MATLAB SIMULINK.
LAB# 08
Introduction to signal processing.

Objective:

• To get familiar with signal processing. And its benefits.

Components:

• Laptop
• MATLAB software with additional Hardware Packages

Pre Lab:

In this lab, I learn about signal processing. As we know singles can be noisy,
too small, non-linear, etc. So, we use this technique to make our single more accurate
for our robot sensor to read and make better decisions. Different steps are use in this
process, such as:
• Protection: The range of the output signals from the transducer may be so high
that it may damage the next unit or element which needs to be protected. So, we
can use a step-down transformer.
• Eliminating the interference: Some disturbances may be associated with the
output signals, which needed to be eliminated by using filters.
• Manipulation of signals: The output signals maybe nonlinear in nature, these need
to be linearized and vice-versa.

DESCRIPTION:

Ultrasonic sensors are used primarily as proximity sensors. They can be found in automobile self-
parking technology and anti-collision safety systems. Ultrasonic sensors are also used in robotic
obstacle detection systems, as well as manufacturing technology. In comparison to infrared (IR)
sensors in proximity sensing applications, ultrasonic sensors are not as susceptible to interference of
smoke, gas, and other airborne particles (though the physical components are still affected by variables
such as heat).

Ultrasonic sensors are also used as level sensors to detect, monitor, and regulate liquid levels in closed
containers (such as vats in chemical factories). Most notably, ultrasonic technology has enabled the
medical industry to produce images of internal organs, identify tumors, and ensure the health of babies
in the womb.
Figure 21 ultrasonic Sensor

Pin Pin Description


Number Name

1 Vcc The Vcc pin powers the sensor, typically with +5V

2 Trigger Trigger pin is an Input pin. This pin has to be kept high for 10us to initialize measurement by sending
US wave.

3 Echo Echo pin is an Output pin. This pin goes high for a period of time which will be equal to the time
taken for the US wave to return back to the sensor.

4 Ground This pin is connected to the Ground of the system.

Sensor Features:

 Operating voltage: +5V


 Theoretical Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm
 Accuracy: 3mm
 Measuring angle covered: <15°
 Operating Current: <15mA
 Operating Frequency: 40Hz
LAB#09
SOLIDWORKS PROJECT MODEL

Objectives:

 The objective of this lab is to design and implement the MSD lab project on solidworks.

 Perform material analysis using solidworks tools,

Introduction:
SOLIDWORKS is used to develop mechatronics systems from beginning to end. At the initial stage,
the software is used for planning, visual ideation, modeling, feasibility assessment, prototyping, and
project management. The software is then used for design and building of mechanical, electrical, and
software elements. Finally, the software can be used for management, including device management,
analytics, data automation, and cloud services.

A sample of the products that are a part of SOLIDWORKS, as described on their website, include:

 Circuit Works: an electronic CAD/ECAD translator that enables engineers to create accurate 3D
models of circuit boards.
 CAM: an add-on to all versions of SOLIDWORKS CAD that lets you prepare your designs for
manufacturability earlier in the development cycle.
 Electrical 3D: enables you to place electrical components and use SOLIDWORKS routing
technology to automatically interconnect electrical design elements within a 3D model. 2D
schematics and 3D models are synchronized bi-directionally in real time so any changes are
automatically updated.
 Simulation: uses Finite Element Analysis (FEA) to predict a product’s real-world physical
behavior by virtually testing CAD models.
 Visualize: leverage your 3D CAD data to create photo-quality content in the fastest and easiest
way you can–from images to animations, interactive web content, and immersive Virtual Reality.
3D CAD Model of our project:
We designed our model on Solid works 2018. The following figures describe the

proposed CAD model of stairlift case

Figure 22 front viwe


Figure 23 Side Front View CAD model

Figure 24 Folded CAD model


Figure25 Miscellaneous view

Conclusion:

At the end of this lab we were able to implement the working model of our project
inside solidworks and we did the simulation study to calculate the stress/strain trends
all along the mechanical model.
LAB#10
V-REP PROJECT MODEL

Objectives:

 The objective of this lab is to design and implement the MSD lab project on V-rep.

 Animate the projects using given constraints and properties.

Introduction:
V-REP - the Virtual Robot Experimentation Platform - is a 3D robot simulation software,
with integrated development environment, that allows you to model, edit, program and
simulate any robot or robotic system (e.g. sensors, mechanisms, etc.). The simulation
features in this software help us better understand the effects of physical forces on our
system and how the system would react in a real environment.

Methodology:

• Open the project Assembly in Solidworks.

• Install the URDF Add-In.

• Export project as .URDF.

• For this you will need to define the joints in solidworks window.

• Open V-rep and from “New” open the .URDF file of the project assembly.

• For another method open individual parts of the assembly.

• Save each part in .stl file format

• Import the parts in V-rep

• Assemble project in V-rep using its own joint definitions.

• Simulate by applying necessary force parameters and joint rotations etc.


Project simulation:

Figure 26 vrep-design

Conclusion:

At the end of this lab we were able to implement the solidworks working model of our
project inside v-rep and we applied the calculated torques on both motors to produce the
output motion that resulted in expected orientations about both axes.
LAB# 011
To derive the mathematical model of your
semester project and modeling it in MATLAB using
SIMULINK/SIMSCAPE.

Objectives:

• Mathematical modeling of semester project.

• Implementation of the model in Simulink/Simscape

Introduction:

Simscape™ enables you to rapidly create models of physical systems within the
Simulink® environment. You model systems such as electric motors, bridge rectifiers,
hydraulic actuators, and refrigeration systems by assembling fundamental components
into a schematic. The models you create can be placed in subsystems so that you can
reuse them in other models.

The models you build are based on physical connections. To model a mass spring
damper, you simply connect mass, spring, and damper components, and Simscape
determines the system level equations for you. This is much easier than deriving the
equations and implementing them in code or by connecting input-output blocks

Figure27 simscape components selection

Methodology:

• Open the project Assembly in Solidworks.


• Open MATLAB.
• Download the simscape Add-in from the official mathworks website.
• Also download the install_addon.m file
• In MATLAB command window follow the given instructions to properly install the
required add-on.
• After Add-on has been installed restart both softwares.
• In solidworks you can now export the assembly by enabling Simulink Add-on.
• The MATLAB window will automatically open and you will see the block diagram of
your mechanical system

Project Diagram:

The below shown window shows the animation window that open up in MATLAB
when you have imported the model. You can play the animation and sets time limits
accordingly, changes made in the block diagram can result in changes in the animation.

Figure 28 animation in matlab

Project Results:

The below shown window shows the obtained scope graphs from the MATLAB Simulink
model. Displacement and acceleration/velocity is given w.r.t time
Figure 0.1xcope output

Conclusion:

At the end of this lab we were able to implement the solidworks working model of our
project inside SIMSCAPE and the obtained model gave us keen insights on the
mathematical values and the input output relation of our project.

You might also like