a1tD0000003mApvIAE

Course: Visual Programming( VPL) with Autonomous Cars
VPL 3: Understanding Acceleration

  • 9-12 grade
  • Intermediate

Lesson Description:

Learn about the physics of motion while you find out how fast your car should go!


 

Standards Covered

CCSS.MATH.PRACTICE.MP1

Make sense of problems and persevere in solving them.

CCSS.MATH.PRACTICE.MP2

Reason abstractly and quantitatively.

CCSS.MATH.PRACTICE.MP3

Construct viable arguments and critique the reasoning of others.

CCSS.MATH.PRACTICE.MP4

Model with mathematics.

CCSS.MATH.PRACTICE.MP5

Use appropriate tools strategically.

CCSS.MATH.PRACTICE.MP6

Attend to precision.

CCSS.MATH.PRACTICE.MP7

Look for and make use of structure.

CCSS.MATH.PRACTICE.MP8

Look for and express regularity in repeated reasoning.

HS-ETS1-2

Design a solution to a complex real-world problem by breaking it down into smaller, more manageable problems that can be solved through engineering.

HS-ETS1-3

Evaluate a solution to a complex real-world problem based on prioritized criteria and trade-offs that account for a range of constraints, including cost, safety, reliability, and aesthetics as well as possible social, cultural, and environmental impacts.

HS-PS2-1

Analyze data to support the claim that Newton’s second law of motion describes the mathematical relationship among the net force on a macroscopic object, its mass, and its acceleration.

HS-PS2-1

Analyze data to support the claim that Newton’s second law of motion describes the mathematical relationship among the net force on a macroscopic object, its mass, and its acceleration.

HS-PS2-4

Use mathematical representations of Newton’s Law of Gravitation and Coulomb’s Law to describe and predict the gravitational and electrostatic forces between objects.

image description

Lesson Modules


Teaching Tips:

Teacher Demo

  

Run this code on a  robot (or simulation) for the students to see.  

Here is the demo code: Lesson 3 Demo Code



Before we begin, let’s try this experiment:

  1. Start by opening your code from the last lesson and running it the same way you did last time.

  2. Try changing the speed from 0.3 to 0.8

  3. Run your code again and note what happens

Take this time to have a discussion about what happened to their cars/simulations and why they think that was the case.  If none of the students guess correctly, explain that when the car is driving too fast, by the time the IR sensor reads a value that causes the car to stop, the car has already moved too far, and maybe even hit something.


Before we begin, let’s try this experiment:

  1. Start by opening your code from the last lesson and running it the same way you did last time.

  2. Try changing the speed from 0.3 to 0.8

  3. Run your code again and note what happens


Imagine you're driving along and you see an obstacle in the distance (like a road block, debris, or even a stop light). Would you slowly come to a stop or slam on the breaks?


How about when you're driving along and a puppy darts in front of your car?


Or when you're driving along the road and see a little old lady driving under the speed limit?



We encounter all kinds of scenarios while driving, and successful drivers can quickly determine how to react by assessing their situation.  So far, our autonomous car has only one speed and only one possible reaction, i.e. stop when it senses an obstacle nearby.  

In this lesson we will try to make our RobotLAB Autonomous Cars behave more like human drivers by making them more responsive to their environment.




What other possible responses should the car have to obstacles? (please answer in one word)


Teaching Tips:

Question 1: When you set the car to drive faster, did your code still work as intended?  Why do you think that happened?
Students will likely find that their code didn't work and the car ran into a wall.

Question 2: How could you solve this problem?
This question is open-ended, but one possible solution is to increase the distance from an obstacle at which the car stops.


Another option is to change the car's response from stop to turn when the speed is over a certain number.


Question 3:  If you were designing a real autonomous car, would you design it to only drive at the legal speed limit?
This question is open-ended, and can be used as a starting point for a discussion about design.

When you set the car to drive faster, did your code still work as intended?  Why do you think that happened?

How could you solve this problem?

If you were designing a real autonomous car, would you design it to only drive at the legal speed limit?




Teaching Tips:

Here is the code solution for the teacher:

Sometimes beginning to write a program can feel daunting, and you don't know where to begin.  During those times it's always helpful to describe what you want to accomplish.




Based on what you need to do, what tools do you think you’ll need?  Look at these blocks and choose the ones you think you’ll need to put in your code.

aAccel.PNG


It may also be helpful to look at your code from the last lesson:
 


What will you need to add to:

  1. Determine how long it takes for the car to accelerate to the speed you set it.
  2. Determine how long it takes for the car to deccelerate down to zero after you apply the brakes.

Try your code out on the simulation and see how it works!


{{simulation

 


Now it's time to translate the pseudocode into real code!

Here's something to get you started:


Remember, writing code is like writing a poem, there are many correct answers.  Maybe you answered differently.  If so, I encourage you to convert your pseudocode into code and see how it works!


Hint:

Remember there are multiple workable solutions.  Some of them include:

  1. Turning to the left when the distance sensor senses an obstacle on the right
  2. Turning to the right when the distance sensor senses an obstacle on the left
  3. Making a U-turn rather than stopping if the car is maving above a certain speed.


 


Teaching Tips:

Question 1: Descibe the solution you designed and how it works.
Answers will vary.
 

Question 2: Check the concepts you understand.  Don’t worry, this isn’t for a grade, it’s just so your teacher can check the classes’ understanding
This is the students' self-assessment of their understanding of the material.  You will see a bar graph once all the poll answers are submitted.  
 






Descibe the solution you designed and how it works.

Check the concepts you understand.  Don’t worry, this isn’t for a grade, it’s just so your teacher can check the classes’ understanding.
  • AltinoDrive
  • AltinoAccelerationSensor
  • Data block
  • Calculate block