1 of 26

Arizona STEM

Acceleration Project

Coding a Drone to Fly on Mars or in a City Park!

2 of 26

Coding a Drone to Fly on Mars or in a City Park!

Coding and Forces of Flight with No Drones Required! Grades 3- 8

Lesson 1 of 2

Robert Lynch

5/20/2024

3 of 26

Notes for Teachers

  • This lesson is dependent upon the teacher and students using the free simulator that is provided by the company who created DroneBlocks.
  • Each year in December DroneBlocks unlocks their simulator that is usually behind a paywall.
  • Students will get the opportunity to fly a drone where the normal attributes of the drone will still be “correct” as the drone will respond to pitch roll and yaw input from the block code.
  • Additionally the students and the teacher can develop their own lesson or missions to change up the learning and difficulty level of the code.
  • Lastly, if you do have a Tello type of drone the students can use the simulator to “pre fly” an obstacle course before connecting the Tello to the computer to upload the pathway created by the student in the simulator.

List of materials:

  • 1 - 2 students per computer if you wish to use Paired Programming
  • Link to the simulator https://dev.droneblocks.io/simulator.html
  • A method for displaying the teacher view to familiarize the students with the basic functions and code blocks that they will be using to complete the lesson.
  • If you are using a Windows based computer and run into issues with lagging or freezing on the computer(s) try running the simulation in Firefox instead.
  • This lesson should take about 65 minutes from intro to completion depending upon your students understanding of block coding and the forces that allow then to maneuver a drone Pitch, Roll, Yaw.

4 of 26

7.P3U1.4 Use non-algebraic mathematics and computational thinking to explain Newton’s laws of motion.

Crosscutting Concepts:

Patterns; Cause and Effect; Scale, Proportion and Quantity; Systems and System Models; Energy and Matter; Structure and Function; Stability and Change4

Background Information:

For any pair of interacting objects, the force exerted by the first object on the second object is equal in strength to the force that the second object exerts on the first but in the opposite direction. The motion of an object is determined by the sum of the forces acting on it; if the total force on the object is not zero, its motion will change. The greater the mass of the object, the greater the force needed to achieve the same change in motion. For any given object, a larger force causes a larger change in motion. Forces on an object can also change its shape or orientation. All positions of objects and the directions of forces and motions must be described in an arbitrarily chosen reference frame and arbitrarily chosen units of size. In order to share information with other people, these choices must also be shared. 4 (pp. 115-116)

7.P3U1.3 Plan and carry out an investigation that can support an evidence-based explanation of how objects on Earth are affected by gravitational force.

U1: Scientists explain phenomena using evidence obtained from observations and or scientific investigations. Evidence may lead to developing models and or theories to make sense of phenomena. As new evidence is discovered, models and theories can be revised.

5 of 26

Objectives:

Today we will experiment with controlling a simulated drone flying in a simulated space, such as Mars, a city park, Egypt, or the Himalayas.

Today we will use code to direct a drone to fly a specific course around an obstacle then returning to the take off spot.

Today students will demonstrate how to use pitch, roll, and yaw to move the drone through the air.

Today students will demonstrate an understanding of how a UAV/Drone flies.

Today we will be able to control a drone as it completes more and more complex flight paths using math and angles to successfully move the drone around the flight path.

Today we will use pseudocode (code in plain language not in block or code speak), and collaboration to allow us to work together to achieve a goal.

6 of 26

Agenda (65 minutes)

As a class view the short video from DroneBlocks about the simulator. (5 minutes)

Show the students the rectangular flight path they need to code to get the drone from the launching pad around the solar panels and back to the landing pad. (10 - 20 minutes)

Then have the students fly above the solar panels to create a triangle above the solar panels (10 - 20 minutes)

Lastly, if time allows have them code a hexagon over the solar panels.

Wrap up and what is ahead for day two?

7 of 26

Have you always wanted to fly a drone but the thought of what happens if it goes out of control and crashes terrifies you?

Well to day we will have the chance to fly a drone but our drone will have a “reset” button!

That’s right we are going to fly a drone in an alien area using our wits, and some block coding to successfully navigate around the area.

While we are doing that we are going to be observing how the drone flys differently than a plane, and even a helicopter.

We are going to use pseudocode, and collaboration to make it easier for us to be successful with each of our three missions.

While the drone is flying we will also have an opportunity to think about all of the obstacles we might have to overcome in the future if we do land on Mars and try to establish a civilization there.

DroneBlocks Simulator video start at 2:24 if you wish to bypass the simple simulator discussion.

Intro/Driving Question/Opening

8 of 26

Hands On Activity Instructions Slide 1 of 3

Students should work in teams of two and should discuss prior to coding which blocks they think they will need.

they should agree to try certain blocks then they should use those blocks and determine if they met the objective.

If they were successful the first time they should raise their hands and show the teacher.

If the drone did not successfully take off fly towards the solar panel go around the solar panel then return to the landing pad. The students should think about what may have caused the drone to behave erratically.

Struggling students could be brought together to observe a coding sequence that “worked” or the teacher could stop the coding and re-visit some hey blocks of code that are necessary to complete the mission. When the class has been successful then move on to mission 2 the triangle.

Remind students that the interior angles of a rectangle, or square are always 90 degrees in each corner!

Mission 1: The Rectangle Around the Solar Panels

9 of 26

Hands On Activity Instructions Slide 2 of 3

Remind the students that the interior angles of a triangle should add up to 360 degrees divided by the three corners.

This will help the students to figure out what the code blocks should look like for a triangle versus the square.

Remember you will need to fly the drone higher up in the atmosphere to “clear” the solar panels.

When the class has been successful then move on to mission 3 the hexagon.

Mission 2: The Triangle Over the Solar Panels!

10 of 26

Hands On Activity Instructions Slide 2 of 3

Remind the students that the interior angles of a hexagon should still add up to 360 degrees divided by the six corners.

This will help the students to figure out what the code blocks should look like for a triangle versus the square.

Remember you will need to fly the drone higher up in the atmosphere to “clear” the solar panels.

When the class has been successful then move on to mission 3 the hexagon.

Mission 3: The Hexagon Over the Solar Panels!

11 of 26

How do we assess our work?

Different types of assessment depending upon the outcome you were hoping for:

Engineering and the design process, did the students use “trial and error” to create each of the shapes. This requires attention by the teacher to determine if students built the code 1 - 2 blocks of code at at time. Then did the students step back ad determine if that set of code “worked.”

Math did the students successfully determine that the square has 4-90° angles equalling 360°

Technology did the students understand how to use all three forces of motion to create the requested paths for the drone. Did the code the students use meet with your objectives (you could have a contest to see who can code the rectangle around the solar panels, then ask if anyone can reduce the total number of blocks (loops et al).

Science did the students use the minutes per second block which will vastly increase the speed of the drone but it will also be necessary to understand that an object in motion remains in motion until acted upon by other forces. In other words were the students able to move the drone quickly and precisely in concert with each other.

Language arts were the students able to write out what the drone needed to do to create the shape. Did the students use pseudocode to describe that they thought should happen. Did they then adjust their instructions after the first iteration of the code?

12 of 26

Differentiation

Allow students who are struggling to view the code blocks (one at a time to allow them to locate and code each block correctly. )

Revisit the video DroneBlocks Simulator video to help to cement in the steps or key blocks that they may have missed.

Pair students who are not as adept at coding to work with stronger students although pairing the less adept students with a very strong coder could backfire.

Having a pre prepared document that has the individual steps and blocks written out or even have screenshots of the blocks without the filled in numbers so that they can construct the code correctly then they will only have to adjust the numbers.

Allow

Remediation

Extension/Enrichment

Students who get finished quickly should try the following challenge.

Using the drone draw a set of four lines over the 9 solar panels “touching” each of them. The line to get to the solar panels does not count as one of the four lines. See the solution on the next slide!

Explore one of the other simulation locations and create a mission for others in the room to complete if/when you have a second day to work with the simulations.

13 of 26

14 of 26

Teacher notes

The use of the simulator for free necessitates your being aware of when the simulator becomes available so going to the DroneBlocks site and signing up for the newsletter or email notifications is highly suggested.

If you have the financial means a year long subscription to DroneBlocks is 500.00

That gives you the teacher access to videos, weekly updates, and 100+ lessons created by DroneBlocks and other teachers who are using the site.

As students become more adept at creating coding and using the simulation you might want to consider getting DroneBlocks compatible drones that the students can fly in the simulation and then connect to the computer to upload the same code to fly the drones.

15 of 26

Simplified STEAM Standards

Used with permission from droneBlocks

16 of 26

Universal Standards & Skill Development Guide

SCIENCE

Understand that force acts on an object and includes strength and direction, causing the object to move.

Objects that appear to not be moving have multiple forces compiling to create zero force on the object.

The motion of an object can be observed and measured.

Synthesize information from a variety of sources to support ...understanding/testing Evaluate solutions, taking into consideration safety, reliability and impact

Observe, question, collect and evaluate data.

17 of 26

Universal Standards & Skill Development Guide

TECHNOLOGY

Technology can be created and improved by the interconnection of Science, Mathematics, and Engineering.

Utilize a variety of technology and resources to better understand concepts and solve problems.

Develop comprehension of the logic and syntax that goes into building or coding a program through engaging in and elaborating upon activities.

Simulate solutions to real-world problems using models and/or computer simulation. Program variables that represent quantities in mathematical problems.

Write conditional expressions to create program logic using if-else statements.

18 of 26

Universal Standards & Skill Development Guide

Improve and optimize results by identifying errors and using mathematics and technology to redesign and solve problems.

Evaluate, use prior knowledge such as scientific processes and real-world problems, and troubleshoot to develop a solution.

Discuss, explain, and collaborate to improve a product through iteration.

Design a device that converts one form of energy into another by building, testing, and refining. Determine the best solution to accomplish a given challenge.

Plan and carry out investigations...gain feedback through design process (design solutions)….construct arguments that provide a convincing explanation of solutions created through programming.

Engineering

19 of 26

Universal Standards & Skill Development Guide

ART

Make, design, and create using a variety of materials to develop a concept or learning experience. Brainstorm ideas through modeling and sketching.

Compile works of art to relate knowledge.

20 of 26

Universal Standards & Skill Development Guide

MATHEMATICS

Measure distances, width, length and speed to gain data for interpretation and refining engineering and design.

Integrate data analysis to collaborate and gain feedback.

Solve mathematical problems with numbers in any form, strategically using applicable tools.

Determine the probability of events and compare data from observed models. Explore and evaluate possible reasoning for discrepancies between models.

Observe an object’s motion, providing data and evidence to evaluate and predict future motion.

Develop and expand knowledge of geometry, understanding the concepts of measuring angles, and geometric constructions.

Understand how variables can be used to represent quantities in a real-world or mathematical problems.

21 of 26

Additional Content

How do Newton's three laws relate to a drone flying?

Newton's three laws of motion are fundamental principles of physics that describe how objects move and interact with each other. These laws have a direct relationship to the flight of a drone and can help explain the physics behind its motion.

  1. Newton's first law of motion states that an object at rest will remain at rest, and an object in motion will remain in motion with a constant velocity unless acted upon by an external force.

In the context of a drone, this law explains why the drone remains in the air when it is not being controlled or affected by any external forces. Once the drone is set in motion by the propellers, it will continue to fly forward until it is acted upon by another force, such as a change in wind direction or a command from the controller to change its flight path.

22 of 26

Additional Content

  1. Newton's second law of motion states that the acceleration of an object is directly proportional to the force applied to it and inversely proportional to its mass.

In the context of a drone, this law explains how the drone is able to change its speed and direction when it is being controlled by the user. By adjusting the amount of force applied to the propellers, the drone can accelerate, decelerate, or change direction. The mass of the drone also affects its acceleration - a lighter drone will be able to accelerate more quickly than a heavier one, given the same amount of force.

23 of 26

Additional Content

  1. Newton's third law of motion states that for every action, there is an equal and opposite reaction.

In the context of a drone, this law explains how the propellers generate lift and keep the drone in the air. As the propellers spin, they push air downward, creating an equal and opposite reaction that propels the drone upward. This lift force must be greater than the force of gravity pulling the drone down in order for it to remain in the air.

Overall, Newton's laws of motion help explain the fundamental principles of flight for a drone, including how it remains in the air, how it changes direction and speed, and how lift is generated to keep it aloft. By understanding these laws, drone pilots and enthusiasts can gain a deeper appreciation for the physics behind the technology and become better pilots as a result. (ChatGPT, personal communication, March 24, 2023)

24 of 26

Coding the rectangle around the solar panels on Mars

25 of 26

Coding the triangle over the solar panels on Mars

26 of 26

Coding the hexagon over the solar panels on Mars