You are on page 1of 8

Electrical Engineering Technician AMAT/ SETAS

Course: EET-126
INSTRUMENTATION 1
Name: Nikita Clarke___________STD 300900958_______
Date: 7th February, 2022_________________

Lab 2: Open and Closed Loop Systems


Overview
In this lab, we will be building both an open loop and closed loop system using the Arduino. We
will be trying to control the speed of a motor.

Components Required
(1) x Elegoo Uno R3

(1) x L239D Driver chip

(1) x DC Motor

(1) x Elegoo power supply

(10) x M-M wires (male to male jumper wires)

(3) x M-F wires (male to female jumper wires)

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
Procedure – Part 1
The circuit diagram is shown below:

A key aspect of controlling the speed of a motor is to understand you must not connect a motor
directly to an Arduino. You need to either build a suitable transistor and diode circuit, or you
need to utilize a motor controller, such as the L293D motor control chip that comes with your.

The purpose of the L293D is to provide enough current to the motor. If you connect the motor
directly to the Arduino, the power supplies will not be able to supply enough current to the

Watch the video on the setup of this circuit and then answer the following questions:
Question 1.1 – Is the system we setup open loop or close loop? Justify your answer
The system was an open loop DC motor control. Open loop control systems are systems where
the control action is independent of the output. In this case, the control action was in the Arduino
code and regardless of the output, the code would remain the same unless manually changed.
Question 1.2 – Why does the L293D have two ground pins?
Two ground pins provide a lower impedance for the ground current to run. It also provides a
greater conduction path for heat to be drawn away from the circuit.
Question 1.3 – How do we set the setpoint in this system?

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
We set it by wiring it to operate at 5V (high) and low by ground. It is also set by controlling it
through the code written in Arduino of input values and expected outcome.

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
Procedure – Part 2

In this part, we explore how to add a tilt cutoff to our DC motor project. In many cases, you may
want to automatically turn your motors off in the case where your project or robot tips over.

Step 2.1 Setup your tilt sensor according to the video posted

Question 2.1 – What kind of system has been built in this section (open loop or closed loop)?

The setup in this circuit was a closed loop system using on and off control. The tilt sensor acts as a switch
which means its either open or closed depending on which direction it is tilted.

Question 2.2 – What kind of controller mode are we using in this section?

A motor controller, such as the L293D motor control chip is used and its operated as a feedback
controller.

Question 2.3 – Assume that the motor is switched on and off every 2 seconds. What is the average
speed of the motor?

The average is 2.5 V. This is because we have a value of 5V and 0V and we are moving every 2 seconds.
The average would therefore be the value between 0 and 5V.

Question 2.4 – Do you think that control mode is appropriate for this scenario if we are looking to use
the motor to control movement of equipment in a plant? Why or why not?

This control mode would be appropriate because you can program a code that instructs the equipment
to operate a certain way when in a certain position or direction. This is due to closed loop systems having
an automatic response. Manufacturing applications such as an equipment in a plant, require continuous

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
monitoring and self-correcting action. The equipment plant would know where to go, how far to go and
what intensity to operate at made.

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
Procedure – Part 3
Part 1 and 2 showed some preliminary concepts in controlling a DC motor using an arduino and
the L293D motor controller. In this part, we show how to control the speed and direction of a
simple DC motor using a joystick. In the neutral position, the motor is stationary. Then the speed
smoothly increases as you move the joystick forward, until you reach maximum speed.
Similarly, in pulling the joystick back from the neutral position, the motor gradually increases
speed in the reverse direction. The diagram below shows the basic motor control schematic we
are working from.

Step 3.1 Connect your joystick using your male/female connectors to the Arduino. See video
posted
Step 3.2 Using the serial output, write down the value of your joystick in neutral position. This is
you Jo value.
The value of my Jo is 512.
Question 3.1 – Using your Jo value and the graph below, find the equation of your controller
both in the positive and negative directions.
1. First find m or the gradient.
M1=y2-y1/x2-x1= 255-0/0-512 = 255/-512 = -257
M2= y2-y1/x2-x1= 0-255/512-1023= -255/-511 =0.499
Y=mx+c = -257x+255 for negative direction
Y=mx+c = 0.499x+255 for positive direction.

Hint:
Remember, the equation is given by:
y=mx +b

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
where m is the slope and b is the y intercept. You can find the slope, m, by finding the rise over
the run. The intercept b can then be found by substituting a point on the line in the above
equation.

Question 3.2 Adjust the code that has been given to you to incorporate your own equation.
Include this code in your lab submission.

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
Deliverables
1. Answer all question provided in each section. You can write your answers on a piece of paper and
take a picture of your answer and neatly paste it in the document.

2. Take a picture of your setup in part 3 and include it in your lab report

3. Include your code for part 3.

This study source was downloaded by 100000854114451 from CourseHero.com on 01-24-2024 13:24:27 GMT -06:00

https://www.coursehero.com/file/138952972/EET-126-Lab-2-Instructionsdocx/
Powered by TCPDF (www.tcpdf.org)

You might also like