BM-305 Mikrodenetleyiciler Güz 2015 (10. Sunu) (Yrd. Doç. Dr. Deniz Dal)

Slides:



Advertisements
Similar presentations
Sensing and Control.
Advertisements

EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Basic DC Motor Circuits
Servos The material presented is taken from a variety of sources including:
Servos The material presented is taken from a variety of sources including:
EET 2261 Unit 13 Controlling Stepper Motors and Servos  Read Almy, Chapter 21.  Lab #13 due next week.  Final Exam next week.
Components of a servomotor are: - a DC electric motor, - gears with an output shaft; - position-sensing mechanism; - control circuitry. Robotics and Automation.
L.
Living with the Lab Using servos with an Arduino EAS 199A Fall 2011.
The Solar Tracker. Solar Tracking Project Team Members: –Cristian Ruvalcaba –Ken Seal –David Clark –Mark McKinley –Richard DeJarnatt.
SENIOR DESIGN 10/16.
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
1 Motors & Motor Controllers ECE AC or DC Motors AC –Few robots use AC except in factories –Most of those that use AC first convert to DC DC –Dominates.
Servo Motors # A servo is a motor that you can position at any angle very accurately. # Servos have a limited servo range; most servos have a range of.
Digital Outputs LCD Display
Applied Control Systems Robotics & Robotic Control
Manufacturing Advanced Design Applications Manufacturing © 2014 International Technology and Engineering Educators Association, STEM  Center for Teaching.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
1  Actuators are used in order to produce mechanical movement in robots.
Practical Electronics & Programming
Instrumentation & Control Engg. Section Electrical Engineering Department Ahmedabad , Gujarat.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Servos The material presented is taken from a variety of sources including:
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Robot Project by Ahmad Shtaiyat Supervised by Dr. Salem Al-Agtash.
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
Solar Powered LED Blinds Group 28: Austin Estes and Kerr Oliva TA: Katherine O’Kane.
Servo Motor Control Using Arduino Instructor: Dr Matthew Khin Yi Kyaw.
Arduino Based DC Motor Speed Control
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Sitarambhai Naranjibhai Patel Institute Of Technology & R.C.
INTERNET OF EVERYTHING SDU 2016 Week 9. Physical Output  Make things move by controlling motors with Arduino  Servo-motors  Rotary actuator that allows.
DC motor principles Speed control Direction Stepper motor principles
Arduino Programming Part 6: LCD Panel Output ME 121 Portland State University.
The “Board of Education” 1 Three-position switch 0 = OFF 1 = ON / wheels OFF 2 = ON / wheels ON breadboard (for building circuits) electrical power (V.
Microcontroller basics Embedded systems for mortals.
ARM CORTEX (STM32) BASED MOTOR SPEED CONTROL SUBMITTED BY EDGEFX TEAM.
Arduino Application: Speed control of small DC Motors
Arduino based Automatic Temperature Controlled Fan Speed Regulator.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Motors & Motor Controllers
BM-305 Mikrodenetleyiciler Güz 2016 (3. Sunu)
Microcontroller basics
Introduction to Motors, servos and steppers
Assist. Prof. Rassim Suliyev - SDU 2017
CU ATLAS Practical electronics Motion and Servos
Lab 2: Arduino Sensors Topics: Arduino Sensor Reading, Display
Microcontroller basics
Introduction to Servos
Program the robotic arm
Cascade switching of an LED
ARDUINO LINE FOLLOWER ROBOT
Servos The material presented is taken from a variety of sources including:
Arduino - Introduction
DC MOTOR SPEED CONTROL 1. Introduction
‘SONAR’ using Arduino & ultrasonic distance sensor
Servos The material presented is taken from a variety of sources including:
Servos The material presented is taken from a variety of sources including:
Arduino Application: Speed control of small DC Motors
Assist. Prof. Rassim Suliyev - SDU 2018
Sensors and actuators Sensors Resistive sensors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
LCD (LIQUID CRISTAL DISPLAY) SCREENS
UNIT 11: RC-SERVOMOTOR CONTROL
Presentation transcript:

BM-305 Mikrodenetleyiciler Güz 2015 (10. Sunu) (Yrd. Doç. Dr. Deniz Dal)

16x2 (16 Sütunlu, 2 Satırlı) Alfanümerik LCD (Liquid Crystal Display) Kontrolü (White Text on Blue Background/Backlight)

You will notice that pin 5 (RW) is tied to ground. This pin is used to control whether you are reading or writing to the display. Since reading from the display is uncommon, most people just tie this pin to ground. The potentiometer connected to pin 3 controls the LCD contrast.

Sending Data and Commands Data and commands are sent to the LCD using the 8 data lines (pins 7-14) and the RS line (pin 4). The RS lines tells the module whether the 8 data bits relate to data or a command. The data/command is read on the falling edge of the enable line (pin 6). This means that when enable transitions from high to low, the values of D0 to D7 and RS are read. So to send data or a command to the display, you need to 1. Set Enable to high 2. Set RS and D0-D7 desired values 3. Set Enable to low Hitachi HD44780 based display modules also have a 4 bit interface mode. Under this mode the data or command is transferred to the module using 2, 4 bit nibbles.

Bağlantı Şeması 5 V GND

Arduino LiquidCrystal Kütüphanesi ( ) ve Hello World Örneği /*LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * LCD VSS pin to ground * LCD VCC pin to 5V * 10K resistor ends to 5 V and ground, wiper to LCD VO pin (pin 3) */ #include // include the library LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// initialize the library with the interface pins void setup() { lcd.begin(16, 2);// set up the LCD's number of columns and rows lcd.print("Hello, World!");// Print a message to the LCD. } void loop() { // set the cursor to column 0, line 1 lcd.setCursor(0, 1);// (note: line 1 is the second row, since counting begins with 0) lcd.print(millis()/1000);// print the number of seconds since reset } File->Examples->LiquidCrystal Yolundaki Tüm Örnekleri Tek Tek Çalıştırınız.

Arduino LiquidCrystal Kütüphanesi ( ) Fonksiyonları LiquidCrystal() begin() clear() home() setCursor() write() print() cursor() noCursor() blink() noBlink() display() noDisplay() scrollDisplayLeft() scrollDisplayRight() autoscroll() noAutoscroll() leftToRight() rightToLeft() createChar()

Servo Motors Servos are the easiest way to start making motion with a microcontroller. Servos have integrated gears and a shaft that can be precisely controlled. Standard servos allow the shaft to be positioned at various angles, usually between 0 and 180 degrees. The servo motor has three leads. The color of the leads varies between servo motors, but the red lead is always 5 V, GND will either be black or brown. The other lead is the control lead and this is usually orange or yellow. This control lead can be connected to a digital pin.

Servo Motor Applications Servo motor mechanism is used in a large number of applications which are critical in position control. We cannot use DC motor to control a tail of aircraft because controlling a DC motor for accurate positioning is not only difficult but almost impossible. One of the most popular servo motor applications is robotic. Consider a simple pick and place robot. Pick and place robot is such a robotic machine which is used to pick an object from one position and place the object at different position. Now, in order to pick an object from position A and place it in position B the motors which are used to actuate the joints are servo motors. This is because; we have to plan the angular movement of each and every joint to complete this task of pick and place. Once this data is fed to the robot controller, the robot will continuously do its job. The controller will send PWM data to the individual motors of the robot. This gives precise angular control of the arm which is not possible with a regular DC motor

Servo Motor Applications Conveyors are used in Industrial manufacturing and assembling units to pass an object from one assembly station to another. Let’s consider an example of bottle filling process, in the process the bottle needs to be filled with the liquid and moved to the next stage which is mainly the packaging stage. So in order to achieve this conveyor belts are used with servo motors so that the bottle moves precisely to the desired location and stops so that the liquid can be poured into it and then it is guided to the next stage. This process continues until stopped. Hence the precise position control ability of the servo shaft comes in handy.

Controlling Servo Motors Servo motors are controlled by a series of pulses and to make it easy to use them, an Arduino library has been created so that you can just instruct the servo to turn to a particular angle. The position of the servo motor is set by the length of a pulse. The servo expects to receive a pulse roughly every 20 milliseconds (50 Hz). If that pulse is high for 1 millisecond, then the servo angle will be zero, if it is 1.5 milliseconds, then it will be at its centre position and if it is 2 milliseconds it will be at 180 degrees. The end points of the servo can vary and many servos only turn through about 170 degrees. You can also buy 'continuous' servos that can rotate through the full 360 degrees.

Servo Motors Dalganın frekansı f=50 Hz ve periyodu T=20 ms Görev Çevrimi (Duty Cycle) değiştirilince açı değişiyor.

Servo Motorların İç Yapısı ve Çalışma Prensibi The shaft of the servo is connected to a potentiometer. The circuitry inside the servo, to which the potentiometer is connected, knows the position of the servo. The current position will be compared with the desired position continuously with the help of an Error Detection Amplifier. If a mismatch is found, then an error signal is provided at the output of the error amplifier and the shaft will rotate to go the exact location required. Once the desired location is reached, it stops and waits.

Bağlantı Şeması

Servo Kütüphanesi ( ) ve Potansiyometre ile Servo Açısının Kontrolü File->Examples->Servo Yolundaki Tüm Örnekleri Tek Tek Çalıştırınız. // Controlling a servo position using a potentiometer (variable resistor) // by Michal Rinott #include //include the library Servo myservo; // create a servo object to control a servo int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { val=analogRead(potpin); // reads the value of the potentiometer (val between 0 and 1023) val=map(val,0,1023,0,179); // scale it to use it with the servo (val between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there }

TIP120 NPN Transistor (60 V, 5 A, TO-220) A small DC motor is likely to use more power than an Arduino digital output can handle directly. If we tried to connect the motor straight to an Arduino pin, there is a good chance that it could damage the Arduino. A transistor like TIP120 can be used as a switch that uses just a little current from the Arduino digital output to control the much bigger current of the motor.

Transistor as Current Amplifier The larger collector current IC is proportional to the base current IB according to the relationship IC =ßIB, or more precisely it is proportional to the base-emitter voltage VBE. The smaller base current controls the larger collector current, achieving current amplification. (ß -> Tranzistör Akım Kazancı) The analogy to a valve is sometimes helpful. The smaller current in the base acts as a "valve", controlling the larger current from collector to emitter. A "signal" in the form of a variation in the base current is reproduced as a larger variation in the collector-to-emitter current, achieving an amplification of that signal.

Arduino ile DC Motor Kontrolü There is a diode connected across the connections of the motor. Diodes only allow electricity to flow in one direction (the direction of their arrow). When you turn the power off to a motor, you get a negative spike of voltage, that can damage your Arduino or the transistor. The diode protects against this, by shorting out any such reverse current from the motor. 1N4007 Motor+Diyot yerine LED+Direnç bağlayarak bir sonraki slayttaki kodu tekrar çalıştırınız.

Arduino ile DC Motor Kontrolü int motorPin = 9; void setup(){ pinMode(motorPin, OUTPUT); } void loop() { for(int motorValue = 0 ; motorValue <= 255; motorValue +=5){ analogWrite(motorPin, motorValue); delay(30); } for(int motorValue = 255 ; motorValue >= 0; motorValue -=5){ analogWrite(motorPin, motorValue); delay(30); }

Şimdi de Motorun Bağlantı Uçlarını Değiştirin…

H-Bridge (H-Köprüsü) H-bridge is a circuit which allows the high voltage to be flown in either direction. Since voltage should change its direction to able to rotate the motor in clockwise or anticlockwise direction, H-bridge IC are ideal for driving a DC motor.

H-Bridge (H-Köprüsü)

L293D Dual H-Bridge Motor Driver