Presentation is loading. Please wait.

Presentation is loading. Please wait.

Smart Vehicles Leyla Nazhand-Ali, Ph.D. Michael Henry

Similar presentations


Presentation on theme: "Smart Vehicles Leyla Nazhand-Ali, Ph.D. Michael Henry"— Presentation transcript:

1 Smart Vehicles Leyla Nazhand-Ali, Ph.D. Michael Henry
Assistant Professor IEEE member Michael Henry Graduate Student

2 Humans Make Mistake In US alone, 400,000 people die every year in traffic accidents.

3 There are Dangerous Zones in the World …

4 We Like to Explore Places, Unmanned

5 This Talk We will talk about Autonomous vehicles
Embedded microprocessors Programming an autonomous toy car

6 What are Autonomous Vehicles?
A fully(semi)-autonomous vehicle can perform all (some) of its actions without any human control. The automatic actions can be as simple as cruise control, or as complicated as completely driving the car.

7 Benefits of Autonomous Vehicles
……… reaction time compared to humans ……… information at its disposal to make decisions. No need to put humans at risk in dangerous terrains. No need to send humans to navigate a vehicle in order to explore difficult-to-reach places.

8 The State of Autonomy in Commercial Vehicles
Anti-lock brakes Cruise control (can adapt to the speed of the vehicle in front) Self parallel park Lexus parallel park Lane departure warning Volvo lane departure warning Auto-pilot systems for airplanes

9 The State of Autonomy in Research Vehicles
DARPA hosts yearly contests for autonomous vehicles and hopes to eventually use unmanned convoys in war zones. In 2007, contest was in an urban environment A car by Carnegie Mellon completed the 60 mile course in under 5 hours without violating any traffic rules. Virginia Tech team placed 3rd, winning $500,000 Department of Defense Advanced Research Projects Association (DARPA) hosts yearly contests for autonomous vehicles. Hopes to eventually use unmanned convoys in war zones. In 2005, an autonomous vehicle by Stanford completed a 132 mile desert course in 6 hours. Virginia Tech placed 8th and 9th. In 2007, contest was in an urban environment complete with traffic, stop lights, and pedestrians. A car by Carnegie Mellon completed the 60 mile course in under 5 hours without violating any traffic rules. Virginia Tech placed 3rd, winning $500,000.

10 How is Autonomy Achieved?
An autonomous system uses Some devices as its eyes and ears Some devices as its brain to process the data collected through those eyes and ears Some devices as its arms to perform actions sensors Controller (microprocessor) actuators

11 The Eyes: The Sensors Some of the sensors and sensor systems included in autonomous vehicles include: GPS Speed sensor Acceleration sensor Skidding sensor Light sensor Sensors to detect an open door Sensors to detect an unlocked seatbelt

12 The Arms: The Actuators
Some of the actuators that are included in autonomous vehicles include: The device that injects the fuel to the engine The device that automatically turns the headlights on when dark The device that takes control of brakes when skidding is sensed

13 The Brain: The Microprocessor
The decisions are made by a device called a microcontroller or microprocessor. It essentially does the same thing as the microprocessors used in your personal computer, i.e. it runs programs; however it is smaller and simpler.

14 Embedded Microprocessors
Since these microprocessors are embedded in the system they are controlling, they are called “embedded microprocessors”.

15 Embedded Microprocessors Used in Cars
An average modern car has 50 embedded microprocessors for all sorts of tasks. Engine operation: fuel injection, engine sensing and monitoring Entertainment: radio, DVD player Driver informatics: gauges, navigation Safety: anti-lock brakes, skid-control, traction control

16 Embedded Microprocessors Characteristics
Compared to general-purpose microprocessors, the embedded ones: are smaller and consume less power usually run a couple of routine programs need to have predictable calculation times (imagine your cruise control acting like your PC!) need to be failures/crash resistant ?

17 Embedded Microprocessors are Everywhere
In your home: Alarm Clock, TV, microwave, thermostat In the office: copy machine, telephone, computer monitor In the hospital: MRI machine, heart monitor Even in your pocket: cell phone, car key remote, ipod

18 Embedded Systems are Deadline Based
The system containing the embedded microprocessor is called embedded system. Embedded Systems are sometimes called real-time systems. Real-time because tasks are time based and deadline based.

19 Why use Embedded Systems?
They are more failure resistant. Imagine if a car had a single computer to run everything. What if the anti-lock brake program was running too slow because the user was using the navigation system? What if the skid control system stops working because an entertainment application crashed the system? Processor Brakes Radio Engine Gauges

20 Why use Embedded Systems?
They end up being ………... They consume significantly …… power, which is crucial for handheld devices such as cell phone. They are ……….. to program and test, reducing the time-to-market.

21 Student Activity You will be given a small motorized car with infrared sensors. You will program the car to achieve 4 tasks Drive the car in a circle Drive the car forward and have it stop when it reaches a black line Follow a curvy path Navigate a simple maze A code framework will be provided and minimal programming skills are required.

22 The Car The car has two infrared sensors, two motors and one embedded processor with a serial connection mounted on top. The processor is connected to the sensors and motors.

23 The Sensors In the front of the car are two infrared sensors mounted next to each other. These sensors can tell the processor whether they are over a black or white surface. Over white surface Over black surface

24 The Actuators There are two motors one connected to each wheel.
The processor can control the speed at which each motor turns. The motors can turn at different speeds and in different directions at the same time.

25 Steering Turning both motors at the same speed and direction will move the car in a straight line. Turning the wheels at different speeds will cause the car to turn. You will be studying how to control the speed in order to turn the car to left or right. ? Turning one wheel while stopping the other will cause the car to make a very sharp turn. ?

26 Decision Making Some autonomous systems take input from a large number of sources, and make a calculated guess as to the best output. In cases such as our car, where there are only a couple of input sources, why not specify the exact output for every possible input combination? We have 2 inputs (left and right infrared sensors) each with 2 possible states (over black or over white surface), so we only need to come up with outputs for 4 possible states. This process is called calculating the state table.

27 State Tables Here is an example state table for our car
Think, Pair, Share Activity: If a car uses this state table and is placed inside a black rectangle on a white piece of paper and turned on, what will happen? Input (IR sensors) Output (Motors) Left Right White Forward Fast Black Reverse Reverse Fast Slow Reverse Slow Forward Slow

28 Visual Representation
State Table IR Sensor Reading Motor Command Visual Representation Left Right Black Reverse Fast White Forward Slow

29 Programming Environment
You will not be required to implement a complicated program. You will essentially be filling in a state table. All four possible states of the infrared sensors ( WW, BB, WB, BW ) will be given and you will insert commands to the car for each state. The transition to the new state is instant. This state table will be run continuously thousands of times per second, so you do not need to consider what happens when the car moves from one state to another.

30 Car Commands Command Effect These are the commands you can send a car:
LMotorForward( Speed ); RMotorForward( Speed ); Moves the motor forward at a given speed. Speed can be from 1 to 10 with 10 being the fastest. LMotorReverse( Speed ); RMotorReverse( Speed ); Moves the motor in reverse at a given speed. Speed can be from 1 to 10 with 10 being the fastest. LMotorStop( ); RMotorStop( ); Stops the motor. When putting the commands into the programming framework, change ‘Speed’ to a number between 1 and 10. Be sure to include the parentheses and semicolon.

31 Programming Framework
The C code on the right will be provided to you as an example. There are four ‘if’ statements each specifying a different state of the sensors. The red lines inside the ‘if’ statements represent the solution that implements the state table shown a few slides ago. You are to put motor commands replacing the red lines to accomplish other tasks. if( LeftSensor == BLACK && RightSensor == BLACK ) { LMotorReverse( 10 ); RMotorReverse (10 ); } else if( LeftSensor == BLACK && RightSensor == WHITE ){ LMotorForward( 5 ); RMotorReverse( 5 ); else if( LeftSensor == WHITE && RightSensor == BLACK ){ LMotorReverse( 5 ); RMotorForward( 5 ); else if( LeftSensor == WHITE && RightSensor == WHITE ){ LMotorForward( 10 ); RMotorForward( 10 );

32 The Tasks You are to program the car to complete four tasks.
Task 1 - Spin the car in circles Task 2 - Move forward and stop on a black line Task 3 - Follow a curvy path Task 4 - Navigate a maze (extra credit task) All of these tasks can be completed by filling in the state table shown previously. The ‘course’ for tasks 2 through 4 is printed on a sheet.

33 Task 1 Spin the car clockwise in place.
The pivot point should be the center of the car, not one of the wheels. Hint: The car should spin in place no matter what surface it is over, so all four entries of your state table should look the same.

34 Task 2 Drive the car in a straight line over a white surface and stop it when it hits a black line.

35 Task 2 Hints You might find that the car doesn’t drive perfectly straight even if both motors are driven at the same speed. The car might hit the line at an angle. Filling in the table when both sensors are black or both are white should be pretty straightforward, but what about when one sensor is black and the other is white?

36 Task 3 Have the car follow a curvy loop.
The car must be able to start anywhere on the loop, and go around clockwise or counterclockwise. You are going to try to traverse the course as fast as possible.

37 Task 3 Hints You may find it difficult to have the car follow the line perfectly. It is expected that the car will repeatedly go off the line and then perform a corrective action. Should the car go completely off the line (both sensors white), something should be done to ensure the car doesn’t travel off the sheet of paper. You might find that the highest motor speeds actually slow down the total traverse time.

38 Task 4 (Extra Credit) Navigate a maze
The car should be start at the circle labeled “1” and should exit at the circle labeled “2” The car should also be able to go from “2” to “1” 2 1

39 The Right Hand Rule The car should navigate the maze using the right hand rule. If you place your right hand on the wall to the right of you when entering a maze, and travel forward without letting go, you will eventually reach the exit. This is not the ideal way to navigate a maze, but it simplifies the problem enough to be solvable with a simple state table. Often with autonomous systems, engineers do not look for the fastest solution, but the simplest and most reliable solution. 2 1

40 Task 4 Hints Low speed is key. The car cannot bust through a wall to the other side, so keep the speed low. The car should try to straddle the wall to the right of it so that the left sensor is white and the right sensor is black. Then think about what to do if the car is moving forward and both sensors hit a black area, or both sensors hit a white area.

41 Discovery Activities After completing the previous tasks, you will spend some time discovering how the car actually works. For the previous tasks, you can take the infrared sensor input and the motor output for granted that it works. The next two activities will show you how they work.

42 More About Infrared Infrared (IR) is an invisible light to human eye but the sensor can see it. The IR sensor consists of two parts: IR transmitter and IR receiver. Here is how it works: IR transmitter IR receiver 1 2 3 Surface IR transmitter, which is an LED (Light Emitting Diode, or simply a special lamp), emits a constant amount of IR light. The IR light bounces off the surface it is pointed at. Not all light bounces off the surface. Some light is absorbed by the surface and converted to heat. Some surfaces absorb more light than others. IR receiver receives the IR light bounced from the surface and measures the amount of light it receives.

43 Reflectivity Different surfaces reflect different levels of IR light.
This is similar to visible light that is reflected in large amounts from a mirror but absorbed by a rough surface. White surfaces reflect the IR light in larger amounts compared to black ones. The microprocessor can use the amount of IR received through the sensor to determine the color of the surface it is looking at. IR transmitter IR receiver Black Surface IR transmitter IR receiver White Surface

44 Infrared Discovery Task
The IR sensor can detect a range of grey scale values, but for this project it is setup to only detect black or white. There is a certain value of reflectivity called the reflectivity threshold, where above this value the sensor detects white and below this value the sensor detects black. Your task is to determine the reflectivity threshold of your car.

45 Infrared Discovery Task
For this task, you place the car on a gradient that starts white and transitions to black. There is a scale at the top of the gradient that tells you the reflectivity at certain points. Note that the reflectivity does not start at 100% and end at 0%. The white surfaces reflects a lot of the infrared light, but not all of it. You will use the same solution as you do for Task 2, record your observations and answer some questions for this task 80% % % % % % % %

46 More About Motors The motors are only designed to run at a certain voltage. A lower voltage will cause the motor to stop; pretty much like when your batteries of your toys ran out and stopped working. On the other hand, we would like to be able to control the speed of the motor in order to steer the car properly. The solution is to turn the voltage on and off repeatedly until the desired speed is achieved; this is similar to an electric stove where the element is turned on and off periodically in order to achieve a consistent temperature.

47 Square Wave If you look at the input voltage for the motor over time, it will look like similar to the below graph. This is called a periodic square wave. A Cycle is one period of the wave that repeats itself over and over again. 5V 0V One cycle

48 Frequency Period is the length of time it takes to complete one cycle.
Frequency is the number of cycles per second, which is expressed in Hertz. The higher the frequency, the faster the wave switches between on and off. Original Wave 5V 0V Higher Frequency 5V 0V Lower Frequency 5V 0V

49 Duty Cycle Duty Cycle is the ratio of time the wave spends “high” to the period of the wave. It is usually expressed as a percentage. If the duty cycle is more than 50%, the wave spends more time high than low. 50% duty cycle 5V 0V 5V 25% duty cycle 0V 5V 75% duty cycle 0V

50 Motor Control Discovery Task
The purpose of this task is to discover the effect of frequency and duty cycle of the wave on controlling the motors. The first discovery task will be to vary the duty cycle from 20% to 100% while keeping the frequency fixed at 1 Hertz. You will observe what changes in the behavior of the car. In the second discovery task, you will set the duty cycle to 50% and vary the frequency and observe its effect.

51 Conclusion After completing the project you should be able to
Describe the benefits of autonomous vehicles Have a basic knowledge of embedded systems and why they are useful Describe how complicated problems like maze navigation can be simplified and solved. Have a basic understanding of IR sensing Have a basic understanding of what square waves are and how they are used to control a motor.


Download ppt "Smart Vehicles Leyla Nazhand-Ali, Ph.D. Michael Henry"

Similar presentations


Ads by Google