Encoders, Motors, Power, Mini Project #1 10/24/2014.

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Advertisements

10 Ways to Ruin Your Mini-Max microcontroller (and lose $69)
MOTION CONTROL ECE 105 Industrial Electronics Engr. Jeffrey T. Dellosa College of Engineering and Information Technology Caraga State University Ampayon,
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Microprocessor Motor Control Spring Introduction  Stamp projects Robots  Sensors  Motor control  Logic Rocketry  Reading acceleration (“g”
Fair Use Building and Research Labs Presents
Panasonic EVE-KC2F2024B 24 pulses per revolution 6mm diameter flattened output shaft output type: quadrature (incremental) minimum life: 15,000 rotations.
We deal with voltage signals Sensors convert environment data to electrical signals Output: Voltage Input: Time/Distance/Whatever Move Receiver around.
PS 141 Presentation By Gabe, Tanya Mae Kim, Jaeyoun Ong, Raymond Carey.
Electricity and Circuits
EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
THIS PRESENTATION HAS BEEN UPLOADED TO THE WIKI. Motors, Controllers, and Regenerative Braking.
12/3/2002BAE Electric Motors Classification / types –DC Motors –AC Motors –Stepper Motors –Linear motors Function –Power conversion - electrical.
L.
DC Motors DC Motors are widely used in robotics because of their small size and high energy output. Key characteristics of DC motors include: 1. High Speed.
Group 4 Rotationally Refreshed Display Patrick Boyd Daniel Hill.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Department of Electrical Engineering Southern Taiwan University of Science and Technology Robot and Servo Drive Lab. 2015/7/2 Digital Control Strategy.
Arduino. Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source.
SENIOR DESIGN 10/16.
Micromouse Meeting #3 Lecture #2 Power Motors Encoders.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Microprocessors Tutorial 2: Arduino Robotics
Embedded Programming and Robotics
Timers and Interrupts Shivendu Bhushan Sonu Agarwal.
Project: sun tracker Idea: –Use two photodiodes to detect where the sun is –Control a motor to turn toward the sun –When sun is “half-way” between PD,
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.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
ENGR 6806 – Motor Control Prepared By: Rob Collett September 15, Office: EN2074.
A.G.I.L.E Autonomously Guided Intelligent Lawn Equipment Team Members: Brad Ramsey Derek Rodriguez Dane Wielgopolan Project Advisors: Dr. Joel Schipper.
Servo Motor Control Demonstration.
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
PH4705 & ET4305: Digital Sensors
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Servo Motor Control Demonstration. EML 2023 Department of Mechanical and Aerospace Engineering motor with gear reducer flex coupling incremental optical.
ANALOG CIRCUIT AND DEVICES 10/7/ Semester I 2013/2014 Course Code: EEE 3123.
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Hybrid I/O – Pulses.
1 Lecture on Lab 6 Lab 7 Lab 8. 2 Lab 6: Open Loop Controller As you learned in lab 5, there are two kinds of control systems: open loop and closed loop.
Microprocessors Tutorial 2: Arduino Robotics. Agenda 1. Robot Anatomy 2. Sensor Review 3. PWM 4. MAKE: Fade 5. Motors 6. H Bridge 7. Robot Control library.
MAKE: AN ELECTRONICS WORKSHOP
NATCAR SUMMER CLASS II 6 July 2004 Chung Hsieh. Topic of Discussion Power Supply Motor Drive Circuits Braking.
SMV Electric Tutorials
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
Microcontroller basics Embedded systems for mortals.
Atmega328p Introduction for Digital and PWM Output Brion L Fuller II Robotics Club.
Microcontroller basics Embedded systems for mortals.
ECE445 Presentation Smart Umbrella Group 35 : Dominic Antonacci, Jonathan Buie, Martin Miller TA: Cara Yang.
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
Application Case Study Christmas Lights Controller
Introduction to Motors, servos and steppers
DC Motors DC Motors are widely used in robotics because of their small size and high energy output. Key characteristics of DC motors include: 1. High Speed.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Electronic Control Systems Week 3 – Switches and Sensors
Timers and Event Counters
Microcontrollers, Basics Tips and Tricks with PIC MCUs
An FPGA Implementation of a Brushless DC Motor Speed Controller
A lecture for Arduino Course, Winter 2017/18
Fair Use Building and Research Labs Presents
Pulse Width Modulation (PWM) Motor Feedback - Shaft Encoder
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
CSCI1600: Embedded and Real Time Software
Fair Use Building and Research Labs Presents
Sensors and actuators Sensors Resistive sensors
Electricity and Circuits
CSCI1600: Embedded and Real Time Software
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Interrupts.
Presentation transcript:

Encoders, Motors, Power, Mini Project #1 10/24/2014

 We cannot use a simple voltage divider to provide a consistent voltage source.  As the voltage from the battery decreases during discharge, the output voltage will decrease!

 In order to provide a consistent source of potential difference, we need to use voltage regulators.  We will provide you with a 5V regulator to connect to your LiPo battery pack for Mini Project #1.

 Use capacitors to smooth out noise in your signal

 Brushed and Brushless

 Brushed motors take a DC signal.  Powers an inductor to rotate a magnet.  Increase the voltage and/or current -> Increase the rotation speed.  Reverse the polarity of the input voltage -> Reverse the rotation.  Most digital microcontrollers do not have an analog signal output.  MCU’s output digital signals – either high or low.  So how do we control brushed motors?

 Mimics an analog voltage signal  Square wave with a certain frequency  This can be used to control the speed of a motor

 Speed is controlled by rapidly turning the motor on and off  Turn the motor on for a greater fraction of the time to make it rotate faster  The percent of time the PWM signal is on is the duty cycle  0% duty cycle is same as off all the time; 100% duty is same as on all the time

 We cannot connect the MCU to the motor.  MCUs don’t provide enough current to power motors.  Microcontrollers cannot invert the PWM signal to rotate the motor in the other direction.

 Have the PWM control a H-bridge  PWM controls transistors (think of them as switches) that allows the battery to pour all its current to the motor  Easy to control direction

 Simplified diagram Turn LeftTurn Right

void turnRight() { digitalWrite(1A, LOW); digitalWrite(2A, HIGH); digitalWrite(3A, HIGH); digitalWrite(4A, LOW); analogWrite(motorPwrR, 100); analogWrite(motorPwrL, 100); } void turnLeft() { digitalWrite(1A, HIGH); //Right wheel digitalWrite(2A, LOW); //Right wheel digitalWrite(3A, LOW); //Left wheel digitalWrite(4A, HIGH); //Left wheel analogWrite(motorPwrR, 100); analogWrite(motorPwrL, 100); }  Actual implementation for two motors

 Goal is the same as brushed motors: rotate something  Mechanics is different  Multiple inductors attract and repel the magnet  Has more control than DC motors  Controlling brushless motors are more complicated  But fairly easy to do with IC chips/software libraries

 Helps you determine how far you have travelled in the maze.  Rotary Encoders attached to wheels  Optical  Magnetic with Hall Effect Sensor

 Light reflects off alternating bright or dark areas. The detector determines when the light was shone on it. (Mini Project #1 uses this).  Another method: LED shines through a teeth in a disc to detector on other side.

 Attach magnets to a disc  Use Hall effect sensors to detect the changing magnetic field

 Count the ticks to see how far the wheels have turned

 Encoders are constantly outputting data  Your MCU needs to read the values all the time!  If your MCU is reading values 100% of the time it can’t do anything useful!  Otherwise you are losing data, or must litter your code with checks every few lines!  Not a good solution 

 Interrupts allow you to process data and then go back to what you were doing

 “Yo imma let you finish, but this is some of the most important data of ALL TIME”

 An interrupt handler is a short function that runs when an external event happens  Rest of the program pauses, and continues after interrupt is done  From the perspective of each, the other doesn’t exist*  *If your interrupt handler runs for too long (and too often) it can choke your entire program!

 Types of interrupts:  RISING  FALLING  CHANGE  LOW  HIGH  Arduino boards: only two interrupt pins  Teensy: all pins!

 The volatile keyword:  Tells the compiler “this value can change at any time!”  MCU will look up value in memory each time and not an old value in a register  Anything your interrupt handler modifies should be volatile, or you may get bugs!

 Increment a counter and return (be fast)!  Don’t want to use this counter directly  If you accidentally overwrite it, you might not be able to know how far you went!  Using good coding style you can prevent mistakes!  But I’m too good to make such silly mistakes! ▪ Nonsense, we are all human, mistakes happen!

 The static keyword:  Means “this variable/function can only be used in this file only!”  Return value of counter with a function!  Now nobody from the outside can mess with it directly!

 Depends on how fast your encoders are  On super high resolution encoders, it may be sufficient to track a single pin per encoder  On lower resolution encoders its better to track both pins changing  Tracking a pin change gives you even “more” resolution  If a wheel is on the edge between ticks, its possible to get “false positives”

 Demonstrate basic understanding of motor control and encoders.  DUE DATE: 11/7/2014 SIGN UP EARLY  Parts (abridged)  Teensy 3.1  Motor  H-bridge  Encoders

 Keep your eyes peeled for an for when the spec sheet for Mini Project #1 is up.  Do not hesitate joining a group you don’t know to complete the Mini Projects. Make friends!  Start early!