Microbit Lesson 5B: Basic Movements PDF

Summary

This document outlines a lesson plan on basic movements for a Micro:bit robot kit. It covers topics such as motor function, loading Makecode extensions, and calculating speed. The lesson plan also has instructions and activities.

Full Transcript

# Module 5B: Basic Movements ## In this module, students will learn: - How to move Micro:bit car kit using motors - How to load extensions in Makecode - How to compute speed with time and distance # What is a motor? An electric motor converts electrical energy into mechanical motion. Most of the...

# Module 5B: Basic Movements ## In this module, students will learn: - How to move Micro:bit car kit using motors - How to load extensions in Makecode - How to compute speed with time and distance # What is a motor? An electric motor converts electrical energy into mechanical motion. Most of the electric motors work by using the force of magnetism. # Electric Motor Movement Motors can spin in either a counter-clockwise or clockwise direction. This is done by reversing the flow of electricity through the motors. Spinning in either way causes a motor to move forward or backward. ## Power Motor + + M - - **Forward** ## Power Motor + + M - - **Backward** For Micro:bit car kit, we do not need to physically reverse the polarity. Instead, we can do it with the values we put in the program blocks. # For the quizzes, refer to the Robotics Microbit Book # Hardware Preparation Micro:bit car kit has four (4) electric motors encased in gearboxes. Before we begin, please prepare check if the following components are properly mounted and connected: - All wires are connected - All motors are not loose, tightly screwed to motor holders # Direction of Movement To move forward or backward, all motors must rotate in the same direction. # Makecode Extension Loading #1 1. Add an extension by clicking "Extension". 2. Input this extension link in the search option: `https://github.com/keyestudio2019/mecanum_robot_v2.git` 3. Click the mecanum-robot link to add the extension in the toolbox. 4. There will be an additional programming blocks in the toolbox for motors, infrared, and LED. # Makecode Extension Loading #2 1. Another way to load extensions is by getting a saved .hex file from the teacher and loading it directly to Makecode. 2. Look for the sample filename "microbit - PeOnz Micro:bit 4WD Car Kit extension 2023.hex" in your folders. 3. Minimize the window of the folder_ with the HEX file then DRAG and DROP the file to Makecode Canvas/Editor area. 4. After dropping the Hex file, there will be an additional coding blocks in the toolbox for motors, sensors, and LED. # New Programming Blocks ## Coding Block ### Motor Upper_left run Forward speed: *% ### car Stop ## Function ### Makes the wheels run forward or backward at the desired speed from 0% to 100% ### Stops all the motor of the robot # Individual Activity: Move Forward 1. When the robot car kit is TURNED ON, all motors will move forward for 1 second at 25% speed only. 2. Test the robot for BACKWARD movement. ## Solution ``` on start Motor Lower_left run Forward speed: 25% Motor Upper_left run Forward speed: 25% Motor Upper_right run Forward speed: 25% Motor Lower_right run Forward speed: 25% pause (ms) 1000 car stop ``` ## Explanation ### START the program when the Micro:bit 4WD car kit is turned ON ### ALL motors will run forward at 25% ### WAIT for 1 second ### ALL motors will stop ### Code ENDS # SPEED, DISTANCE, and TIME Speed is a measure of how quickly an object moves from one place to another. It is equal to the distance traveled divided by the time. It is possible to find any of these three values using the other two. ``` speed = distance / time time = distance / speed distance = speed x time ``` Speed can vary as long as they follow the principles of motor movement discussed in the previous lesson. # Individual Activity: Speed Competitions Code the robot to move forward with different settings on Time and Motor Power. Record the distance traveled by the robot in centimeters by using a ruler. Compute the Speed and record on the table below. The robot can use any type of wheel in this activity. ## Table 1. Time as Variable | Time (ms) | Motor Power | Distance (cm) | Speed (mm/sec) | |---|---|---|---| | 500 | 25% | | | | 1000 | 25% | | | | 1500 | 25% | | | | 2000 | 25% | | | | 2500 | 25% | | | ## Table 2. Motor Power as Variable | Time (ms) | Motor Power | Distance (cm) | Speed (mm/sec) | |---|---|---|---| | 1000 | 10% | | | | 1000 | 25% | | | | 1000 | 50% | | | | 1000 | 75% | | | | 1000 | 100% | | | Mark a starting point at the bottom of the robot. Measure the distanced travelled by using a ruler. Change Time from 0 to infinite. Note that 1000 ms = 1 second. Change Motor Power from 0 to 100%.

Use Quizgecko on...
Browser
Browser