micromouse meeting #3 lecture #2 power motors encoders

22
Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Upload: jirair

Post on 23-Feb-2016

48 views

Category:

Documents


0 download

DESCRIPTION

Micromouse Meeting #3 Lecture #2 Power Motors Encoders. Microcontroller – pick one yet? Meet your team Some teams were changed. Previous Stuff. High Level Diagram. Everything needs power Batteries Supply a constant voltage Supply as much current as needed (Ideally). Power. =. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Micromouse Meeting #3Lecture #2

PowerMotorsEncoders

Page 2: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Previous Stuff

Microcontroller – pick one yet?

Meet your team Some teams were changed

Page 3: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

High Level Diagram

Page 4: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Power

Everything needs power Batteries

Supply a constant voltage Supply as much current as

needed (Ideally)

=(almost)

Page 5: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Power Regulation

Different components require different supply voltages

MCU: ~5V Gyro: 5V or 3.3V

Supply too little, components don’t work properly

Supply too much, components tend to light on fire

Page 6: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Power Regulation

Common voltage divider circuit

Does not work for Micromouse! Battery voltage decreases as it discharges If input voltage decreases, output voltage also decreases

Page 7: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Power Regulation

Solution:Voltage Regulator

These will output a constant voltage even if the input voltage changes

Inside is a complicated mess of transistors and other components

Check datasheet for input voltage range

Page 8: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motors Convert electrical energy to mechanical

energy Two types:

Brushed Brushless

Page 9: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motors:Brushed

Brushed motors take a DC signal So they are also known as DC motors

Power 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 How do we control brushed motors?

Page 10: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Pulse Width Modulation (PWM)

“Fake” 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

Microcontrollers have libraries/functions that make generating PWM signals really easy

Page 11: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motors: Signal Power and turning

PWM signals can control the speed of the motors easily – cool

Problem: Connect a pin on a MCU to a motor and output a PWM

The motor barely moves MCUs cannot provide enough current to turn motors

at fast enough speeds Another problem: Microcontrollers cannot invert the

PWM signal to rotate the motor in the other direction

Page 12: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motors: Driver

Use the PWM signal to control a transistor

The transistor acts as a two-state switch that can handle lots of current

The transistor switches on and off according to the PWM

The motor can be directly powered by the battery, but now its speed can be controlled too

Solution: Motor Driver

Page 13: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motors: Rotation Control

Motor driver circuit can pour all the current the battery can supply to the motor – nice

Problem: How can the motor change direction? Previous circuit allows current to flow in only one

direction

Page 14: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motor Driver: H-Bridge These use several driver

circuits All contained in an IC

Solution: Use H-Bridges

Page 15: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

H-Bridge: Simplified diagram

Turn selected switches on/off to control the current path

Page 16: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

H-Bridge States

Datasheet of H bridge describes which pins does what

Close these switches:Motor turns in one direction

Close these switches:Motor turns in other direction

Page 17: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Motors: Brushless

Goal is the same as brushed motors: rotate something

Mechanics is different Multiple inductors attract

and repel the magnet Has more control over DC

motors Controlling brushless motors

are more complicated But fairly easy to do with IC

chips/software libraries

Page 18: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Cell Counter

While the mouse is moving around the maze, it needs to memorize it

It needs some way to tell how many cells it has transversed So we need some kind of cell counter

How does the mouse know going this far is four cells long?

Page 19: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Rotary Encoder

Attach something to the wheels to count how many times the wheels have turned to get distance

Two major flavors Optical Magnets with Hall effect sensor

Solution: Rotary Encoder

Page 20: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Rotary Encoder: Optical

LED shines light through holes in a disc A detector on the other side counts how many times

the disc turns

Page 21: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Rotary Encoder: Magnetic

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

magnetic field

Page 22: Micromouse Meeting #3 Lecture #2 Power Motors Encoders

Next Sensors!Meet your team if you haven’t already