Robotics Chapter 7: Stopping Motors Function
14 Questions
3 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the command rm.run(Raspi_MotorHAT.RELEASE)?

  • It runs the right motor in the forward direction.
  • It sets the right motor to a speed of 150.
  • It releases the right motor, stopping its rotation. (correct)
  • It registers the `turn_off_motors` function to be called on program exit.
  • What is the purpose of the line atexit.register(turn_off_motors)?

  • It runs the motors in the forward direction.
  • It sets the speed of the left motor to 150.
  • It registers the `turn_off_motors` function to be called automatically when the program exits. (correct)
  • It releases the right motor, stopping its rotation.
  • What is the purpose of the commands lm.setSpeed(150) and rm.setSpeed(150)?

  • They register the `turn_off_motors` function to be called on program exit.
  • They release the left and right motors, stopping their rotation.
  • They run the left and right motors in the forward direction.
  • They set the speed of the left and right motors to 150 out of a maximum value of 255. (correct)
  • What is the purpose of the commands lm.run(Raspi_MotorHAT.FORWARD) and rm.run(Raspi_MotorHAT.FORWARD)?

    <p>They run the left and right motors in the forward direction.</p> Signup and view all the answers

    What is the purpose of the line time.sleep(1)?

    <p>It introduces a delay of 1 second, allowing the motors to run forward for one second.</p> Signup and view all the answers

    Which type of steering involves moving a bar to turn the vehicle?

    <p>Steerable wheels with rack and pinion steering.</p> Signup and view all the answers

    What is the key difference between steerable wheels and fixed wheels?

    <p>Steerable wheels can turn to change the direction of the vehicle, while fixed wheels' axes are fixed in relation to the chassis.</p> Signup and view all the answers

    Which of the following is NOT a common type of steerable wheel steering?

    <p>Differential steering.</p> Signup and view all the answers

    What is the purpose of the Raspi_MotorHAT library used in the code?

    <p>It provides methods for initializing and controlling motors connected to a Raspberry Pi.</p> Signup and view all the answers

    What distinguishes Atlas from ASIMO and NAO robots?

    <p>Atlas is a fast robot that moves on two legs with natural-looking motion.</p> Signup and view all the answers

    How does Atlas primarily move?

    <p>On two legs</p> Signup and view all the answers

    Which company developed the Atlas robot?

    <p>Boston Dynamics</p> Signup and view all the answers

    What type of motion is characteristic of Atlas?

    <p>Natural-looking motion on two legs</p> Signup and view all the answers

    In the context of robot mobility, what sets Atlas apart from other robots?

    <p>Fast bipedal movement</p> Signup and view all the answers

    Study Notes

    Stopping Motors

    • self.left_motor.run(Raspi_MotorHAT.RELEASE) stops the left motor by running it in RELEASE mode.
    • self.right_motor.run(Raspi_MotorHAT.RELEASE) stops the right motor by running it in RELEASE mode.

    Understanding the Formula

    • The formula (speed * 255) // 100 is used to convert a percentage value into a fraction of 255.
    • Multiplying the speed by 255 scales it up, ensuring that the division operation results in a non-zero value.
    • The // operator performs integer division, ensuring that the output remains an integer.

    Importing Libraries

    • The line from Raspi_MotorHAT import Raspi_MotorHAT imports the Raspi_MotorHAT module.
    • The time module is imported to introduce delays in the code.
    • The atexit module is imported to register functions to be called when the program exits.

    Initializing Motor HAT and Motors

    • The line mh = Raspi_MotorHAT(addr=0x6f) initializes the Raspi_MotorHAT object with the I2C address 0x6f.
    • lm = mh.getMotor(1) initializes the left motor by retrieving the motor object associated with motor port 1.
    • rm = mh.getMotor(2) initializes the right motor by retrieving the motor object associated with motor port 2.

    Defining Function to Turn Off Motors

    • The function turn_off_motors() is defined to release the motors, stopping their rotation.
    • The function is registered to be called when the program exits using atexit.register(turn_off_motors).

    Robot Examples

    • Boston Dynamics BigDog is a four-legged robot that can walk and run in challenging conditions like ice.
    • Atlas (from Boston Dynamics) is a fast robot on two legs that uses laser radar to navigate.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Learn how to stop left and right motors by running them in RELEASE mode. Explore changes that enable the use of speeds from 0 to 100, converted to the range of 0 to 255 expected by the motor HAT.

    More Like This

    Robotics Fundamentals Quiz
    10 questions
    Understanding Servo Motors
    10 questions
    Control de Posición de Servomotores
    8 questions
    Use Quizgecko on...
    Browser
    Browser