instrumentation lab 2 report bilive

docx

School

Centennial College *

*We aren’t endorsed by this school

Course

126

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

docx

Pages

6

Uploaded by GeneralMulePerson937

Report
Electrical Engineering Technician AMAT/ SETAS Course: EET-126 INSTRUMENTATION 1 Name: Bilive khatri Student id: 301362967 Date:15-01-2024 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) 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 This is an open loop system because there is no feedback system. Question 1.2 – Why does the L293D have two ground pins? By having two pins either side this greatly increases the cross sectional area of the copper available for conduction and improves heat flow. Question 1.3 – How do we set the setpoint in this system? We set the setpoint in the code to run motor, to change the speed of the motor we change the code motorspeed= 0-255.
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)? This system was close loop system because tilt sensor is used as feedback so that we can turn on and off the motor. Question 2.2 – What kind of controller mode are we using in this section? We used motion controller to sense the motion and according to that it will run and stop the motor. 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 speed of the motor will be 150 turn per second. 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? The appropriateness of using motion control mode for equipment in a plant depends on various factors and the specific requirements of the application. Motion control mode can be a suitable choice in certain scenarios, but it may not be the best option for all situations. 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
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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 J o value. Question 3.1 – Using your J o value and the graph below, find the equation of your controller both in the positive and negative directions. Hint: Remember, the equation is given by: 𝑦=𝑚𝑥+𝑏 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. For the positive direction:M= Line passes across (1023,255) Y=0.5x-256.5 For the negative direction; M= Line passes across(0,255) Y=0.5x+255 joystickValue motorSpeed 0 1023 J O 255 (1023, 255) (0, 255) (J O , 0)
Question 3.2 Adjust the code that has been given to you to incorporate your own equation. Include this code in your lab submission. int speedPin = 5; //You must change 507 to your Jo value //Jo is what you see in serial monitor when joystick is in neutral position //See video instructions int Jo = 507; int directionPin1 = 4; int directionPin2 = 3; int motorSpeed=150; //number between 0 - 255, >100 for motor int joystickPin = A1; int joystickValue; void setup() { // put your setup code here, to run once: pinMode(speedPin, OUTPUT); pinMode(directionPin1, OUTPUT); pinMode(directionPin2, OUTPUT); pinMode(joystickPin, INPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: //Find out what the neutral position is for Joystick
//DIfferent for each joystick joystickValue = analogRead(joystickPin); Serial.println(joystickValue); if (joystickValue < Jo) { digitalWrite(directionPin1, HIGH); digitalWrite(directionPin2, LOW); motorSpeed = -0.5 * joystickValue + 255; if (motorSpeed > 255) motorSpeed = 255; analogWrite(speedPin, motorSpeed); } else if (joystickValue >= Jo) { digitalWrite(directionPin1, LOW); digitalWrite(directionPin2, HIGH); motorSpeed = 0.5 * joystickValue - 256.5; if (motorSpeed > 255) motorSpeed = 255; analogWrite(speedPin, motorSpeed); } } 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.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help